1 /*
2  * BEGIN illumos section
3  *   This is an unstable interface; changes may be made
4  *   without notice.
5  * END illumos section
6  */
7 /***********************************************************************
8 *                                                                      *
9 *               This software is part of the ast package               *
10 *          Copyright (c) 1985-2011 AT&T Intellectual Property          *
11 *                      and is licensed under the                       *
12 *                 Eclipse Public License, Version 1.0                  *
13 *                    by AT&T Intellectual Property                     *
14 *                                                                      *
15 *                A copy of the License is available at                 *
16 *          http://www.eclipse.org/org/documents/epl-v10.html           *
17 *         (with md5 checksum b35adb5213ca9657e911e9befb180842)         *
18 *                                                                      *
19 *              Information and Software Systems Research               *
20 *                            AT&T Research                             *
21 *                           Florham Park NJ                            *
22 *                                                                      *
23 *                 Glenn Fowler <gsf@research.att.com>                  *
24 *                  David Korn <dgk@research.att.com>                   *
25 *                   Phong Vo <kpv@research.att.com>                    *
26 *                                                                      *
27 ***********************************************************************/
28 #pragma prototyped
29 /*
30  * Glenn Fowler
31  * AT&T Research
32  *
33  * ls formatter interface definitions
34  */
35 
36 #ifndef _LS_H
37 #define _LS_H
38 
39 #include <ast_std.h>
40 #include <ast_fs.h>
41 #include <ast_mode.h>
42 
43 /*
44  * some systems (could it beee AIX) pollute the std name space
45  */
46 
47 #undef	fileid
48 #define fileid	fileID
49 
50 #define LS_BLOCKSIZE	512
51 
52 #define iblocks(p)	_iblocks(p)
53 
54 #if _mem_st_rdev_stat
55 #define idevice(p)	((p)->st_rdev)
56 #define IDEVICE(p,v)	((p)->st_rdev=(v))
57 #else
58 #define idevice(p)	0
59 #define IDEVICE(p,v)
60 #endif
61 
62 #define LS_ATIME	(1<<0)		/* list st_atime		*/
63 #define LS_BLOCKS	(1<<1)		/* list blocks used by file	*/
64 #define LS_CTIME	(1<<2)		/* list st_ctime		*/
65 #define LS_EXTERNAL	(1<<3)		/* st_mode is modex canonical	*/
66 #define LS_INUMBER	(1<<4)		/* list st_ino			*/
67 #define LS_LONG		(1<<5)		/* long listing			*/
68 #define LS_MARK		(1<<6)		/* append file name marks	*/
69 #define LS_NOGROUP	(1<<7)		/* omit group name for LS_LONG	*/
70 #define LS_NOUSER	(1<<8)		/* omit user name for LS_LONG	*/
71 #define LS_NUMBER	(1<<9)		/* number instead of name	*/
72 
73 #define LS_USER		(1<<10)		/* first user flag bit		*/
74 
75 #define LS_W_BLOCKS	6		/* LS_BLOCKS field width	*/
76 #define LS_W_INUMBER	9		/* LS_INUMBER field width	*/
77 #define LS_W_LONG	57		/* LS_LONG width (w/o names)	*/
78 #define LS_W_LINK	4		/* link text width (w/o names)	*/
79 #define LS_W_MARK	1		/* LS_MARK field width		*/
80 #define LS_W_NAME	9		/* group|user name field width	*/
81 
82 #if _BLD_ast && defined(__EXPORT__)
83 #define extern		__EXPORT__
84 #endif
85 
86 extern off_t		_iblocks(struct stat*);
87 extern char*		fmtdev(struct stat*);
88 extern char*		fmtfs(struct stat*);
89 extern char*		fmtls(char*, const char*, struct stat*, const char*, const char*, int);
90 extern int		pathstat(const char*, struct stat*);
91 
92 #undef	extern
93 
94 #endif
95