4 * Copyright (c) Tuomo Valkonen 1999-2002.
6 * You may distribute and modify this library under the terms of either
7 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
14 int stringintmap_ndx(const StringIntMap *map, const char *str)
18 for(i=0; map[i].string!=NULL; i++){
19 if(strcmp(str, map[i].string)==0)
27 int stringintmap_value(const StringIntMap *map, const char *str, int dflt)
29 int i=stringintmap_ndx(map, str);
30 return (i==-1 ? dflt : map[i].value);
34 const char *stringintmap_key(const StringIntMap *map, int value,
39 for(i=0; map[i].string!=NULL; ++i){
40 if(map[i].value==value){