Home | History | Annotate | Download | only in conf

Lines Matching refs:conf

1 /* crypto/conf/conf.c */
59 /* Part of the code in here was originally in conf.c, which is now removed */
66 #include <openssl/conf.h>
72 static char *eat_ws(CONF *conf, char *p);
73 static char *eat_alpha_numeric(CONF *conf, char *p);
74 static void clear_comments(CONF *conf, char *p);
75 static int str_copy(CONF *conf,char *section,char **to, char *from);
76 static char *scan_quote(CONF *conf, char *p);
77 static char *scan_dquote(CONF *conf, char *p);
78 #define scan_esc(conf,p) (((IS_EOF((conf),(p)[1]))?((p)+1):((p)+2)))
80 static CONF *def_create(CONF_METHOD *meth);
81 static int def_init_default(CONF *conf);
82 static int def_init_WIN32(CONF *conf);
83 static int def_destroy(CONF *conf);
84 static int def_destroy_data(CONF *conf);
85 static int def_load(CONF *conf, const char *name, long *eline);
86 static int def_load_bio(CONF *conf, BIO *bp, long *eline);
87 static int def_dump(const CONF *conf, BIO *bp);
88 static int def_is_number(const CONF *conf, char c);
89 static int def_to_int(const CONF *conf, char c);
128 static CONF *def_create(CONF_METHOD *meth)
130 CONF *ret;
132 ret = OPENSSL_malloc(sizeof(CONF) + sizeof(unsigned short *));
142 static int def_init_default(CONF *conf)
144 if (conf == NULL)
147 conf->meth = &default_method;
148 conf->meth_data = CONF_type_default;
149 conf->data = NULL;
154 static int def_init_WIN32(CONF *conf)
156 if (conf == NULL)
159 conf->meth = &WIN32_method;
160 conf->meth_data = (void *)CONF_type_win32;
161 conf->data = NULL;
166 static int def_destroy(CONF *conf)
168 if (def_destroy_data(conf))
170 OPENSSL_free(conf);
176 static int def_destroy_data(CONF *conf)
178 if (conf == NULL)
180 _CONF_free_data(conf);
184 static int def_load(CONF *conf, const char *name, long *line)
203 ret = def_load_bio(conf, in, line);
209 static int def_load_bio(CONF *conf, BIO *in, long *line)
223 void *h = (void *)(conf->data);
239 if (_CONF_new_data(conf) == 0)
245 sv=_CONF_new_section(conf,section);
298 if (IS_ESC(conf,p[0]) &&
299 ((bufnum <= 1) || !IS_ESC(conf,p[-1])))
309 clear_comments(conf, buf);
310 s=eat_ws(conf, buf);
311 if (IS_EOF(conf,*s)) continue; /* blank line */
317 start=eat_ws(conf, s);
320 end=eat_alpha_numeric(conf, ss);
321 p=eat_ws(conf, end);
334 if (!str_copy(conf,NULL,&section,start)) goto err;
335 if ((sv=_CONF_get_section(conf,section)) == NULL)
336 sv=_CONF_new_section(conf,section);
349 end=eat_alpha_numeric(conf, s);
356 end=eat_alpha_numeric(conf, end);
358 p=eat_ws(conf, end);
367 start=eat_ws(conf, p);
368 while (!IS_EOF(conf,*p))
371 while ((p != start) && (IS_WS(conf,*p)))
392 if (!str_copy(conf,psection,&(v->value),start)) goto err;
396 if ((tv=_CONF_get_section(conf,psection))
398 tv=_CONF_new_section(conf,psection);
409 if (_CONF_add_string(conf, tv, v) == 0)
423 vv=(CONF_VALUE *)lh_insert(conf->data,v);
444 if ((h != conf->data) && (conf->data != NULL))
446 CONF_free(conf->data);
447 conf->data=NULL;
458 static void clear_comments(CONF *conf, char *p)
462 if (IS_FCOMMENT(conf,*p))
467 if (!IS_WS(conf,*p))
476 if (IS_COMMENT(conf,*p))
481 if (IS_DQUOTE(conf,*p))
483 p=scan_dquote(conf, p);
486 if (IS_QUOTE(conf,*p))
488 p=scan_quote(conf, p);
491 if (IS_ESC(conf,*p))
493 p=scan_esc(conf,p);
496 if (IS_EOF(conf,*p))
503 static int str_copy(CONF *conf, char *section, char **pto, char *from)
516 if (IS_QUOTE(conf,*from))
520 while (!IS_EOF(conf,*from) && (*from != q))
522 if (IS_ESC(conf,*from))
525 if (IS_EOF(conf,*from)) break;
531 else if (IS_DQUOTE(conf,*from))
535 while (!IS_EOF(conf,*from))
552 else if (IS_ESC(conf,*from))
556 if (IS_EOF(conf,v)) break;
563 else if (IS_EOF(conf,*from))
579 while (IS_ALPHA_NUMERIC(conf,*e))
589 while (IS_ALPHA_NUMERIC(conf,*e))
613 p=_CONF_get_string(conf,cp,np);
649 static char *eat_ws(CONF *conf, char *p)
651 while (IS_WS(conf,*p) && (!IS_EOF(conf,*p)))
656 static char *eat_alpha_numeric(CONF *conf, char *p)
660 if (IS_ESC(conf,*p))
662 p=scan_esc(conf,p);
665 if (!IS_ALPHA_NUMERIC_PUNCT(conf,*p))
671 static char *scan_quote(CONF *conf, char *p)
676 while (!(IS_EOF(conf,*p)) && (*p != q))
678 if (IS_ESC(conf,*p))
681 if (IS_EOF(conf,*p)) return(p);
690 static char *scan_dquote(CONF *conf, char *p)
695 while (!(IS_EOF(conf,*p)))
724 static int def_dump(const CONF *conf, BIO *out)
726 lh_CONF_VALUE_doall_arg(conf->data, LHASH_DOALL_ARG_FN(dump_value),
731 static int def_is_number(const CONF *conf, char c)
733 return IS_NUMBER(conf,c);
736 static int def_to_int(const CONF *conf, char c)