hashtable.h

来自「mobile ip 在linux下的一种实现」· C头文件 代码 · 共 47 行

H
47
字号
/* $Id: hashtable.h,v 1.17 2000/04/06 07:26:53 jm Exp $ * This file defines the interface of a generic hashtable. * * Dynamic hierarchial IP tunnel * Copyright (C) 1998-2000, Dynamics group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. See README and COPYING for * more details. */#ifndef HASHTABLE_H#define HASHTABLE_H#include "list.h"/* structures */struct hashtable {	int hashtablesize;	struct list *hasharray; /* An array of collision lists. */};/* prototypes */struct hashtable *hashtable_init(int size);int hashtable_destroy(struct hashtable *table);int hashtable_add(struct hashtable *table,		  int (*hashfunc)(void *key, const int hashsize),		  void *key, struct node *entry);struct node *hashtable_fetch(struct hashtable *table,			     int (*hashfunc)(void *key, const int hashsize),			     void *key,			     int (*cmpfunc)(void *key, struct node *cmprd));int hashtable_find_and_remove(struct hashtable *table,			      int (*hashfunc)(void *key, const int hashsize),			      void *key,			      int (*cmpfunc)(void *key, struct node *cmprd));void hashtable_remove(struct node *entry);int hashtable_iterator(struct hashtable *table,		       int (*iterfunc)(struct node *node, void *data),		       void *data);int hashtable_find_prime(int n);#endif /* HASHTABLE_H */

⌨️ 快捷键说明

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