3 * Copyright (C) 2007 Andreas Ă–man
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30 static int str2val0(const char *str, struct strtab tab[], int l)
31 __attribute((unused));
34 str2val0(const char *str, struct strtab tab[], int l)
37 for(i = 0; i < l; i++)
38 if(!strcasecmp(str, tab[i].str))
44 #define str2val(str, tab) str2val0(str, tab, sizeof(tab) / sizeof(tab[0]))
46 static const char * val2str0(int val, struct strtab tab[], int l)
47 __attribute__((unused));
50 val2str0(int val, struct strtab tab[], int l)
53 for(i = 0; i < l; i++)
59 #define val2str(val, tab) val2str0(val, tab, sizeof(tab) / sizeof(tab[0]))
61 #endif /* STRTAB_H_ */