Added uri parsing
This commit is contained in:
25
src/uri.h
25
src/uri.h
@ -10,20 +10,27 @@
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define URI_DIR_MODE_FORBIDDEN 0
|
||||
#define URI_DIR_MODE_LIST 1
|
||||
#define URI_DIR_MODE_INFO 2
|
||||
|
||||
typedef struct {
|
||||
char *webroot;
|
||||
char *path;
|
||||
char *pathinfo;
|
||||
char *query;
|
||||
char *filename;
|
||||
char *filename_comp;
|
||||
char *uri;
|
||||
char *webroot; // "/srv/www/www.test.org"
|
||||
char *req_path; // "/account/login"
|
||||
char *path; // "/account/"
|
||||
char *pathinfo; // "login"
|
||||
char *query; // "username=test"
|
||||
char *filename; // "/account/index.php"
|
||||
char *filename_comp; // "/srv/www/www.test.org/res/.file.css.compressed"
|
||||
char *uri; // "/account/login?username=test"
|
||||
char *etag;
|
||||
struct stat stat;
|
||||
int is_static:1;
|
||||
unsigned int is_static:1;
|
||||
unsigned int is_dir:1;
|
||||
} http_uri;
|
||||
|
||||
|
||||
int uri_init(http_uri *uri, const char *webroot, const char *uri_str);
|
||||
int uri_init(http_uri *uri, const char *webroot, const char *uri_str, int dir_mode);
|
||||
|
||||
void uri_free(http_uri *uri);
|
||||
|
||||
|
Reference in New Issue
Block a user