about summary refs log tree commit diff
path: root/converter/ppm/ppmtompeg/headers/psocket.h
diff options
context:
space:
mode:
Diffstat (limited to 'converter/ppm/ppmtompeg/headers/psocket.h')
-rw-r--r--converter/ppm/ppmtompeg/headers/psocket.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/converter/ppm/ppmtompeg/headers/psocket.h b/converter/ppm/ppmtompeg/headers/psocket.h
new file mode 100644
index 00000000..214f5dce
--- /dev/null
+++ b/converter/ppm/ppmtompeg/headers/psocket.h
@@ -0,0 +1,41 @@
+#ifndef PSOCKET_H_INCLUDED
+#define PSOCKET_H_INCLUDED
+
+#include <netdb.h>
+
+void
+ReadInt(int   const socketFd,
+        int * const valueP);
+
+void
+ReadBytes(int             const fd,
+          unsigned char * const buf,
+          unsigned int    const nbyte);
+
+void
+WriteInt(int const socketFd,
+         int const value);
+
+void
+WriteBytes(int             const fd,
+           unsigned char * const buf,
+           unsigned int    const nbyte);
+
+void
+ConnectToSocket(const char *      const machineName, 
+                int               const portNum, 
+                struct hostent ** const hostEnt,
+                int *             const socketFdP,
+                const char **     const errorP);
+
+void
+CreateListeningSocket(int *         const socketP,
+                      int *         const portNumP,
+                      const char ** const errorP);
+
+void
+AcceptConnection(int           const listenSocketFd,
+                 int *         const connectSocketFdP,
+                 const char ** const errorP);
+
+#endif