#ifndef _SOCKH
#define _SOCKH

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
//#include <netinet/in.h>
#include <sys/un.h>
#include <arpa/inet.h>

#ifndef INADDR_NONE
#define INADDR_NONE 0xffffffff /* should be in <netinet/in.h> */
#endif

/* function prototypes */
int sockcreate(char path[]);

/* sockaccept -- accept connection on a socket.
   Return new socket descriptor if ok, -1 if not ok. */
int sockaccept(int sock);

/* sockconnect -- create socket to host at port.
   Return socket if ok, -1 if no ok. */
int sockconnect(char path[]);

/* function prototypes */
int sockcreateINET(int port);

/* sockconnect -- create socket to host at port.
   Return socket if ok, -1 if no ok. */
int sockconnectINET(int socket);

/* recvWithSize -- recevie a message where 4 first bytes 
   indicate the size of the next message */
int recvWithSize (int, char *, int);

/* sendWithSize -- send a message indicated in the 4 first 
   bytes the size of the messafe */
int sendWithSize (int, char *, int);

int recvWithSizeMem (int, char **, int);
//Equals sendWithSize, int sendWithSizeMem (int, char *, int);

#endif

