1 Star 0 Fork 1

卐卍/编译原理虎书代码

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
table.h 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
ylyhappy 提交于 2024-05-20 22:34 . 增加语法shu
/*
* table.h - generic hash table
*
* No algorithm should use these functions directly, because
* programming with void* is too error-prone. Instead,
* each module should make "wrapper" functions that take
* well-typed arguments and call the TAB_ functions.
*/
#ifndef __TABLE_H
#define __TABLE_H
typedef struct TAB_table_ *TAB_table;
/* Make a new table mapping "keys" to "values". */
TAB_table TAB_empty(void);
/* Enter the mapping "key"->"value" into table "t",
* shadowing but not destroying any previous binding for "key". */
void TAB_enter(TAB_table t, void *key, void *value);
/* Look up the most recent binding for "key" in table "t" */
void *TAB_look(TAB_table t, void *key);
/* Pop the most recent binding and return its key.
* This may expose another binding for the same key, if there was one. */
void *TAB_pop(TAB_table t);
/* Call "show" on every "key"->"value" pair in the table,
* including shadowed bindings, in order from the most
* recent binding of any key to the oldest binding in the table */
void TAB_dump(TAB_table t, void (*show)(void *key, void *value));
#endif // !__TABLE_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Happy_world_cn/hushu.git
git@gitee.com:Happy_world_cn/hushu.git
Happy_world_cn
hushu
编译原理虎书代码
master

搜索帮助