src/server/daemon/rewrite.h

changeset 646
f64ebb0c5fa9
parent 635
b85d45fd3b01
child 647
ffbc5076b4bf
equal deleted inserted replaced
645:0c85c4cd0dd8 646:f64ebb0c5fa9
38 38
39 #ifdef __cplusplus 39 #ifdef __cplusplus
40 extern "C" { 40 extern "C" {
41 #endif 41 #endif
42 42
43 #define WS_REWRITE_NMATCH 16
44
43 typedef struct RewriteRule { 45 typedef struct RewriteRule {
44 /* 46 /*
45 * 47 * uncompiled regex string
46 */ 48 */
47 cxmutstr match; 49 cxmutstr match;
48 50
49 /* 51 /*
50 * Compiled match regex 52 * Compiled match regex
51 */ 53 */
52 regex_t regex; 54 regex_t regex;
53 55
54 /* 56 /*
57 * does this RewriteRule has a regex rule?
58 */
59 WSBool has_regex;
60
61 /*
55 * Rewrite to this url 62 * Rewrite to this url
56 */ 63 */
57 StringTemplate *url; 64 StringTemplate *url;
58 } RewriteRule; 65 } RewriteRule;
66
67 int rewrite_url(
68 RewriteRule *rule,
69 regmatch_t *match,
70 int nmatch,
71 const CxAllocator *a,
72 const char *url,
73 char **new_url);
59 74
60 75
61 #ifdef __cplusplus 76 #ifdef __cplusplus
62 } 77 }
63 #endif 78 #endif

mercurial