map.c

changeset 75
725a7187c6ff
parent 70
e866dc825481
child 76
58280b944cda
--- a/map.c	Sat Jun 19 00:13:45 2004 +0200
+++ b/map.c	Sun Jun 20 13:22:50 2004 +0200
@@ -30,3 +30,18 @@
     return (i==-1 ? dflt : map[i].value); 
 }
 
+
+const char *stringintmap_reverse_value(const StringIntMap *map, int value, 
+                                       const char *dflt)
+{
+    int i;
+    
+    for(i=0; map[i].string!=NULL; ++i){
+        if(map[i].value==value){
+            return map[i].string;
+        }
+    }
+    
+    return dflt;
+    
+}

mercurial