From cc92c670802bb7f7a0789777f86f0c3f00706216 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 19 Nov 2010 19:52:39 -0300 Subject: [PATCH] qpkg: (jrb) remove _gen suffix, since we removed the non-generic variants - jrb.h, jrb.c (jrb_find_gte_gen): renamed to jrb_find_gte - jrb.h, jrb.c (jrb_find_gen): renamed to jrb_find - jrb.h, jrb.c (jrb_insert_gen): renamed to jrb_insert - rbtest.c (INSERT): track jrb_insert_gen name change --- qpkg/jrb.c | 10 +++++----- qpkg/jrb.h | 6 +++--- qpkg/rbtest.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/qpkg/jrb.c b/qpkg/jrb.c index 63b7fa6..036a977 100644 --- a/qpkg/jrb.c +++ b/qpkg/jrb.c @@ -165,7 +165,7 @@ JRB make_jrb(void) return head; } -JRB jrb_find_gte_gen(JRB n, const void *key, +JRB jrb_find_gte(JRB n, const void *key, int (*fxn)(const void *, const void *), int *fnd) { int cmp; @@ -194,12 +194,12 @@ JRB jrb_find_gte_gen(JRB n, const void *key, } } -JRB jrb_find_gen(JRB n, const void *key, int (*fxn)(const void *, const void *)) +JRB jrb_find(JRB n, const void *key, int (*fxn)(const void *, const void *)) { int fnd; JRB j; - j = jrb_find_gte_gen(n, key, fxn, &fnd); + j = jrb_find_gte(n, key, fxn, &fnd); if (fnd) return j; else return NULL; } @@ -494,10 +494,10 @@ void *jrb_val(JRB n) return n->val; } -JRB jrb_insert_gen(JRB tree, void *key, void *val, +JRB jrb_insert(JRB tree, void *key, void *val, int (*func)(const void *, const void *)) { int fnd; - return jrb_insert_b(jrb_find_gte_gen(tree, key, func, &fnd), key, val); + return jrb_insert_b(jrb_find_gte(tree, key, func, &fnd), key, val); } diff --git a/qpkg/jrb.h b/qpkg/jrb.h index c48f537..8ae2bab 100644 --- a/qpkg/jrb.h +++ b/qpkg/jrb.h @@ -65,20 +65,20 @@ extern JRB make_jrb(void); /* Creates a new rb-tree */ jrb_insert uses strcmp() as comparison funcion. jrb_inserti uses <>=, jrb_insertg uses func() */ -extern JRB jrb_insert_gen(JRB tree, void *key, void *val, +extern JRB jrb_insert(JRB tree, void *key, void *val, int (*func)(const void *, const void *)); /* returns an external node in t whose value is equal k. Returns NULL if there is no such node in the tree */ -extern JRB jrb_find_gen(JRB root, const void *, +extern JRB jrb_find(JRB root, const void *, int (*func)(const void *, const void *)); /* returns an external node in t whose value is equal k or whose value is the smallest value greater than k. Sets found to 1 if the key was found, and 0 otherwise. */ -extern JRB jrb_find_gte_gen(JRB root, const void *key, +extern JRB jrb_find_gte(JRB root, const void *key, int (*func)(const void *, const void *), int *found); diff --git a/qpkg/rbtest.c b/qpkg/rbtest.c index abe3369..c7e62af 100644 --- a/qpkg/rbtest.c +++ b/qpkg/rbtest.c @@ -12,7 +12,7 @@ static int cmp(const void *a, const void *b) #define INSERT(key, val) \ - jrb_insert_gen(tree, key, val, cmp) + jrb_insert(tree, key, val, cmp) int main(void)