40 lines
536 B
C
40 lines
536 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);
|
|
void throw(int errcode);
|
|
char *substr_extract(const char *str, int start, int end);
|