projects
/
rrq
/
rrqmisc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
revise hashvector_contents to optionally create the target vector
[rrq/rrqmisc.git]
/
vector
/
integeritem.c
diff --git
a/vector/integeritem.c
b/vector/integeritem.c
index 6e6ac04659966c73c62a07410a722603f592e623..ae4db929ae95c4bd358ac516e111864641bb38fe 100644
(file)
--- a/
vector/integeritem.c
+++ b/
vector/integeritem.c
@@
-36,9
+36,18
@@
static void *integeritem_itemkey(void *this,void *item) {
static void integeritem_releasekey(void *this,void *key) {
}
static void integeritem_releasekey(void *this,void *key) {
}
+/**
+ * This callback function writes a representation of an item into
+ * a character buffer.
+ */
+static int integeritem_tostring(void *this,void *item,char *buffer,int limit) {
+ return snprintf( buffer, limit, "%lld", (long long) item );
+}
+
itemkeyfun integeritem = {
.hashcode = integeritem_hashcode,
.haskey = integeritem_haskey,
.itemkey = integeritem_itemkey,
itemkeyfun integeritem = {
.hashcode = integeritem_hashcode,
.haskey = integeritem_haskey,
.itemkey = integeritem_itemkey,
- .releasekey = integeritem_releasekey
+ .releasekey = integeritem_releasekey,
+ .tostring = integeritem_tostring
};
};