#endif
#include <stdint.h> // uint32_t
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef uint32_t socklen_t;
-typedef enum
+enum
{
AF_UNSPEC = 0,
AF_PACKET = 1,
AF_LOCAL = 2,
AF_INET = 4,
AF_INET6 = 6,
-} sa_family_t;
+};
#define AF_UNIX AF_LOCAL
+typedef uint8_t sa_family_t; // I would use an enum, but cast issues
struct sockaddr
{
*/
extern int listen(int sockfd, int backlog);
+#define SOMAXCONN 128 // Maximum size of backlog (actually far higher)
+
/**
* \brief Accept an incoming connection
*/
extern const char *hstrerror(int err);
extern struct hostent *gethostent(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif