Lines Matching defs:option

26  * Purpose: find an option in the option list
28 * Returns: pointer to option on success, NULL otherwise
48 * Purpose: set a specific option doing type conversions
53 static int set_option_str(char *filename, int line, OPTION *option, char *p)
56 option->val = (void *) strdup(p);
58 option->val = NULL;
63 static int set_option_int(char *filename, int line, OPTION *option, char *p)
68 error("%s: line %d: bogus option value", filename, line);
78 option->val = (void *) iptr;
83 static int set_option_srv(char *filename, int line, OPTION *option, char *p)
91 error("%s: line %d: bogus option value", filename, line);
95 serv = (SERVER *) option->val;
109 if (!strcmp(option->name,"authserver"))
114 else if (!strcmp(option->name, "acctserver"))
120 error("%s: line %d: no default port for %s", filename, line, option->name);
133 static int set_option_auo(char *filename, int line, OPTION *option, char *p)
138 warn("%s: line %d: bogus option value", filename, line);
172 option->val = (void *) iptr;
190 OPTION *option;
218 if ((option = find_option(p, OT_ANY)) == NULL) {
223 if (option->status != ST_UNDEF) {
224 error("%s: line %d: duplicate option line: %s", filename, line, p);
232 switch (option->type) {
234 if (set_option_str(filename, line, option, p) < 0)
238 if (set_option_int(filename, line, option, p) < 0)
242 if (set_option_srv(filename, line, option, p) < 0)
246 if (set_option_auo(filename, line, option, p) < 0)
262 * Purpose: get the value of a config option
264 * Returns: config option value
269 OPTION *option;
271 option = find_option(optname, OT_STR);
273 if (option == NULL)
274 fatal("rc_conf_str: unkown config option requested: %s", optname);
275 return (char *)option->val;
280 OPTION *option;
282 option = find_option(optname, OT_INT|OT_AUO);
284 if (option == NULL)
285 fatal("rc_conf_int: unkown config option requested: %s", optname);
286 return *((int *)option->val);
291 OPTION *option;
293 option = find_option(optname, OT_SRV);
295 if (option == NULL)
296 fatal("rc_conf_srv: unkown config option requested: %s", optname);
297 return (SERVER *)option->val;