1 Star 0 Fork 14

no2key/pinyin-php

forked from 独孤影/pinyin-php 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
py_hashtable.h 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
独孤影 提交于 2014-04-22 00:10 . a bug in hashtable lookup
/**
* Azalea Chatting Server
*
* Copyright (C) 2013-2015 Rex Lee <[email protected]>
*
* This program is free and opensource software;
* you can redistribute it and/or modify
* it under the terms of the GNU General Public License
*/
#include <stdio.h>
#include <stdlib.h>
// #include "dmalloc.h"
#ifndef _HASHTABLE_H_
#define _HASHTABLE_H_
#define HASH_TABLE_MAX_SIZE 10000
typedef struct HashNode HashNode;
struct HashNode
{
char* sKey;
void* nValue;
HashNode* pNext;
} ;
typedef struct i_HashTable i_HashTable;
struct i_HashTable
{
int ht_size;
HashNode* table[HASH_TABLE_MAX_SIZE];
};
/**
* @brief initial the hashtable
* @details this function not alloc memory for HashTable pointer
*
* @param HashTable the pointer of hashtable
*/
void ht_init(i_HashTable* hash_table);
/**
* @brief insert key-value into hash table
* @details [long description]
*
* @param HashTable the hashtable
* @param skey key
* @param nvalue value
*/
void ht_insert(i_HashTable* hash_table, const char* skey, void* nvalue);
/**
* @brief remove the hash node from hashtable
* @details [long description]
*
* @param HashTable the hashtable
* @param skey the key of hashtable you'll remove
*/
void ht_remove(i_HashTable* hash_table, const char* skey);
/**
* @brief [brief description]
* @details [long description]
*
* @param HashTable [description]
* @param skey [description]
* @return [description]
*/
HashNode* ht_lookup(i_HashTable* hash_table, const char* skey);
/**
* @brief release the hashtable
* @details [long description]
*
* @param hash_table the hashtable
*/
void ht_release(i_HashTable* hash_table);
void ht_print(i_HashTable* hash_table);
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/no2key/pinyin-php.git
[email protected]:no2key/pinyin-php.git
no2key
pinyin-php
pinyin-php
master

搜索帮助