diff options
Diffstat (limited to 'src/lib/libcrypto/conf/conf.h')
-rw-r--r-- | src/lib/libcrypto/conf/conf.h | 69 |
1 files changed, 65 insertions, 4 deletions
diff --git a/src/lib/libcrypto/conf/conf.h b/src/lib/libcrypto/conf/conf.h index 21831a92a3..2f70634455 100644 --- a/src/lib/libcrypto/conf/conf.h +++ b/src/lib/libcrypto/conf/conf.h | |||
@@ -59,14 +59,15 @@ | |||
59 | #ifndef HEADER_CONF_H | 59 | #ifndef HEADER_CONF_H |
60 | #define HEADER_CONF_H | 60 | #define HEADER_CONF_H |
61 | 61 | ||
62 | #ifdef __cplusplus | ||
63 | extern "C" { | ||
64 | #endif | ||
65 | |||
66 | #include <openssl/bio.h> | 62 | #include <openssl/bio.h> |
67 | #include <openssl/lhash.h> | 63 | #include <openssl/lhash.h> |
68 | #include <openssl/stack.h> | 64 | #include <openssl/stack.h> |
69 | #include <openssl/safestack.h> | 65 | #include <openssl/safestack.h> |
66 | #include <openssl/e_os.h> | ||
67 | |||
68 | #ifdef __cplusplus | ||
69 | extern "C" { | ||
70 | #endif | ||
70 | 71 | ||
71 | typedef struct | 72 | typedef struct |
72 | { | 73 | { |
@@ -77,6 +78,25 @@ typedef struct | |||
77 | 78 | ||
78 | DECLARE_STACK_OF(CONF_VALUE) | 79 | DECLARE_STACK_OF(CONF_VALUE) |
79 | 80 | ||
81 | struct conf_st; | ||
82 | typedef struct conf_st CONF; | ||
83 | struct conf_method_st; | ||
84 | typedef struct conf_method_st CONF_METHOD; | ||
85 | |||
86 | struct conf_method_st | ||
87 | { | ||
88 | const char *name; | ||
89 | CONF *(MS_FAR *create)(CONF_METHOD *meth); | ||
90 | int (MS_FAR *init)(CONF *conf); | ||
91 | int (MS_FAR *destroy)(CONF *conf); | ||
92 | int (MS_FAR *destroy_data)(CONF *conf); | ||
93 | int (MS_FAR *load)(CONF *conf, BIO *bp, long *eline); | ||
94 | int (MS_FAR *dump)(CONF *conf, BIO *bp); | ||
95 | int (MS_FAR *is_number)(CONF *conf, char c); | ||
96 | int (MS_FAR *to_int)(CONF *conf, char c); | ||
97 | }; | ||
98 | |||
99 | int CONF_set_default_method(CONF_METHOD *meth); | ||
80 | LHASH *CONF_load(LHASH *conf,const char *file,long *eline); | 100 | LHASH *CONF_load(LHASH *conf,const char *file,long *eline); |
81 | #ifndef NO_FP_API | 101 | #ifndef NO_FP_API |
82 | LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); | 102 | LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); |
@@ -86,8 +106,40 @@ STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section); | |||
86 | char *CONF_get_string(LHASH *conf,char *group,char *name); | 106 | char *CONF_get_string(LHASH *conf,char *group,char *name); |
87 | long CONF_get_number(LHASH *conf,char *group,char *name); | 107 | long CONF_get_number(LHASH *conf,char *group,char *name); |
88 | void CONF_free(LHASH *conf); | 108 | void CONF_free(LHASH *conf); |
109 | int CONF_dump_fp(LHASH *conf, FILE *out); | ||
110 | int CONF_dump_bio(LHASH *conf, BIO *out); | ||
89 | void ERR_load_CONF_strings(void ); | 111 | void ERR_load_CONF_strings(void ); |
90 | 112 | ||
113 | /* New conf code. The semantics are different from the functions above. | ||
114 | If that wasn't the case, the above functions would have been replaced */ | ||
115 | |||
116 | struct conf_st | ||
117 | { | ||
118 | CONF_METHOD *meth; | ||
119 | void *meth_data; | ||
120 | LHASH *data; | ||
121 | }; | ||
122 | |||
123 | CONF *NCONF_new(CONF_METHOD *meth); | ||
124 | CONF_METHOD *NCONF_default(); | ||
125 | CONF_METHOD *NCONF_WIN32(); | ||
126 | #if 0 /* Just to give you an idea of what I have in mind */ | ||
127 | CONF_METHOD *NCONF_XML(); | ||
128 | #endif | ||
129 | void NCONF_free(CONF *conf); | ||
130 | void NCONF_free_data(CONF *conf); | ||
131 | |||
132 | int NCONF_load(CONF *conf,const char *file,long *eline); | ||
133 | #ifndef NO_FP_API | ||
134 | int NCONF_load_fp(CONF *conf, FILE *fp,long *eline); | ||
135 | #endif | ||
136 | int NCONF_load_bio(CONF *conf, BIO *bp,long *eline); | ||
137 | STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section); | ||
138 | char *NCONF_get_string(CONF *conf,char *group,char *name); | ||
139 | long NCONF_get_number(CONF *conf,char *group,char *name); | ||
140 | int NCONF_dump_fp(CONF *conf, FILE *out); | ||
141 | int NCONF_dump_bio(CONF *conf, BIO *out); | ||
142 | |||
91 | 143 | ||
92 | /* BEGIN ERROR CODES */ | 144 | /* BEGIN ERROR CODES */ |
93 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 145 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
@@ -97,15 +149,24 @@ void ERR_load_CONF_strings(void ); | |||
97 | /* Error codes for the CONF functions. */ | 149 | /* Error codes for the CONF functions. */ |
98 | 150 | ||
99 | /* Function codes. */ | 151 | /* Function codes. */ |
152 | #define CONF_F_CONF_DUMP_FP 104 | ||
100 | #define CONF_F_CONF_LOAD 100 | 153 | #define CONF_F_CONF_LOAD 100 |
101 | #define CONF_F_CONF_LOAD_BIO 102 | 154 | #define CONF_F_CONF_LOAD_BIO 102 |
102 | #define CONF_F_CONF_LOAD_FP 103 | 155 | #define CONF_F_CONF_LOAD_FP 103 |
156 | #define CONF_F_NCONF_DUMP_BIO 105 | ||
157 | #define CONF_F_NCONF_DUMP_FP 106 | ||
158 | #define CONF_F_NCONF_GET_NUMBER 107 | ||
159 | #define CONF_F_NCONF_GET_SECTION 108 | ||
160 | #define CONF_F_NCONF_GET_STRING 109 | ||
161 | #define CONF_F_NCONF_LOAD_BIO 110 | ||
162 | #define CONF_F_NCONF_NEW 111 | ||
103 | #define CONF_F_STR_COPY 101 | 163 | #define CONF_F_STR_COPY 101 |
104 | 164 | ||
105 | /* Reason codes. */ | 165 | /* Reason codes. */ |
106 | #define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 | 166 | #define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 |
107 | #define CONF_R_MISSING_EQUAL_SIGN 101 | 167 | #define CONF_R_MISSING_EQUAL_SIGN 101 |
108 | #define CONF_R_NO_CLOSE_BRACE 102 | 168 | #define CONF_R_NO_CLOSE_BRACE 102 |
169 | #define CONF_R_NO_CONF 105 | ||
109 | #define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 | 170 | #define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 |
110 | #define CONF_R_VARIABLE_HAS_NO_VALUE 104 | 171 | #define CONF_R_VARIABLE_HAS_NO_VALUE 104 |
111 | 172 | ||