
/* 
 * 2010 (C) Marcus Clyne 
 *
 * DO NOT EDIT THIS FILE MANUALLY
 * ------------------------------
 * This file has been generated automatically from scripts in the $base/auto dir and
 * data in the $base/auto/data dir. If you wish to edit the output of this file, then
 * you should edit these files instead.
 *
*/


/* conf-merge-value macros */

/* TODO : check that all the main types have a corresponding merge function */

#define     ndk_conf_merge_value            ngx_conf_merge_value
#define     ndk_conf_merge_off_value        ngx_conf_merge_off_value 
#define     ndk_conf_merge_ptr_value        ngx_conf_merge_ptr_value
#define     ndk_conf_merge_str_value        ngx_conf_merge_str_value
#define     ndk_conf_merge_size_value       ngx_conf_merge_size_value 


#define     ndk_conf_merge_keyval_value(conf,prev,default)                                  \
                                                                                            \
                conf = prev ? prev : default;

#define     ndk_conf_merge_str_array_value(conf,prev,val1,...)                              \
                                                                                            \
                if (conf == NGX_CONF_UNSET_PTR) {                                           \
                    if (prev == NGX_CONF_UNSET_PTR) {                                       \
                        if (val1 == NULL) {                                                 \
                            conf = NULL;                                                    \
                        } else {                                                            \
                            char * elts[] = {val1,##__VA_ARGS__};                           \
                            int    n = sizeof(elts)/sizeof(char*);                          \
                                                                                            \
                            conf = ndk_str_array_create (cf->pool, elts, n);                \
                                                                                            \
                            if (conf == NULL)                                               \
                                return  NGX_CONF_ERROR;                                     \
                        }                                                                   \
                    } else {                                                                \
                        conf = prev;                                                        \
                    }                                                                       \
                }

#define     ndk_conf_merge_http_complex_value_value(conf,prev,default)                      \
                                                                                            \
                if (!conf.str.len) {                                                        \
                    if (prev.str.len) {                                                     \
                        conf = prev;                                                        \
                    } else {                                                                \
                        conf.str.data = (u_char *) default;                                 \
                        conf.str.len = sizeof (default) - 1;                                \
                                                                                            \
                        if (ndk_http_complex_value_compile (cf, &conf))                     \
                            return  NGX_CONF_ERROR;                                         \
                    }                                                                       \
                }

#define     ndk_conf_merge_http_complex_value_array_value(conf,prev,val1,...)               \
                                                                                            \
                if (conf == NGX_CONF_UNSET_PTR) {                                           \
                    if (prev == NGX_CONF_UNSET_PTR) {                                       \
                        if (val1 == NULL)                                                   \
                            conf = NULL;                                                    \
                        else {                                                              \
                            char * elts[] = {val1,##__VA_ARGS__};                           \
                            int    n = sizeof(elts)/sizeof(char*);                          \
                                                                                            \
                            conf = ndk_http_complex_value_array_create (cf, elts, n);       \
                                                                                            \
                            if (conf == NULL)                                               \
                                return  NGX_CONF_ERROR;                                     \
                        }                                                                   \
                    } else {                                                                \
                        conf = prev;                                                        \
                    }                                                                       \
                }

#define     ndk_conf_merge_http_complex_path_value(conf,prev,...)                           \
                ndk_conf_merge_http_complex_value_array_value (conf.a, prev.a, __VA_ARGS__)

#define     ndk_conf_merge_split_path_value(conf,prev,path)                                 \
                                                                                            \
                if (conf == NGX_CONF_UNSET_PTR)  {                                          \
                    conf = (prev == NGX_CONF_UNSET_PTR ?                                    \
                        ndk_split_path_create_raw (cf, path) : prev);                       \
                }


/* conf-merge-prop macros */

#define     ndk_conf_merge_prop(prop,default)\
            ndk_conf_merge_value\
                (conf->prop, prev->prop, default)

#define     ndk_conf_merge_bitmask_prop(prop,default,...)\
            ndk_conf_merge_bitmask_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_bufs_prop(prop,default,...)\
            ndk_conf_merge_bufs_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_encoding_prop(prop,default,...)\
            ndk_conf_merge_encoding_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_enum_prop(prop,default,...)\
            ndk_conf_merge_enum_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_false_prop(prop,default,...)\
            ndk_conf_merge_false_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_flag_prop(prop,default,...)\
            ndk_conf_merge_flag_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_full_path_prop(prop,default,...)\
            ndk_conf_merge_full_path_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_http_complex_keyval_prop(prop,default,...)\
            ndk_conf_merge_http_complex_keyval_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_http_complex_path_prop(prop,default,...)\
            ndk_conf_merge_http_complex_path_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_http_complex_value_prop(prop,default,...)\
            ndk_conf_merge_http_complex_value_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_http_complex_value_array_prop(prop,default,...)\
            ndk_conf_merge_http_complex_value_array_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_keyval_prop(prop,default,...)\
            ndk_conf_merge_keyval_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_keyval1_prop(prop,default,...)\
            ndk_conf_merge_keyval1_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_msec_prop(prop,default,...)\
            ndk_conf_merge_msec_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_null_prop(prop,default,...)\
            ndk_conf_merge_null_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_num_prop(prop,default,...)\
            ndk_conf_merge_num_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_num64_prop(prop,default,...)\
            ndk_conf_merge_num64_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_num_flag_prop(prop,default,...)\
            ndk_conf_merge_num_flag_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_off_prop(prop,default,...)\
            ndk_conf_merge_off_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_ptr_prop(prop,default,...)\
            ndk_conf_merge_ptr_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_regex_prop(prop,default,...)\
            ndk_conf_merge_regex_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_regex_array_prop(prop,default,...)\
            ndk_conf_merge_regex_array_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_regex_array_caseless_prop(prop,default,...)\
            ndk_conf_merge_regex_array_caseless_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_regex_caseless_prop(prop,default,...)\
            ndk_conf_merge_regex_caseless_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_sec_prop(prop,default,...)\
            ndk_conf_merge_sec_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_sec_flag_prop(prop,default,...)\
            ndk_conf_merge_sec_flag_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_size_prop(prop,default,...)\
            ndk_conf_merge_size_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_split_path_prop(prop,default,...)\
            ndk_conf_merge_split_path_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_str_prop(prop,default,...)\
            ndk_conf_merge_str_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_str_array_prop(prop,default,...)\
            ndk_conf_merge_str_array_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_str_array_multi_prop(prop,default,...)\
            ndk_conf_merge_str_array_multi_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
#define     ndk_conf_merge_true_prop(prop,default,...)\
            ndk_conf_merge_true_value\
                (conf->prop, prev->prop, default,##__VA_ARGS__)
    
