API参考
载入中...
搜索中...
未找到
bsl_conf_def.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
15
16#ifndef BSL_CONF_DEF_H
17#define BSL_CONF_DEF_H
18
19#include "hitls_build.h"
20#ifdef HITLS_BSL_CONF
21
22#include <stdint.h>
23#include "bsl_uio.h"
24#include "bsl_list.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#define BSL_CONF_LINE_SIZE 513
31#define BSL_CONF_SEC_SIZE 510
32
33typedef struct BslConfDefaultKeyValue {
34 char *key;
35 char *value;
36 uint32_t keyLen;
37 uint32_t valueLen;
38} BSL_CONF_KeyValue;
39
40typedef struct BslConfDefaultSection {
41 BslList *keyValueList;
42 char *section;
43 uint32_t sectionLen;
44} BSL_CONF_Section;
45
46/* LIST(BslList)_____SECTION1(BSL_CONF_Section)_____LIST(BslList)_______KEY1, VALUE(BSL_CONF_KeyValue)
47 * | |__KEY2, VALUE(BSL_CONF_KeyValue)
48 * | |__KEY3, VALUE(BSL_CONF_KeyValue)
49 * |
50 * |__SECTION2(BSL_CONF_Section)_____LIST(BslList)_______KEY1, VALUE(BSL_CONF_KeyValue)
51 * | |__KEY2, VALUE(BSL_CONF_KeyValue)
52 * ...
53 */
54typedef BslList *(*BslConfCreate)(void);
55typedef void (*BslConfDestroy)(BslList *sectionList);
56typedef int32_t (*BslConfLoad)(BslList *sectionList, const char *file);
57typedef int32_t (*BslConfLoadUio)(BslList *sectionList, BSL_UIO *uio);
58typedef int32_t (*BslConfDump)(BslList *sectionList, const char *file);
59typedef int32_t (*BslConfDumpUio)(BslList *sectionList, BSL_UIO *uio);
60typedef BslList *(*BslConfGetSection)(BslList *sectionList, const char *section);
61typedef int32_t (*BslConfGetString)(BslList *sectionList, const char *section, const char *key,
62 char *string, uint32_t *strLen);
63typedef int32_t (*BslConfGetNumber)(BslList *sectionList, const char *section, const char *key, long int *num);
64typedef char **(*BslConfGetSectionNames)(BslList *sectionList, uint32_t *namesSize);
65
66typedef struct BSL_CONF_MethodStruct {
67 BslConfCreate create;
68 BslConfDestroy destroy;
69 BslConfLoad load;
70 BslConfLoadUio loadUio;
71 BslConfDump dump;
72 BslConfDumpUio dumpUio;
73 BslConfGetSection getSection;
74 BslConfGetString getString;
75 BslConfGetNumber getNumber;
76 BslConfGetSectionNames getSectionNames;
77} BSL_CONF_Method;
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /* HITLS_BSL_CONF */
84
85#endif /* BSL_CONF_DEF_H */
struct UIO_ControlBlock BSL_UIO
UIO module control structure
定义 bsl_uio.h:37
定义 bsl_list.h:49