-/* $OpenBSD: ar_subs.c,v 1.4 1996/10/27 06:45:09 downsj Exp $ */
+/* $OpenBSD: ar_subs.c,v 1.5 1997/01/24 19:41:19 millert Exp $ */
/* $NetBSD: ar_subs.c,v 1.5 1995/03/21 09:07:06 cgd Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)ar_subs.c 8.2 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: ar_subs.c,v 1.4 1996/10/27 06:45:09 downsj Exp $";
+static char rcsid[] = "$OpenBSD: ar_subs.c,v 1.5 1997/01/24 19:41:19 millert Exp $";
#endif
#endif /* not lint */
if ((res = mod_name(arcn)) < 0)
break;
if (res == 0)
- ls_list(arcn, now);
+ ls_list(arcn, now, stdout);
}
/*
ARCHD archd;
struct stat sb;
int fd;
+ time_t now;
arcn = &archd;
/*
if (iflag && (name_start() < 0))
return;
+ now = time((time_t *)NULL);
+
/*
* step through each entry on the archive until the format read routine
* says it is done
}
if (vflag) {
- (void)fputs(arcn->name, stderr);
- vfpart = 1;
+ if (vflag > 1)
+ ls_list(arcn, now, stderr);
+ else {
+ (void)fputs(arcn->name, stderr);
+ vfpart = 1;
+ }
}
/*
off_t cnt;
int (*wrf)();
int fd = -1;
+ time_t now;
/*
* if this format supports hard link storage, start up the database
*/
wr_one = is_app;
+ now = time((time_t *)NULL);
+
/*
* while there are files to archive, process them one at at time
*/
}
if (vflag) {
- (void)fputs(arcn->name, stderr);
- vfpart = 1;
+ if (vflag > 1)
+ ls_list(arcn, now, stderr);
+ else {
+ (void)fputs(arcn->name, stderr);
+ vfpart = 1;
+ }
}
++flcnt;
-/* $OpenBSD: extern.h,v 1.7 1996/12/09 12:00:14 deraadt Exp $ */
+/* $OpenBSD: extern.h,v 1.8 1997/01/24 19:41:20 millert Exp $ */
/* $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $ */
/*-
/*
* gen_subs.c
*/
-void ls_list __P((register ARCHD *, time_t));
+void ls_list __P((register ARCHD *, time_t, FILE *));
void ls_tty __P((register ARCHD *));
void zf_strncpy __P((register char *, register char *, int));
int l_strncpy __P((register char *, register char *, int));
-/* $OpenBSD: gen_subs.c,v 1.3 1996/06/23 14:20:35 deraadt Exp $ */
+/* $OpenBSD: gen_subs.c,v 1.4 1997/01/24 19:41:21 millert Exp $ */
/* $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: gen_subs.c,v 1.3 1996/06/23 14:20:35 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: gen_subs.c,v 1.4 1997/01/24 19:41:21 millert Exp $";
#endif
#endif /* not lint */
#if __STDC__
void
-ls_list(register ARCHD *arcn, time_t now)
+ls_list(register ARCHD *arcn, time_t now, FILE *fp)
#else
void
-ls_list(arcn, now)
+ls_list(arcn, now, fp)
register ARCHD *arcn;
time_t now;
+ FILE *fp;
#endif
{
register struct stat *sbp;
* if not verbose, just print the file name
*/
if (!vflag) {
- (void)printf("%s\n", arcn->name);
- (void)fflush(stdout);
+ (void)fprintf(fp, "%s\n", arcn->name);
+ (void)fflush(fp);
return;
}
*/
if (strftime(f_date,DATELEN,timefrmt,localtime(&(sbp->st_mtime))) == 0)
f_date[0] = '\0';
- (void)printf("%s%2u %-*s %-*s ", f_mode, sbp->st_nlink, UT_NAMESIZE,
- name_uid(sbp->st_uid, 1), UT_GRPSIZE,
+ (void)fprintf(fp, "%s%2u %-*s %-*s ", f_mode, sbp->st_nlink,
+ UT_NAMESIZE, name_uid(sbp->st_uid, 1), UT_GRPSIZE,
name_gid(sbp->st_gid, 1));
/*
*/
if ((arcn->type == PAX_CHR) || (arcn->type == PAX_BLK))
# ifdef NET2_STAT
- (void)printf("%4u,%4u ", MAJOR(sbp->st_rdev),
+ (void)fprintf(fp, "%4u,%4u ", MAJOR(sbp->st_rdev),
# else
- (void)printf("%4lu,%4lu ", (unsigned long)MAJOR(sbp->st_rdev),
+ (void)fprintf(fp, "%4lu,%4lu ", (unsigned long)MAJOR(sbp->st_rdev),
# endif
(unsigned long)MINOR(sbp->st_rdev));
else {
# ifdef NET2_STAT
- (void)printf("%9lu ", sbp->st_size);
+ (void)fprintf(fp, "%9lu ", sbp->st_size);
# else
- (void)printf("%9qu ", sbp->st_size);
+ (void)fprintf(fp, "%9qu ", sbp->st_size);
# endif
}
/*
* print name and link info for hard and soft links
*/
- (void)printf("%s %s", f_date, arcn->name);
+ (void)fprintf(fp, "%s %s", f_date, arcn->name);
if ((arcn->type == PAX_HLK) || (arcn->type == PAX_HRG))
- (void)printf(" == %s\n", arcn->ln_name);
+ (void)fprintf(fp, " == %s\n", arcn->ln_name);
else if (arcn->type == PAX_SLK)
- (void)printf(" => %s\n", arcn->ln_name);
+ (void)fprintf(fp, " => %s\n", arcn->ln_name);
else
- (void)putchar('\n');
- (void)fflush(stdout);
+ (void)putc('\n', fp);
+ (void)fflush(fp);
return;
}