SCCS-vsn: bin/ls/ls.h 5.6
SCCS-vsn: bin/ls/print.c 5.11
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#)ls.h 5.5 (Berkeley) %G%
+ * @(#)ls.h 5.6 (Berkeley) %G%
*/
typedef struct _lsstruct {
*/
typedef struct _lsstruct {
struct stat lstat; /* lstat(2) for file */
} LS;
struct stat lstat; /* lstat(2) for file */
} LS;
+/*
+ * overload -- we probably have to save blocks and/or maxlen with the lstat
+ * array, so tabdir() stuffs it into unused fields in the first stat structure.
+ * If there's ever a type larger than u_long, fix this. Any calls to qsort
+ * must save and restore the values.
+ */
+#define st_btotal st_flags
+#define st_maxlen st_gen
+
extern int errno;
extern int f_accesstime; /* use time of last access */
extern int errno;
extern int f_accesstime; /* use time of last access */
-static char sccsid[] = "@(#)print.c 5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)print.c 5.11 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
LS *stats;
register int num;
{
LS *stats;
register int num;
{
- (void)printf("total %lu\n", stats[0].lstat.st_flags);
+ (void)printf("total %lu\n", stats[0].lstat.st_btotal);
for (; num--; ++stats) {
if (f_inode)
(void)printf("%6lu ", stats->lstat.st_ino);
for (; num--; ++stats) {
if (f_inode)
(void)printf("%6lu ", stats->lstat.st_ino);
register int base, chcnt, cnt, col, colwidth;
int endcol, numcols, numrows, row;
register int base, chcnt, cnt, col, colwidth;
int endcol, numcols, numrows, row;
- colwidth = stats[0].lstat.st_flags;
+ colwidth = stats[0].lstat.st_maxlen;
if (f_inode)
colwidth += 6;
if (f_size)
if (f_inode)
colwidth += 6;
if (f_size)
if (num % numcols)
++numrows;
if (num % numcols)
++numrows;
+ if (f_size)
+ (void)printf("total %lu\n", stats[0].lstat.st_btotal);
for (row = 0; row < numrows; ++row) {
endcol = colwidth;
for (base = row, chcnt = col = 0; col < numcols; ++col) {
for (row = 0; row < numrows; ++row) {
endcol = colwidth;
for (base = row, chcnt = col = 0; col < numcols; ++col) {