15 #include "gwenbuild/types/option_p.h" 20 #include <gwenhywfar/misc.h> 37 option->id=
id?strdup(
id):
NULL;
38 option->aliasList=GWB_KeyValuePair_List_new();
51 free(option->defaultValue);
52 free(option->definePrefix);
55 GWB_KeyValuePair_List_free(option->aliasList);
72 return option->optionType;
86 return option->defaultValue;
93 free(option->defaultValue);
94 option->defaultValue=s?strdup(s):
NULL;
101 return option->aliasList;
111 GWB_KeyValuePair_List_Add(kvp, option->aliasList);
125 return option->choiceList;
158 return option->definePrefix;
165 free(option->definePrefix);
166 option->definePrefix=s?strdup(s):
NULL;
176 for(i=0; i<indent; i++)
177 fprintf(stderr,
" ");
178 fprintf(stderr,
"Option:\n");
208 if (strcasecmp(s,
"unknown")==0)
210 else if (strcasecmp(s,
"none")==0)
212 else if (strcasecmp(s,
"string")==0)
214 else if (strcasecmp(s,
"stringlist")==0)
void GWB_Option_AddAlias(GWB_OPTION *option, const char *name, const char *value)
int GWB_Option_GetOptionType(const GWB_OPTION *option)
struct GWB_OPTION GWB_OPTION
void GWB_Option_AddChoice(GWB_OPTION *option, const char *s)
#define GWEN_FREE_OBJECT(varname)
void GWB_Option_free(GWB_OPTION *option)
void GWBUILD_Debug_PrintValue(const char *sName, const char *sValue, int indent)
void GWEN_StringList_free(GWEN_STRINGLIST *sl)
GWEN_STRINGLIST * GWB_Option_GetChoiceList(const GWB_OPTION *option)
#define GWEN_NEW_OBJECT(typ, varname)
int GWEN_StringList_AppendString(GWEN_STRINGLIST *sl, const char *s, int take, int checkDouble)
GWB_OPTION * GWB_Option_new(const char *id)
void GWBUILD_Debug_PrintKvpList(const char *sName, const GWB_KEYVALUEPAIR_LIST *kvpList, int indent)
void GWB_Option_SetDefaultValue(GWB_OPTION *option, const char *s)
const char * GWB_OptionType_toString(int t)
struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST
void GWBUILD_Debug_PrintStringList(const char *sName, const GWEN_STRINGLIST *sl, int indent)
int GWB_Option_IsValidChoice(const GWB_OPTION *option, const char *s)
const char * GWB_Option_GetDefinePrefix(const GWB_OPTION *option)
GWB_KEYVALUEPAIR * GWB_KeyValuePair_new(const char *key, const char *value)
unsigned int GWEN_StringList_Count(const GWEN_STRINGLIST *sl)
void GWB_Option_SetOptionType(GWB_OPTION *option, int i)
int GWEN_StringList_HasString(const GWEN_STRINGLIST *sl, const char *s)
const char * GWB_Option_GetDefaultValue(const GWB_OPTION *option)
struct GWB_KEYVALUEPAIR GWB_KEYVALUEPAIR
void GWB_Option_SetDefinePrefix(GWB_OPTION *option, const char *s)
int GWB_Option_HasChoices(const GWB_OPTION *option)
const char * GWB_KeyValuePair_List_GetValue(const GWB_KEYVALUEPAIR_LIST *kvpList, const char *key)
void GWB_Option_Dump(const GWB_OPTION *option, int indent)
#define GWEN_LIST_INIT(t, element)
#define GWEN_LIST_FUNCTIONS(t, pr)
const char * GWB_Option_GetAlias(const GWB_OPTION *option, const char *name)
GWEN_STRINGLIST * GWEN_StringList_new(void)
GWB_KEYVALUEPAIR_LIST * GWB_Option_GetAliasList(const GWB_OPTION *option)
#define GWEN_LIST_FINI(t, element)
int GWB_OptionType_fromString(const char *s)
const char * GWB_Option_GetId(const GWB_OPTION *option)