diff options
author | erdgeist <> | 2007-10-18 23:33:07 +0000 |
---|---|---|
committer | erdgeist <> | 2007-10-18 23:33:07 +0000 |
commit | b86e6382a1d496cdb2acb0b85732c644de3add11 (patch) | |
tree | f9a169f692b59201cee2fa73cd993a90f83e902d /scan_urlencoded_query.h | |
parent | dba3bb3ae7957773f9799a14d6f7b47f08b7c03b (diff) |
Save a lot of work when skipping through uninteresting http request parameters
Diffstat (limited to 'scan_urlencoded_query.h')
-rw-r--r-- | scan_urlencoded_query.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/scan_urlencoded_query.h b/scan_urlencoded_query.h index 56d93c8..4fa35c4 100644 --- a/scan_urlencoded_query.h +++ b/scan_urlencoded_query.h | |||
@@ -4,17 +4,24 @@ | |||
4 | #ifndef __SCAN_URLENCODED_QUERY_H__ | 4 | #ifndef __SCAN_URLENCODED_QUERY_H__ |
5 | #define __SCAN_URLENCODED_QUERY_H__ | 5 | #define __SCAN_URLENCODED_QUERY_H__ |
6 | 6 | ||
7 | #define SCAN_PATH 0 | 7 | typedef enum { |
8 | #define SCAN_SEARCHPATH_PARAM 1 | 8 | SCAN_PATH = 1, |
9 | #define SCAN_SEARCHPATH_VALUE 2 | 9 | SCAN_SEARCHPATH_PARAM = 2, |
10 | SCAN_SEARCHPATH_VALUE = 4, | ||
11 | SCAN_SEARCHPATH_TERMINATOR = 8 | ||
12 | } SCAN_SEARCHPATH_FLAG; | ||
10 | 13 | ||
11 | /* string pointer to source, pointer to after terminator on return | 14 | /* string pointer to source, pointer to next scan position on return |
12 | deststring pointer to destination | 15 | deststring pointer to destination |
13 | flags determines, what to parse | 16 | flags determines, what to parse |
14 | returns number of valid converted characters in deststring | 17 | returns number of valid converted characters in deststring |
15 | or -1 for parse error | 18 | or -1 for parse error |
16 | */ | 19 | */ |
17 | ssize_t scan_urlencoded_query(char **string, char *deststring, int flags); | 20 | ssize_t scan_urlencoded_query(char **string, char *deststring, SCAN_SEARCHPATH_FLAG flags); |
21 | |||
22 | /* string pointer to source, pointer to next scan position on return | ||
23 | */ | ||
24 | void scan_urlencoded_skipvalue( char **string ); | ||
18 | 25 | ||
19 | /* data pointer to len chars of string | 26 | /* data pointer to len chars of string |
20 | len length of chars in data to parse | 27 | len length of chars in data to parse |