2005-09-15 09:58:31 -04:00
|
|
|
/* Option variables types handlers */
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "elinks.h"
|
|
|
|
|
|
|
|
#include "bfu/dialog.h"
|
|
|
|
#include "config/options.h"
|
|
|
|
#include "config/opttypes.h"
|
|
|
|
#include "intl/charsets.h"
|
|
|
|
#include "intl/gettext/libintl.h"
|
|
|
|
#include "util/color.h"
|
|
|
|
#include "util/conv.h"
|
|
|
|
#include "util/error.h"
|
|
|
|
#include "util/memory.h"
|
|
|
|
#include "util/string.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* Commandline handlers. */
|
|
|
|
|
|
|
|
/* TAKE CARE! Remember that your _rd handler can be used for commandline
|
|
|
|
* parameters as well - probably, you don't want to be so syntactically
|
|
|
|
* strict, and _ESPECIALLY_ you don't want to move any file pointers ahead,
|
|
|
|
* since you will parse the commandline _TWO TIMES_! Remember! :-) */
|
|
|
|
int commandline = 0;
|
|
|
|
|
|
|
|
static unsigned char *
|
|
|
|
gen_cmd(struct option *o, unsigned char ***argv, int *argc)
|
|
|
|
{
|
|
|
|
unsigned char *str;
|
|
|
|
int dummy_line = 0;
|
|
|
|
|
|
|
|
if (!*argc) return gettext("Parameter expected");
|
|
|
|
|
|
|
|
/* FIXME!! We will modify argv! (maybe) */
|
|
|
|
commandline = 1;
|
|
|
|
str = option_types[o->type].read(o, *argv, &dummy_line);
|
|
|
|
commandline = 0;
|
|
|
|
if (str) {
|
|
|
|
/* We ate parameter */
|
|
|
|
(*argv)++; (*argc)--;
|
|
|
|
if (option_types[o->type].set(o, str)) {
|
|
|
|
mem_free(str);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
mem_free(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
return gettext("Read error");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If 0 follows, disable option and eat 0. If 1 follows, enable option and
|
|
|
|
* eat 1. If anything else follow, enable option and don't eat anything. */
|
|
|
|
static unsigned char *
|
|
|
|
bool_cmd(struct option *o, unsigned char ***argv, int *argc)
|
|
|
|
{
|
|
|
|
o->value.number = 1;
|
|
|
|
|
|
|
|
if (!*argc) return NULL;
|
|
|
|
|
|
|
|
/* Argument is empty or longer than 1 char.. */
|
|
|
|
if (!(*argv)[0][0] || (*argv)[0][1]) return NULL;
|
|
|
|
|
|
|
|
switch ((*argv)[0][0]) {
|
|
|
|
case '0': o->value.number = 0; break;
|
|
|
|
case '1': o->value.number = 1; break;
|
|
|
|
default: return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We ate parameter */
|
|
|
|
(*argv)++; (*argc)--;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned char *
|
|
|
|
exec_cmd(struct option *o, unsigned char ***argv, int *argc)
|
|
|
|
{
|
|
|
|
return o->value.command(o, argv, argc);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Wrappers for OPT_ALIAS. */
|
|
|
|
/* Note that they can wrap only to config_options now. I don't think it could be
|
|
|
|
* a problem, but who knows.. however, changing that will be pretty tricky -
|
|
|
|
* possibly changing ptr to structure containing target name and pointer to
|
|
|
|
* options list? --pasky */
|
|
|
|
|
|
|
|
static unsigned char *
|
|
|
|
redir_cmd(struct option *opt, unsigned char ***argv, int *argc)
|
|
|
|
{
|
|
|
|
struct option *real = get_opt_rec(config_options, opt->value.string);
|
|
|
|
unsigned char * ret = NULL;
|
|
|
|
|
2007-03-11 06:22:02 -04:00
|
|
|
assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string);
|
2005-09-15 09:58:31 -04:00
|
|
|
if_assert_failed { return ret; }
|
|
|
|
|
|
|
|
if (option_types[real->type].cmdline) {
|
|
|
|
ret = option_types[real->type].cmdline(real, argv, argc);
|
|
|
|
if ((opt->flags & OPT_ALIAS_NEGATE) && real->type == OPT_BOOL) {
|
|
|
|
real->value.number = !real->value.number;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned char *
|
|
|
|
redir_rd(struct option *opt, unsigned char **file, int *line)
|
2008-02-03 07:19:22 -05:00
|
|
|
{
|
|
|
|
struct option *real = get_opt_rec(config_options, opt->value.string);
|
|
|
|
unsigned char *ret = NULL;
|
|
|
|
|
|
|
|
assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string);
|
|
|
|
if_assert_failed { return ret; }
|
|
|
|
|
|
|
|
if (option_types[real->type].read) {
|
|
|
|
ret = option_types[real->type].read(real, file, line);
|
|
|
|
if (ret && (opt->flags & OPT_ALIAS_NEGATE) && real->type == OPT_BOOL) {
|
|
|
|
*(long *) ret = !*(long *) ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
static void
|
|
|
|
redir_wr(struct option *opt, struct string *string)
|
|
|
|
{
|
|
|
|
struct option *real = get_opt_rec(config_options, opt->value.string);
|
|
|
|
|
2007-03-11 06:22:02 -04:00
|
|
|
assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string);
|
2005-09-15 09:58:31 -04:00
|
|
|
if_assert_failed { return; }
|
|
|
|
|
|
|
|
if (option_types[real->type].write)
|
|
|
|
option_types[real->type].write(real, string);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
redir_set(struct option *opt, unsigned char *str)
|
|
|
|
{
|
|
|
|
struct option *real = get_opt_rec(config_options, opt->value.string);
|
|
|
|
int ret = 0;
|
|
|
|
|
2007-03-11 06:22:02 -04:00
|
|
|
assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string);
|
2005-09-15 09:58:31 -04:00
|
|
|
if_assert_failed { return ret; }
|
|
|
|
|
|
|
|
if (option_types[real->type].set) {
|
2008-02-03 07:16:46 -05:00
|
|
|
long negated;
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
if ((opt->flags & OPT_ALIAS_NEGATE) && real->type == OPT_BOOL) {
|
2008-02-03 07:16:46 -05:00
|
|
|
negated = !*(long *) str;
|
|
|
|
str = (unsigned char *) &negated;
|
2005-09-15 09:58:31 -04:00
|
|
|
}
|
2008-02-03 07:16:46 -05:00
|
|
|
ret = option_types[real->type].set(real, str);
|
2005-09-15 09:58:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2008-02-03 07:36:48 -05:00
|
|
|
static int
|
|
|
|
redir_eq(struct option *opt, const unsigned char *str)
|
|
|
|
{
|
|
|
|
struct option *real = get_opt_rec(config_options, opt->value.string);
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string);
|
|
|
|
if_assert_failed { return ret; }
|
|
|
|
|
|
|
|
if (option_types[real->type].equals) {
|
|
|
|
long negated;
|
|
|
|
|
|
|
|
if ((opt->flags & OPT_ALIAS_NEGATE) && real->type == OPT_BOOL) {
|
|
|
|
negated = !*(const long *) str;
|
|
|
|
str = (unsigned char *) &negated;
|
|
|
|
}
|
|
|
|
ret = option_types[real->type].equals(real, str);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
/* Support functions for config file parsing. */
|
|
|
|
|
|
|
|
static void
|
2007-01-27 17:52:21 -05:00
|
|
|
add_optstring_to_string(struct string *s, const unsigned char *q, int qlen)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
|
|
|
if (!commandline) add_char_to_string(s, '"');
|
|
|
|
add_quoted_to_string(s, q, qlen);
|
|
|
|
if (!commandline) add_char_to_string(s, '"');
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Config file handlers. */
|
|
|
|
|
|
|
|
static unsigned char *
|
|
|
|
num_rd(struct option *opt, unsigned char **file, int *line)
|
|
|
|
{
|
|
|
|
unsigned char *end = *file;
|
|
|
|
long *value = mem_alloc(sizeof(*value));
|
|
|
|
|
|
|
|
if (!value) return NULL;
|
|
|
|
|
|
|
|
/* We don't want to move file if (commandline), but strtolx() second
|
|
|
|
* parameter must not be NULL. */
|
|
|
|
*value = strtolx(*file, &end);
|
|
|
|
if (!commandline) *file = end;
|
|
|
|
|
|
|
|
/* Another trap for unwary - we need to check *end, not **file - reason
|
|
|
|
* is left as an exercise to the reader. */
|
|
|
|
if ((*end != 0 && (commandline || (!isspace(*end) && *end != '#')))
|
|
|
|
|| (*value < opt->min || *value > opt->max)) {
|
|
|
|
mem_free(value);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (unsigned char *) value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
num_set(struct option *opt, unsigned char *str)
|
|
|
|
{
|
|
|
|
opt->value.number = *((long *) str);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-02-03 07:36:48 -05:00
|
|
|
static int
|
|
|
|
num_eq(struct option *opt, const unsigned char *str)
|
|
|
|
{
|
|
|
|
return str && opt->value.number == *(const long *) str;
|
|
|
|
}
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
static void
|
|
|
|
num_wr(struct option *option, struct string *string)
|
|
|
|
{
|
|
|
|
add_knum_to_string(string, option->value.number);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-06-27 08:13:04 -04:00
|
|
|
static int
|
|
|
|
long_set(struct option *opt, unsigned char *str)
|
|
|
|
{
|
|
|
|
opt->value.big_number = *((long *) str);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-02-03 07:36:48 -05:00
|
|
|
static int
|
|
|
|
long_eq(struct option *opt, const unsigned char *str)
|
|
|
|
{
|
|
|
|
return str && opt->value.big_number == *(const long *) str;
|
|
|
|
}
|
|
|
|
|
2006-06-27 08:13:04 -04:00
|
|
|
static void
|
|
|
|
long_wr(struct option *option, struct string *string)
|
|
|
|
{
|
|
|
|
add_knum_to_string(string, option->value.big_number);
|
|
|
|
}
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
static unsigned char *
|
|
|
|
str_rd(struct option *opt, unsigned char **file, int *line)
|
|
|
|
{
|
|
|
|
unsigned char *str = *file;
|
|
|
|
struct string str2;
|
|
|
|
|
|
|
|
if (!init_string(&str2)) return NULL;
|
|
|
|
|
|
|
|
/* We're getting used in some parser functions in conf.c as well, and
|
|
|
|
* that's w/ opt == NULL; so don't rely on opt to point anywhere. */
|
|
|
|
if (!commandline) {
|
|
|
|
if (!isquote(*str)) {
|
|
|
|
done_string(&str2);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
str++;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (*str && (commandline || !isquote(*str))) {
|
|
|
|
if (*str == '\\') {
|
|
|
|
/* FIXME: This won't work on crlf systems. */
|
2008-02-10 07:30:26 -05:00
|
|
|
if (str[1] == '\n') { str[1] = ' '; str++; (*line)++; }
|
2005-09-15 09:58:31 -04:00
|
|
|
/* When there's quote char, we will just move on there,
|
|
|
|
* thus we will never test for it in while () condition
|
|
|
|
* and we will treat it just as '"', ignoring the
|
|
|
|
* backslash itself. */
|
2008-01-30 15:56:00 -05:00
|
|
|
else if (isquote(str[1])) str++;
|
2005-09-15 09:58:31 -04:00
|
|
|
/* \\ means \. */
|
2008-01-30 15:56:00 -05:00
|
|
|
else if (str[1] == '\\') str++;
|
2005-09-15 09:58:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (*str == '\n') (*line)++;
|
|
|
|
|
|
|
|
add_char_to_string(&str2, *str);
|
|
|
|
str++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!commandline && !*str) {
|
|
|
|
done_string(&str2);
|
|
|
|
*file = str;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
str++; /* Skip the quote. */
|
|
|
|
if (!commandline) *file = str;
|
|
|
|
|
|
|
|
if (opt && opt->max && str2.length >= opt->max) {
|
|
|
|
done_string(&str2);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str2.source;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
str_set(struct option *opt, unsigned char *str)
|
|
|
|
{
|
|
|
|
assert(opt->value.string);
|
|
|
|
|
|
|
|
safe_strncpy(opt->value.string, str, MAX_STR_LEN);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-02-03 07:36:48 -05:00
|
|
|
static int
|
|
|
|
str_eq(struct option *opt, const unsigned char *str)
|
|
|
|
{
|
|
|
|
return str && strcmp(opt->value.string, str) == 0;
|
|
|
|
}
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
static void
|
|
|
|
str_wr(struct option *o, struct string *s)
|
|
|
|
{
|
|
|
|
int len = strlen(o->value.string);
|
|
|
|
|
|
|
|
int_upper_bound(&len, o->max - 1);
|
|
|
|
add_optstring_to_string(s, o->value.string, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
str_dup(struct option *opt, struct option *template)
|
|
|
|
{
|
|
|
|
unsigned char *new = mem_alloc(MAX_STR_LEN);
|
|
|
|
|
|
|
|
if (new) safe_strncpy(new, template->value.string, MAX_STR_LEN);
|
|
|
|
opt->value.string = new;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
cp_set(struct option *opt, unsigned char *str)
|
|
|
|
{
|
|
|
|
int ret = get_cp_index(str);
|
|
|
|
|
|
|
|
if (ret < 0) return 0;
|
|
|
|
|
|
|
|
opt->value.number = ret;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-02-03 07:36:48 -05:00
|
|
|
static int
|
|
|
|
cp_eq(struct option *opt, const unsigned char *str)
|
|
|
|
{
|
|
|
|
return str && get_cp_index(str) == opt->value.number;
|
|
|
|
}
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
static void
|
|
|
|
cp_wr(struct option *o, struct string *s)
|
|
|
|
{
|
2007-03-20 14:41:05 -04:00
|
|
|
unsigned char *mime_name = get_cp_config_name(o->value.number);
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
add_optstring_to_string(s, mime_name, strlen(mime_name));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
lang_set(struct option *opt, unsigned char *str)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_NLS
|
|
|
|
opt->value.number = name_to_language(str);
|
|
|
|
set_language(opt->value.number);
|
|
|
|
#endif
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-02-03 07:36:48 -05:00
|
|
|
static int
|
|
|
|
lang_eq(struct option *opt, const unsigned char *str)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_NLS
|
|
|
|
return str && name_to_language(str) == opt->value.number;
|
|
|
|
#else
|
|
|
|
return 1; /* All languages are the same. */
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
static void
|
|
|
|
lang_wr(struct option *o, struct string *s)
|
|
|
|
{
|
|
|
|
unsigned char *lang;
|
|
|
|
|
|
|
|
#ifdef CONFIG_NLS
|
|
|
|
lang = language_to_name(current_language);
|
|
|
|
#else
|
|
|
|
lang = "System";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
add_optstring_to_string(s, lang, strlen(lang));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
color_set(struct option *opt, unsigned char *str)
|
|
|
|
{
|
|
|
|
return !decode_color(str, strlen(str), &opt->value.color);
|
|
|
|
}
|
|
|
|
|
2008-02-03 07:36:48 -05:00
|
|
|
static int
|
|
|
|
color_eq(struct option *opt, const unsigned char *str)
|
|
|
|
{
|
|
|
|
color_T color;
|
|
|
|
|
|
|
|
return str && !decode_color(str, strlen(str), &color)
|
|
|
|
&& color == opt->value.color;
|
|
|
|
}
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
static void
|
|
|
|
color_wr(struct option *opt, struct string *str)
|
|
|
|
{
|
|
|
|
color_T color = opt->value.color;
|
|
|
|
unsigned char hexcolor[8];
|
2007-01-27 17:52:21 -05:00
|
|
|
const unsigned char *strcolor = get_color_string(color, hexcolor);
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
add_optstring_to_string(str, strcolor, strlen(strcolor));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
tree_dup(struct option *opt, struct option *template)
|
|
|
|
{
|
2007-07-26 15:39:08 -04:00
|
|
|
LIST_OF(struct option) *new = init_options_tree();
|
|
|
|
LIST_OF(struct option) *tree = template->value.tree;
|
2005-09-15 09:58:31 -04:00
|
|
|
struct option *option;
|
|
|
|
|
|
|
|
if (!new) return;
|
|
|
|
opt->value.tree = new;
|
|
|
|
|
|
|
|
foreachback (option, *tree) {
|
|
|
|
struct option *new_opt = copy_option(option);
|
|
|
|
|
|
|
|
if (!new_opt) continue;
|
2006-10-11 12:50:49 -04:00
|
|
|
object_nolock(new_opt, "option");
|
2005-09-15 09:58:31 -04:00
|
|
|
add_to_list_end(*new, new_opt);
|
|
|
|
new_opt->root = opt;
|
|
|
|
|
|
|
|
if (!new_opt->box_item) continue;
|
|
|
|
|
|
|
|
if (new_opt->name && !strcmp(new_opt->name, "_template_"))
|
|
|
|
new_opt->box_item->visible = get_opt_bool("config.show_template");
|
|
|
|
|
|
|
|
if (opt->box_item) {
|
|
|
|
add_to_list(opt->box_item->child,
|
|
|
|
new_opt->box_item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const struct option_type_info option_types[] = {
|
2007-12-15 18:09:18 -05:00
|
|
|
/* The OPT_ comments below are here to be found by grep. */
|
|
|
|
|
|
|
|
/* OPT_BOOL */
|
2008-02-03 07:36:48 -05:00
|
|
|
{ N_("Boolean"), bool_cmd, num_rd, num_wr, NULL, num_set, num_eq, N_("[0|1]") },
|
2007-12-15 18:09:18 -05:00
|
|
|
/* OPT_INT */
|
2008-02-03 07:36:48 -05:00
|
|
|
{ N_("Integer"), gen_cmd, num_rd, num_wr, NULL, num_set, num_eq, N_("<num>") },
|
2007-12-15 18:09:18 -05:00
|
|
|
/* OPT_LONG */
|
2008-02-03 07:36:48 -05:00
|
|
|
{ N_("Longint"), gen_cmd, num_rd, long_wr, NULL, long_set, long_eq, N_("<num>") },
|
2007-12-15 18:09:18 -05:00
|
|
|
/* OPT_STRING */
|
2008-02-03 07:36:48 -05:00
|
|
|
{ N_("String"), gen_cmd, str_rd, str_wr, str_dup, str_set, str_eq, N_("<str>") },
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2007-12-15 18:09:18 -05:00
|
|
|
/* OPT_CODEPAGE */
|
2008-02-03 07:36:48 -05:00
|
|
|
{ N_("Codepage"), gen_cmd, str_rd, cp_wr, NULL, cp_set, cp_eq, N_("<codepage>") },
|
2007-12-15 18:09:18 -05:00
|
|
|
/* OPT_LANGUAGE */
|
2008-02-03 07:36:48 -05:00
|
|
|
{ N_("Language"), gen_cmd, str_rd, lang_wr, NULL, lang_set, lang_eq, N_("<language>") },
|
2007-12-15 18:09:18 -05:00
|
|
|
/* OPT_COLOR */
|
2008-02-03 07:36:48 -05:00
|
|
|
{ N_("Color"), gen_cmd, str_rd, color_wr, NULL, color_set, color_eq, N_("<color|#rrggbb>") },
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2007-12-15 18:09:18 -05:00
|
|
|
/* OPT_COMMAND */
|
2008-02-03 07:36:48 -05:00
|
|
|
{ N_("Special"), exec_cmd, NULL, NULL, NULL, NULL, NULL, "" },
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2007-12-15 18:09:18 -05:00
|
|
|
/* OPT_ALIAS */
|
2008-02-03 07:36:48 -05:00
|
|
|
{ N_("Alias"), redir_cmd, redir_rd, redir_wr, NULL, redir_set, redir_eq, "" },
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2007-12-15 18:09:18 -05:00
|
|
|
/* OPT_TREE */
|
2008-02-03 07:36:48 -05:00
|
|
|
{ N_("Folder"), NULL, NULL, NULL, tree_dup, NULL, NULL, "" },
|
2005-09-15 09:58:31 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
unsigned char *
|
|
|
|
get_option_type_name(enum option_type type)
|
|
|
|
{
|
|
|
|
assert(type >= 0 && type < sizeof(option_types)/sizeof(struct option_type_info));
|
|
|
|
if_assert_failed return "";
|
|
|
|
|
|
|
|
return option_types[type].name;
|
|
|
|
}
|