apportate/src/support.h

41 lines
585 B
C

/* return codes */
enum
{
/* failed to allocate or otherwise access memory */
ERRMEM = -20,
/* URI appears to be malformed */
ERRMALF,
/* couldn't create a socket */
ERRSOCK,
/* addrinfo couldn't init */
ERRADDR,
/* couldn't connect */
ERRCONN,
ERRUSAGE,
/* */
/* no error, everything is okay */
ERROKAY = 0
};
typedef struct
{
char *proto;
char *fqdn;
char *path;
} uri;
char *reqgen(uri *urip);
int resp_parse(char *data, uri *uristruct);
char *substr_extract(const char *str, int start, int end);
char *buftolower(char *bufp);