Pass CFLAG to dependency makers, so non-standard system include paths are
[openssl.git] / crypto / conf / conf_api.c
index bf84cecc1e39514bcf35cde8a962905b2a2368e5..0032baa7119b2e250ec08b4bbc0db66a4b2cce8d 100644 (file)
 #include <string.h>
 #include <openssl/conf.h>
 #include <openssl/conf_api.h>
+#include "e_os.h"
 
 static void value_free_hash(CONF_VALUE *a, LHASH *conf);
 static void value_free_stack(CONF_VALUE *a,LHASH *conf);
+static IMPLEMENT_LHASH_DOALL_ARG_FN(value_free_hash, CONF_VALUE *, LHASH *)
+static IMPLEMENT_LHASH_DOALL_ARG_FN(value_free_stack, CONF_VALUE *, LHASH *)
 /* We don't use function pointer casting or wrapper functions - but cast each
  * callback parameter inside the callback functions. */
 /* static unsigned long hash(CONF_VALUE *v); */
@@ -78,19 +81,20 @@ static unsigned long hash(const void *v_void);
 static int cmp_conf(const void *a_void,const void *b_void);
 
 /* Up until OpenSSL 0.9.5a, this was get_section */
-CONF_VALUE *_CONF_get_section(CONF *conf, char *section)
+CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section)
        {
        CONF_VALUE *v,vv;
 
        if ((conf == NULL) || (section == NULL)) return(NULL);
        vv.name=NULL;
-       vv.section=section;
+       vv.section=(char *)section;
        v=(CONF_VALUE *)lh_retrieve(conf->data,&vv);
        return(v);
        }
 
 /* Up until OpenSSL 0.9.5a, this was CONF_get_section */
-STACK_OF(CONF_VALUE) *_CONF_get_section_values(CONF *conf, char *section)
+STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
+                                              const char *section)
        {
        CONF_VALUE *v;
 
@@ -125,7 +129,7 @@ int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value)
        return 1;
        }
 
-char *_CONF_get_string(CONF *conf, char *section, char *name)
+char *_CONF_get_string(const CONF *conf, const char *section, const char *name)
        {
        CONF_VALUE *v,vv;
        char *p;
@@ -135,8 +139,8 @@ char *_CONF_get_string(CONF *conf, char *section, char *name)
                {
                if (section != NULL)
                        {
-                       vv.name=name;
-                       vv.section=section;
+                       vv.name=(char *)name;
+                       vv.section=(char *)section;
                        v=(CONF_VALUE *)lh_retrieve(conf->data,&vv);
                        if (v != NULL) return(v->value);
                        if (strcmp(section,"ENV") == 0)
@@ -146,7 +150,7 @@ char *_CONF_get_string(CONF *conf, char *section, char *name)
                                }
                        }
                vv.section="default";
-               vv.name=name;
+               vv.name=(char *)name;
                v=(CONF_VALUE *)lh_retrieve(conf->data,&vv);
                if (v != NULL)
                        return(v->value);
@@ -198,13 +202,13 @@ void _CONF_free_data(CONF *conf)
 
        conf->data->down_load=0; /* evil thing to make sure the 'OPENSSL_free()'
                                  * works as expected */
-       lh_doall_arg(conf->data, (LHASH_DOALL_ARG_FN_TYPE)value_free_hash,
+       lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(value_free_hash),
                        conf->data);
 
        /* We now have only 'section' entries in the hash table.
         * Due to problems with */
 
-       lh_doall_arg(conf->data, (LHASH_DOALL_ARG_FN_TYPE)value_free_stack,
+       lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(value_free_stack),
                        conf->data);
        lh_free(conf->data);
        }
@@ -270,7 +274,7 @@ static int cmp_conf(const void *a_void,const  void *b_void)
        }
 
 /* Up until OpenSSL 0.9.5a, this was new_section */
-CONF_VALUE *_CONF_new_section(CONF *conf, char *section)
+CONF_VALUE *_CONF_new_section(CONF *conf, const char *section)
        {
        STACK *sk=NULL;
        int ok=0,i;