2014-11-19 00:25:21 +08:00
|
|
|
|
#ifndef ACL_XINETD_CFG_INCLUDE_H
|
|
|
|
|
#define ACL_XINETD_CFG_INCLUDE_H
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "acl_define.h"
|
|
|
|
|
#include "acl_array.h"
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
typedef struct ACL_XINETD_CFG_PARSER ACL_XINETD_CFG_PARSER;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param xcp: <EFBFBD>ṹָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param name: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API const char *acl_xinetd_cfg_get(const ACL_XINETD_CFG_PARSER *xcp, const char *name);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param xcp: <EFBFBD>ṹָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param name: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API const ACL_ARRAY *acl_xinetd_cfg_get_ex(const ACL_XINETD_CFG_PARSER *xcp, const char *name);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>л<EFBFBD><EFBFBD>ö<EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵλ<EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param xcp: <EFBFBD>ṹָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param idx: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @param ppname: ָ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ַ<EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param ppvalue: ָ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ַ<EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return 0: OK, -1: ERR
|
|
|
|
|
*/
|
|
|
|
|
ACL_API int acl_xinetd_cfg_index(const ACL_XINETD_CFG_PARSER *xcp,
|
|
|
|
|
int idx,
|
|
|
|
|
char **ppname,
|
|
|
|
|
char **ppvalue);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param xcp: <EFBFBD>ṹָ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API int acl_xinetd_cfg_size(const ACL_XINETD_CFG_PARSER *xcp);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD>ͷ<EFBFBD><EFBFBD>ɽṹָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ռ<EFBFBD>
|
|
|
|
|
* @param xcp: <EFBFBD>ṹָ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_xinetd_cfg_free(ACL_XINETD_CFG_PARSER *xcp);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param pathname: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return <EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>Ľṹָ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_XINETD_CFG_PARSER *acl_xinetd_cfg_load(const char *pathname);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṹ
|
|
|
|
|
*/
|
|
|
|
|
typedef struct ACL_CFG_INT_TABLE {
|
|
|
|
|
const char *name;
|
|
|
|
|
int defval;
|
|
|
|
|
int *target;
|
|
|
|
|
int min;
|
|
|
|
|
int max;
|
|
|
|
|
} ACL_CFG_INT_TABLE;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 64 λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṹ
|
|
|
|
|
*/
|
|
|
|
|
typedef struct ACL_CFG_INT64_TABLE {
|
|
|
|
|
const char *name;
|
|
|
|
|
acl_int64 defval;
|
|
|
|
|
acl_int64 *target;
|
|
|
|
|
acl_int64 min;
|
|
|
|
|
acl_int64 max;
|
|
|
|
|
} ACL_CFG_INT64_TABLE;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṹ
|
|
|
|
|
*/
|
|
|
|
|
typedef struct ACL_CFG_STR_TABLE {
|
|
|
|
|
const char *name;
|
|
|
|
|
const char *defval;
|
|
|
|
|
char **target;
|
|
|
|
|
} ACL_CFG_STR_TABLE;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṹ
|
|
|
|
|
*/
|
|
|
|
|
typedef struct ACL_CFG_BOOL_TABLE {
|
|
|
|
|
const char *name;
|
|
|
|
|
int defval;
|
|
|
|
|
int *target;
|
|
|
|
|
} ACL_CFG_BOOL_TABLE;
|
|
|
|
|
|
|
|
|
|
/* in acl_xinetd_params.c */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵ı<EFBFBD>
|
|
|
|
|
* @param cfg {ACL_XINETD_CFG_PARSER*} <EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>и<EFBFBD>ֵ
|
|
|
|
|
* @param table {ACL_CFG_INT_TABLE*}
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_xinetd_params_int_table(ACL_XINETD_CFG_PARSER *cfg,
|
|
|
|
|
ACL_CFG_INT_TABLE *table);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ȡ 64 λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵ı<EFBFBD>
|
|
|
|
|
* @param cfg {ACL_XINETD_CFG_PARSER*} <EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>и<EFBFBD>ֵ
|
|
|
|
|
* @param table {ACL_CFG_INT64_TABLE*}
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_xinetd_params_int64_table(ACL_XINETD_CFG_PARSER *cfg,
|
|
|
|
|
ACL_CFG_INT64_TABLE *table);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ȡ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵ı<EFBFBD>
|
|
|
|
|
* @param cfg {ACL_XINETD_CFG_PARSER*} <EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>и<EFBFBD>ֵ
|
|
|
|
|
* @param table {ACL_CFG_STR_TABLE*}
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_xinetd_params_str_table(ACL_XINETD_CFG_PARSER *cfg,
|
|
|
|
|
ACL_CFG_STR_TABLE *table);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ȡBOOL<EFBFBD><EFBFBD><EFBFBD>͵ı<EFBFBD>
|
|
|
|
|
* @param cfg {ACL_XINETD_CFG_PARSER*} <EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>и<EFBFBD>ֵ
|
|
|
|
|
* @param table {ACL_CFG_BOOL_TABLE*}
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_xinetd_params_bool_table(ACL_XINETD_CFG_PARSER *cfg,
|
|
|
|
|
ACL_CFG_BOOL_TABLE *table);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|