14887Schin /*********************************************************************** 24887Schin * * 34887Schin * This software is part of the ast package * 4*12068SRoger.Faulkner@Oracle.COM * Copyright (c) 1985-2010 AT&T Intellectual Property * 54887Schin * and is licensed under the * 64887Schin * Common Public License, Version 1.0 * 78462SApril.Chin@Sun.COM * by AT&T Intellectual Property * 84887Schin * * 94887Schin * A copy of the License is available at * 104887Schin * http://www.opensource.org/licenses/cpl1.0.txt * 114887Schin * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 124887Schin * * 134887Schin * Information and Software Systems Research * 144887Schin * AT&T Research * 154887Schin * Florham Park NJ * 164887Schin * * 174887Schin * Glenn Fowler <gsf@research.att.com> * 184887Schin * David Korn <dgk@research.att.com> * 194887Schin * Phong Vo <kpv@research.att.com> * 204887Schin * * 214887Schin ***********************************************************************/ 224887Schin #pragma prototyped 234887Schin /* 244887Schin * Glenn Fowler 254887Schin * AT&T Research 264887Schin * 274887Schin * 3d fs interface definitions 284887Schin */ 294887Schin 304887Schin #ifndef _FS3D_H 314887Schin #define _FS3D_H 324887Schin 334887Schin #include <ast_fs.h> 344887Schin 354887Schin #if _int_st_spare1 364887Schin #define iview(p) ((p)->st_spare1) 374887Schin #define IVIEW(p,v) ((p)->st_spare1=(v)) 384887Schin #else 394887Schin #if _ary_st_spare4 404887Schin #define iview(p) ((p)->st_spare4[0]) 414887Schin #define IVIEW(p,v) ((p)->st_spare4[0]=(v)) 424887Schin #else 434887Schin #if _ary_st_pad4 444887Schin #define iview(p) ((p)->st_pad4[0]) 454887Schin #define IVIEW(p,v) ((p)->st_pad4[0]=(v)) 464887Schin #else 474887Schin #if _mem_st_rdev_stat 484887Schin #define iview(p) ((S_ISBLK((p)->st_mode)||S_ISCHR((p)->st_mode))?0:(p)->st_rdev) 494887Schin #define IVIEW(p,v) do{if(!S_ISBLK((p)->st_mode)&&!S_ISCHR((p)->st_mode))(p)->st_rdev=(v);}while(0) 504887Schin #else 514887Schin #define iview(p) 0 524887Schin #define IVIEW(p,v) 534887Schin #endif 544887Schin #endif 554887Schin #endif 564887Schin #endif 574887Schin 584887Schin /* 594887Schin * special options 604887Schin */ 614887Schin 624887Schin #define FS3D_init "/#option/init" 634887Schin #define FS3D_on "/#option/3d" 644887Schin #define FS3D_off "/#option/2d" 654887Schin 664887Schin /* 674887Schin * fs3d(3) ops 684887Schin */ 694887Schin 704887Schin #define FS3D_OP(o,a) (((a)<<3)|(o)) 714887Schin 724887Schin #define FS3D_INIT FS3D_OP_INIT /* re-initialize tables */ 734887Schin #define FS3D_OFF FS3D_OP_OFF 744887Schin #define FS3D_ON FS3D_OP_ON 754887Schin #define FS3D_TEST FS3D_OP_TEST 764887Schin #define FS3D_LIMIT(n) FS3D_OP(FS3D_OP_LIMIT,n) 774887Schin 784887Schin #define FS3D_op(x) ((x)&07) 794887Schin #define FS3D_arg(x) (((x)>>3)&07777) 804887Schin 814887Schin #define FS3D_OP_OFF 0 824887Schin #define FS3D_OP_ON 1 834887Schin #define FS3D_OP_TEST 2 844887Schin #define FS3D_OP_LIMIT 3 854887Schin #define FS3D_OP_INIT 7 864887Schin 874887Schin /* 884887Schin * mount(2) ops 894887Schin */ 904887Schin 914887Schin #define FS3D_ALL (FS3D_VIEW|FS3D_VERSION) 924887Schin #define FS3D_VIEW 002 934887Schin #define FS3D_VERSION 004 944887Schin #define FS3D_GET 010 954887Schin #define FS3D_SIZE(n) ((n)<<4) 964887Schin #define FS3D_SIZEOF(n) ((n)>>4) 974887Schin 9810898Sroland.mainz@nrubsig.org #if !_BLD_3d 9910898Sroland.mainz@nrubsig.org #define mount(s,t,f,d) fs3d_mount(s,t,f,d) 10010898Sroland.mainz@nrubsig.org #endif 1014887Schin 1024887Schin #if _BLD_ast && defined(__EXPORT__) 1034887Schin #define extern __EXPORT__ 1044887Schin #endif 1054887Schin 1064887Schin extern int fs3d(int); 10710898Sroland.mainz@nrubsig.org extern int fs3d_mount(const char*, char*, int, void*); 1084887Schin extern char* pathnext(char*, char*, long*); 1094887Schin 1104887Schin #undef extern 1114887Schin 1124887Schin #endif 113