Remove unused functions
This commit is contained in:
parent
a0f681295a
commit
ba3de80478
1 changed files with 0 additions and 349 deletions
|
@ -198,14 +198,8 @@ LOCAL struct todo *todo_idr = NULL;
|
||||||
LOCAL struct todo **todo_pp = &todo_idr;
|
LOCAL struct todo **todo_pp = &todo_idr;
|
||||||
|
|
||||||
|
|
||||||
LOCAL int isonum_721 __PR((char * p));
|
|
||||||
LOCAL int isonum_723 __PR((char * p));
|
|
||||||
LOCAL int isonum_731 __PR((char * p));
|
LOCAL int isonum_731 __PR((char * p));
|
||||||
LOCAL int isonum_732 __PR((char * p));
|
|
||||||
LOCAL int isonum_733 __PR((unsigned char * p));
|
LOCAL int isonum_733 __PR((unsigned char * p));
|
||||||
LOCAL void printchars __PR((char *s, int n, BOOL ucs));
|
|
||||||
LOCAL char *sdate __PR((char *dp));
|
|
||||||
LOCAL void dump_pathtab __PR((int block, int size));
|
|
||||||
LOCAL int parse_rr __PR((unsigned char * pnt, int len,
|
LOCAL int parse_rr __PR((unsigned char * pnt, int len,
|
||||||
int cont_flag));
|
int cont_flag));
|
||||||
LOCAL void find_rr __PR((struct iso_directory_record * idr,
|
LOCAL void find_rr __PR((struct iso_directory_record * idr,
|
||||||
|
@ -227,46 +221,17 @@ LOCAL BOOL parse_de __PR((struct iso_directory_record *idr));
|
||||||
LOCAL void parse_dir __PR((struct todo *dp,
|
LOCAL void parse_dir __PR((struct todo *dp,
|
||||||
char * rootname, int extent, int len));
|
char * rootname, int extent, int len));
|
||||||
EXPORT int main __PR((int argc, char *argv[]));
|
EXPORT int main __PR((int argc, char *argv[]));
|
||||||
LOCAL void list_vd __PR((struct iso_primary_descriptor *vp, BOOL ucs));
|
|
||||||
LOCAL void list_locales __PR((void));
|
LOCAL void list_locales __PR((void));
|
||||||
LOCAL char *arch_name __PR((int val));
|
|
||||||
LOCAL char *boot_name __PR((int val));
|
|
||||||
LOCAL char *bootmedia_name __PR((int val));
|
|
||||||
LOCAL int time_cvt __PR((unsigned char *dp, int len));
|
LOCAL int time_cvt __PR((unsigned char *dp, int len));
|
||||||
LOCAL time_t iso9660_time __PR((unsigned char *date, int *hsecp,
|
LOCAL time_t iso9660_time __PR((unsigned char *date, int *hsecp,
|
||||||
BOOL longfmt));
|
BOOL longfmt));
|
||||||
#ifdef USE_FIND
|
#ifdef USE_FIND
|
||||||
LOCAL int getfind __PR((char *arg, long *valp,
|
|
||||||
int *pac, char *const **pav));
|
|
||||||
LOCAL BOOL find_stat __PR((char *rootname,
|
LOCAL BOOL find_stat __PR((char *rootname,
|
||||||
struct iso_directory_record * idr,
|
struct iso_directory_record * idr,
|
||||||
char *fname,
|
char *fname,
|
||||||
int extent));
|
int extent));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL int
|
|
||||||
isonum_721(p)
|
|
||||||
char *p;
|
|
||||||
{
|
|
||||||
return ((p[0] & 0xff)
|
|
||||||
| ((p[1] & 0xff) << 8));
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL int
|
|
||||||
isonum_723(p)
|
|
||||||
char * p;
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
if (p[0] != p[3] || p[1] != p[2]) {
|
|
||||||
fprintf(stderr, "invalid format 7.2.3 number\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return (isonum_721(p));
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL int
|
LOCAL int
|
||||||
isonum_731(p)
|
isonum_731(p)
|
||||||
char *p;
|
char *p;
|
||||||
|
@ -277,16 +242,6 @@ isonum_731(p)
|
||||||
| ((p[3] & 0xff) << 24));
|
| ((p[3] & 0xff) << 24));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL int
|
|
||||||
isonum_732(p)
|
|
||||||
char *p;
|
|
||||||
{
|
|
||||||
return ((p[3] & 0xff)
|
|
||||||
| ((p[2] & 0xff) << 8)
|
|
||||||
| ((p[1] & 0xff) << 16)
|
|
||||||
| ((p[0] & 0xff) << 24));
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL int
|
LOCAL int
|
||||||
isonum_733(p)
|
isonum_733(p)
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
|
@ -294,176 +249,13 @@ isonum_733(p)
|
||||||
return (isonum_731((char *)p));
|
return (isonum_731((char *)p));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void
|
|
||||||
printchars(s, n, ucs)
|
|
||||||
char *s;
|
|
||||||
int n;
|
|
||||||
BOOL ucs;
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
char *p;
|
|
||||||
int c;
|
|
||||||
|
|
||||||
for (; n > 0 && (*s || (ucs && s[1])); n--) {
|
|
||||||
if (ucs) {
|
|
||||||
c = *s++ & 0xFF;
|
|
||||||
c *= 256;
|
|
||||||
c += *s++ & 0xFF;
|
|
||||||
n--;
|
|
||||||
} else {
|
|
||||||
c = *s++;
|
|
||||||
}
|
|
||||||
if (c == ' ') {
|
|
||||||
int c2;
|
|
||||||
p = s;
|
|
||||||
i = n;
|
|
||||||
while (--i >= 0) {
|
|
||||||
if (ucs) {
|
|
||||||
c2 = *p++ & 0xFF;
|
|
||||||
c2 *= 256;
|
|
||||||
c2 += *p++ & 0xFF;
|
|
||||||
i--;
|
|
||||||
} else {
|
|
||||||
c2 = *p++;
|
|
||||||
}
|
|
||||||
if (c2 != ' ')
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (i <= 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
putchar(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Print date info from PVD
|
|
||||||
*/
|
|
||||||
LOCAL char *
|
|
||||||
sdate(dp)
|
|
||||||
char *dp;
|
|
||||||
{
|
|
||||||
static char d[30];
|
|
||||||
|
|
||||||
js_sprintf(d, "%4.4s %2.2s %2.2s %2.2s:%2.2s:%2.2s.%2.2s",
|
|
||||||
&dp[0], /* Year */
|
|
||||||
&dp[4], /* Month */
|
|
||||||
&dp[6], /* Monthday */
|
|
||||||
&dp[8], /* Hour */
|
|
||||||
&dp[10], /* Minute */
|
|
||||||
&dp[12], /* Seconds */
|
|
||||||
&dp[14]); /* Hunreds of a Seconds */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* dp[16] contains minute offset from Greenwich
|
|
||||||
* Positive values are to the east of Greenwich.
|
|
||||||
*/
|
|
||||||
return (d);
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL void
|
|
||||||
dump_pathtab(block, size)
|
|
||||||
int block;
|
|
||||||
int size;
|
|
||||||
{
|
|
||||||
unsigned char *buf;
|
|
||||||
int offset;
|
|
||||||
int idx;
|
|
||||||
int extent;
|
|
||||||
int pindex;
|
|
||||||
int j;
|
|
||||||
int len;
|
|
||||||
int jlen;
|
|
||||||
char namebuf[256*3];
|
|
||||||
unsigned char uc;
|
|
||||||
|
|
||||||
|
|
||||||
printf(_("Path table starts at block %d, size %d\n"), block, size);
|
|
||||||
|
|
||||||
buf = (unsigned char *) malloc(ISO_ROUND_UP(size));
|
|
||||||
|
|
||||||
#ifdef USE_SCG
|
|
||||||
readsecs(block - sector_offset, buf, ISO_BLOCKS(size));
|
|
||||||
#else
|
|
||||||
lseek(fileno(infile), ((off_t)(block - sector_offset)) << 11, SEEK_SET);
|
|
||||||
read(fileno(infile), buf, size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
offset = 0;
|
|
||||||
idx = 1;
|
|
||||||
while (offset < size) {
|
|
||||||
len = buf[offset];
|
|
||||||
extent = isonum_731((char *)buf + offset + 2);
|
|
||||||
pindex = isonum_721((char *)buf + offset + 6);
|
|
||||||
switch (ucs_level) {
|
|
||||||
case 3:
|
|
||||||
case 2:
|
|
||||||
case 1:
|
|
||||||
jlen = len/2;
|
|
||||||
namebuf[0] = '\0';
|
|
||||||
#ifdef USE_ICONV
|
#ifdef USE_ICONV
|
||||||
#ifdef HAVE_ICONV_CONST
|
#ifdef HAVE_ICONV_CONST
|
||||||
#define __IC_CONST const
|
#define __IC_CONST const
|
||||||
#else
|
#else
|
||||||
#define __IC_CONST
|
#define __IC_CONST
|
||||||
#endif
|
#endif
|
||||||
if (use_iconv(unls)) {
|
|
||||||
int u;
|
|
||||||
char *to = namebuf;
|
|
||||||
|
|
||||||
for (j = 0, u = 0; j < jlen; j++) {
|
|
||||||
char *ibuf = (char *)&buf[offset + 8 + j*2];
|
|
||||||
size_t isize = 2; /* UCS-2 character size */
|
|
||||||
size_t osize = 4;
|
|
||||||
|
|
||||||
if (iconv(unls->sic_uni2cd, (__IC_CONST char **)&ibuf, &isize,
|
|
||||||
(char **)&to, &osize) == -1) {
|
|
||||||
int err = geterrno();
|
|
||||||
|
|
||||||
if ((err == EINVAL || err == EILSEQ) &&
|
|
||||||
osize == 4) {
|
|
||||||
*to = '_';
|
|
||||||
u += 1;
|
|
||||||
to++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
u += 4 - osize;
|
|
||||||
to = &namebuf[u];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
j = u;
|
|
||||||
} else
|
|
||||||
#endif
|
#endif
|
||||||
for (j = 0; j < jlen; j++) {
|
|
||||||
UInt16_t unichar;
|
|
||||||
|
|
||||||
unichar = (buf[offset + 8 + j*2] & 0xFF) * 256 +
|
|
||||||
(buf[offset + 8 + j*2+1] & 0xFF);
|
|
||||||
|
|
||||||
if (unls)
|
|
||||||
uc = sic_uni2c(unls, unichar); /* Get the backconverted char */
|
|
||||||
else
|
|
||||||
uc = unichar > 255 ? '_' : unichar;
|
|
||||||
|
|
||||||
namebuf[j] = uc ? uc : '_';
|
|
||||||
}
|
|
||||||
namebuf[j] = '\0';
|
|
||||||
printf("%4d: %4d %x %s\n",
|
|
||||||
idx, pindex, extent, namebuf);
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
printf("%4d: %4d %x %.*s\n",
|
|
||||||
idx, pindex, extent, len, buf + offset + 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
idx++;
|
|
||||||
offset += 8 + len;
|
|
||||||
if (offset & 1)
|
|
||||||
offset++;
|
|
||||||
}
|
|
||||||
|
|
||||||
free(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL int
|
LOCAL int
|
||||||
parse_rr(pnt, len, cont_flag)
|
parse_rr(pnt, len, cont_flag)
|
||||||
|
@ -1714,79 +1506,6 @@ setcharset:
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL void
|
|
||||||
list_vd(vp, ucs)
|
|
||||||
struct iso_primary_descriptor *vp;
|
|
||||||
BOOL ucs;
|
|
||||||
{
|
|
||||||
struct iso_directory_record *idr = (struct iso_directory_record *)
|
|
||||||
vp->root_directory_record;
|
|
||||||
|
|
||||||
printf(_("System id: "));
|
|
||||||
printchars(vp->system_id, 32, ucs);
|
|
||||||
putchar('\n');
|
|
||||||
printf(_("Volume id: "));
|
|
||||||
printchars(vp->volume_id, 32, ucs);
|
|
||||||
putchar('\n');
|
|
||||||
|
|
||||||
printf(_("Volume set id: "));
|
|
||||||
printchars(vp->volume_set_id, 128, ucs);
|
|
||||||
putchar('\n');
|
|
||||||
printf(_("Publisher id: "));
|
|
||||||
printchars(vp->publisher_id, 128, ucs);
|
|
||||||
putchar('\n');
|
|
||||||
printf(_("Data preparer id: "));
|
|
||||||
printchars(vp->preparer_id, 128, ucs);
|
|
||||||
putchar('\n');
|
|
||||||
printf(_("Application id: "));
|
|
||||||
printchars(vp->application_id, 128, ucs);
|
|
||||||
putchar('\n');
|
|
||||||
|
|
||||||
printf(_("Copyright File id: "));
|
|
||||||
printchars(vp->copyright_file_id, 37, ucs);
|
|
||||||
putchar('\n');
|
|
||||||
printf(_("Abstract File id: "));
|
|
||||||
printchars(vp->abstract_file_id, 37, ucs);
|
|
||||||
putchar('\n');
|
|
||||||
printf(_("Bibliographic File id: "));
|
|
||||||
printchars(vp->bibliographic_file_id, 37, ucs);
|
|
||||||
putchar('\n');
|
|
||||||
|
|
||||||
printf(_("Volume set size is: %d\n"), isonum_723(vp->volume_set_size));
|
|
||||||
printf(_("Volume set sequence number is: %d\n"), isonum_723(vp->volume_sequence_number));
|
|
||||||
printf(_("Logical block size is: %d\n"), isonum_723(vp->logical_block_size));
|
|
||||||
printf(_("Volume size is: %d\n"), isonum_733((unsigned char *)vp->volume_space_size));
|
|
||||||
if (debug) {
|
|
||||||
int dextent;
|
|
||||||
int dlen;
|
|
||||||
|
|
||||||
dextent = isonum_733((unsigned char *)idr->extent);
|
|
||||||
dlen = isonum_733((unsigned char *)idr->size);
|
|
||||||
printf(_("Root directory extent: %d size: %d\n"),
|
|
||||||
dextent, dlen);
|
|
||||||
printf(_("Path table size is: %d\n"),
|
|
||||||
isonum_733((unsigned char *)vp->path_table_size));
|
|
||||||
printf(_("L Path table start: %d\n"),
|
|
||||||
isonum_731(vp->type_l_path_table));
|
|
||||||
printf(_("L Path opt table start: %d\n"),
|
|
||||||
isonum_731(vp->opt_type_l_path_table));
|
|
||||||
printf(_("M Path table start: %d\n"),
|
|
||||||
isonum_732(vp->type_m_path_table));
|
|
||||||
printf(_("M Path opt table start: %d\n"),
|
|
||||||
isonum_732(vp->opt_type_m_path_table));
|
|
||||||
printf(_("Creation Date: %s\n"),
|
|
||||||
sdate(vp->creation_date));
|
|
||||||
printf(_("Modification Date: %s\n"),
|
|
||||||
sdate(vp->modification_date));
|
|
||||||
printf(_("Expiration Date: %s\n"),
|
|
||||||
sdate(vp->expiration_date));
|
|
||||||
printf(_("Effective Date: %s\n"),
|
|
||||||
sdate(vp->effective_date));
|
|
||||||
printf(_("File structure version: %d\n"),
|
|
||||||
vp->file_structure_version[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL void
|
LOCAL void
|
||||||
list_locales()
|
list_locales()
|
||||||
{
|
{
|
||||||
|
@ -1812,59 +1531,6 @@ list_locales()
|
||||||
|
|
||||||
#include <schily/intcvt.h>
|
#include <schily/intcvt.h>
|
||||||
|
|
||||||
LOCAL char *
|
|
||||||
arch_name(val)
|
|
||||||
int val;
|
|
||||||
{
|
|
||||||
switch (val) {
|
|
||||||
|
|
||||||
case EL_TORITO_ARCH_x86:
|
|
||||||
return ("x86");
|
|
||||||
case EL_TORITO_ARCH_PPC:
|
|
||||||
return ("PPC");
|
|
||||||
case EL_TORITO_ARCH_MAC:
|
|
||||||
return ("MAC");
|
|
||||||
default:
|
|
||||||
return ("Unknown Arch");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL char *
|
|
||||||
boot_name(val)
|
|
||||||
int val;
|
|
||||||
{
|
|
||||||
switch (val) {
|
|
||||||
|
|
||||||
case EL_TORITO_BOOTABLE:
|
|
||||||
return ("bootable");
|
|
||||||
case EL_TORITO_NOT_BOOTABLE:
|
|
||||||
return ("not bootable");
|
|
||||||
default:
|
|
||||||
return ("Illegal");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL char *
|
|
||||||
bootmedia_name(val)
|
|
||||||
int val;
|
|
||||||
{
|
|
||||||
switch (val) {
|
|
||||||
|
|
||||||
case EL_TORITO_MEDIA_NOEMUL:
|
|
||||||
return ("No Emulation Boot");
|
|
||||||
case EL_TORITO_MEDIA_12FLOP:
|
|
||||||
return ("1200 Floppy");
|
|
||||||
case EL_TORITO_MEDIA_144FLOP:
|
|
||||||
return ("1.44MB Floppy");
|
|
||||||
case EL_TORITO_MEDIA_288FLOP:
|
|
||||||
return ("2.88MB Floppy");
|
|
||||||
case EL_TORITO_MEDIA_HD:
|
|
||||||
return ("Hard Disk Emulation");
|
|
||||||
default:
|
|
||||||
return ("Illegal Bootmedia");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL int
|
LOCAL int
|
||||||
time_cvt(dp, len)
|
time_cvt(dp, len)
|
||||||
unsigned char *dp;
|
unsigned char *dp;
|
||||||
|
@ -1933,21 +1599,6 @@ iso9660_time(date, hsecp, longfmt)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_FIND
|
#ifdef USE_FIND
|
||||||
/* ARGSUSED */
|
|
||||||
LOCAL int
|
|
||||||
getfind(arg, valp, pac, pav)
|
|
||||||
char *arg;
|
|
||||||
long *valp; /* Not used until we introduce a ptr to opt struct */
|
|
||||||
int *pac;
|
|
||||||
char *const **pav;
|
|
||||||
{
|
|
||||||
do_find = TRUE;
|
|
||||||
find_ac = *pac;
|
|
||||||
find_av = *pav;
|
|
||||||
find_ac--, find_av++;
|
|
||||||
return (NOARGS);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called from dump_stat()
|
* Called from dump_stat()
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue