Score
0
Watch 4 Star 3 Fork 1

Konghy / seqlistC

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
seqlist.h 1.12 KB
Copy Edit Web IDE Raw Blame History
Konghy authored 2015-01-18 21:39 . first commit
/*============================================================================
# FileName: seqlist.h
# Author: Huoty
# Email: sudohuoty@163.com
# HomePage: http://konghy.blog.163.com/
# Version: 0.0.1
# CreateDate: 2014-12-19 14:59:41
# History:
# Description: 顺序存储序列
============================================================================*/
#ifndef SEQLIST_H
#define SEQLIST_H
/* 定义存储的数据类型 */
typedef struct {
char *key;
char *val;
} KVData_t;
/* 重定义存储的数据类型 */
typedef KVData_t DataType;
/******** 顺序序列 ********/
/* define sequential list */
typedef struct {
int max; // maximum list length
int len; // real list length
DataType *slp; // sequential list pointer
} SeqList;
int seqlist_init(SeqList *seql);
void seqlist_destroy(SeqList *seql);
int seqlist_add_data(SeqList *seql, char *key, char *val);
void seqlist_data_sort(SeqList *seql);
char *seqlist_data_search(SeqList *seql, const char *key);
#endif /* !SEQLIST_H */
/*********************** (C) COPYRIGHT HOUTY PRIVATE *****END OF FILE****/

Comment ( 0 )

Sign in for post a comment