#ifndef FUNCTIONS_H_INCLUDED #define FUNCTIONS_H_INCLUDED #include #include #include #include #include #include #include #include #include #include #include #define MAXDATASIZE 513 // max number of bytes we can get at once (RFC2812 says 512, plus one for null terminator) // getstdin() return codes #define OK 0 #define NO_INPUT 1 #define TOO_LONG 2 // 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); // Remove leading colon ':' which is the starting character of a prefix in an IRC message void stripprefix(char *string); // Extract final parameter from IRC message, removing the leading colon ':' void extractfinalparameter(char *string); // Extract the IRC nick from a prefix void extractnickfromprefix(char *string); // Update an existing nickuserhost string with a new nick void updatenickuserhost(char *nickuserhost, char *nick); #endif