summaryrefslogtreecommitdiffstats
path: root/src/htable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/htable.h')
-rw-r--r--src/htable.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/htable.h b/src/htable.h
index 10d04c1..3bde5ef 100644
--- a/src/htable.h
+++ b/src/htable.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004-2011 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2012 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -69,9 +69,7 @@ struct name { \
}
#define HTABLE_ENTRY(type) \
-struct { \
- struct type *next; /* To build the bucket chain list. */ \
-}
+struct type *next /* To build the bucket chain list. */
#define HTABLE_SIZE(head) \
(sizeof (*(head)->bkts) ? sizeof ((head)->bkts) / sizeof (*(head)->bkts) : 0)
@@ -106,7 +104,11 @@ struct { \
#define HTABLE_PROTOTYPE(name, type) \
struct type *name##_HTABLE_INSERT(struct name *, struct type *); \
struct type *name##_HTABLE_REMOVE(struct name *, struct type *); \
-struct type *name##_HTABLE_LOOKUP(struct name *, struct type *);
+struct type *name##_HTABLE_LOOKUP(struct name *, struct type *); \
+uint32_t name##_HTABLE_FIND_BKT(struct name *, struct type *); \
+int name##_HTABLE_CHAIN_LEN(struct name *, uint32_t); \
+struct type *name##_HTABLE_FIRST_FROM(struct name *, int); \
+struct type *name##_HTABLE_NEXT(struct name *, struct type *);
/*
* Generate function bodies.
@@ -116,7 +118,7 @@ uint32_t \
name##_HTABLE_FIND_BKT(struct name *head, struct type *elm) \
{ \
uint32_t __bkt; \
- char *__key; \
+ const char *__key; \
int __len; \
\
(key) (elm, &__key, &__len); \