diff options
| author | jvoisin | 2022-03-20 18:20:45 +0100 |
|---|---|---|
| committer | jvoisin | 2022-03-20 18:20:45 +0100 |
| commit | 81dd7f2ef07af306fe83d7755cbac4529aa9fc8d (patch) | |
| tree | 32cc44c6231b30db5ac7b15699297863460784aa /src/sp_config_scanner.h | |
| parent | 83b01942dfc80474cc05e09aeef4b44307a7120b (diff) | |
| parent | c38df1077a6c1dfbca1baca049214d053e2e7684 (diff) | |
Merge remote-tracking branch 'sektioneins/master'
Diffstat (limited to 'src/sp_config_scanner.h')
| -rw-r--r-- | src/sp_config_scanner.h | 25 |
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 | |||
| 5 | typedef enum { | ||
| 6 | SP_ARGTYPE_UNKNOWN = 0, | ||
| 7 | SP_ARGTYPE_NONE, | ||
| 8 | SP_ARGTYPE_EMPTY, | ||
| 9 | SP_ARGTYPE_STR | ||
| 10 | } sp_argtype; | ||
| 11 | |||
| 12 | typedef 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 | |||
| 21 | zend_result sp_config_scan(char *data, zend_result (*process_rule)(sp_parsed_keyword*)); | ||
| 22 | zend_string *sp_get_arg_string(sp_parsed_keyword *kw); | ||
| 23 | zend_string *sp_get_textual_representation(sp_parsed_keyword *parsed_rule); | ||
| 24 | |||
| 25 | #endif \ No newline at end of file | ||
