xref: /titanic_44/usr/src/lib/libast/sparc/include/ast/fs3d.h (revision 1e4c938b57d1656808e4112127ff1dce3eba5314)
1 
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 ***********************************************************************/
24 
25 /*
26  * Glenn Fowler
27  * AT&T Research
28  *
29  * 3d fs interface definitions
30  */
31 
32 #ifndef _FS3D_H
33 #if !defined(__PROTO__)
34 #include <prototyped.h>
35 #endif
36 #if !defined(__LINKAGE__)
37 #define __LINKAGE__		/* 2004-08-11 transition */
38 #endif
39 
40 #define _FS3D_H
41 
42 #include <ast_fs.h>
43 
44 #if _int_st_spare1
45 #define iview(p)	((p)->st_spare1)
46 #define IVIEW(p,v)	((p)->st_spare1=(v))
47 #else
48 #if _ary_st_spare4
49 #define iview(p)	((p)->st_spare4[0])
50 #define IVIEW(p,v)	((p)->st_spare4[0]=(v))
51 #else
52 #if _ary_st_pad4
53 #define iview(p)	((p)->st_pad4[0])
54 #define IVIEW(p,v)	((p)->st_pad4[0]=(v))
55 #else
56 #if _mem_st_rdev_stat
57 #define iview(p)	((S_ISBLK((p)->st_mode)||S_ISCHR((p)->st_mode))?0:(p)->st_rdev)
58 #define IVIEW(p,v)	do{if(!S_ISBLK((p)->st_mode)&&!S_ISCHR((p)->st_mode))(p)->st_rdev=(v);}while(0)
59 #else
60 #define iview(p)	0
61 #define IVIEW(p,v)
62 #endif
63 #endif
64 #endif
65 #endif
66 
67 /*
68  * special options
69  */
70 
71 #define FS3D_init	"/#option/init"
72 #define FS3D_on		"/#option/3d"
73 #define FS3D_off	"/#option/2d"
74 
75 /*
76  * fs3d(3) ops
77  */
78 
79 #define FS3D_OP(o,a)	(((a)<<3)|(o))
80 
81 #define FS3D_INIT	FS3D_OP_INIT	/* re-initialize tables		*/
82 #define FS3D_OFF	FS3D_OP_OFF
83 #define FS3D_ON		FS3D_OP_ON
84 #define FS3D_TEST	FS3D_OP_TEST
85 #define FS3D_LIMIT(n)	FS3D_OP(FS3D_OP_LIMIT,n)
86 
87 #define FS3D_op(x)	((x)&07)
88 #define FS3D_arg(x)	(((x)>>3)&07777)
89 
90 #define FS3D_OP_OFF	0
91 #define FS3D_OP_ON	1
92 #define FS3D_OP_TEST	2
93 #define FS3D_OP_LIMIT	3
94 #define FS3D_OP_INIT	7
95 
96 /*
97  * mount(2) ops
98  */
99 
100 #define FS3D_ALL	(FS3D_VIEW|FS3D_VERSION)
101 #define FS3D_VIEW	002
102 #define FS3D_VERSION	004
103 #define FS3D_GET	010
104 #define FS3D_SIZE(n)	((n)<<4)
105 #define FS3D_SIZEOF(n)	((n)>>4)
106 
107 #if !_BLD_3d
108 #define mount(s,t,f,d)	fs3d_mount(s,t,f,d)
109 #endif
110 
111 #if _BLD_ast && defined(__EXPORT__)
112 #undef __MANGLE__
113 #define __MANGLE__ __LINKAGE__		__EXPORT__
114 #endif
115 
116 extern __MANGLE__ int		fs3d __PROTO__((int));
117 extern __MANGLE__ int		fs3d_mount __PROTO__((const char*, char*, int, __V_*));
118 extern __MANGLE__ char*		pathnext __PROTO__((char*, char*, long*));
119 
120 #undef __MANGLE__
121 #define __MANGLE__ __LINKAGE__
122 
123 #endif
124