Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1083747
  • 博文数量: 190
  • 博客积分: 1156
  • 博客等级: 少尉
  • 技术积分: 2153
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-16 15:01
个人简介

go!go!go!

文章分类

全部博文(190)

文章存档

2023年(11)

2022年(13)

2021年(15)

2020年(38)

2019年(3)

2018年(6)

2016年(1)

2015年(16)

2014年(13)

2013年(24)

2012年(46)

分类: C/C++

2013-11-22 17:27:07

typedef struct {                                                                                                                                              
    hash_link hash;                                                                                                                                           
    int n;                                                                                                                                                    
} fvdb_entry;


fvdb_entry *fv;


static hash_table *via_table = NULL;
via_table = hash_create((HASHCMP *) strcmp, 977, hash4);
if (NULL == hash)
return;
fv = hash_lookup(hash, key);                                                                                                                              
if (NULL == fv) {                                                                                                                                         
        fv = xcalloc(1, sizeof(fvdb_entry));                                                                                                                  
        fv->hash.key = xstrdup(key);                                                                                                                          
        hash_join(hash, &fv->hash);                                                                                                                           
}                                                                                                                                                         
fv->n++;


hashFreeItems(via_table, fvdbFreeEntry);                                                                                                                  
hashFreeMemory(via_table);                                                                                                                                

阅读(1057) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~