dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libast / common / include / stk.h
blob96bff0baa0be79567b15774465d8a04ad794103b
1 /***********************************************************************
2 * *
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 *
8 * *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
12 * *
13 * Information and Software Systems Research *
14 * AT&T Research *
15 * Florham Park NJ *
16 * *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
20 * *
21 ***********************************************************************/
22 #pragma prototyped
24 * David Korn
25 * AT&T Research
27 * Interface definitions for a stack-like storage library
31 #ifndef _STK_H
32 #define _STK_H
34 #include <sfio.h>
36 #define _Stk_data _Stak_data
38 #define stkstd (&_Stk_data)
40 #define Stk_t Sfio_t
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__
52 #endif
53 #if !_BLD_ast && defined(__IMPORT__)
54 #define extern extern __IMPORT__
55 #endif
57 extern Sfio_t _Stk_data;
59 #undef extern
61 #if _BLD_ast && defined(__EXPORT__)
62 #define extern __EXPORT__
63 #endif
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 *);
76 #undef extern
78 #endif