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

📄 list.h

📁 At can be given its arguments in a file. You can comment out lines by preceding them with either #
💻 H
字号:
/* =====================================================
*
* LIST.C
*
* This file contains definitions for doubly linked list data structure.
*
* Copyright(c): Martti Ylikoski. 1991
*
* Programmer:	Martti Ylikoski
* Created:	21.12.1991
* Version:	1.0
*
* ====================================================== */
#ifndef LIST_DEFINED
#define LIST_DEFINED
/* Error definitions: move later to list.h and make them enum */
#define LIST_OK  0

#define LIST_ERR_MEMORY_ALLOCATION	100
#define LIST_ERR_BAD_POINTER            101
#define LIST_ERR_NO_CURR                102
#define LIST_ERR_END_LIST               103
#define LIST_ERR_BEG_LIST               104

typedef struct {
    void *buf ;        /* pointer to actual data */
   long buflen ;       /* length of data */
   int used ;          /* needed ?? */
   void *prior ;       /* prior item in chain */
   void *next ;        /* next item in chain */
   /* void *userdata */
} LIST_ENTRY ;

typedef struct {
   LIST_ENTRY *beginptr ; /* first entry in list */
   LIST_ENTRY *endptr ;   /* last entry in list */
   LIST_ENTRY *currptr ;  /* current entry */
   long currno ;          /* current rows ordinal number in list */
   long itemscount ;       /* count of items in list */
   /* void * userdata */
/*    int ( *searchfn) () ; */
} HNDLIST ;

HNDLIST *ListInit(void) ;
int ListExit(HNDLIST *lhandle) ;
int ListAdd (HNDLIST *lhandle, void *buf, long buflen ) ;
int ListInsert(HNDLIST *lhandle, void *buf, long buflen) ;
int ListDel(HNDLIST *lhandle) ;
int ListReturn(HNDLIST *lhandle, void **buf, unsigned long *buflen) ;
int ListOverwrite(HNDLIST *lhandle, void *buf, long buflen) ;
int ListFirst(HNDLIST *lhandle) ;
int ListLast(HNDLIST *lhandle) ;
int ListForward(HNDLIST *lhandle, long forward) ;
int ListNext(HNDLIST *lhandle) ;
int ListBackward(HNDLIST *lhandle, long backward) ;
int ListPrior(HNDLIST *lhandle) ;
LIST_ENTRY *ListGetPos(HNDLIST * lhandle, int *actioncode, long *currno) ;
int ListSetPos(HNDLIST * lhandle, LIST_ENTRY *newcurrptr, long newcurrno) ;
#endif

⌨️ 快捷键说明

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