Ulfius
HTTP Framework for REST Applications in C
yuarel.h
Go to the documentation of this file.
1 
22 #ifndef INC_YUAREL_H
23 #define INC_YUAREL_H
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
37 struct yuarel {
38  char *scheme; /* scheme, without ":" and "//" */
39  char *username; /* username, default: NULL */
40  char *password; /* password, default: NULL */
41  char *host; /* hostname or IP address */
42  int port; /* port, default: 0 */
43  char *path; /* path, without leading "/", default: NULL */
44  char *query; /* query, default: NULL */
45  char *fragment; /* fragment, default: NULL */
46 };
47 
48 /* A struct to hold the query string parameter values. */
49 struct yuarel_param {
50  char *key;
51  char *val;
52 };
53 
72 extern int yuarel_parse(struct yuarel *url, char *url_str);
73 
87 extern int yuarel_split_path(char *path, char **parts, int max_parts);
88 
108 extern int yuarel_parse_query(char *query, char delimiter, struct yuarel_param *params, int max_params);
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif /* INC_YUAREL_H */
Definition: yuarel.h:49
char * key
Definition: yuarel.h:50
char * val
Definition: yuarel.h:51
Definition: yuarel.h:37
char * host
Definition: yuarel.h:41
char * password
Definition: yuarel.h:40
char * query
Definition: yuarel.h:44
char * fragment
Definition: yuarel.h:45
int port
Definition: yuarel.h:42
char * username
Definition: yuarel.h:39
char * scheme
Definition: yuarel.h:38
char * path
Definition: yuarel.h:43
int yuarel_parse(struct yuarel *url, char *url_str)
Definition: yuarel.c:139
int yuarel_split_path(char *path, char **parts, int max_parts)
Definition: yuarel.c:236
int yuarel_parse_query(char *query, char delimiter, struct yuarel_param *params, int max_params)
Definition: yuarel.c:266