}
loadparm_context->s3_fns = s3_fns;
loadparm_context->globals = s3_fns->globals;
+ loadparm_context->flags = s3_fns->flags;
+
return loadparm_context;
}
bool lp_is_security_and_server_role_valid(int server_role, int security);
struct loadparm_global * get_globals(void);
+unsigned int * get_flags(void);
char * lp_string(TALLOC_CTX *, const char *);
bool lp_string_set(char **, const char *);
int getservicebyname(const char *, struct loadparm_service *);
bool (*lp_do_parameter)(int, const char *, const char *);
bool (*do_section)(const char *pszSectionName, void *userdata);
struct loadparm_global *globals;
+ unsigned int *flags;
};
#endif /* __S3_PARAM_H__ */
ZERO_STRUCT(Globals);
Globals.ctx = talloc_pooled_object(NULL, char, 272, 2048);
- flags_list = talloc_zero_array(Globals.ctx, unsigned int, num_parameters());
+
+ /* Initialize the flags list if necessary */
+ if (flags_list == NULL) {
+ get_flags();
+ }
for (i = 0; parm_table[i].label; i++) {
if ((parm_table[i].type == P_STRING ||
{
return &Globals;
}
+
+unsigned int * get_flags(void)
+{
+ if (flags_list == NULL) {
+ flags_list = talloc_zero_array(NULL, unsigned int, num_parameters());
+ }
+
+ return flags_list;
+}
struct loadparm_s3_helpers *helpers;
helpers = &s3_fns;
helpers->globals = get_globals();
+ helpers->flags = get_flags();
return helpers;
}