2005-01-10 08:39:26 +00:00
|
|
|
/*-
|
1994-05-26 06:18:55 +00:00
|
|
|
* Copyright (c) 1989, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* Michael Fischbein.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1997-08-07 15:33:50 +00:00
|
|
|
* from: @(#)ls.h 8.1 (Berkeley) 5/31/93
|
1999-08-27 23:15:48 +00:00
|
|
|
* $FreeBSD$
|
1994-05-26 06:18:55 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define NO_PRINT 1
|
|
|
|
|
2010-01-24 19:23:07 +00:00
|
|
|
#define HUMANVALSTR_LEN 5
|
|
|
|
|
1994-05-26 06:18:55 +00:00
|
|
|
extern long blocksize; /* block size units */
|
|
|
|
|
|
|
|
extern int f_accesstime; /* use time of last access */
|
2006-03-24 16:38:02 +00:00
|
|
|
extern int f_birthtime; /* use time of file creation */
|
1994-05-26 06:18:55 +00:00
|
|
|
extern int f_flags; /* show flags associated with a file */
|
2001-12-28 20:50:12 +00:00
|
|
|
extern int f_humanval; /* show human-readable file sizes */
|
2002-10-24 00:07:30 +00:00
|
|
|
extern int f_label; /* show MAC label */
|
1994-05-26 06:18:55 +00:00
|
|
|
extern int f_inode; /* print inode */
|
|
|
|
extern int f_longform; /* long listing format */
|
1998-04-21 22:02:01 +00:00
|
|
|
extern int f_octal; /* print unprintables in octal */
|
1998-04-24 07:49:51 +00:00
|
|
|
extern int f_octal_escape; /* like f_octal but use C escapes if possible */
|
2000-07-04 23:09:23 +00:00
|
|
|
extern int f_nonprint; /* show unprintables as ? */
|
2012-11-08 00:24:26 +00:00
|
|
|
extern int f_samesort; /* sort time and name in same direction */
|
1994-05-26 06:18:55 +00:00
|
|
|
extern int f_sectime; /* print the real time for all files */
|
|
|
|
extern int f_size; /* list size in short listing */
|
2002-05-19 02:51:36 +00:00
|
|
|
extern int f_slash; /* append a '/' if the file is a directory */
|
2008-04-04 03:57:46 +00:00
|
|
|
extern int f_sortacross; /* sort across rows, not down columns */
|
1994-05-26 06:18:55 +00:00
|
|
|
extern int f_statustime; /* use time of last mode change */
|
2012-11-08 00:24:26 +00:00
|
|
|
extern int f_thousands; /* show file sizes with thousands separators */
|
2008-04-04 03:57:46 +00:00
|
|
|
extern char *f_timeformat; /* user-specified time format */
|
1998-07-29 00:46:13 +00:00
|
|
|
extern int f_notabs; /* don't use tab-separated multi-col output */
|
1994-05-26 06:18:55 +00:00
|
|
|
extern int f_type; /* add type character for non-regular files */
|
2000-06-05 02:14:01 +00:00
|
|
|
#ifdef COLORLS
|
2000-06-02 14:53:42 +00:00
|
|
|
extern int f_color; /* add type in color for non-regular files */
|
2000-06-05 02:14:01 +00:00
|
|
|
#endif
|
1994-05-26 06:18:55 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
FTSENT *list;
|
|
|
|
u_long btotal;
|
|
|
|
int entries;
|
|
|
|
int maxlen;
|
2002-02-03 19:11:32 +00:00
|
|
|
u_int s_block;
|
|
|
|
u_int s_flags;
|
2002-10-24 00:07:30 +00:00
|
|
|
u_int s_label;
|
2002-02-03 19:11:32 +00:00
|
|
|
u_int s_group;
|
|
|
|
u_int s_inode;
|
|
|
|
u_int s_nlink;
|
|
|
|
u_int s_size;
|
|
|
|
u_int s_user;
|
1994-05-26 06:18:55 +00:00
|
|
|
} DISPLAY;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char *user;
|
|
|
|
char *group;
|
|
|
|
char *flags;
|
2002-10-24 00:07:30 +00:00
|
|
|
char *label;
|
1994-05-26 06:18:55 +00:00
|
|
|
char data[1];
|
|
|
|
} NAMES;
|