1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1985-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
21 ***********************************************************************/
27 * Interface definitions for a stack-like storage library
36 #define _Stk_data _Stak_data
38 #define stkstd (&_Stk_data)
42 #define STK_SMALL 1 /* small stkopen stack */
43 #define STK_NULL 2 /* return NULL on overflow */
45 #define stkptr(sp,n) ((char*)((sp)->_data)+(n))
46 #define stktop(sp) ((char*)(sp)->_next)
47 #define stktell(sp) ((sp)->_next-(sp)->_data)
48 #define stkseek(sp,n) ((n)==0?(char*)((sp)->_next=(sp)->_data):_stkseek(sp,n))
50 #if _BLD_ast && defined(__EXPORT__)
51 #define extern extern __EXPORT__
53 #if !_BLD_ast && defined(__IMPORT__)
54 #define extern extern __IMPORT__
57 extern Sfio_t _Stk_data
;
61 #if _BLD_ast && defined(__EXPORT__)
62 #define extern __EXPORT__
65 extern Stk_t
* stkopen(int);
66 extern Stk_t
* stkinstall(Stk_t
*, char*(*)(int));
67 extern int stkclose(Stk_t
*);
68 extern int stklink(Stk_t
*);
69 extern char* stkalloc(Stk_t
*, unsigned);
70 extern char* stkcopy(Stk_t
*,const char*);
71 extern char* stkset(Stk_t
*, char*, unsigned);
72 extern char* _stkseek(Stk_t
*, unsigned);
73 extern char* stkfreeze(Stk_t
*, unsigned);
74 extern int stkon(Stk_t
*, char *);