⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hthash.h

📁 www工具包. 这是W3C官方支持的www支撑库. 其中提供通用目的的客户端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, POS
💻 H
字号:
/*  					W3C Sample Code Library libwww Hash Table Class!  Hash Table Class!Written and integrated into libwww by John Punin - thanks!This module is implemented by HTHash.c, and is a partof the  W3C Sample Code Library.This HashTable class implements a simple hash table to keep objects associatedwith key words.*/#ifndef HTHASH_H#define HTHASH_H#include "HTList.h"typedef struct _HTHashtable HTHashtable;struct _HTHashtable {    void **table;    int count;    int size;};    typedef struct _keynode keynode;struct _keynode {    char *key;    void *object;};/*.  Creation and Deletion Methods.These methods create and deletes a Hash Table*/extern HTHashtable *	HTHashtable_new	(int size);extern BOOL	HTHashtable_delete (HTHashtable *me);/*.  Add an Element to a HashTable.*/extern BOOL HTHashtable_addObject (HTHashtable *me, const char *key, void *newObject);/*.  Remove an Element from a HashTable.*/extern BOOL HTHashtable_removeObject (HTHashtable *me, const char *key);/*.  Search for an Element in a Hash Table.*/extern void *	HTHashtable_object (HTHashtable * me, const char *key);/*.  Size of a Hash Table.*/extern int	HTHashtable_count  (HTHashtable *me);/*.  Walk all the elements in a Hash Table.Walking the hashtable calls the specified function pointer with each keyand object that is in the hash table.  If the callback function returns 0,the walking stops.  If it returns a negative number, the current elementis removed from the hash table.  Return a positive number to keep going.Note that it is legal for the walkFunc to call HTHashtable_removeObject()on any element in the current hash table except the currentone (if you intend to keep going, that is).  The only legal way to delete thecurrent element while continuing to walk the table is to use the negativereturn value.*/extern BOOL	HTHashtable_walk (HTHashtable *me, int (*walkFunc)(HTHashtable *, char *, void *));/*.  Extract in a dynamic array all keys of the Hash Table.*/extern HTArray * HTHashtable_keys  (HTHashtable *me);/*.  Print the keys of the Hash Table.*/extern void HTHashtable_print (HTHashtable *me);/**/#endif/*    @(#) $Id: HTHash.html,v 1.2 2000/08/11 07:49:07 kahan Exp $*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -