acl  3.5.3.0
acl_loadcfg.h
浏览该文件的文档.
1 #ifndef ACL_LOADCFG_INCLUDE_H
2 #define ACL_LOADCFG_INCLUDE_H
3 
4 # ifdef __cplusplus
5 extern "C" {
6 # endif
7 
8 #include "acl_define.h"
9 #include "acl_array.h"
10 
12 
13 typedef struct ACL_CFG_LINE {
14  char **value; /* store the separated values of the line */
15  char *pdata; /* point to the beginning of the line data */
16  int ncount; /* how many values in this line data,
17  * if ncount == 0, then this is an
18  * invalid line, but still be stored
19  * here in pdata.
20  */
21  int line_number; /* 该行在配置文件中的行号 */
22 } ACL_CFG_LINE;
23 
24 typedef struct ACL_CFG_FN {
25  const char *name;
26  int (*func)(const ACL_CFG_LINE *);
27 } ACL_CFG_FN;
28 
29 typedef void (*ACL_CFG_WALK_FN)(void *arg);
30 
31 ACL_API ACL_CFG_PARSER *acl_cfg_parser_load(const char *pathname, const char *delimiter);
32 ACL_API void acl_cfg_parser_free(ACL_CFG_PARSER *parser);
33 ACL_API void acl_cfg_parser_walk(ACL_CFG_PARSER *parser, ACL_CFG_WALK_FN walk_fn);
34 ACL_API int acl_cfg_line_replace(ACL_CFG_LINE *cfg_line, const char **value, int from, int to);
35 ACL_API ACL_CFG_LINE *acl_cfg_parser_index(const ACL_CFG_PARSER *parser, int idx);
36 ACL_API int acl_cfg_parser_size(const ACL_CFG_PARSER *parser);
37 ACL_API int acl_cfg_parser_dump(const ACL_CFG_PARSER *parser, const char *pathname, const char *delimiter);
38 ACL_API int acl_cfg_parser_append(ACL_CFG_PARSER *parser, ACL_CFG_LINE *cfg_line);
39 ACL_API int acl_cfg_parser_delete(ACL_CFG_PARSER *parser, const char *name);
40 ACL_API ACL_CFG_LINE *acl_cfg_line_new(const char **value, int ncount);
41 
42 # ifdef __cplusplus
43 }
44 # endif
45 
46 #endif
47 
ACL_API int acl_cfg_line_replace(ACL_CFG_LINE *cfg_line, const char **value, int from, int to)
char ** value
Definition: acl_loadcfg.h:14
HTTP_API void const char * name
Definition: lib_http.h:620
struct ACL_CFG_LINE ACL_CFG_LINE
ACL_API void acl_cfg_parser_free(ACL_CFG_PARSER *parser)
const char * name
Definition: acl_loadcfg.h:25
ACL_API int acl_cfg_parser_delete(ACL_CFG_PARSER *parser, const char *name)
ACL_API ACL_CFG_LINE * acl_cfg_parser_index(const ACL_CFG_PARSER *parser, int idx)
ACL_API int acl_cfg_parser_dump(const ACL_CFG_PARSER *parser, const char *pathname, const char *delimiter)
ACL_API ACL_CFG_LINE * acl_cfg_line_new(const char **value, int ncount)
struct ACL_CFG_FN ACL_CFG_FN
void(* ACL_CFG_WALK_FN)(void *arg)
Definition: acl_loadcfg.h:29
struct ACL_CFG_PARSER ACL_CFG_PARSER
Definition: acl_loadcfg.h:11
ACL_API ACL_CFG_PARSER * acl_cfg_parser_load(const char *pathname, const char *delimiter)
ACL_API void acl_cfg_parser_walk(ACL_CFG_PARSER *parser, ACL_CFG_WALK_FN walk_fn)
ACL_API int acl_cfg_parser_append(ACL_CFG_PARSER *parser, ACL_CFG_LINE *cfg_line)
char * pdata
Definition: acl_loadcfg.h:15
ACL_API int acl_cfg_parser_size(const ACL_CFG_PARSER *parser)
int(* func)(const ACL_CFG_LINE *)
Definition: acl_loadcfg.h:26