summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/conf/conf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/conf/conf.h')
-rw-r--r--src/lib/libcrypto/conf/conf.h69
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
63extern "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
69extern "C" {
70#endif
70 71
71typedef struct 72typedef struct
72 { 73 {
@@ -77,6 +78,25 @@ typedef struct
77 78
78DECLARE_STACK_OF(CONF_VALUE) 79DECLARE_STACK_OF(CONF_VALUE)
79 80
81struct conf_st;
82typedef struct conf_st CONF;
83struct conf_method_st;
84typedef struct conf_method_st CONF_METHOD;
85
86struct 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
99int CONF_set_default_method(CONF_METHOD *meth);
80LHASH *CONF_load(LHASH *conf,const char *file,long *eline); 100LHASH *CONF_load(LHASH *conf,const char *file,long *eline);
81#ifndef NO_FP_API 101#ifndef NO_FP_API
82LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); 102LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline);
@@ -86,8 +106,40 @@ STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section);
86char *CONF_get_string(LHASH *conf,char *group,char *name); 106char *CONF_get_string(LHASH *conf,char *group,char *name);
87long CONF_get_number(LHASH *conf,char *group,char *name); 107long CONF_get_number(LHASH *conf,char *group,char *name);
88void CONF_free(LHASH *conf); 108void CONF_free(LHASH *conf);
109int CONF_dump_fp(LHASH *conf, FILE *out);
110int CONF_dump_bio(LHASH *conf, BIO *out);
89void ERR_load_CONF_strings(void ); 111void 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
116struct conf_st
117 {
118 CONF_METHOD *meth;
119 void *meth_data;
120 LHASH *data;
121 };
122
123CONF *NCONF_new(CONF_METHOD *meth);
124CONF_METHOD *NCONF_default();
125CONF_METHOD *NCONF_WIN32();
126#if 0 /* Just to give you an idea of what I have in mind */
127CONF_METHOD *NCONF_XML();
128#endif
129void NCONF_free(CONF *conf);
130void NCONF_free_data(CONF *conf);
131
132int NCONF_load(CONF *conf,const char *file,long *eline);
133#ifndef NO_FP_API
134int NCONF_load_fp(CONF *conf, FILE *fp,long *eline);
135#endif
136int NCONF_load_bio(CONF *conf, BIO *bp,long *eline);
137STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section);
138char *NCONF_get_string(CONF *conf,char *group,char *name);
139long NCONF_get_number(CONF *conf,char *group,char *name);
140int NCONF_dump_fp(CONF *conf, FILE *out);
141int 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