2 /* : : generated by proto : : */
3 /***********************************************************************
5 * This software is part of the ast package *
6 * Copyright (c) 1985-2010 AT&T Intellectual Property *
7 * and is licensed under the *
8 * Common Public License, Version 1.0 *
9 * by AT&T Intellectual Property *
11 * A copy of the License is available at *
12 * http://www.opensource.org/licenses/cpl1.0.txt *
13 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
15 * Information and Software Systems Research *
19 * Glenn Fowler <gsf@research.att.com> *
20 * David Korn <dgk@research.att.com> *
21 * Phong Vo <kpv@research.att.com> *
23 ***********************************************************************/
29 * Interface definitions for a stack-like storage library
34 #if !defined(__PROTO__)
35 #include <prototyped.h>
37 #if !defined(__LINKAGE__)
38 #define __LINKAGE__ /* 2004-08-11 transition */
45 #define _Stk_data _Stak_data
47 #define stkstd (&_Stk_data)
51 #define STK_SMALL 1 /* small stkopen stack */
52 #define STK_NULL 2 /* return NULL on overflow */
54 #define stkptr(sp,n) ((char*)((sp)->_data)+(n))
55 #define stktop(sp) ((char*)(sp)->_next)
56 #define stktell(sp) ((sp)->_next-(sp)->_data)
57 #define stkseek(sp,n) ((n)==0?(char*)((sp)->_next=(sp)->_data):_stkseek(sp,n))
59 #if _BLD_ast && defined(__EXPORT__)
61 #define __MANGLE__ __LINKAGE__ __EXPORT__
63 #if !_BLD_ast && defined(__IMPORT__)
65 #define __MANGLE__ __LINKAGE__ __IMPORT__
68 extern __MANGLE__ Sfio_t _Stk_data
;
71 #define __MANGLE__ __LINKAGE__
73 #if _BLD_ast && defined(__EXPORT__)
75 #define __MANGLE__ __LINKAGE__ __EXPORT__
78 extern __MANGLE__ Stk_t
* stkopen
__PROTO__((int));
79 extern __MANGLE__ Stk_t
* stkinstall
__PROTO__((Stk_t
*, char*(*)(int)));
80 extern __MANGLE__
int stkclose
__PROTO__((Stk_t
*));
81 extern __MANGLE__
int stklink
__PROTO__((Stk_t
*));
82 extern __MANGLE__
char* stkalloc
__PROTO__((Stk_t
*, unsigned));
83 extern __MANGLE__
char* stkcopy
__PROTO__((Stk_t
*,const char*));
84 extern __MANGLE__
char* stkset
__PROTO__((Stk_t
*, char*, unsigned));
85 extern __MANGLE__
char* _stkseek
__PROTO__((Stk_t
*, unsigned));
86 extern __MANGLE__
char* stkfreeze
__PROTO__((Stk_t
*, unsigned));
87 extern __MANGLE__
int stkon
__PROTO__((Stk_t
*, char *));
90 #define __MANGLE__ __LINKAGE__