include/libtu/map.h

Mon, 17 Nov 2003 14:28:28 +0100

author
tuomov
date
Mon, 17 Nov 2003 14:28:28 +0100
changeset 55
d32ef6ce17a4
parent 53
f8f9366b359c
permissions
-rw-r--r--

trunk: changeset 59
Set _GNU_SOURCE when compiling with system asprintf. Default to system
asprintf.

34
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
1 /*
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
2 * libtu/map.h
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
3 *
36
63cd573ffbcf trunk: changeset 39
tuomov
parents: 34
diff changeset
4 * Copyright (c) Tuomo Valkonen 1999-2002.
53
f8f9366b359c trunk: changeset 57
tuomov
parents: 51
diff changeset
5 *
f8f9366b359c trunk: changeset 57
tuomov
parents: 51
diff changeset
6 * You may distribute and modify this library under the terms of either
f8f9366b359c trunk: changeset 57
tuomov
parents: 51
diff changeset
7 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
34
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
8 */
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
9
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
10 #ifndef LIBTU_MAP_H
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
11 #define LIBTU_MAP_H
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
12
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
13 typedef struct _StringIntMap{
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
14 const char *string;
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
15 int value;
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
16 } StringIntMap;
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
17
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
18 #define END_STRINGINTMAP {NULL, 0}
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
19
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
20 /* Return the index of str in map or -1 if not found. */
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
21 extern int stringintmap_ndx(const StringIntMap *map, const char *str);
51
2d95d77aa954 trunk: changeset 55
tuomov
parents: 36
diff changeset
22 extern int stringintmap_value(const StringIntMap *map, const char *str,
2d95d77aa954 trunk: changeset 55
tuomov
parents: 36
diff changeset
23 int dflt);
2d95d77aa954 trunk: changeset 55
tuomov
parents: 36
diff changeset
24
34
828f3afd5c76 trunk: changeset 37
tuomov
parents:
diff changeset
25 #endif /* LIBTU_MAP_H */

mercurial