📄 e_hash.h
字号:
/*------------------------------------------------------------------------** Copyright 1998 by Paul Leventis, Jonathan Rose and the University of ** Toronto. Use is permitted, provided that this attribution is retained ** and no part of the code is re-distributed or included in any commercial ** product except by written agreement with the above parties. ** ** For more information, contact us directly: ** Paul Leventis (leventi@eecg.utoronto.ca) ** Jonathan Rose (jayar@eecg.toronto.edu) ** Department of Electrical and Computer Engineering ** University of Toronto, 10 King's College Rd., ** Toronto, Ontario, CANADA M5S 1A4 ** Phone: (416) 978-6992 Fax: (416) 971-2286 **------------------------------------------------------------------------*//* * e_hash.h * Generalized hash structure definition * * Paul Leventis, July 1997*/#ifndef E_HASH_H#define E_HASH_Hstruct tagHASH_ENTRY { char *name; int index; void *pPayload; struct tagHASH_ENTRY *pNextEntry;};typedef struct tagHASH_ENTRY HASH_ENTRY;struct tagHASH_TABLE { int size; HASH_ENTRY **table; int (*hash_func)(char *); void (*free_payload)(void *);};typedef struct tagHASH_TABLE HASH_TABLE;#define hash_free(pHashTable) { hash_free_helper(pHashTable); pHashTable = NULL; }int hash_add(HASH_TABLE *pHashTable, char *key, void *pPackage);void* hash_get(HASH_TABLE *pHashTable, char *key);HASH_TABLE *hash_alloc(int size, int (*hash_func)(char *), void (*free_entry)(void *));void hash_free_helper(HASH_TABLE *pHashTable);int hash_remove(HASH_TABLE *pHashTable, char *key);int hash_hashfunc1(char *key);int hash_hashfunc2(char *key);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -