dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libast / i386 / include / ast / stk.h
blob7a226b0e98ea08cd326005b939847b4d14895da7
2 /* : : generated by proto : : */
3 /***********************************************************************
4 * *
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 *
10 * *
11 * A copy of the License is available at *
12 * http://www.opensource.org/licenses/cpl1.0.txt *
13 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
14 * *
15 * Information and Software Systems Research *
16 * AT&T Research *
17 * Florham Park NJ *
18 * *
19 * Glenn Fowler <gsf@research.att.com> *
20 * David Korn <dgk@research.att.com> *
21 * Phong Vo <kpv@research.att.com> *
22 * *
23 ***********************************************************************/
26 * David Korn
27 * AT&T Research
29 * Interface definitions for a stack-like storage library
33 #ifndef _STK_H
34 #if !defined(__PROTO__)
35 #include <prototyped.h>
36 #endif
37 #if !defined(__LINKAGE__)
38 #define __LINKAGE__ /* 2004-08-11 transition */
39 #endif
41 #define _STK_H
43 #include <sfio.h>
45 #define _Stk_data _Stak_data
47 #define stkstd (&_Stk_data)
49 #define Stk_t Sfio_t
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__)
60 #undef __MANGLE__
61 #define __MANGLE__ __LINKAGE__ __EXPORT__
62 #endif
63 #if !_BLD_ast && defined(__IMPORT__)
64 #undef __MANGLE__
65 #define __MANGLE__ __LINKAGE__ __IMPORT__
66 #endif
68 extern __MANGLE__ Sfio_t _Stk_data;
70 #undef __MANGLE__
71 #define __MANGLE__ __LINKAGE__
73 #if _BLD_ast && defined(__EXPORT__)
74 #undef __MANGLE__
75 #define __MANGLE__ __LINKAGE__ __EXPORT__
76 #endif
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 *));
89 #undef __MANGLE__
90 #define __MANGLE__ __LINKAGE__
92 #endif