diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-07 19:53:17 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-07 19:53:17 +0000 |
commit | 18312fa6fd1b06c68d5f97fd7d1b8830b0d8669f (patch) | |
tree | 910b73f9255316238e43e1b4c671b35ff9db042a /options.c | |
parent | 51ca51e329b1ddcbe4a40c76ee5195bd39d34c10 (diff) | |
download | rtmux-18312fa6fd1b06c68d5f97fd7d1b8830b0d8669f.tar.gz rtmux-18312fa6fd1b06c68d5f97fd7d1b8830b0d8669f.tar.bz2 rtmux-18312fa6fd1b06c68d5f97fd7d1b8830b0d8669f.zip |
Some options tidying/code shrinkage. Also add -u option to unset non-global options (allowing them to inherit), and some extra info.
Diffstat (limited to 'options.c')
-rw-r--r-- | options.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: options.c,v 1.3 2008-06-23 07:41:21 nicm Exp $ */ +/* $Id: options.c,v 1.4 2009-01-07 19:53:17 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -83,6 +83,22 @@ options_find(struct options *oo, const char *name) return (o); } +int +options_remove(struct options *oo, const char *name) +{ + struct options_entry *o; + + if ((o = options_find1(oo, name)) == NULL) + return (-1); + + SPLAY_REMOVE(options_tree, &oo->tree, o); + xfree(o->name); + if (o->type == OPTIONS_STRING) + xfree(o->value.string); + xfree(o); + return (0); +} + void printflike3 options_set_string(struct options *oo, const char *name, const char *fmt, ...) { |