/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1985-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* David Korn <[email protected]> *18* Phong Vo <[email protected]> *19* *20***********************************************************************/21#pragma prototyped22/*23* David Korn24* AT&T Research25*26* Interface definitions for a stack-like storage library27*28*/2930#ifndef _STK_H31#define _STK_H3233#include <sfio.h>3435#define _Stk_data _Stak_data3637#define stkstd (&_Stk_data)3839#define Stk_t Sfio_t4041#define STK_SMALL 1 /* small stkopen stack */42#define STK_NULL 2 /* return NULL on overflow */4344#define stkptr(sp,n) ((char*)((sp)->_data)+(n))45#define stktop(sp) ((char*)(sp)->_next)46#define stktell(sp) ((sp)->_next-(sp)->_data)47#define stkseek(sp,n) ((n)==0?(char*)((sp)->_next=(sp)->_data):_stkseek(sp,n))4849#if _BLD_ast && defined(__EXPORT__)50#define extern extern __EXPORT__51#endif52#if !_BLD_ast && defined(__IMPORT__)53#define extern extern __IMPORT__54#endif5556extern Sfio_t _Stk_data;5758#undef extern5960#if _BLD_ast && defined(__EXPORT__)61#define extern __EXPORT__62#endif6364extern Stk_t* stkopen(int);65extern Stk_t* stkinstall(Stk_t*, char*(*)(int));66extern int stkclose(Stk_t*);67extern int stklink(Stk_t*);68extern char* stkalloc(Stk_t*, size_t);69extern char* stkcopy(Stk_t*, const char*);70extern char* stkset(Stk_t*, char*, size_t);71extern char* _stkseek(Stk_t*, ssize_t);72extern char* stkfreeze(Stk_t*, size_t);73extern int stkon(Stk_t*, char*);7475#undef extern7677#endif787980