| 646:f64ebb0c5fa9 | 647:ffbc5076b4bf |
|---|---|
| 42 | 42 |
| 43 #define WS_REWRITE_NMATCH 16 | 43 #define WS_REWRITE_NMATCH 16 |
| 44 | 44 |
| 45 typedef struct RewriteRule { | 45 typedef struct RewriteRule { |
| 46 /* | 46 /* |
| 47 * uncompiled regex string | |
| 48 */ | |
| 49 cxmutstr match; | |
| 50 | |
| 51 /* | |
| 52 * Compiled match regex | 47 * Compiled match regex |
| 53 */ | 48 */ |
| 54 regex_t regex; | 49 regex_t regex; |
| 55 | 50 |
| 56 /* | 51 /* |
| 61 /* | 56 /* |
| 62 * Rewrite to this url | 57 * Rewrite to this url |
| 63 */ | 58 */ |
| 64 StringTemplate *url; | 59 StringTemplate *url; |
| 65 } RewriteRule; | 60 } RewriteRule; |
| 61 | |
| 62 RewriteRule* rewrite_rule_create(const CxAllocator *a, cxmutstr regex, cxmutstr url); | |
| 66 | 63 |
| 67 int rewrite_url( | 64 int rewrite_url( |
| 68 RewriteRule *rule, | 65 RewriteRule *rule, |
| 69 regmatch_t *match, | 66 regmatch_t *match, |
| 70 int nmatch, | 67 int nmatch, |