1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
/* : : generated by proto : : */
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2010 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
/*
* Glenn Fowler
* AT&T Research
*
* 3d fs interface definitions
*/
#ifndef _FS3D_H
#if !defined(__PROTO__)
#include <prototyped.h>
#endif
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
#define _FS3D_H
#include <ast_fs.h>
#if _int_st_spare1
#define iview(p) ((p)->st_spare1)
#define IVIEW(p,v) ((p)->st_spare1=(v))
#else
#if _ary_st_spare4
#define iview(p) ((p)->st_spare4[0])
#define IVIEW(p,v) ((p)->st_spare4[0]=(v))
#else
#if _ary_st_pad4
#define iview(p) ((p)->st_pad4[0])
#define IVIEW(p,v) ((p)->st_pad4[0]=(v))
#else
#if _mem_st_rdev_stat
#define iview(p) ((S_ISBLK((p)->st_mode)||S_ISCHR((p)->st_mode))?0:(p)->st_rdev)
#define IVIEW(p,v) do{if(!S_ISBLK((p)->st_mode)&&!S_ISCHR((p)->st_mode))(p)->st_rdev=(v);}while(0)
#else
#define iview(p) 0
#define IVIEW(p,v)
#endif
#endif
#endif
#endif
/*
* special options
*/
#define FS3D_init "/#option/init"
#define FS3D_on "/#option/3d"
#define FS3D_off "/#option/2d"
/*
* fs3d(3) ops
*/
#define FS3D_OP(o,a) (((a)<<3)|(o))
#define FS3D_INIT FS3D_OP_INIT /* re-initialize tables */
#define FS3D_OFF FS3D_OP_OFF
#define FS3D_ON FS3D_OP_ON
#define FS3D_TEST FS3D_OP_TEST
#define FS3D_LIMIT(n) FS3D_OP(FS3D_OP_LIMIT,n)
#define FS3D_op(x) ((x)&07)
#define FS3D_arg(x) (((x)>>3)&07777)
#define FS3D_OP_OFF 0
#define FS3D_OP_ON 1
#define FS3D_OP_TEST 2
#define FS3D_OP_LIMIT 3
#define FS3D_OP_INIT 7
/*
* mount(2) ops
*/
#define FS3D_ALL (FS3D_VIEW|FS3D_VERSION)
#define FS3D_VIEW 002
#define FS3D_VERSION 004
#define FS3D_GET 010
#define FS3D_SIZE(n) ((n)<<4)
#define FS3D_SIZEOF(n) ((n)>>4)
#if !_BLD_3d
#define mount(s,t,f,d) fs3d_mount(s,t,f,d)
#endif
#if _BLD_ast && defined(__EXPORT__)
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__ __EXPORT__
#endif
extern __MANGLE__ int fs3d __PROTO__((int));
extern __MANGLE__ int fs3d_mount __PROTO__((const char*, char*, int, __V_*));
extern __MANGLE__ char* pathnext __PROTO__((char*, char*, long*));
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__
#endif
|