| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #ifndef __LANGUAGE_HASHMAP_H
- #define __LANGUAGE_HASHMAP_H
- #define MAX_LEN 1024
- #define DELIMITER "|"
- typedef struct HashEntry
- {
- char *key;
- char **value;
- int valueLength;
- struct HashEntry *next;
- } HashEntry;
- typedef struct HashTable
- {
- HashEntry **ptable;
- int size;
- } HashTable;
- unsigned int _hash(HashTable *table,const char *key) ;
- HashTable *create_hash_table(int size);
-
- // 在哈希表中插入键值对
- void insert_Newhash(HashTable *table, const char *key, char value[][64],int valuelens);
-
- // 在哈希表中查找键对应的值
- const HashEntry*find_hash(HashTable *table, const char *key);
-
- // 释放哈希表占用的内存
- void free_hash_table(HashTable *table);
- // 替换管包裹字符
- void replace_sequences(char *str, HashTable *table);
- #endif
|