00001 /* Module configuration library 00002 * Copyright (C) 2009 Eric Day 00003 * All rights reserved. 00004 * 00005 * Use and distribution licensed under the BSD license. See 00006 * the COPYING file in the parent directory for full text. 00007 */ 00008 00014 #ifndef __GEARMAN_SERVER_CONF_MODULE_H__ 00015 #define __GEARMAN_SERVER_CONF_MODULE_H__ 00016 00017 #ifdef __cplusplus 00018 extern "C" { 00019 #endif 00020 00027 struct gearman_conf_module_st 00028 { 00029 struct { 00030 bool allocated; 00031 } options; 00032 size_t current_option; 00033 size_t current_value; 00034 gearman_conf_st *conf; 00035 const char *name; 00036 }; 00037 00041 GEARMAN_API 00042 gearman_conf_module_st *gearman_conf_module_create(gearman_conf_st *conf, 00043 gearman_conf_module_st *module, 00044 const char *name); 00045 00049 GEARMAN_API 00050 void gearman_conf_module_free(gearman_conf_module_st *module); 00051 00055 GEARMAN_API 00056 gearman_conf_module_st *gearman_conf_module_find(gearman_conf_st *conf, 00057 const char *name); 00058 00062 GEARMAN_API 00063 void gearman_conf_module_add_option(gearman_conf_module_st *module, 00064 const char *name, int short_name, 00065 const char *value_name, const char *help); 00066 00070 GEARMAN_API 00071 bool gearman_conf_module_value(gearman_conf_module_st *module, 00072 const char **name, const char **value); 00073 00076 #ifdef __cplusplus 00077 } 00078 #endif 00079 00080 #endif /* __GEARMAN_SERVER_CONF_MODULE_H__ */