Commit 08fdc2f4 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Removed uthash.h.

parent 68ed8077
......@@ -6,7 +6,6 @@
#if defined(HAVE_LIBCMOR)
#include <unistd.h>
#include "uthash.h"
#include "util.h"
extern "C" {
......
......@@ -172,7 +172,6 @@ libcdo_la_SOURCES = \
timebase.h \
timer.cc \
userlog.cc \
uthash.h \
util.cc \
util.h \
varlist.h \
......
......@@ -583,8 +583,8 @@ libcdo_la_SOURCES = argument.h argument.cc array.h array.cc cdo_int.h \
remap_bicubic_scrip.cc remap_bilinear_scrip.cc stdnametable.cc \
stdnametable.h specspace.cc specspace.h statistic.cc \
statistic.h table.cc text.cc text.h timebase.h timer.cc \
userlog.cc uthash.h util.cc util.h varlist.h zaxis_print.cc \
zaxis.cc json/jsmn.h json/jsmn.c kdtreelib/kdtree.h \
userlog.cc util.cc util.h varlist.h zaxis_print.cc zaxis.cc \
json/jsmn.h json/jsmn.c kdtreelib/kdtree.h \
kdtreelib/kdtree_cartesian.cc kdtreelib/kdtree_common.cc \
kdtreelib/kdtree_spherical.cc kdtreelib/qsort.cc \
kdtreelib/pmergesort.cc kdtreelib/pqueue.cc kdtreelib/pqueue.h \
......
#include <stdlib.h>
#include "uthash.h"
struct kv
{
char *key;
char *value;
UT_hash_handle hh;
};
void hinsert(struct kv **ht, const char *key, const char *value)
{
/* Insert new keys. Do not overwrite values of existing keys. */
struct kv *e, *s;
HASH_FIND_STR(*ht, key, s);
if ( s == NULL)
{
e = malloc(sizeof(struct kv));
e->key = malloc(strlen(key) + 1);
e->value = malloc(strlen(value) + 1);
strcpy(e->key, key);
strcpy(e->value, value);
HASH_ADD_KEYPTR(hh, *ht, e->key, strlen(e->key), e);
}
}
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment