map.h

Mon, 17 Jan 2005 22:02:09 +0100

author
tuomov
date
Mon, 17 Jan 2005 22:02:09 +0100
changeset 85
9f94b2e96e3b
parent 75
725a7187c6ff
permissions
-rw-r--r--

trunk: changeset 1934
Fixed everything that requires locale stuff to check CF_NO_LOCALE.

58
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
1 /*
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
2 * libtu/map.h
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
3 *
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
4 * Copyright (c) Tuomo Valkonen 1999-2002.
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
5 *
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
6 * You may distribute and modify this library under the terms of either
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
7 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
8 */
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
9
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
10 #ifndef LIBTU_MAP_H
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
11 #define LIBTU_MAP_H
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
12
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
13 typedef struct _StringIntMap{
62
aae5facf9fc5 trunk: changeset 1318
tuomov
parents: 58
diff changeset
14 const char *string;
aae5facf9fc5 trunk: changeset 1318
tuomov
parents: 58
diff changeset
15 int value;
58
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
16 } StringIntMap;
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
17
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
18 #define END_STRINGINTMAP {NULL, 0}
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
19
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
20 /* Return the index of str in map or -1 if not found. */
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
21 extern int stringintmap_ndx(const StringIntMap *map, const char *str);
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
22 extern int stringintmap_value(const StringIntMap *map, const char *str,
62
aae5facf9fc5 trunk: changeset 1318
tuomov
parents: 58
diff changeset
23 int dflt);
75
725a7187c6ff trunk: changeset 1583
tuomov
parents: 62
diff changeset
24 extern const char *stringintmap_key(const StringIntMap *map,
725a7187c6ff trunk: changeset 1583
tuomov
parents: 62
diff changeset
25 int value, const char *dflt);
58
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
26
789df543d0c3 trunk: changeset 1303
tuomov
parents:
diff changeset
27 #endif /* LIBTU_MAP_H */

mercurial