Make functions static in order to limit scope

This commit is contained in:
Tobias Eidelpes 2018-05-08 18:20:31 +02:00
parent d7f113584b
commit c2c2e8581d

10
websh.c
View File

@ -74,7 +74,7 @@ static void handle_signal(int signal)
* @param void This function takes no parameters. * @param void This function takes no parameters.
* @return Exit code of the program. Always non-zero. * @return Exit code of the program. Always non-zero.
*/ */
void usage(void) static void usage(void)
{ {
fprintf(stderr, "Usage: websh [-e] [-h] [-s WORD:TAG]\n"); fprintf(stderr, "Usage: websh [-e] [-h] [-s WORD:TAG]\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -85,7 +85,7 @@ void usage(void)
* @param sArg The supplied string after the -s flag. * @param sArg The supplied string after the -s flag.
* @return This function has no return value. * @return This function has no return value.
*/ */
void parsesArg(char *sArg) static void parsesArg(char *sArg)
{ {
char *token; char *token;
int i = 0; int i = 0;
@ -109,7 +109,7 @@ void parsesArg(char *sArg)
* @param argv The array of commandline arguments. * @param argv The array of commandline arguments.
* @return This function has no return value * @return This function has no return value
*/ */
void parse(int argc, char *argv[]) static void parse(int argc, char *argv[])
{ {
int optInd = 0; int optInd = 0;
char *sArg; char *sArg;
@ -157,7 +157,7 @@ void parse(int argc, char *argv[])
* @param line The linux command supplied via stdin. * @param line The linux command supplied via stdin.
* @return This function has no return value. * @return This function has no return value.
*/ */
void child2(int fd[], char *line) static void child2(int fd[], char *line)
{ {
/* CHILD TWO */ /* CHILD TWO */
char readbuffer[MAX_LEN]; char readbuffer[MAX_LEN];
@ -204,7 +204,7 @@ void child2(int fd[], char *line)
* @param line The linux command specified via stdin in the calling process. * @param line The linux command specified via stdin in the calling process.
* @return This function has no return value. * @return This function has no return value.
*/ */
void child1(int fd[], char *line) static void child1(int fd[], char *line)
{ {
/* CHILD ONE */ /* CHILD ONE */
close(fd[0]); close(fd[0]);