summaryrefslogtreecommitdiff
path: root/src/lib/hashtable.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2017-01-09 16:40:40 +0100
committerSander Vrijders <sander.vrijders@intec.ugent.be>2017-01-09 16:40:40 +0100
commit6c1cfb990f56b2fa87500732cb4f0966616907c7 (patch)
tree4af3a0e2ce9fc12d7dc759803da70b7f570d6f8a /src/lib/hashtable.c
parente56d24010287127fc6b9c9da8d1f7cf160c50253 (diff)
parent5273b0f5915956e49bcad4167cca2c1349e8816d (diff)
downloadouroboros-6c1cfb990f56b2fa87500732cb4f0966616907c7.tar.gz
ouroboros-6c1cfb990f56b2fa87500732cb4f0966616907c7.zip
Merged in dstaesse/ouroboros/be-list (pull request #340)
Updates to list and fixes LGPL license for library
Diffstat (limited to 'src/lib/hashtable.c')
-rw-r--r--src/lib/hashtable.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/lib/hashtable.c b/src/lib/hashtable.c
index 8dcd4ec1..f17accaf 100644
--- a/src/lib/hashtable.c
+++ b/src/lib/hashtable.c
@@ -1,22 +1,23 @@
/*
- * Ouroboros - Copyright (C) 2016
+ * Ouroboros - Copyright (C) 2016 - 2017
*
* Hash table with separate chaining on collisions
*
* Sander Vrijders <sander.vrijders@intec.ugent.be>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
*
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
*/
#include <ouroboros/config.h>
@@ -69,7 +70,7 @@ struct htable * htable_create(uint64_t buckets, bool hash_key)
}
for (i = 0; i < buckets; i++)
- INIT_LIST_HEAD(&(tmp->buckets[i]));
+ list_head_init(&(tmp->buckets[i]));
return tmp;
}
@@ -136,7 +137,7 @@ int htable_insert(struct htable * table, uint64_t key, void * val)
entry->key = key;
entry->val = val;
- INIT_LIST_HEAD(&entry->next);
+ list_head_init(&entry->next);
list_add(&entry->next, &(table->buckets[lookup_key]));