summaryrefslogtreecommitdiff
path: root/functions.h
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-04-18 01:58:02 +0200
committerLuke Bratch <luke@bratch.co.uk>2019-04-18 01:58:02 +0200
commit84b3f43a97da2b305cfa5c620aceec543168f6bc (patch)
treef6cda57d836c6e606648e135d300016510c8e115 /functions.h
parent7d5fbb2c855ebe7e2a0dc373bfd3943e4728c750 (diff)
Split functions into different files
Diffstat (limited to 'functions.h')
-rw-r--r--functions.h30
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