summaryrefslogtreecommitdiffhomepage
path: root/src/ternary.h
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2001-08-30 16:52:09 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2001-08-30 16:52:09 +0000
commita328cefbf067785a867f53df042ca02ec3e6f39d (patch)
tree80646d0fed90a24ba3d48ef1811b246eb4e09d73 /src/ternary.h
parent22bdb8123d8c1687bf8ea31c98bdd0c47833aee7 (diff)
Renamed ternary_insert() to ternary_insert_replace() and added the ability
to replace existing data (without a memory leak.) Added two DEFINES ternary_insert() and ternary_replace() to aid in coding.
Diffstat (limited to 'src/ternary.h')
-rw-r--r--src/ternary.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ternary.h b/src/ternary.h
index fcb6c17..5fb6d51 100644
--- a/src/ternary.h
+++ b/src/ternary.h
@@ -1,4 +1,4 @@
-/* $Id: ternary.h,v 1.2 2000-09-26 04:59:20 rjkaes Exp $
+/* $Id: ternary.h,v 1.3 2001-08-30 16:52:09 rjkaes Exp $
*
* See 'ternary.c' for a detailed description.
*
@@ -58,7 +58,11 @@ extern char te_errbuf[256];
extern TERNARY ternary_new(void);
extern int ternary_destroy(TERNARY tno, void (*freeptr)(void *));
-extern int ternary_insert(TERNARY tno, const char *s, void *data);
+#define ternary_insert(x, y, z) ternary_insert_replace(x, y, z, 0)
+#define ternary_replace(x, y, z) ternary_insert_replace(x, y, z, 1)
+
+extern int ternary_insert_replace(TERNARY tno, const char *s, void *data,
+ short int replace);
extern int ternary_search(TERNARY tno, const char *s, void **data);
#endif