all: Add iso9660_get_rock_attr_str to get an ls-like mode string for rock

ridge.

{cd,iso}-info.c util.{c,h}: put common printing routine in util.c

rock.h: add enum for NM flags
iso9660.h: move mode_t typedef so it can be used in rock.h
xa.{c,h}: small typos.

test/*: in most cases better output. On VCD's however there there is a
slight regression on displaying the filename someitmes. Will be
addressed later.
This commit is contained in:
rocky
2005-02-20 10:21:01 +00:00
parent 0a048cb05c
commit a8e1fd6038
21 changed files with 470 additions and 296 deletions

View File

@@ -1,5 +1,5 @@
/*
$Id: cd-info.c,v 1.115 2005/02/19 11:43:05 rocky Exp $
$Id: cd-info.c,v 1.116 2005/02/20 10:21:01 rocky Exp $
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1996, 1997, 1998 Gerd Knorr <kraxel@bytesex.org>
@@ -92,6 +92,8 @@ struct arguments
int silent;
int no_header;
int no_joliet;
int no_xa;
int no_rock_ridge;
int print_iso9660;
int list_drives;
source_image_t source_image;
@@ -239,6 +241,12 @@ parse_options (int argc, const char *argv[])
0, "Don't use Joliet extensions"},
#endif /*HAVE_JOLIET*/
{"no-rock-ridge", '\0', POPT_ARG_NONE, &opts.no_rock_ridge,
0, "Don't use Rock-Ridge-extension information"},
{"no-xa", '\0', POPT_ARG_NONE, &opts.no_xa,
0, "Don't use XA-extension information"},
{"quiet", 'q', POPT_ARG_NONE, &opts.silent, 0,
"Don't produce warning output" },
@@ -591,8 +599,6 @@ print_iso9660_recurse (CdIo_t *p_cdio, const char pathname[],
char *psz_iso_name = p_statbuf->filename;
char _fullname[4096] = { 0, };
char translated_name[MAX_ISONAME+1];
#define DATESTR_SIZE 30
char date_str[DATESTR_SIZE];
if (yep != p_statbuf->b_rock) {
iso9660_name_translate_ext(psz_iso_name, translated_name,
@@ -610,26 +616,8 @@ print_iso9660_recurse (CdIo_t *p_cdio, const char pathname[],
&& strcmp (psz_iso_name, ".."))
_cdio_list_append (p_dirlist, strdup (_fullname));
if (fs & CDIO_FS_ANAL_XA) {
printf ( " %c %s %d %d [fn %.2d] [LSN %6lu] ",
(p_statbuf->type == _STAT_DIR) ? 'd' : '-',
iso9660_get_xa_attr_str (p_statbuf->xa.attributes),
uint16_from_be (p_statbuf->xa.user_id),
uint16_from_be (p_statbuf->xa.group_id),
p_statbuf->xa.filenum,
(long unsigned int) p_statbuf->lsn);
if (uint16_from_be(p_statbuf->xa.attributes) & XA_ATTR_MODE2FORM2) {
printf ("%9u (%9u)",
(unsigned int) p_statbuf->secsize * M2F2_SECTOR_SIZE,
(unsigned int) p_statbuf->size);
} else {
printf ("%9u", (unsigned int) p_statbuf->size);
}
}
strftime(date_str, DATESTR_SIZE, "%b %d %Y %H:%M ", &p_statbuf->tm);
printf (" %s %s\n", date_str, (yep != p_statbuf->b_rock)
? translated_name : psz_iso_name);
print_fs_attrs(p_statbuf, opts.no_rock_ridge, fs & CDIO_FS_ANAL_XA,
translated_name, psz_iso_name);
}
_cdio_list_free (p_entlist, true);
@@ -831,7 +819,9 @@ init(void)
opts.silent = false;
opts.list_drives = false;
opts.no_header = false;
opts.no_joliet = false;
opts.no_joliet = 0;
opts.no_rock_ridge = 0;
opts.no_xa = 0;
opts.no_device = 0;
opts.no_disc_mode = 0;
opts.debug_level = 0;