stk.h
来自「c语言库函数!里面包含了所以c语言中的系统函数的实现及其详细说明和代码!请大家及」· C头文件 代码 · 共 67 行
H
67 行
/* +++Date last modified: 05-Jul-1997 */
/*
** stk.h - Stack manager (stk.c) header file.
**
** By Dustin Puryear (dpuryear@intersurf.com), placed into Public Domain.
*/
#ifndef STK__H
#define STK__H
typedef struct stknode
{
void *pdata;
struct stknode *pprev;
} StkNode;
typedef struct stk
{
StkNode *ptop;
unsigned vcount;
} Stk;
/*
** stkInit()
**
** Precondition - pstack points to a stk type variable.
** Postcondition - Stack pointed to by pstack is initialized.
** Returns - None.
*/
extern void stkInit(Stk *pstack);
/*
** stkPush()
**
** Precondition - pstack points to an initialized stack.
** pdata points to data to be stored in stack.
** Postcondition - Data contained in pdata is pushed onto the stack.
** Returns - Non-zero if success, 0 if error.
*/
extern int stkPush(Stk *pstack, void *pdata);
/*
** stkPop()
**
** Precondition - ppdata points to a pointer to contain data.
** pstack points to initialized stack.
** Postcondition - Top of stack is pushed into ppdata (pointer).
** Returns - Non-zero if success, 0 if error.
*/
extern int stkPop(void **ppdata, Stk *pstack);
/*
** stkCount()
**
** Precondition - pstack points to an initialized stack.
** Postcondition - None.
** Returns - Number of items on stack.
*/
extern unsigned stkCount(Stk *pstack);
#endif /* STK__H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?