print.c (61291) | print.c (61292) |
---|---|
1/* 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Michael Fischbein. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 25 unchanged lines hidden (view full) --- 34 * SUCH DAMAGE. 35 */ 36 37#ifndef lint 38#if 0 39static char sccsid[] = "@(#)print.c 8.4 (Berkeley) 4/17/94"; 40#else 41static const char rcsid[] = | 1/* 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Michael Fischbein. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 25 unchanged lines hidden (view full) --- 34 * SUCH DAMAGE. 35 */ 36 37#ifndef lint 38#if 0 39static char sccsid[] = "@(#)print.c 8.4 (Berkeley) 4/17/94"; 40#else 41static const char rcsid[] = |
42 "$FreeBSD: head/bin/ls/print.c 61291 2000-06-05 19:39:39Z ache $"; | 42 "$FreeBSD: head/bin/ls/print.c 61292 2000-06-05 19:56:52Z ache $"; |
43#endif 44#endif /* not lint */ 45 46#include <sys/param.h> 47#include <sys/stat.h> 48 49#ifdef COLORLS 50#include <ctype.h> --- 36 unchanged lines hidden (view full) --- 87 C_WSDIR, /* directory writeble to others, with sticky bit */ 88 C_WDIR, /* directory writeble to others, without sticky bit */ 89 C_NUMCOLORS /* just a place-holder */ 90} Colors ; 91 92char *defcolors = "4x5x2x3x1x464301060203"; 93 94static int colors[C_NUMCOLORS][2]; | 43#endif 44#endif /* not lint */ 45 46#include <sys/param.h> 47#include <sys/stat.h> 48 49#ifdef COLORLS 50#include <ctype.h> --- 36 unchanged lines hidden (view full) --- 87 C_WSDIR, /* directory writeble to others, with sticky bit */ 88 C_WDIR, /* directory writeble to others, without sticky bit */ 89 C_NUMCOLORS /* just a place-holder */ 90} Colors ; 91 92char *defcolors = "4x5x2x3x1x464301060203"; 93 94static int colors[C_NUMCOLORS][2]; |
95static int color_printed = 0; | |
96#endif 97 98void 99printscol(dp) 100 DISPLAY *dp; 101{ 102 FTSENT *p; 103 --- 8 unchanged lines hidden (view full) --- 112void 113printlong(dp) 114 DISPLAY *dp; 115{ 116 struct stat *sp; 117 FTSENT *p; 118 NAMES *np; 119 char buf[20]; | 95#endif 96 97void 98printscol(dp) 99 DISPLAY *dp; 100{ 101 FTSENT *p; 102 --- 8 unchanged lines hidden (view full) --- 111void 112printlong(dp) 113 DISPLAY *dp; 114{ 115 struct stat *sp; 116 FTSENT *p; 117 NAMES *np; 118 char buf[20]; |
119#ifdef COLORLS 120 int color_printed = 0; 121#endif |
|
120 121 if (dp->list->fts_level != FTS_ROOTLEVEL && (f_longform || f_size)) 122 (void)printf("total %lu\n", howmany(dp->btotal, blocksize)); 123 124 for (p = dp->list; p; p = p->fts_link) { 125 if (IS_NOPRINT(p)) 126 continue; 127 sp = p->fts_statp; --- 136 unchanged lines hidden (view full) --- 264 */ 265static int 266printaname(p, inodefield, sizefield) 267 FTSENT *p; 268 u_long sizefield, inodefield; 269{ 270 struct stat *sp; 271 int chcnt; | 122 123 if (dp->list->fts_level != FTS_ROOTLEVEL && (f_longform || f_size)) 124 (void)printf("total %lu\n", howmany(dp->btotal, blocksize)); 125 126 for (p = dp->list; p; p = p->fts_link) { 127 if (IS_NOPRINT(p)) 128 continue; 129 sp = p->fts_statp; --- 136 unchanged lines hidden (view full) --- 266 */ 267static int 268printaname(p, inodefield, sizefield) 269 FTSENT *p; 270 u_long sizefield, inodefield; 271{ 272 struct stat *sp; 273 int chcnt; |
274#ifdef COLORLS 275 int color_printed = 0; 276#endif |
|
272 273 sp = p->fts_statp; 274 chcnt = 0; 275 if (f_inode) 276 chcnt += printf("%*lu ", (int)inodefield, (u_long)sp->st_ino); 277 if (f_size) 278 chcnt += printf("%*qd ", 279 (int)sizefield, howmany(sp->st_blocks, blocksize)); --- 213 unchanged lines hidden --- | 277 278 sp = p->fts_statp; 279 chcnt = 0; 280 if (f_inode) 281 chcnt += printf("%*lu ", (int)inodefield, (u_long)sp->st_ino); 282 if (f_size) 283 chcnt += printf("%*qd ", 284 (int)sizefield, howmany(sp->st_blocks, blocksize)); --- 213 unchanged lines hidden --- |