00001 /* Gearman server and 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_H__ 00015 #define __GEARMAN_SERVER_CONF_H__ 00016 00017 #ifdef __cplusplus 00018 extern "C" { 00019 #endif 00020 00027 struct gearman_conf_option_st 00028 { 00029 size_t value_count; 00030 gearman_conf_module_st *module; 00031 const char *name; 00032 const char *value_name; 00033 const char *help; 00034 char **value_list; 00035 }; 00036 00037 struct gearman_conf_st 00038 { 00039 struct { 00040 bool allocated; 00041 } options; 00042 gearman_return_t last_return; 00043 int last_errno; 00044 size_t module_count; 00045 size_t option_count; 00046 size_t short_count; 00047 gearman_conf_module_st **module_list; 00048 gearman_conf_option_st *option_list; 00049 struct option *option_getopt; 00050 char option_short[GEARMAN_CONF_MAX_OPTION_SHORT]; 00051 char last_error[GEARMAN_MAX_ERROR_SIZE]; 00052 }; 00053 00057 GEARMAN_API 00058 gearman_conf_st *gearman_conf_create(gearman_conf_st *conf); 00059 00063 GEARMAN_API 00064 void gearman_conf_free(gearman_conf_st *conf); 00065 00069 GEARMAN_API 00070 gearman_return_t gearman_conf_return(gearman_conf_st *conf); 00071 00075 GEARMAN_API 00076 const char *gearman_conf_error(gearman_conf_st *conf); 00077 00081 GEARMAN_API 00082 int gearman_conf_errno(gearman_conf_st *conf); 00083 00087 GEARMAN_API 00088 gearman_return_t gearman_conf_parse_args(gearman_conf_st *conf, int argc, 00089 char *argv[]); 00090 00094 GEARMAN_API 00095 void gearman_conf_usage(gearman_conf_st *conf); 00096 00099 #ifdef __cplusplus 00100 } 00101 #endif 00102 00103 #endif /* __GEARMAN_SERVER_CONF_H__ */