diff options
author | dos-reis <gdr@axiomatics.org> | 2010-11-28 15:08:36 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-11-28 15:08:36 +0000 |
commit | bbb5a69f0f2348adbbb8db960e5e45306b865683 (patch) | |
tree | 23f3039b350d61a402f3af97e8cc3ec06f08797e /src/include/hash.h | |
parent | ab86c48186a05391f1c1fbc3f90759cc0caff45b (diff) | |
download | open-axiom-bbb5a69f0f2348adbbb8db960e5e45306b865683.tar.gz |
* lib/Makefile.in: Build libopen-axiom-core and libspad with a C++
compiler and linker.
* lib/bsdsignal.c: Fix C calling convention annotation.
* lib/cfuns-c.c: Likewise.
* lib/edin.c: Likewise.
* lib/sockio-c.c: Likewise.
* include/bsdsignal.h: Remove 'extern "C"'-block annotation.
* include/cfuns.h: Likewise.
* include/cursor.h: Likewise.
* include/edin.h: Likewise.
* include/fnct_key.h: Likewise.
* include/halloc.h: Likewise.
* include/hash.h: Likewise.
* include/openpty.h: Likewise.
* include/pixmap.h: Likewise.
* include/prt.h: Likewise.
* include/sockio.h: Likewise.
* include/spadcolors.h: Likewise.
* include/util.H1: Likewise.
* include/view.h: Likewise.
* include/wct.h: Likewise.
* include/open-axiom.h (OPENAXIOM_C_CALL): New macro.
(OPENAXIOM_C_EXPORT): Likewise.
Diffstat (limited to 'src/include/hash.h')
-rw-r--r-- | src/include/hash.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/include/hash.h b/src/include/hash.h index aadcec03..8f97754d 100644 --- a/src/include/hash.h +++ b/src/include/hash.h @@ -1,6 +1,8 @@ /* Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. All rights reserved. + Copyright (C) 2007-2010, Gabriel Dos Reis. + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -34,27 +36,23 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef OPENAXIOM_HASH_INCLUDED #define OPENAXIOM_HASH_INCLUDED -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct HashEntry { +struct HashEntry { const char *key; /* pointer to key data */ char *data; /* Pointer to entry */ struct HashEntry *next; /* Link to next entry */ -} HashEntry; +}; typedef int (*EqualFunction)(const void*, const void*); typedef int (*HashcodeFunction)(const void*,int); typedef void (*MappableFunction) (const void*); typedef void (*FreeFunction) (void *); -typedef struct HashTable { +struct HashTable { HashEntry **table; /* the actual table */ int size; /* size of table */ int num_entries; /* number of elements in a hash table */ EqualFunction equal; /* equality predicate for keys */ HashcodeFunction hash_code; /* create hash code for a key */ -} HashTable; +}; extern char* alloc_string(const char*); extern HashEntry* hash_copy_entry(HashEntry*); @@ -69,8 +67,4 @@ extern char* hash_replace(HashTable*, char*, const char*); extern int string_equal(const char*, const char*); extern int string_hash(const char*, int size); -#ifdef __cplusplus -} -#endif - #endif /* OPENAXIOM_HASH_INCLUDED */ |