diff options
Diffstat (limited to 'functions.h')
-rw-r--r-- | functions.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/functions.h b/functions.h new file mode 100644 index 0000000..4605da6 --- /dev/null +++ b/functions.h @@ -0,0 +1,30 @@ +#ifndef FUNCTIONS_H_INCLUDED +#define FUNCTIONS_H_INCLUDED + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <errno.h> +#include <string.h> +#include <netdb.h> +#include <sys/types.h> +#include <netinet/in.h> +#include <sys/socket.h> +#include <arpa/inet.h> +#include <sys/select.h> + +// getstdin() return codes +#define OK 0 +#define NO_INPUT 1 +#define TOO_LONG 2 + +// Print a debugging message, if debugging enabled +void debug(char *string); + +// Get stdin line with buffer overrun protection +int getstdin(char *prompt, char *buff, size_t sz); + +// Append CR-LF to the end of a string (after cleaning up any existing trailing CR or LF) +void appendcrlf(char *string); + +#endif |