19ddb49cbSWarner Losh /*- 24b88c807SRodney W. Grimes * Copyright (c) 1989, 1993 34b88c807SRodney W. Grimes * The Regents of the University of California. All rights reserved. 44b88c807SRodney W. Grimes * 54b88c807SRodney W. Grimes * This code is derived from software contributed to Berkeley by 64b88c807SRodney W. Grimes * Michael Fischbein. 74b88c807SRodney W. Grimes * 84b88c807SRodney W. Grimes * Redistribution and use in source and binary forms, with or without 94b88c807SRodney W. Grimes * modification, are permitted provided that the following conditions 104b88c807SRodney W. Grimes * are met: 114b88c807SRodney W. Grimes * 1. Redistributions of source code must retain the above copyright 124b88c807SRodney W. Grimes * notice, this list of conditions and the following disclaimer. 134b88c807SRodney W. Grimes * 2. Redistributions in binary form must reproduce the above copyright 144b88c807SRodney W. Grimes * notice, this list of conditions and the following disclaimer in the 154b88c807SRodney W. Grimes * documentation and/or other materials provided with the distribution. 16*fbbd9655SWarner Losh * 3. Neither the name of the University nor the names of its contributors 174b88c807SRodney W. Grimes * may be used to endorse or promote products derived from this software 184b88c807SRodney W. Grimes * without specific prior written permission. 194b88c807SRodney W. Grimes * 204b88c807SRodney W. Grimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 214b88c807SRodney W. Grimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 224b88c807SRodney W. Grimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 234b88c807SRodney W. Grimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 244b88c807SRodney W. Grimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 254b88c807SRodney W. Grimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 264b88c807SRodney W. Grimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 274b88c807SRodney W. Grimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 284b88c807SRodney W. Grimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 294b88c807SRodney W. Grimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 304b88c807SRodney W. Grimes * SUCH DAMAGE. 314b88c807SRodney W. Grimes * 32d46c1a60SSteve Price * from: @(#)ls.h 8.1 (Berkeley) 5/31/93 332a456239SPeter Wemm * $FreeBSD$ 344b88c807SRodney W. Grimes */ 354b88c807SRodney W. Grimes 364b88c807SRodney W. Grimes #define NO_PRINT 1 374b88c807SRodney W. Grimes 3855926a66SJaakko Heinonen #define HUMANVALSTR_LEN 5 3955926a66SJaakko Heinonen 40e5542be4SAllan Jude #define LS_XO_VERSION "1" 41e5542be4SAllan Jude 424b88c807SRodney W. Grimes extern long blocksize; /* block size units */ 434b88c807SRodney W. Grimes 444b88c807SRodney W. Grimes extern int f_accesstime; /* use time of last access */ 45fe79420eSJohn Baldwin extern int f_birthtime; /* use time of file creation */ 464b88c807SRodney W. Grimes extern int f_flags; /* show flags associated with a file */ 470e8d1551SJosef Karthauser extern int f_humanval; /* show human-readable file sizes */ 484d33b62eSRobert Watson extern int f_label; /* show MAC label */ 494b88c807SRodney W. Grimes extern int f_inode; /* print inode */ 504b88c807SRodney W. Grimes extern int f_longform; /* long listing format */ 517ea30648SDag-Erling Smørgrav extern int f_octal; /* print unprintables in octal */ 520d86878cSDag-Erling Smørgrav extern int f_octal_escape; /* like f_octal but use C escapes if possible */ 53ee579ffbSAssar Westerlund extern int f_nonprint; /* show unprintables as ? */ 549aa68a3fSGreg Lehey extern int f_samesort; /* sort time and name in same direction */ 554b88c807SRodney W. Grimes extern int f_sectime; /* print the real time for all files */ 564b88c807SRodney W. Grimes extern int f_size; /* list size in short listing */ 5794274c73STim J. Robbins extern int f_slash; /* append a '/' if the file is a directory */ 5894274c73STim J. Robbins extern int f_sortacross; /* sort across rows, not down columns */ 594b88c807SRodney W. Grimes extern int f_statustime; /* use time of last mode change */ 609aa68a3fSGreg Lehey extern int f_thousands; /* show file sizes with thousands separators */ 612269fa57SGreg Lehey extern char *f_timeformat; /* user-specified time format */ 62545f583cSTim Vanderhoek extern int f_notabs; /* don't use tab-separated multi-col output */ 63e5542be4SAllan Jude extern int f_numericonly; /* don't convert uid/gid to name */ 644b88c807SRodney W. Grimes extern int f_type; /* add type character for non-regular files */ 6574985094SJosef Karthauser #ifdef COLORLS 663885812cSJosef Karthauser extern int f_color; /* add type in color for non-regular files */ 6774985094SJosef Karthauser #endif 684b88c807SRodney W. Grimes 694b88c807SRodney W. Grimes typedef struct { 704b88c807SRodney W. Grimes FTSENT *list; 714b88c807SRodney W. Grimes u_long btotal; 724b88c807SRodney W. Grimes int entries; 734b88c807SRodney W. Grimes int maxlen; 749052855aSMark Murray u_int s_block; 759052855aSMark Murray u_int s_flags; 764d33b62eSRobert Watson u_int s_label; 779052855aSMark Murray u_int s_group; 789052855aSMark Murray u_int s_inode; 799052855aSMark Murray u_int s_nlink; 809052855aSMark Murray u_int s_size; 819052855aSMark Murray u_int s_user; 824b88c807SRodney W. Grimes } DISPLAY; 834b88c807SRodney W. Grimes 844b88c807SRodney W. Grimes typedef struct { 854b88c807SRodney W. Grimes char *user; 864b88c807SRodney W. Grimes char *group; 874b88c807SRodney W. Grimes char *flags; 884d33b62eSRobert Watson char *label; 894b88c807SRodney W. Grimes char data[1]; 904b88c807SRodney W. Grimes } NAMES; 91