| 1 | #ifndef YAML_PATH_H |
| 2 | #define YAML_PATH_H |
| 3 | |
| 4 | #include <yaml.h> |
| 5 | |
| 6 | |
| 7 | typedef struct yaml_path yaml_path_t; |
| 8 | |
| 9 | typedef enum yaml_path_error_type { |
| 10 | YAML_PATH_ERROR_NONE, |
| 11 | YAML_PATH_ERROR_NOMEM, |
| 12 | YAML_PATH_ERROR_PARSE, |
| 13 | YAML_PATH_ERROR_SECTION, |
| 14 | } yaml_path_error_type_t; |
| 15 | |
| 16 | typedef struct yaml_path_error { |
| 17 | yaml_path_error_type_t type; |
| 18 | const char *message; |
| 19 | size_t pos; |
| 20 | } yaml_path_error_t; |
| 21 | |
| 22 | typedef enum yaml_path_filter_result { |
| 23 | YAML_PATH_FILTER_RESULT_OUT, |
| 24 | YAML_PATH_FILTER_RESULT_IN, |
| 25 | YAML_PATH_FILTER_RESULT_IN_DANGLING_KEY, |
| 26 | } yaml_path_filter_result_t; |
| 27 | |
| 28 | |
| 29 | yaml_path_t* |
| 30 | yaml_path_create (void); |
| 31 | |
| 32 | int |
| 33 | yaml_path_parse (yaml_path_t *path, char *s_path); |
| 34 | |
| 35 | void |
| 36 | yaml_path_destroy (yaml_path_t *path); |
| 37 | |
| 38 | const yaml_path_error_t* |
| 39 | yaml_path_error_get (yaml_path_t *path); |
| 40 | |
| 41 | yaml_path_filter_result_t |
| 42 | yaml_path_filter_event (yaml_path_t *path, yaml_parser_t *parser, yaml_event_t *event); |
| 43 | |
| 44 | size_t |
| 45 | yaml_path_snprint (yaml_path_t *path, char *s, size_t max_len); |
| 46 | |
| 47 | #endif//YAML_PATH_H |
| 48 |