=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/options.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/usr.bin/tmux/options.c 2009/09/22 12:38:10 1.5 +++ src/usr.bin/tmux/options.c 2012/01/21 08:40:09 1.6 @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.5 2009/09/22 12:38:10 nicm Exp $ */ +/* $OpenBSD: options.c,v 1.6 2012/01/21 08:40:09 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -54,8 +54,6 @@ xfree(o->name); if (o->type == OPTIONS_STRING) xfree(o->str); - else if (o->type == OPTIONS_DATA) - o->freefn(o->data); xfree(o); } } @@ -97,8 +95,6 @@ xfree(o->name); if (o->type == OPTIONS_STRING) xfree(o->str); - else if (o->type == OPTIONS_DATA) - o->freefn(o->data); xfree(o); } @@ -114,8 +110,6 @@ SPLAY_INSERT(options_tree, &oo->tree, o); } else if (o->type == OPTIONS_STRING) xfree(o->str); - else if (o->type == OPTIONS_DATA) - o->freefn(o->data); va_start(ap, fmt); o->type = OPTIONS_STRING; @@ -147,8 +141,6 @@ SPLAY_INSERT(options_tree, &oo->tree, o); } else if (o->type == OPTIONS_STRING) xfree(o->str); - else if (o->type == OPTIONS_DATA) - o->freefn(o->data); o->type = OPTIONS_NUMBER; o->num = value; @@ -165,37 +157,4 @@ if (o->type != OPTIONS_NUMBER) fatalx("option not a number"); return (o->num); -} - -struct options_entry * -options_set_data( - struct options *oo, const char *name, void *value, void (*freefn)(void *)) -{ - struct options_entry *o; - - if ((o = options_find1(oo, name)) == NULL) { - o = xmalloc(sizeof *o); - o->name = xstrdup(name); - SPLAY_INSERT(options_tree, &oo->tree, o); - } else if (o->type == OPTIONS_STRING) - xfree(o->str); - else if (o->type == OPTIONS_DATA) - o->freefn(o->data); - - o->type = OPTIONS_DATA; - o->data = value; - o->freefn = freefn; - return (o); -} - -void * -options_get_data(struct options *oo, const char *name) -{ - struct options_entry *o; - - if ((o = options_find(oo, name)) == NULL) - fatalx("missing option"); - if (o->type != OPTIONS_DATA) - fatalx("option not data"); - return (o->data); }