#ifndef _SERVER_H_ #define _SERVER_H_ // The maximum number of clients that the server can handle // simultaneously. (This only comes into play in Part C.) const int MAX_THREADS = 1; // // parseArguments // // Returns the first command-line argument of the program, converted // to an integer. If there is not exactly one command-line argument, // or if the argument does not represent an integer, then it prints // an error message and exits the program. // int parseArguments(int argc, char **argv); // // getServerSocket // // Opens a server socket bound to port !portnum!, returning the // file descriptor of the socket. If any errors are encountered, // the function prints a function and exits the program. // int getServerSocket(int portnum); // // splitLine // // Breaks the string to which !buf! points into a sequence of // words. The pointer to each successive word is placed into // the !argv! array, stopping at !max_args! words. The function // returns the number of words found in !buf! (up to !max_args!). // int splitLine(char *buf, char **argv, int max_args); #endif _SERVER_H_