version 1.2, 2009/07/21 19:54:22 |
version 1.3, 2009/09/21 07:00:09 |
|
|
SPLAY_REMOVE(options_tree, &oo->tree, o); |
SPLAY_REMOVE(options_tree, &oo->tree, o); |
xfree(o->name); |
xfree(o->name); |
if (o->type == OPTIONS_STRING) |
if (o->type == OPTIONS_STRING) |
xfree(o->value.string); |
xfree(o->str); |
xfree(o); |
xfree(o); |
} |
} |
} |
} |
|
|
SPLAY_REMOVE(options_tree, &oo->tree, o); |
SPLAY_REMOVE(options_tree, &oo->tree, o); |
xfree(o->name); |
xfree(o->name); |
if (o->type == OPTIONS_STRING) |
if (o->type == OPTIONS_STRING) |
xfree(o->value.string); |
xfree(o->str); |
xfree(o); |
xfree(o); |
} |
} |
|
|
|
|
o->name = xstrdup(name); |
o->name = xstrdup(name); |
SPLAY_INSERT(options_tree, &oo->tree, o); |
SPLAY_INSERT(options_tree, &oo->tree, o); |
} else if (o->type == OPTIONS_STRING) |
} else if (o->type == OPTIONS_STRING) |
xfree(o->value.string); |
xfree(o->str); |
|
|
va_start(ap, fmt); |
va_start(ap, fmt); |
o->type = OPTIONS_STRING; |
o->type = OPTIONS_STRING; |
xvasprintf(&o->value.string, fmt, ap); |
xvasprintf(&o->str, fmt, ap); |
va_end(ap); |
va_end(ap); |
} |
} |
|
|
|
|
fatalx("missing option"); |
fatalx("missing option"); |
if (o->type != OPTIONS_STRING) |
if (o->type != OPTIONS_STRING) |
fatalx("option not a string"); |
fatalx("option not a string"); |
return (o->value.string); |
return (o->str); |
} |
} |
|
|
void |
void |
|
|
o->name = xstrdup(name); |
o->name = xstrdup(name); |
SPLAY_INSERT(options_tree, &oo->tree, o); |
SPLAY_INSERT(options_tree, &oo->tree, o); |
} else if (o->type == OPTIONS_STRING) |
} else if (o->type == OPTIONS_STRING) |
xfree(o->value.string); |
xfree(o->str); |
|
|
o->type = OPTIONS_NUMBER; |
o->type = OPTIONS_NUMBER; |
o->value.number = value; |
o->num = value; |
|
|
} |
} |
|
|
|
|
fatalx("missing option"); |
fatalx("missing option"); |
if (o->type != OPTIONS_NUMBER) |
if (o->type != OPTIONS_NUMBER) |
fatalx("option not a number"); |
fatalx("option not a number"); |
return (o->value.number); |
return (o->num); |
} |
} |