icstack.h

来自「IBE是一种非对称密码技术」· C头文件 代码 · 共 72 行

H
72
字号
/* Copyright 2003-2006, Voltage Security, all rights reserved.
 */

#include "vibe.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "stringutil.h"

#ifndef _ICSTACK_H_
#define _ICSTACK_H_

#ifdef __cplusplus
extern "C" {
#endif

typedef struct 
{
	Pointer       *items;
	unsigned int   capacity;
	unsigned int   length;
} icStack;

/* Creates a stack.
 */
int icStackCreate (
   icStack **stack,
   VoltLibCtx *libCtx
   );

/* Frees all memory associated with the stack.  If the items contained in
 * the stack need to be freed then you must first pop all the items off
 * and free them one by one to ensure you don't cause a memory leak.
 */
void icStackFree (
   icStack **stack,
   VoltLibCtx *libCtx
   );

/* Pushes an item onto the top of the stack.
 */
int icStackPush (
   icStack *stack,
   Pointer item,
   VoltLibCtx *libCtx
   );

/* Removes an item from the top of the stack.
 * If the caller passes an address for item, the function will return
 * it. If not, the function will just eliminate the item from the stack.
 */
int icStackPop (
   icStack *stack,
   Pointer *item,
   VoltLibCtx *libCtx
   );

/* Returns the item on the top of the stack, but does not pop the item
 * (that is, after the call, the item is still there).
 */
int icStackTop (
   icStack *stack,
   Pointer *item,
   VoltLibCtx *libCtx
   );

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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