summaryrefslogtreecommitdiff
path: root/src/sp_config_scanner.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_config_scanner.h')
-rw-r--r--src/sp_config_scanner.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/sp_config_scanner.h b/src/sp_config_scanner.h
new file mode 100644
index 0000000..3284713
--- /dev/null
+++ b/src/sp_config_scanner.h
@@ -0,0 +1,25 @@
1
2#ifndef SP_CONFIG_SCANNER_H
3#define SP_CONFIG_SCANNER_H
4
5typedef enum {
6 SP_ARGTYPE_UNKNOWN = 0,
7 SP_ARGTYPE_NONE,
8 SP_ARGTYPE_EMPTY,
9 SP_ARGTYPE_STR
10} sp_argtype;
11
12typedef struct {
13 char *kw; // keyword points directly to the parsed input text and as such is not null-terminated
14 size_t kwlen;
15 char *arg; // optional argument / can be not null terminated
16 size_t arglen;
17 sp_argtype argtype;
18 long lineno;
19} sp_parsed_keyword;
20
21zend_result sp_config_scan(char *data, zend_result (*process_rule)(sp_parsed_keyword*));
22zend_string *sp_get_arg_string(sp_parsed_keyword *kw);
23zend_string *sp_get_textual_representation(sp_parsed_keyword *parsed_rule);
24
25#endif \ No newline at end of file