shithub: gemnine

ref: 3a91d0da6accefe72f46e3c7d149ef3d5cfd759e
dir: /gemnine.h/

View raw version
typedef struct Response Response;
typedef struct Url Url;

struct Response {
	Url *url;
	char *mime;
	char *prompt;
	int status;
	int fd;
};

struct Url {
	char *full;
	char *scheme;
	char *user;
	char *pass;
	char *host;
	char *port;
	char *path;
	char *query;
	char *fragment;
};

typedef struct {
	char *s1;
	char *s2;
}Str2;

#pragma varargck type "U" Url*
#pragma varargck type "E" Str2
#pragma varargck type "N" char*
#pragma varargck type "]" char*

/* req.c */
Response *request(Url *url);
void freeresponse(Response *r);

/* url.c */
int	Efmt(Fmt*);
int	Nfmt(Fmt*);
int	Mfmt(Fmt*);
int Ufmt(Fmt *f);
Url *urlparse(Url *from, char *s);
int matchurl(Url *u, Url *s);
void freeurl(Url *u);
char *Upath(Url *u);

/* util.c */
void *emalloc(int n);
char *estrdup(char *s);