cdrkit-1.1.11/0000755000372500001440000000000011456674345012143 5ustar steveuserscdrkit-1.1.11/FAQ0000644000372500001440000000276210535002030012451 0ustar steveusersFrequently Asked Questions about cdrkit ======================================= Q: What does "wodim" stand for? A: It is not a forest troll and not a winner of the inpronounceability contest. It was simply the next alternative to wom (Writes Optical Media) which was unfortunately already used by other software products. Q: What this name of ... mean? A: Terminology: some names are based on pure imagination, some on abbreviations, some on permutations of chars in descriptions. genisoimage: Generate ISO IMAGEs icedax: InCrEdible Audio eXtractor librols: LIB Remains Of LibSchily libusal: LIB Unified/Universal Scsi Access Layer netscsid: NET SCSI Daemon readom: READ Optical Media (see also wodim) wodim: see above Q: Are there additional depedencies, compared to cdrtools? A: Yes. Libcap is required on Linux plattform. Libmagic is needed to support content-based creator/type tables with HFS (optional). Libiconv is needed to support iconv-based filename converstion, eg. from UTF-8 ins Joliet's UCS-2 unicode (optional, on plattform where iconv is not already included in the libc system library). Q: Burning dies with (logical unit communication crc error (ultra-dma/32)). Reason? Solutions? A: Try enabling DMA for your device. Some CDROM readers/writters seem to send non-critical UDMA control/error codes without beeing in DMA mode and so those messages are not interpreted by the kernel but delivered to the applications instead. cdrkit-1.1.11/libparanoia/0000755000372500001440000000000011456674315014421 5ustar steveuserscdrkit-1.1.11/libparanoia/isort.c0000644000372500001440000000704110536265343015722 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)isort.c 1.14 04/02/20 J. Schilling from cdparanoia-III-alpha9.8 */ /* * Modifications to make the code portable Copyright (c) 2002 J. Schilling */ /* * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Monty (xiphmont@mit.edu) * * sorted vector abstraction for paranoia * */ /* * Old isort got a bit complex. This re-constrains complexity to * give a go at speed through a more alpha-6-like mechanism. */ #include #include #include #include #include #include "p_block.h" #include "isort.h" #include "pmalloc.h" sort_info *sort_alloc(long size); void sort_unsortall(sort_info * i); void sort_free(sort_info * i); void sort_sort(sort_info * i, long sortlo, long sorthi); void sort_setup(sort_info * i, Int16_t * vector, long *abspos, long size, long sortlo, long sorthi); sort_link *sort_getmatch(sort_info * i, long post, long overlap, int value); sort_link *sort_nextmatch(sort_info * i, sort_link * prev); sort_info *sort_alloc(long size) { sort_info *ret = _pcalloc(1, sizeof (sort_info)); ret->vector = NULL; ret->sortbegin = -1; ret->size = -1; ret->maxsize = size; ret->head = _pcalloc(65536, sizeof (sort_link *)); ret->bucketusage = _pmalloc(65536 * sizeof (long)); ret->revindex = _pcalloc(size, sizeof (sort_link)); ret->lastbucket = 0; return (ret); } void sort_unsortall(sort_info *i) { if (i->lastbucket > 2000) { /* a guess */ memset(i->head, 0, 65536 * sizeof (sort_link *)); } else { long b; for (b = 0; b < i->lastbucket; b++) i->head[i->bucketusage[b]] = NULL; } i->lastbucket = 0; i->sortbegin = -1; } void sort_free(sort_info *i) { _pfree(i->revindex); _pfree(i->head); _pfree(i->bucketusage); _pfree(i); } void sort_sort(sort_info *i, long sortlo, long sorthi) { long j; for (j = sorthi - 1; j >= sortlo; j--) { sort_link **hv = i->head + i->vector[j] + 32768; sort_link *l = i->revindex + j; if (*hv == NULL) { i->bucketusage[i->lastbucket] = i->vector[j] + 32768; i->lastbucket++; } l->next = *hv; *hv = l; } i->sortbegin = 0; } /* * size *must* be less than i->maxsize */ void sort_setup(sort_info *i, Int16_t *vector, long *abspos, long size, long sortlo, long sorthi) { if (i->sortbegin != -1) sort_unsortall(i); i->vector = vector; i->size = size; i->abspos = abspos; i->lo = min(size, max(sortlo - *abspos, 0)); i->hi = max(0, min(sorthi - *abspos, size)); } sort_link *sort_getmatch(sort_info *i, long post, long overlap, int value) { sort_link *ret; if (i->sortbegin == -1) sort_sort(i, i->lo, i->hi); /* * Now we reuse lo and hi */ post = max(0, min(i->size, post)); i->val = value + 32768; i->lo = max(0, post - overlap); /* absolute position */ i->hi = min(i->size, post + overlap); /* absolute position */ ret = i->head[i->val]; while (ret) { if (ipos(i, ret) < i->lo) { ret = ret->next; } else { if (ipos(i, ret) >= i->hi) ret = NULL; break; } } /* i->head[i->val]=ret; */ return (ret); } sort_link *sort_nextmatch(sort_info *i, sort_link *prev) { sort_link *ret = prev->next; if (!ret || ipos(i, ret) >= i->hi) return (NULL); return (ret); } cdrkit-1.1.11/libparanoia/overlap.h0000644000372500001440000000211210513514665016230 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)overlap.h 1.7 04/02/18 J. Schilling from cdparanoia-III-alpha9.8 */ /* * Modifications to make the code portable Copyright (c) 2002 J. Schilling */ /* * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Monty (xiphmont@mit.edu) */ #ifndef _OVERLAP_H_ #define _OVERLAP_H_ extern void paranoia_resetcache(cdrom_paranoia *p); extern void paranoia_resetall(cdrom_paranoia *p); extern void i_paranoia_trim(cdrom_paranoia *p, long beginword, long endword); extern void offset_adjust_settings(cdrom_paranoia *p, void (*callback) (long, int)); extern void offset_add_value(cdrom_paranoia *p, offsets *o, long value, void (*callback) (long, int)); #endif cdrkit-1.1.11/libparanoia/pmalloc.c0000644000372500001440000000376410536265343016221 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)pmalloc.c 1.3 04/05/15 Copyright 2004 J. Schilling */ /* * Paranoia malloc() functions * * Copyright (c) 2004 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include "pmalloc.h" #ifdef PM_ADD_DEBUG static int madd = 8192; static int cadd = 8192; static int radd = 8192; #else static int madd = 0; /*static int cadd = 0;*/ static int radd = 0; #endif void _pfree(void *ptr) { free(ptr); } void *_pmalloc(size_t size) { void *p; p = malloc(size + madd); if (p == NULL) raisecond("NO MEM", 0L); return (p); } void *_pcalloc(size_t nelem, size_t elsize) { void *p; #ifdef PM_ADD_DEBUG size_t n = nelem * elsize; n += cadd; p = calloc(1, n); #else p = calloc(nelem, elsize); #endif if (p == NULL) raisecond("NO MEM", 0L); return (p); } void *_prealloc(void *ptr, size_t size) { void *p; p = realloc(ptr, size + radd); if (p == NULL) raisecond("NO MEM", 0L); return (p); } cdrkit-1.1.11/libparanoia/pmalloc.h0000644000372500001440000000264310513514665016220 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)pmalloc.h 1.1 04/02/20 Copyright 2004 J. Schilling */ /* * Paranoia malloc() functions * * Copyright (c) 2004 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _PMALLOC_H #define _PMALLOC_H extern void _pfree(void *ptr); extern void *_pmalloc(size_t size); extern void *_pcalloc(size_t nelem, size_t elsize); extern void *_prealloc(void *ptr, size_t size); #endif /* _PMALLOC_H */ cdrkit-1.1.11/libparanoia/isort.h0000644000372500001440000000354510513514665015733 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)isort.h 1.10 04/02/18 J. Schilling from cdparanoia-III-alpha9.8 */ /* * Modifications to make the code portable Copyright (c) 2002 J. Schilling */ /* * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Monty (xiphmont@mit.edu) */ #ifndef _ISORT_H_ #define _ISORT_H_ typedef struct sort_link { struct sort_link *next; } sort_link; typedef struct sort_info { Int16_t *vector; /* vector */ /* vec storage doesn't belong to us */ long *abspos; /* pointer for side effects */ long size; /* vector size */ long maxsize; /* maximum vector size */ long sortbegin; /* range of contiguous sorted area */ long lo; long hi; /* current post, overlap range */ int val; /* ...and val */ /* * sort structs */ sort_link **head; /* sort buckets (65536) */ long *bucketusage; /* of used buckets (65536) */ long lastbucket; sort_link *revindex; } sort_info; extern sort_info *sort_alloc(long size); extern void sort_unsortall(sort_info * i); extern void sort_setup(sort_info * i, Int16_t * vector, long *abspos, long size, long sortlo, long sorthi); extern void sort_free(sort_info * i); extern sort_link *sort_getmatch(sort_info * i, long post, long overlap, int value); extern sort_link *sort_nextmatch(sort_info * i, sort_link * prev); #define is(i) ((i)->size) #define ib(i) (*(i)->abspos) #define ie(i) ((i)->size + *(i)->abspos) #define iv(i) ((i)->vector) #define ipos(i, l) ((l) - (i)->revindex) #endif cdrkit-1.1.11/libparanoia/overlap.c0000644000372500001440000001207710536265343016237 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)overlap.c 1.11 04/02/20 J. Schilling from cdparanoia-III-alpha9.8 */ /* * Modifications to make the code portable Copyright (c) 2002 J. Schilling */ /* * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Monty (xiphmont@mit.edu) * * Statistic code and cache management for overlap settings * */ #include #include #include #include #include "p_block.h" #include "cdda_paranoia.h" #include "overlap.h" #include "isort.h" void paranoia_resetcache(cdrom_paranoia *p); void paranoia_resetall(cdrom_paranoia *p); void i_paranoia_trim(cdrom_paranoia *p, long beginword, long endword); void offset_adjust_settings(cdrom_paranoia *p, void (*callback)(long, int)); void offset_add_value(cdrom_paranoia *p, offsets *o, long value, void (*callback)(long, int)); /* * Internal cache management */ void paranoia_resetcache(cdrom_paranoia *p) { c_block *c = c_first(p); v_fragment *v; while (c) { free_c_block(c); c = c_first(p); } v = v_first(p); while (v) { free_v_fragment(v); v = v_first(p); } } void paranoia_resetall(cdrom_paranoia *p) { p->root.returnedlimit = 0; p->dyndrift = 0; p->root.lastsector = 0; if (p->root.vector) { i_cblock_destructor(p->root.vector); p->root.vector = NULL; } paranoia_resetcache(p); } void i_paranoia_trim(cdrom_paranoia *p, long beginword, long endword) { root_block *root = &(p->root); if (root->vector != NULL) { long target = beginword - p->maxdynoverlap; long rbegin = cb(root->vector); long rend = ce(root->vector); if (rbegin > beginword) goto rootfree; if (rbegin + p->maxdynoverlap < beginword) { if (target + MIN_WORDS_OVERLAP > rend) goto rootfree; { long offset = target - rbegin; c_removef(root->vector, offset); } } { c_block *c = c_first(p); while (c) { c_block *next = c_next(c); if (ce(c) < beginword - p->maxdynoverlap) free_c_block(c); c = next; } } } return; rootfree: i_cblock_destructor(root->vector); root->vector = NULL; root->returnedlimit = -1; root->lastsector = 0; } /* * Statistical and heuristic[al? :-] management */ void offset_adjust_settings(cdrom_paranoia *p, void (*callback)(long, int)) { if (p->stage2.offpoints >= 10) { /* * drift: look at the average offset value. If it's over one * sector, frob it. We just want a little hysteresis [sp?] */ long av = (p->stage2.offpoints ? p->stage2.offaccum / p->stage2.offpoints : 0); if (abs(av) > p->dynoverlap / 4) { av = (av / MIN_SECTOR_EPSILON) * MIN_SECTOR_EPSILON; if (callback) (*callback) (ce(p->root.vector), PARANOIA_CB_DRIFT); p->dyndrift += av; /* * Adjust all the values in the cache otherwise we get * a (potentially unstable) feedback loop */ { c_block *c = c_first(p); v_fragment *v = v_first(p); while (v && v->one) { /* * safeguard beginning bounds case with * a hammer */ if (fb(v) < av || cb(v->one) < av) { v->one = NULL; } else { fb(v) -= av; } v = v_next(v); } while (c) { long adj = min(av, cb(c)); c_set(c, cb(c) - adj); c = c_next(c); } } p->stage2.offaccum = 0; p->stage2.offmin = 0; p->stage2.offmax = 0; p->stage2.offpoints = 0; p->stage2.newpoints = 0; p->stage2.offdiff = 0; } } if (p->stage1.offpoints >= 10) { /* * dynoverlap: we arbitrarily set it to 4x the running * difference value, unless min/max are more */ p->dynoverlap = (p->stage1.offpoints ? p->stage1.offdiff / p->stage1.offpoints * 3 : CD_FRAMEWORDS); if (p->dynoverlap < -p->stage1.offmin * 1.5) p->dynoverlap = -p->stage1.offmin * 1.5; if (p->dynoverlap < p->stage1.offmax * 1.5) p->dynoverlap = p->stage1.offmax * 1.5; if (p->dynoverlap < p->mindynoverlap) p->dynoverlap = p->mindynoverlap; if (p->dynoverlap > p->maxdynoverlap) p->dynoverlap = p->maxdynoverlap; if (callback) (*callback) (p->dynoverlap, PARANOIA_CB_OVERLAP); if (p->stage1.offpoints > 600) { /* * bit of a bug; this routine is called too often * due to the overlap mesh alg we use in stage 1 */ p->stage1.offpoints /= 1.2; p->stage1.offaccum /= 1.2; p->stage1.offdiff /= 1.2; } p->stage1.offmin = 0; p->stage1.offmax = 0; p->stage1.newpoints = 0; } } void offset_add_value(cdrom_paranoia *p, offsets *o, long value, void (*callback)(long, int)) { if (o->offpoints != -1) { o->offdiff += abs(value); o->offpoints++; o->newpoints++; o->offaccum += value; if (value < o->offmin) o->offmin = value; if (value > o->offmax) o->offmax = value; if (o->newpoints >= 10) offset_adjust_settings(p, callback); } } cdrkit-1.1.11/libparanoia/README.interface0000644000372500001440000000360610531367430017233 0ustar steveusers/* * Exports (libparanoia) cdda_paranoia.h */ cdrom_paranoia *paranoia_init __PR((void * d, int nsectors)); void paranoia_modeset __PR((cdrom_paranoia * p, int mode)); long paranoia_seek __PR((cdrom_paranoia * p, long seek, int mode)); Int16_t *paranoia_read __PR((cdrom_paranoia * p, void (*callback) (long, int))); Int16_t *paranoia_read_limited __PR((cdrom_paranoia * p, void (*callback) (long, int), int maxretries)); void paranoia_free __PR((cdrom_paranoia * p)); void paranoia_overlapset __PR((cdrom_paranoia * p, long overlap)); /* * Exports ?? (libparanoia) overlap.h */ extern void paranoia_resetall __PR((cdrom_paranoia * p)); extern void paranoia_resetcache __PR((cdrom_paranoia * p)); Supported: PARANOIA_MODE_VERIFY PARANOIA_MODE_OVERLAP PARANOIA_MODE_NEVERSKIP Unsupported: PARANOIA_MODE_FRAGMENT PARANOIA_MODE_SCRATCH PARANOIA_MODE_REPAIR /* * Imports (global Code) */ cdda_disc_firstsector (cdrom_drive *d) -> long sector cdda_disc_lastsector (cdrom_drive *d) -> long sector cdda_read (cdrom_drive *d, void *buffer, long beginsector, long sectors) -> long sectors cdda_sector_gettrack (cdrom_drive *d,long sector) -> int trackno cdda_track_audiop (cdrom_drive *d,int track) -> int ??? /* Is audiotrack */ cdda_track_firstsector (cdrom_drive *d,int track) -> long sector cdda_track_lastsector (cdrom_drive *d,int track) -> long sector cdda_tracks (cdrom_drive *d) -> int tracks callback (long inpos, int function) /* * Imports (libc) */ calloc free malloc realloc memcmp memcpy memmove memset qsort /*--------------------------------------------------------------------------*/ usalp = usal_open(); bufsize = usal_bufsize(usalp, CDR_BUF_SIZE); nsecs = bufsize / SEC_SIZE; cdp = paranoia_init(usalp, nsecs); # paranoia_modeset(cdp, mode); # paranoia_overlapset(cdp, overlap); while (not ready) { bp = paranoia_read(cdp, NULL); write(f, bp, SEC_SISE); } paranoia_free(cdp); cdrkit-1.1.11/libparanoia/CMakeLists.txt0000644000372500001440000000042211304054475017146 0ustar steveusersPROJECT (LIBparanoia C) INCLUDE_DIRECTORIES(../include ${CMAKE_BINARY_DIR} ../wodim ${CMAKE_BINARY_DIR}/include) ADD_DEFINITIONS(-DHAVE_CONFIG_H) SET(LIBparanoia_SRCS gap.c isort.c overlap.c p_block.c paranoia.c pmalloc.c) ADD_LIBRARY (paranoia STATIC ${LIBparanoia_SRCS}) cdrkit-1.1.11/libparanoia/cdda_paranoia.h0000644000372500001440000000726210513514665017340 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)cdda_paranoia.h 1.20 04/02/20 J. Schilling from cdparanoia-III-alpha9.8 */ /* * Modifications to make the code portable Copyright (c) 2002 J. Schilling */ /* * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Monty (xiphmont@mit.edu) * */ #ifndef _CDROM_PARANOIA_H #define _CDROM_PARANOIA_H #ifndef _MCONFIG_H #include #endif #ifndef _UTYPES_H #include #endif #ifndef __GNUC__ #define inline #endif #define CD_FRAMESIZE_RAW 2352 #define CD_FRAMEWORDS (CD_FRAMESIZE_RAW/2) /* * Second parameter of the callback function */ #define PARANOIA_CB_READ 0 /* Read off adjust ??? */ #define PARANOIA_CB_VERIFY 1 /* Verifying jitter */ #define PARANOIA_CB_FIXUP_EDGE 2 /* Fixed edge jitter */ #define PARANOIA_CB_FIXUP_ATOM 3 /* Fixed atom jitter */ #define PARANOIA_CB_SCRATCH 4 /* Unsupported */ #define PARANOIA_CB_REPAIR 5 /* Unsupported */ #define PARANOIA_CB_SKIP 6 /* Skip exhausted retry */ #define PARANOIA_CB_DRIFT 7 /* Drift detected */ #define PARANOIA_CB_BACKOFF 8 /* Unsupported */ #define PARANOIA_CB_OVERLAP 9 /* Dyn Overlap adjust */ #define PARANOIA_CB_FIXUP_DROPPED 10 /* Fixed dropped bytes */ #define PARANOIA_CB_FIXUP_DUPED 11 /* Fixed duplicate bytes */ #define PARANOIA_CB_READERR 12 /* Hard read error */ /* * Cdparanoia modes to be set with paranoia_modeset() */ #define PARANOIA_MODE_FULL 0xFF #define PARANOIA_MODE_DISABLE 0 #define PARANOIA_MODE_VERIFY 1 /* Verify data integrity in overlap area */ #define PARANOIA_MODE_FRAGMENT 2 /* unsupported */ #define PARANOIA_MODE_OVERLAP 4 /* Perform overlapped reads */ #define PARANOIA_MODE_SCRATCH 8 /* unsupported */ #define PARANOIA_MODE_REPAIR 16 /* unsupported */ #define PARANOIA_MODE_NEVERSKIP 32 /* Do not skip failed reads (retry maxretries) */ #ifndef CDP_COMPILE typedef void cdrom_paranoia; #endif /* * The interface from libcdparanoia to the high level caller */ extern cdrom_paranoia *paranoia_init(void * d, int nsectors); extern void paranoia_dynoverlapset(cdrom_paranoia * p, int minoverlap, int maxoverlap); extern void paranoia_modeset(cdrom_paranoia * p, int mode); extern long paranoia_seek(cdrom_paranoia * p, long seek, int mode); extern Int16_t *paranoia_read(cdrom_paranoia * p, void (*callback) (long, int)); extern Int16_t *paranoia_read_limited(cdrom_paranoia * p, void (*callback) (long, int), int maxretries); extern void paranoia_free(cdrom_paranoia * p); extern void paranoia_overlapset(cdrom_paranoia * p, long overlap); #ifndef HAVE_MEMMOVE #define memmove(dst, src, size) movebytes((src), (dst), (size)) #endif /* * The callback interface from libparanoia to the CD-ROM interface */ extern long cdda_disc_firstsector(void *d); /* -> long sector */ extern long cdda_disc_lastsector(void *d); /* -> long sector */ /* -> long sectors */ extern long cdda_read(void *d, void *buffer, long beginsector, long sectors); extern int cdda_sector_gettrack(void *d, long sector); /* -> int trackno */ extern int cdda_track_audiop(void *d, int track); /* -> int Is audiotrack */ extern long cdda_track_firstsector(void *d, int track); /* -> long sector */ extern long cdda_track_lastsector(void *d, int track); /* -> long sector */ extern int cdda_tracks(void *d); /* -> int tracks */ #endif /* _CDROM_PARANOIA_H */ cdrkit-1.1.11/libparanoia/p_block.c0000644000372500001440000002355210536265343016200 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)p_block.c 1.19 04/02/23 J. Schilling from cdparanoia-III-alpha9.8 */ /* * Modifications to make the code portable Copyright (c) 2002 J. Schilling */ #include #include #include #include #include #include "p_block.h" #include "cdda_paranoia.h" #include "pmalloc.h" linked_list *new_list(void *(*newp) (void), void (*freep) (void *)); linked_element *add_elem(linked_list *l, void *elem); linked_element *new_elem(linked_list *list); void free_elem(linked_element *e, int free_ptr); void free_list(linked_list *list, int free_ptr); void *get_elem(linked_element *e); linked_list *copy_list(linked_list *list); static c_block *i_cblock_constructor(void); void i_cblock_destructor(c_block *c); c_block *new_c_block(cdrom_paranoia *p); void free_c_block(c_block *c); static v_fragment *i_vfragment_constructor(void); static void i_v_fragment_destructor(v_fragment *v); v_fragment *new_v_fragment(cdrom_paranoia *p, c_block *one, long begin, long end, int last); void free_v_fragment(v_fragment *v); c_block *c_first(cdrom_paranoia *p); c_block *c_last(cdrom_paranoia *p); c_block *c_next(c_block *c); c_block *c_prev(c_block *c); v_fragment *v_first(cdrom_paranoia *p); v_fragment *v_last(cdrom_paranoia *p); v_fragment *v_next(v_fragment *v); v_fragment *v_prev(v_fragment *v); void recover_cache(cdrom_paranoia *p); Int16_t *v_buffer(v_fragment *v); c_block *c_alloc(Int16_t *vector, long begin, long size); void c_set(c_block *v, long begin); void c_remove(c_block *v, long cutpos, long cutsize); void c_overwrite(c_block *v, long pos, Int16_t *b, long size); void c_append(c_block *v, Int16_t *vector, long size); void c_removef(c_block *v, long cut); void i_paranoia_firstlast(cdrom_paranoia *p); cdrom_paranoia *paranoia_init(void *d, int nsectors); linked_list *new_list(void *(*newp)(void), void (*freep)(void *)) { linked_list *ret = _pcalloc(1, sizeof (linked_list)); ret->new_poly = newp; ret->free_poly = freep; return (ret); } linked_element *add_elem(linked_list *l, void *elem) { linked_element *ret = _pcalloc(1, sizeof (linked_element)); ret->stamp = l->current++; ret->ptr = elem; ret->list = l; if (l->head) l->head->prev = ret; else l->tail = ret; ret->next = l->head; ret->prev = NULL; l->head = ret; l->active++; return (ret); } linked_element *new_elem(linked_list *list) { void *new = list->new_poly(); return (add_elem(list, new)); } void free_elem(linked_element *e, int free_ptr) { linked_list *l = e->list; if (free_ptr) l->free_poly(e->ptr); if (e == l->head) l->head = e->next; if (e == l->tail) l->tail = e->prev; if (e->prev) e->prev->next = e->next; if (e->next) e->next->prev = e->prev; l->active--; _pfree(e); } void free_list(linked_list *list, int free_ptr) { while (list->head) free_elem(list->head, free_ptr); _pfree(list); } void *get_elem(linked_element *e) { return (e->ptr); } linked_list *copy_list(linked_list *list) { linked_list *new = new_list(list->new_poly, list->free_poly); linked_element *i = list->tail; while (i) { add_elem(new, i->ptr); i = i->prev; } return (new); } /**** C_block stuff ******************************************************/ #define vp_cblock_constructor_func ((void*(*)(void))i_cblock_constructor) static c_block *i_cblock_constructor() { c_block *ret = _pcalloc(1, sizeof (c_block)); return (ret); } #define vp_cblock_destructor_func ((void(*)(void*))i_cblock_destructor) void i_cblock_destructor(c_block *c) { if (c) { if (c->vector) _pfree(c->vector); if (c->flags) _pfree(c->flags); c->e = NULL; _pfree(c); } } c_block *new_c_block(cdrom_paranoia *p) { linked_element *e = new_elem(p->cache); c_block *c = e->ptr; c->e = e; c->p = p; return (c); } void free_c_block(c_block *c) { /* * also rid ourselves of v_fragments that reference this block */ v_fragment *v = v_first(c->p); while (v) { v_fragment *next = v_next(v); if (v->one == c) free_v_fragment(v); v = next; } free_elem(c->e, 1); } #define vp_vfragment_constructor_func ((void*(*)(void))i_vfragment_constructor) static v_fragment *i_vfragment_constructor() { v_fragment *ret = _pcalloc(1, sizeof (v_fragment)); return (ret); } #define vp_v_fragment_destructor_func ((void(*)(void*))i_v_fragment_destructor) static void i_v_fragment_destructor(v_fragment *v) { _pfree(v); } v_fragment *new_v_fragment(cdrom_paranoia *p, c_block *one, long begin, long end, int last) { linked_element *e = new_elem(p->fragments); v_fragment *b = e->ptr; b->e = e; b->p = p; b->one = one; b->begin = begin; b->vector = one->vector + begin - one->begin; b->size = end - begin; b->lastsector = last; return (b); } void free_v_fragment(v_fragment *v) { free_elem(v->e, 1); } c_block *c_first(cdrom_paranoia *p) { if (p->cache->head) return (p->cache->head->ptr); return (NULL); } c_block* c_last(cdrom_paranoia *p) { if (p->cache->tail) return (p->cache->tail->ptr); return (NULL); } c_block *c_next(c_block *c) { if (c->e->next) return (c->e->next->ptr); return (NULL); } c_block *c_prev(c_block *c) { if (c->e->prev) return (c->e->prev->ptr); return (NULL); } v_fragment *v_first(cdrom_paranoia *p) { if (p->fragments->head) { return (p->fragments->head->ptr); } return (NULL); } v_fragment *v_last(cdrom_paranoia *p) { if (p->fragments->tail) return (p->fragments->tail->ptr); return (NULL); } v_fragment *v_next(v_fragment *v) { if (v->e->next) return (v->e->next->ptr); return (NULL); } v_fragment *v_prev(v_fragment *v) { if (v->e->prev) return (v->e->prev->ptr); return (NULL); } void recover_cache(cdrom_paranoia *p) { linked_list *l = p->cache; /* * Are we at/over our allowed cache size? */ while (l->active > p->cache_limit) { /* * cull from the tail of the list */ free_c_block(c_last(p)); } } Int16_t *v_buffer(v_fragment *v) { if (!v->one) return (NULL); if (!cv(v->one)) return (NULL); return (v->vector); } /* * alloc a c_block not on a cache list */ c_block *c_alloc(Int16_t *vector, long begin, long size) { c_block *c = _pcalloc(1, sizeof (c_block)); c->vector = vector; c->begin = begin; c->size = size; return (c); } void c_set(c_block *v, long begin) { v->begin = begin; } /* * pos here is vector position from zero */ void c_insert(c_block *v, long pos, Int16_t *b, long size) { int vs = cs(v); if (pos < 0 || pos > vs) return; if (v->vector) v->vector = _prealloc(v->vector, sizeof (Int16_t) * (size + vs)); else v->vector = _pmalloc(sizeof (Int16_t) * size); if (pos < vs) memmove(v->vector + pos + size, v->vector + pos, (vs - pos) * sizeof (Int16_t)); memcpy(v->vector + pos, b, size * sizeof (Int16_t)); v->size += size; } void c_remove(c_block *v, long cutpos, long cutsize) { int vs = cs(v); if (cutpos < 0 || cutpos > vs) return; if (cutpos + cutsize > vs) cutsize = vs - cutpos; if (cutsize < 0) cutsize = vs - cutpos; if (cutsize < 1) return; memmove(v->vector + cutpos, v->vector + cutpos + cutsize, (vs - cutpos - cutsize) * sizeof (Int16_t)); v->size -= cutsize; } void c_overwrite(c_block *v, long pos, Int16_t *b, long size) { int vs = cs(v); if (pos < 0) return; if (pos + size > vs) size = vs - pos; memcpy(v->vector + pos, b, size * sizeof (Int16_t)); } void c_append(c_block *v, Int16_t *vector, long size) { int vs = cs(v); /* * update the vector */ if (v->vector) v->vector = _prealloc(v->vector, sizeof (Int16_t) * (size + vs)); else v->vector = _pmalloc(sizeof (Int16_t) * size); memcpy(v->vector + vs, vector, sizeof (Int16_t) * size); v->size += size; } void c_removef(c_block *v, long cut) { c_remove(v, 0, cut); v->begin += cut; } /* * Initialization */ void i_paranoia_firstlast(cdrom_paranoia *p) { int i; void *d = p->d; p->current_lastsector = -1; for (i = cdda_sector_gettrack(d, p->cursor); i < cdda_tracks(d); i++) if (!cdda_track_audiop(d, i)) p->current_lastsector = cdda_track_lastsector(d, i - 1); if (p->current_lastsector == -1) p->current_lastsector = cdda_disc_lastsector(d); p->current_firstsector = -1; for (i = cdda_sector_gettrack(d, p->cursor); i > 0; i--) if (!cdda_track_audiop(d, i)) p->current_firstsector = cdda_track_firstsector(d, i + 1); if (p->current_firstsector == -1) p->current_firstsector = cdda_disc_firstsector(d); } cdrom_paranoia *paranoia_init(void *d, int nsectors) { cdrom_paranoia *p = _pcalloc(1, sizeof (cdrom_paranoia)); p->cache = new_list(vp_cblock_constructor_func, vp_cblock_destructor_func); p->fragments = new_list(vp_vfragment_constructor_func, vp_v_fragment_destructor_func); p->nsectors = nsectors; p->readahead = 150; p->sortcache = sort_alloc(p->readahead * CD_FRAMEWORDS); p->d = d; p->mindynoverlap = MIN_SECTOR_EPSILON; p->maxdynoverlap = MAX_SECTOR_OVERLAP * CD_FRAMEWORDS; p->maxdynoverlap = (nsectors - 1) * CD_FRAMEWORDS; p->dynoverlap = MAX_SECTOR_OVERLAP * CD_FRAMEWORDS; p->cache_limit = JIGGLE_MODULO; p->enable = PARANOIA_MODE_FULL; p->cursor = cdda_disc_firstsector(d); p->lastread = -1000000; /* * One last one... in case data and audio tracks are mixed... */ i_paranoia_firstlast(p); return (p); } void paranoia_dynoverlapset(cdrom_paranoia *p, int minoverlap, int maxoverlap) { if (minoverlap >= 0) p->mindynoverlap = minoverlap; if (maxoverlap > minoverlap) p->maxdynoverlap = maxoverlap; if (p->maxdynoverlap < p->mindynoverlap) p->maxdynoverlap = p->mindynoverlap; } cdrkit-1.1.11/libparanoia/p_block.h0000644000372500001440000001254110513514665016200 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)p_block.h 1.16 04/02/20 J. Schilling from cdparanoia-III-alpha9.8 */ /* * Modifications to make the code portable Copyright (c) 2002 J. Schilling */ /* * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Monty (xiphmont@mit.edu) */ #ifndef _p_block_h_ #define _p_block_h_ #define MIN_WORDS_OVERLAP 64 /* 16 bit words */ #define MIN_WORDS_SEARCH 64 /* 16 bit words */ #define MIN_WORDS_RIFT 16 /* 16 bit words */ #define MAX_SECTOR_OVERLAP 32 /* sectors */ #define MIN_SECTOR_EPSILON 128 /* words */ #define MIN_SECTOR_BACKUP 16 /* sectors */ #define JIGGLE_MODULO 15 /* sectors */ #define MIN_SILENCE_BOUNDARY 1024 /* 16 bit words */ #define min(x, y) ((x) > (y)?(y):(x)) #define max(x, y) ((x) < (y)?(y):(x)) #include "isort.h" typedef struct linked_list { /* linked list */ struct linked_element *head; struct linked_element *tail; void *(*new_poly)(void); void (*free_poly)(void *poly); long current; long active; } linked_list; typedef struct linked_element { void *ptr; struct linked_element *prev; struct linked_element *next; struct linked_list *list; int stamp; } linked_element; extern linked_list *new_list(void *(*newp) (void), void (*freep) (void *)); extern linked_element *new_elem(linked_list *list); extern linked_element *add_elem(linked_list *list, void *elem); extern void free_list(linked_list *list, int free_ptr); /* unlink or free */ extern void free_elem(linked_element *e, int free_ptr); /* unlink or free */ extern void *get_elem(linked_element *e); extern linked_list *copy_list(linked_list *list); /* shallow; doesn't copy */ /* contained structures */ typedef struct c_block { /* The buffer */ Int16_t *vector; long begin; long size; /* auxiliary support structures */ unsigned char *flags; /* * 1 known boundaries in read data * 2 known blanked data * 4 matched sample * 8 reserved * 16 reserved * 32 reserved * 64 reserved * 128 reserved */ /* end of session cases */ long lastsector; struct cdrom_paranoia *p; struct linked_element *e; } c_block; extern void free_c_block(c_block *c); extern void i_cblock_destructor(c_block *c); extern c_block *new_c_block(struct cdrom_paranoia *p); typedef struct v_fragment { c_block *one; long begin; long size; Int16_t *vector; /* end of session cases */ long lastsector; /* linked list */ struct cdrom_paranoia *p; struct linked_element *e; } v_fragment; extern void free_v_fragment(v_fragment *c); extern v_fragment *new_v_fragment(struct cdrom_paranoia *p, c_block *one, long begin, long end, int lastsector); extern Int16_t *v_buffer(v_fragment *v); extern c_block *c_first(struct cdrom_paranoia *p); extern c_block *c_last(struct cdrom_paranoia *p); extern c_block *c_next(c_block *c); extern c_block *c_prev(c_block *c); extern v_fragment *v_first(struct cdrom_paranoia *p); extern v_fragment *v_last(struct cdrom_paranoia *p); extern v_fragment *v_next(v_fragment *v); extern v_fragment *v_prev(v_fragment *v); typedef struct root_block { long returnedlimit; long lastsector; struct cdrom_paranoia *p; c_block *vector; /* doesn't use any sorting */ int silenceflag; long silencebegin; } root_block; typedef struct offsets { long offpoints; long newpoints; long offaccum; long offdiff; long offmin; long offmax; } offsets; typedef struct cdrom_paranoia { void *d; /* A pointer to the driver interface */ int nsectors; /* # of sectors that fit into DMA buf */ root_block root; /* verified/reconstructed cached data */ linked_list *cache; /* our data as read from the cdrom */ long cache_limit; linked_list *fragments; /* fragments of blocks that have been */ /* 'verified' */ sort_info *sortcache; int readahead; /* sectors of readahead in each readop */ int jitter; long lastread; int enable; long cursor; long current_lastsector; long current_firstsector; /* statistics for drift/overlap */ struct offsets stage1; struct offsets stage2; long mindynoverlap; long maxdynoverlap; long dynoverlap; long dyndrift; /* statistics for verification */ } cdrom_paranoia; extern c_block *c_alloc(Int16_t *vector, long begin, long size); extern void c_set(c_block *v, long begin); extern void c_insert(c_block *v, long pos, Int16_t *b, long size); extern void c_remove(c_block *v, long cutpos, long cutsize); extern void c_overwrite(c_block *v, long pos, Int16_t *b, long size); extern void c_append(c_block *v, Int16_t *vector, long size); extern void c_removef(c_block *v, long cut); #define ce(v) ((v)->begin + (v)->size) #define cb(v) ((v)->begin) #define cs(v) ((v)->size) /* * pos here is vector position from zero */ extern void recover_cache(cdrom_paranoia *p); extern void i_paranoia_firstlast(cdrom_paranoia *p); #define cv(c) ((c)->vector) #define fe(f) ((f)->begin + (f)->size) #define fb(f) ((f)->begin) #define fs(f) ((f)->size) #define fv(f) (v_buffer(f)) #define CDP_COMPILE #endif cdrkit-1.1.11/libparanoia/paranoia.c0000644000372500001440000012271310557233453016360 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)paranoia.c 1.33 04/08/17 J. Schilling from cdparanoia-III-alpha9.8 */ /* * Modifications to make the code portable Copyright (c) 2002 J. Schilling */ /* * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Monty (xiphmont@mit.edu) * * Toplevel file for the paranoia abstraction over the cdda lib * */ /* immediate todo:: */ /* Allow disabling of root fixups? */ /* * Dupe bytes are creeping into cases that require greater overlap * than a single fragment can provide. We need to check against a * larger area* (+/-32 sectors of root?) to better eliminate * dupes. Of course this leads to other problems... Is it actually a * practically solvable problem? */ /* Bimodal overlap distributions break us. */ /* scratch detection/tolerance not implemented yet */ /* * Da new shtick: verification now a two-step assymetric process. * * A single 'verified/reconstructed' data segment cache, and then the * multiple fragment cache * * verify a newly read block against previous blocks; do it only this * once. We maintain a list of 'verified sections' from these matches. * * We then glom these verified areas into a new data buffer. * Defragmentation fixups are allowed here alone. * * We also now track where read boundaries actually happened; do not * verify across matching boundaries. */ /* * Silence. "It's BAAAAAAaaack." * * audio is now treated as great continents of values floating on a * mantle of molten silence. Silence is not handled by basic * verification at all; we simply anchor sections of nonzero audio to a * position and fill in everything else as silence. We also note the * audio that interfaces with silence; an edge must be 'wet'. */ #include #include #include #include #include #include #include #include #include "p_block.h" #include "cdda_paranoia.h" #include "overlap.h" #include "gap.h" #include "isort.h" #include "pmalloc.h" /* * used by: i_iterate_stage2() / i_stage2_each() */ typedef struct sync_result { long offset; long begin; long end; } sync_result; static inline long re(root_block *root); static inline long rb(root_block *root); static inline long rs(root_block *root); static inline Int16_t *rv(root_block *root); static inline long i_paranoia_overlap(Int16_t *buffA, Int16_t *buffB, long offsetA, long offsetB, long sizeA, long sizeB, long *ret_begin, long *ret_end); static inline long i_paranoia_overlap2(Int16_t *buffA, Int16_t *buffB, Uchar *flagsA, Uchar *flagsB, long offsetA, long offsetB, long sizeA, long sizeB, long *ret_begin, long *ret_end); static inline long do_const_sync(c_block *A, sort_info *B, Uchar *flagB, long posA, long posB, long *begin, long *end, long *offset); static inline long try_sort_sync(cdrom_paranoia *p, sort_info *A, Uchar *Aflags, c_block *B, long post, long *begin, long *end, long *offset, void (*callback) (long, int)); static inline void stage1_matched(c_block *old, c_block *new, long matchbegin, long matchend, long matchoffset, void (*callback) (long, int)); static long i_iterate_stage1(cdrom_paranoia *p, c_block *old, c_block *new, void (*callback) (long, int)); static long i_stage1(cdrom_paranoia *p, c_block *new, void (*callback) (long, int)); static long i_iterate_stage2(cdrom_paranoia *p, v_fragment *v, sync_result *r, void (*callback)(long, int)); static void i_silence_test(root_block *root); static long i_silence_match(root_block *root, v_fragment *v, void (*callback) (long, int)); static long i_stage2_each(root_block *root, v_fragment *v, void (*callback) (long, int)); static int i_init_root(root_block *root, v_fragment *v, long begin, void (*callback)(long, int)); static int vsort(const void *a, const void *b); static int i_stage2(cdrom_paranoia *p, long beginword, long endword, void (*callback)(long, int)); static void i_end_case(cdrom_paranoia *p, long endword, void (*callback)(long, int)); static void verify_skip_case(cdrom_paranoia *p, void (*callback)(long, int)); void paranoia_free(cdrom_paranoia *p); void paranoia_modeset(cdrom_paranoia *p, int enable); long paranoia_seek(cdrom_paranoia *p, long seek, int mode); c_block *i_read_c_block(cdrom_paranoia *p, long beginword, long endword, void (*callback)(long,int)); Int16_t *paranoia_read(cdrom_paranoia *p, void (*callback)(long, int)); Int16_t *paranoia_read_limited(cdrom_paranoia *p, void (*callback)(long, int), int max_retries); void paranoia_overlapset(cdrom_paranoia *p, long overlap); static inline long re(root_block *root) { if (!root) return (-1); if (!root->vector) return (-1); return (ce(root->vector)); } static inline long rb(root_block *root) { if (!root) return (-1); if (!root->vector) return (-1); return (cb(root->vector)); } static inline long rs(root_block *root) { if (!root) return (-1); if (!root->vector) return (-1); return (cs(root->vector)); } static inline Int16_t *rv(root_block *root) { if (!root) return (NULL); if (!root->vector) return (NULL); return (cv(root->vector)); } #define rc(r) ((r)->vector) /* * matching and analysis code */ static inline long i_paranoia_overlap(Int16_t *buffA, Int16_t *buffB, long offsetA, long offsetB, long sizeA, long sizeB, long *ret_begin, long *ret_end) { long beginA = offsetA; long endA = offsetA; long beginB = offsetB; long endB = offsetB; for (; beginA >= 0 && beginB >= 0; beginA--, beginB--) if (buffA[beginA] != buffB[beginB]) break; beginA++; beginB++; for (; endA < sizeA && endB < sizeB; endA++, endB++) if (buffA[endA] != buffB[endB]) break; if (ret_begin) *ret_begin = beginA; if (ret_end) *ret_end = endA; return (endA - beginA); } static inline long i_paranoia_overlap2(Int16_t *buffA, Int16_t *buffB, Uchar *flagsA, Uchar *flagsB, long offsetA, long offsetB, long sizeA, long sizeB, long *ret_begin, long *ret_end) { long beginA = offsetA; long endA = offsetA; long beginB = offsetB; long endB = offsetB; for (; beginA >= 0 && beginB >= 0; beginA--, beginB--) { if (buffA[beginA] != buffB[beginB]) break; /* * don't allow matching across matching sector boundaries */ if ((flagsA[beginA] & flagsB[beginB] & 1)) { beginA--; beginB--; break; } /* * don't allow matching through known missing data */ if ((flagsA[beginA] & 2) || (flagsB[beginB] & 2)) break; } beginA++; beginB++; for (; endA < sizeA && endB < sizeB; endA++, endB++) { if (buffA[endA] != buffB[endB]) break; /* * don't allow matching across matching sector boundaries */ if ((flagsA[endA] & flagsB[endB] & 1) && endA != beginA) { break; } /* * don't allow matching through known missing data */ if ((flagsA[endA] & 2) || (flagsB[endB] & 2)) break; } if (ret_begin) *ret_begin = beginA; if (ret_end) *ret_end = endA; return (endA - beginA); } /* Top level of the first stage matcher */ /* * We match each analysis point of new to the preexisting blocks * recursively. We can also optionally maintain a list of fragments of * the preexisting block that didn't match anything, and match them back * afterward. */ #define OVERLAP_ADJ (MIN_WORDS_OVERLAP/2-1) static inline long do_const_sync(c_block *A, sort_info *B, Uchar *flagB, long posA, long posB, long *begin, long *end, long *offset) { Uchar *flagA = A->flags; long ret = 0; if (flagB == NULL) ret = i_paranoia_overlap(cv(A), iv(B), posA, posB, cs(A), is(B), begin, end); else if ((flagB[posB] & 2) == 0) ret = i_paranoia_overlap2(cv(A), iv(B), flagA, flagB, posA, posB, cs(A), is(B), begin, end); if (ret > MIN_WORDS_SEARCH) { *offset = (posA + cb(A)) - (posB + ib(B)); *begin += cb(A); *end += cb(A); return (ret); } return (0); } /* * post is w.r.t. B. in stage one, we post from old. In stage 2 we * post from root. Begin, end, offset count from B's frame of * reference */ static inline long try_sort_sync(cdrom_paranoia *p, sort_info *A, Uchar *Aflags, c_block *B, long post, long *begin, long *end, long *offset, void (*callback)(long, int)) { long dynoverlap = p->dynoverlap; sort_link *ptr = NULL; Uchar *Bflags = B->flags; /* * block flag matches 0x02 (unmatchable) */ if (Bflags == NULL || (Bflags[post - cb(B)] & 2) == 0) { /* * always try absolute offset zero first! */ { long zeropos = post - ib(A); if (zeropos >= 0 && zeropos < is(A)) { if (cv(B)[post - cb(B)] == iv(A)[zeropos]) { if (do_const_sync(B, A, Aflags, post - cb(B), zeropos, begin, end, offset)) { offset_add_value(p, &(p->stage1), *offset, callback); return (1); } } } } } else return (0); ptr = sort_getmatch(A, post - ib(A), dynoverlap, cv(B)[post - cb(B)]); while (ptr) { if (do_const_sync(B, A, Aflags, post - cb(B), ipos(A, ptr), begin, end, offset)) { offset_add_value(p, &(p->stage1), *offset, callback); return (1); } ptr = sort_nextmatch(A, ptr); } *begin = -1; *end = -1; *offset = -1; return (0); } static inline void stage1_matched(c_block *old, c_block *new, long matchbegin, long matchend, long matchoffset, void (*callback)(long, int)) { long i; long oldadjbegin = matchbegin - cb(old); long oldadjend = matchend - cb(old); long newadjbegin = matchbegin - matchoffset - cb(new); long newadjend = matchend - matchoffset - cb(new); if (matchbegin - matchoffset <= cb(new) || matchbegin <= cb(old) || (new->flags[newadjbegin] & 1) || (old->flags[oldadjbegin] & 1)) { if (matchoffset) if (callback) (*callback) (matchbegin, PARANOIA_CB_FIXUP_EDGE); } else if (callback) (*callback) (matchbegin, PARANOIA_CB_FIXUP_ATOM); if (matchend - matchoffset >= ce(new) || (new->flags[newadjend] & 1) || matchend >= ce(old) || (old->flags[oldadjend] & 1)) { if (matchoffset) if (callback) (*callback) (matchend, PARANOIA_CB_FIXUP_EDGE); } else if (callback) (*callback) (matchend, PARANOIA_CB_FIXUP_ATOM); /* * Mark the verification flags. Don't mark the first or last OVERLAP/2 * elements so that overlapping fragments have to overlap by OVERLAP to * actually merge. We also remove elements from the sort such that * later sorts do not have to sift through already matched data */ newadjbegin += OVERLAP_ADJ; newadjend -= OVERLAP_ADJ; for (i = newadjbegin; i < newadjend; i++) new->flags[i] |= 4; /* mark verified */ oldadjbegin += OVERLAP_ADJ; oldadjend -= OVERLAP_ADJ; for (i = oldadjbegin; i < oldadjend; i++) old->flags[i] |= 4; /* mark verified */ } #define CB_NULL (void (*)(long, int))0 static long i_iterate_stage1(cdrom_paranoia *p, c_block *old, c_block *new, void (*callback)(long, int)) { long matchbegin = -1; long matchend = -1; long matchoffset; /* * we no longer try to spread the stage one search area by dynoverlap */ long searchend = min(ce(old), ce(new)); long searchbegin = max(cb(old), cb(new)); long searchsize = searchend - searchbegin; sort_info *i = p->sortcache; long ret = 0; long j; long tried = 0; long matched = 0; if (searchsize <= 0) return (0); /* * match return values are in terms of the new vector, not old */ for (j = searchbegin; j < searchend; j += 23) { if ((new->flags[j - cb(new)] & 6) == 0) { tried++; if (try_sort_sync(p, i, new->flags, old, j, &matchbegin, &matchend, &matchoffset, callback) == 1) { matched += matchend - matchbegin; /* * purely cosmetic: if we're matching zeros, * don't use the callback because they will * appear to be all skewed */ { long jj = matchbegin - cb(old); long end = matchend - cb(old); for (; jj < end; jj++) if (cv(old)[jj] != 0) break; if (jj < end) { stage1_matched(old, new, matchbegin, matchend, matchoffset, callback); } else { stage1_matched(old, new, matchbegin, matchend, matchoffset, CB_NULL); } } ret++; if (matchend - 1 > j) j = matchend - 1; } } } #ifdef NOISY fprintf(stderr, "iterate_stage1: search area=%ld[%ld-%ld] tried=%ld matched=%ld spans=%ld\n", searchsize, searchbegin, searchend, tried, matched, ret); #endif return (ret); } static long i_stage1(cdrom_paranoia *p, c_block *new, void (*callback)(long, int)) { long size = cs(new); c_block *ptr = c_last(p); int ret = 0; long begin = 0; long end; if (ptr) sort_setup(p->sortcache, cv(new), &cb(new), cs(new), cb(new), ce(new)); while (ptr && ptr != new) { if (callback) (*callback) (cb(new), PARANOIA_CB_VERIFY); i_iterate_stage1(p, ptr, new, callback); ptr = c_prev(ptr); } /* * parse the verified areas of new into v_fragments */ begin = 0; while (begin < size) { for (; begin < size; begin++) if (new->flags[begin] & 4) break; for (end = begin; end < size; end++) if ((new->flags[end] & 4) == 0) break; if (begin >= size) break; ret++; new_v_fragment(p, new, cb(new) + max(0, begin - OVERLAP_ADJ), cb(new) + min(size, end + OVERLAP_ADJ), (end + OVERLAP_ADJ >= size && new->lastsector)); begin = end; } return (ret); } /* * reconcile v_fragments to root buffer. Free if matched, fragment/fixup root * if necessary * * do *not* match using zero posts */ static long i_iterate_stage2(cdrom_paranoia *p, v_fragment *v, sync_result *r, void (*callback)(long, int)) { root_block *root = &(p->root); long matchbegin = -1; long matchend = -1; long offset; long fbv; long fev; #ifdef NOISY fprintf(stderr, "Stage 2 search: fbv=%ld fev=%ld\n", fb(v), fe(v)); #endif if (min(fe(v) + p->dynoverlap, re(root)) - max(fb(v) - p->dynoverlap, rb(root)) <= 0) return (0); if (callback) (*callback) (fb(v), PARANOIA_CB_VERIFY); /* * just a bit of v; determine the correct area */ fbv = max(fb(v), rb(root) - p->dynoverlap); /* * we want to avoid zeroes */ while (fbv < fe(v) && fv(v)[fbv - fb(v)] == 0) fbv++; if (fbv == fe(v)) return (0); fev = min(min(fbv + 256, re(root) + p->dynoverlap), fe(v)); { /* * spread the search area a bit. We post from root, so * containment must strictly adhere to root */ long searchend = min(fev + p->dynoverlap, re(root)); long searchbegin = max(fbv - p->dynoverlap, rb(root)); sort_info *i = p->sortcache; long j; sort_setup(i, fv(v), &fb(v), fs(v), fbv, fev); for (j = searchbegin; j < searchend; j += 23) { while (j < searchend && rv(root)[j - rb(root)] == 0) j++; if (j == searchend) break; if (try_sort_sync(p, i, (Uchar *)0, rc(root), j, &matchbegin, &matchend, &offset, callback)) { r->begin = matchbegin; r->end = matchend; r->offset = -offset; if (offset) if (callback) (*callback) (r->begin, PARANOIA_CB_FIXUP_EDGE); return (1); } } } return (0); } /* * simple test for a root vector that ends in silence */ static void i_silence_test(root_block *root) { Int16_t *vec = rv(root); long end = re(root) - rb(root) - 1; long j; for (j = end - 1; j >= 0; j--) if (vec[j] != 0) break; if (j < 0 || end - j > MIN_SILENCE_BOUNDARY) { if (j < 0) j = 0; root->silenceflag = 1; root->silencebegin = rb(root) + j; if (root->silencebegin < root->returnedlimit) root->silencebegin = root->returnedlimit; } } /* * match into silence vectors at offset zero if at all possible. This * also must be called with vectors in ascending begin order in case * there are nonzero islands */ static long i_silence_match(root_block *root, v_fragment *v, void (*callback)(long, int)) { cdrom_paranoia *p = v->p; Int16_t *vec = fv(v); long end = fs(v); long begin; long j; /* * does this vector begin wet? */ if (end < MIN_SILENCE_BOUNDARY) return (0); for (j = 0; j < end; j++) if (vec[j] != 0) break; if (j < MIN_SILENCE_BOUNDARY) return (0); j += fb(v); /* * is the new silent section ahead of the end of the old * by < p->dynoverlap? */ if (fb(v) >= re(root) && fb(v) - p->dynoverlap < re(root)) { /* * extend the zeroed area of root * XXX dynarrays are not needed here. */ long addto = fb(v) + MIN_SILENCE_BOUNDARY - re(root); /* Int16_t avec[addto];*/ #ifdef HAVE_ALLOCA Int16_t *avec = alloca(addto * sizeof (Int16_t)); #else Int16_t *avec = _pmalloc(addto * sizeof (Int16_t)); #endif memset(avec, 0, sizeof (avec)); c_append(rc(root), avec, addto); #ifndef HAVE_ALLOCA _pfree(avec); #endif } /* * do we have an 'effortless' overlap? */ begin = max(fb(v), root->silencebegin); end = min(j, re(root)); if (begin < end) { /* * don't use it unless it will extend... */ if (fe(v) > re(root)) { long voff = begin - fb(v); c_remove(rc(root), begin - rb(root), -1); c_append(rc(root), vec + voff, fs(v) - voff); } offset_add_value(p, &p->stage2, 0, callback); } else { if (j < begin) { /* * OK, we'll have to force it a bit as the root is * jittered forward */ long voff = j - fb(v); /* * don't use it unless it will extend... */ if (begin + fs(v) - voff > re(root)) { c_remove(rc(root), root->silencebegin - rb(root), -1); c_append(rc(root), vec + voff, fs(v) - voff); } offset_add_value(p, &p->stage2, end - begin, callback); } else return (0); } /* * test the new root vector for ending in silence */ root->silenceflag = 0; i_silence_test(root); if (v->lastsector) root->lastsector = 1; free_v_fragment(v); return (1); } static long i_stage2_each(root_block *root, v_fragment *v, void (*callback)(long, int)) { cdrom_paranoia *p = v->p; long dynoverlap = p->dynoverlap / 2 * 2; if (!v || !v->one) return (0); if (!rv(root)) { return (0); } else { sync_result r; if (i_iterate_stage2(p, v, &r, callback)) { long begin = r.begin - rb(root); long end = r.end - rb(root); long offset = r.begin + r.offset - fb(v) - begin; long temp; c_block *l = NULL; /* * we have a match! We don't rematch off rift, we chase * the match all the way to both extremes doing rift * analysis. */ #ifdef NOISY fprintf(stderr, "Stage 2 match\n"); #endif /* * chase backward * note that we don't extend back right now, only * forward. */ while ((begin + offset > 0 && begin > 0)) { long matchA = 0, matchB = 0, matchC = 0; long beginL = begin + offset; if (l == NULL) { Int16_t *buff = _pmalloc(fs(v) * sizeof (Int16_t)); l = c_alloc(buff, fb(v), fs(v)); memcpy(buff, fv(v), fs(v) * sizeof (Int16_t)); } i_analyze_rift_r(rv(root), cv(l), rs(root), cs(l), begin - 1, beginL - 1, &matchA, &matchB, &matchC); #ifdef NOISY fprintf(stderr, "matching rootR: matchA:%ld matchB:%ld matchC:%ld\n", matchA, matchB, matchC); #endif if (matchA) { /* * a problem with root */ if (matchA > 0) { /* * dropped bytes; add back from v */ if (callback) (*callback) (begin + rb(root) - 1, PARANOIA_CB_FIXUP_DROPPED); if (rb(root) + begin < p->root.returnedlimit) break; else { c_insert(rc(root), begin, cv(l) + beginL - matchA, matchA); offset -= matchA; begin += matchA; end += matchA; } } else { /* * duplicate bytes; drop from root */ if (callback) (*callback) (begin + rb(root) - 1, PARANOIA_CB_FIXUP_DUPED); if (rb(root) + begin + matchA < p->root.returnedlimit) break; else { c_remove(rc(root), begin + matchA, -matchA); offset -= matchA; begin += matchA; end += matchA; } } } else if (matchB) { /* * a problem with the fragment */ if (matchB > 0) { /* * dropped bytes */ if (callback) (*callback) (begin + rb(root) - 1, PARANOIA_CB_FIXUP_DROPPED); c_insert(l, beginL, rv(root) + begin - matchB, matchB); offset += matchB; } else { /* * duplicate bytes */ if (callback) (*callback) (begin + rb(root) - 1, PARANOIA_CB_FIXUP_DUPED); c_remove(l, beginL + matchB, -matchB); offset += matchB; } } else if (matchC) { /* * Uhh... problem with both * Set 'disagree' flags in root */ if (rb(root) + begin - matchC < p->root.returnedlimit) break; c_overwrite(rc(root), begin - matchC, cv(l) + beginL - matchC, matchC); } else { /* * do we have a mismatch due to silence * beginning/end case? * in the 'chase back' case, we don't * do anything. * Did not determine nature of * difficulty... report and bail */ /* RRR(*callback)(post,PARANOIA_CB_XXX); */ break; } /* * not the most efficient way, but it will do * for now */ beginL = begin + offset; i_paranoia_overlap(rv(root), cv(l), begin, beginL, rs(root), cs(l), &begin, &end); } /* * chase forward */ temp = l ? cs(l) : fs(v); while (end + offset < temp && end < rs(root)) { long matchA = 0, matchB = 0, matchC = 0; long beginL = begin + offset; long endL = end + offset; if (l == NULL) { Int16_t *buff = _pmalloc(fs(v) * sizeof (Int16_t)); l = c_alloc(buff, fb(v), fs(v)); memcpy(buff, fv(v), fs(v) * sizeof (Int16_t)); } i_analyze_rift_f(rv(root), cv(l), rs(root), cs(l), end, endL, &matchA, &matchB, &matchC); #ifdef NOISY fprintf(stderr, "matching rootF: matchA:%ld matchB:%ld matchC:%ld\n", matchA, matchB, matchC); #endif if (matchA) { /* * a problem with root */ if (matchA > 0) { /* * dropped bytes; add back from v */ if (callback) (*callback) (end + rb(root), PARANOIA_CB_FIXUP_DROPPED); if (end + rb(root) < p->root.returnedlimit) break; c_insert(rc(root), end, cv(l) + endL, matchA); } else { /* * duplicate bytes; drop from root */ if (callback) (*callback) (end + rb(root), PARANOIA_CB_FIXUP_DUPED); if (end + rb(root) < p->root.returnedlimit) break; c_remove(rc(root), end, -matchA); } } else if (matchB) { /* * a problem with the fragment */ if (matchB > 0) { /* * dropped bytes */ if (callback) (*callback) (end + rb(root), PARANOIA_CB_FIXUP_DROPPED); c_insert(l, endL, rv(root) + end, matchB); } else { /* * duplicate bytes */ if (callback) (*callback) (end + rb(root), PARANOIA_CB_FIXUP_DUPED); c_remove(l, endL, -matchB); } } else if (matchC) { /* * Uhh... problem with both * Set 'disagree' flags in root */ if (end + rb(root) < p->root.returnedlimit) break; c_overwrite(rc(root), end, cv(l) + endL, matchC); } else { analyze_rift_silence_f(rv(root), cv(l), rs(root), cs(l), end, endL, &matchA, &matchB); if (matchA) { /* * silence in root * Can only do this if we haven't * already returned data */ if (end + rb(root) >= p->root.returnedlimit) { c_remove(rc(root), end, -1); } } else if (matchB) { /* * silence in fragment; lose it */ if (l) i_cblock_destructor(l); free_v_fragment(v); return (1); } else { /* * Could not determine nature of * difficulty... report and bail */ /* RRR(*callback)(post,PARANOIA_CB_XXX); */ } break; } /* * not the most efficient way, but it will do for now */ i_paranoia_overlap(rv(root), cv(l), begin, beginL, rs(root), cs(l), (long *)0, &end); } /* * if this extends our range, let's glom */ { long sizeA = rs(root); long sizeB; long vecbegin; Int16_t *vector; if (l) { sizeB = cs(l); vector = cv(l); vecbegin = cb(l); } else { sizeB = fs(v); vector = fv(v); vecbegin = fb(v); } if (sizeB - offset > sizeA || v->lastsector) { if (v->lastsector) { root->lastsector = 1; } if (end < sizeA) c_remove(rc(root), end, -1); if (sizeB - offset - end) c_append(rc(root), vector + end + offset, sizeB - offset - end); i_silence_test(root); /* * add offset into dynoverlap stats */ offset_add_value(p, &p->stage2, offset + vecbegin - rb(root), callback); } } if (l) i_cblock_destructor(l); free_v_fragment(v); return (1); } else { /* * D'oh. No match. What to do with the fragment? */ if (fe(v) + dynoverlap < re(root) && !root->silenceflag) { /* * It *should* have matched. No good; free it. */ free_v_fragment(v); } /* * otherwise, we likely want this for an upcoming match * we don't free the sort info (if it was collected) */ return (0); } } } static int i_init_root(root_block *root, v_fragment *v, long begin, void (*callback)(long, int)) { if (fb(v) <= begin && fe(v) > begin) { root->lastsector = v->lastsector; root->returnedlimit = begin; if (rv(root)) { i_cblock_destructor(rc(root)); rc(root) = NULL; } { Int16_t *buff = _pmalloc(fs(v) * sizeof (Int16_t)); memcpy(buff, fv(v), fs(v) * sizeof (Int16_t)); root->vector = c_alloc(buff, fb(v), fs(v)); } i_silence_test(root); return (1); } else return (0); } static int vsort(const void *a, const void *b) { return ((*(v_fragment **) a)->begin - (*(v_fragment **) b)->begin); } static int i_stage2(cdrom_paranoia *p, long beginword, long endword, void (*callback)(long, int)) { int flag = 1; int ret = 0; root_block *root = &(p->root); #ifdef NOISY fprintf(stderr, "Fragments:%ld\n", p->fragments->active); fflush(stderr); #endif /* * even when the 'silence flag' is lit, we try to do non-silence * matching in the event that there are still audio vectors with * content to be sunk before the silence */ while (flag) { /* * loop through all the current fragments */ v_fragment *first = v_first(p); long active = p->fragments->active, count = 0; #ifdef HAVE_DYN_ARRAYS v_fragment *list[active]; #else v_fragment **list = _pmalloc(active * sizeof (v_fragment *)); #endif while (first) { v_fragment *next = v_next(first); list[count++] = first; first = next; } flag = 0; if (count) { /* * sorted in ascending order of beginning */ qsort(list, active, sizeof (v_fragment *), vsort); /* * we try a nonzero based match even if in silent mode * in the case that there are still cached vectors to * sink behind continent->ocean boundary */ for (count = 0; count < active; count++) { first = list[count]; if (first->one) { if (rv(root) == NULL) { if (i_init_root(&(p->root), first, beginword, callback)) { free_v_fragment(first); flag = 1; ret++; } } else { if (i_stage2_each(root, first, callback)) { ret++; flag = 1; } } } } /* * silence handling */ if (!flag && p->root.silenceflag) { for (count = 0; count < active; count++) { first = list[count]; if (first->one) { if (rv(root) != NULL) { if (i_silence_match(root, first, callback)) { ret++; flag = 1; } } } } } } #ifndef HAVE_DYN_ARRAYS _pfree(list); #endif } return (ret); } static void i_end_case(cdrom_paranoia *p, long endword, void (*callback)(long, int)) { root_block *root = &p->root; /* * have an 'end' flag; if we've just read in the last sector in a * session, set the flag. If we verify to the end of a fragment * which has the end flag set, we're done (set a done flag). * Pad zeroes to the end of the read */ if (root->lastsector == 0) return; if (endword < re(root)) return; { long addto = endword - re(root); char *temp = _pcalloc(addto, sizeof (char) * 2); c_append(rc(root), (void *) temp, addto); _pfree(temp); /* * trash da cache */ paranoia_resetcache(p); } } /* * We want to add a sector. Look through the caches for something that * spans. Also look at the flags on the c_block... if this is an * obliterated sector, get a bit of a chunk past the obliteration. * * Not terribly smart right now, actually. We can probably find * *some* match with a cache block somewhere. Take it and continue it * through the skip */ static void verify_skip_case(cdrom_paranoia *p, void (*callback)(long, int)) { root_block *root = &(p->root); c_block *graft = NULL; int vflag = 0; int gend = 0; long post; #ifdef NOISY fprintf(stderr, "\nskipping\n"); #endif if (rv(root) == NULL) { post = 0; } else { post = re(root); } if (post == -1) post = 0; if (callback) (*callback) (post, PARANOIA_CB_SKIP); if (p->enable & PARANOIA_MODE_NEVERSKIP) return; /* * We want to add a sector. Look for a c_block that spans, * preferrably a verified area */ { c_block *c = c_first(p); while (c) { long cbegin = cb(c); long cend = ce(c); if (cbegin <= post && cend > post) { long vend = post; if (c->flags[post - cbegin] & 4) { /* * verified area! */ while (vend < cend && (c->flags[vend - cbegin] & 4)) vend++; if (!vflag || vend > vflag) { graft = c; gend = vend; } vflag = 1; } else { /* * not a verified area */ if (!vflag) { while (vend < cend && (c->flags[vend - cbegin] & 4) == 0) vend++; if (graft == NULL || gend > vend) { /* * smallest unverified area */ graft = c; gend = vend; } } } } c = c_next(c); } if (graft) { long cbegin = cb(graft); long cend = ce(graft); while (gend < cend && (graft->flags[gend - cbegin] & 4)) gend++; gend = min(gend + OVERLAP_ADJ, cend); if (rv(root) == NULL) { Int16_t *buff = _pmalloc(cs(graft)); memcpy(buff, cv(graft), cs(graft)); rc(root) = c_alloc(buff, cb(graft), cs(graft)); } else { c_append(rc(root), cv(graft) + post - cbegin, gend - post); } root->returnedlimit = re(root); return; } } /* * No? Fine. Great. Write in some zeroes :-P */ { void *temp = _pcalloc(CD_FRAMESIZE_RAW, sizeof (Int16_t)); if (rv(root) == NULL) { rc(root) = c_alloc(temp, post, CD_FRAMESIZE_RAW); } else { c_append(rc(root), temp, CD_FRAMESIZE_RAW); _pfree(temp); } root->returnedlimit = re(root); } } /* * toplevel */ void paranoia_free(cdrom_paranoia *p) { paranoia_resetall(p); sort_free(p->sortcache); _pfree(p); } void paranoia_modeset(cdrom_paranoia *p, int enable) { p->enable = enable; } long paranoia_seek(cdrom_paranoia *p, long seek, int mode) { long sector; long ret; switch (mode) { case SEEK_SET: sector = seek; break; case SEEK_END: sector = cdda_disc_lastsector(p->d) + seek; break; default: sector = p->cursor + seek; break; } if (cdda_sector_gettrack(p->d, sector) == -1) return (-1); i_cblock_destructor(p->root.vector); p->root.vector = NULL; p->root.lastsector = 0; p->root.returnedlimit = 0; ret = p->cursor; p->cursor = sector; i_paranoia_firstlast(p); /* * Evil hack to fix pregap patch for NEC drives! To be rooted out in a10 */ p->current_firstsector = sector; return (ret); } /* * returns last block read, -1 on error */ c_block *i_read_c_block(cdrom_paranoia *p, long beginword, long endword, void (*callback)(long, int)) { /* * why do it this way? We need to read lots of sectors to kludge * around stupid read ahead buffers on cheap drives, as well as avoid * expensive back-seeking. We also want to 'jiggle' the start address * to try to break borderline drives more noticeably (and make broken * drives with unaddressable sectors behave more often). */ long readat; long firstread; long totaltoread = p->readahead; long sectatonce = p->nsectors; long driftcomp = (float) p->dyndrift / CD_FRAMEWORDS + .5; c_block *new = NULL; root_block *root = &p->root; Int16_t *buffer = NULL; void *bufbase = NULL; Uchar *flags = NULL; long sofar; long dynoverlap = (p->dynoverlap + CD_FRAMEWORDS - 1) / CD_FRAMEWORDS; long anyflag = 0; int reduce = 0; static int pagesize = -1; #define valign(x, a) (((char *)(x)) + ((a) - 1 - ((((UIntptr_t)(x))-1)%(a)))) /* * What is the first sector to read? want some pre-buffer if we're not * at the extreme beginning of the disc */ if (p->enable & (PARANOIA_MODE_VERIFY | PARANOIA_MODE_OVERLAP)) { /* * we want to jitter the read alignment boundary */ long target; if (rv(root) == NULL || rb(root) > beginword) target = p->cursor - dynoverlap; else target = re(root) / (CD_FRAMEWORDS) - dynoverlap; if (target + MIN_SECTOR_BACKUP > p->lastread && target <= p->lastread) target = p->lastread - MIN_SECTOR_BACKUP; /* * we want to jitter the read alignment boundary, as some * drives, beginning from a specific point, will tend to * lose bytes between sectors in the same place. Also, as * our vectors are being made up of multiple reads, we want * the overlap boundaries to move.... */ readat = (target & (~((long) JIGGLE_MODULO - 1))) + p->jitter; if (readat > target) readat -= JIGGLE_MODULO; p->jitter++; if (p->jitter >= JIGGLE_MODULO) p->jitter = 0; } else { readat = p->cursor; } readat += driftcomp; if (p->enable & (PARANOIA_MODE_OVERLAP | PARANOIA_MODE_VERIFY)) { flags = _pcalloc(totaltoread * CD_FRAMEWORDS, 1); new = new_c_block(p); recover_cache(p); } else { /* * in the case of root it's just the buffer */ paranoia_resetall(p); new = new_c_block(p); } /* * Do not use valloc() as valloc() in glibc is buggy and returns memory * that cannot be passed to free(). */ if (pagesize < 0) { pagesize = getpagesize(); if (pagesize < 0) pagesize = 4096; /* Just a guess */ } reduce = pagesize / CD_FRAMESIZE_RAW; bufbase = _pmalloc(totaltoread * CD_FRAMESIZE_RAW + pagesize); buffer = (Int16_t *)valign(bufbase, pagesize); sofar = 0; firstread = -1; /* * actual read loop */ while (sofar < totaltoread) { long secread = sectatonce; long adjread = readat; long thisread; /* * don't under/overflow the audio session */ if (adjread < p->current_firstsector) { secread -= p->current_firstsector - adjread; adjread = p->current_firstsector; } if (adjread + secread - 1 > p->current_lastsector) secread = p->current_lastsector - adjread + 1; if (sofar + secread > totaltoread) secread = totaltoread - sofar; /* * If we are inside the buffer, the transfers are no longer * page aligned. Reduce the transfer size to avoid problems. * Such problems are definitely known to appear on FreeBSD. */ if ((sofar > 0) && (secread > (sectatonce - reduce))) secread = sectatonce - reduce; if (secread > 0) { if (firstread < 0) firstread = adjread; if ((thisread = cdda_read(p->d, buffer + sofar * CD_FRAMEWORDS, adjread, secread)) < secread) { if (thisread < 0) thisread = 0; /* * Uhhh... right. Make something up. But * don't make us seek backward! */ if (callback) (*callback) ((adjread + thisread) * CD_FRAMEWORDS, PARANOIA_CB_READERR); memset(buffer + (sofar + thisread) * CD_FRAMEWORDS, 0, CD_FRAMESIZE_RAW * (secread - thisread)); if (flags) memset(flags + (sofar + thisread) * CD_FRAMEWORDS, 2, CD_FRAMEWORDS * (secread - thisread)); } if (thisread != 0) anyflag = 1; if (flags && sofar != 0) { /* * Don't verify across overlaps that are too * close to one another */ int i = 0; for (i = -MIN_WORDS_OVERLAP / 2; i < MIN_WORDS_OVERLAP / 2; i++) flags[sofar * CD_FRAMEWORDS + i] |= 1; } p->lastread = adjread + secread; if (adjread + secread - 1 == p->current_lastsector) new->lastsector = -1; if (callback) (*callback) ((adjread + secread - 1) * CD_FRAMEWORDS, PARANOIA_CB_READ); sofar += secread; readat = adjread + secread; } else if (readat < p->current_firstsector) { readat += sectatonce; /* * due to being before the * readable area */ } else { break; /* due to being past the readable area */ } } if (anyflag) { new->vector = _pmalloc(totaltoread * CD_FRAMESIZE_RAW); memcpy(new->vector, buffer, totaltoread * CD_FRAMESIZE_RAW); _pfree(bufbase); new->begin = firstread * CD_FRAMEWORDS - p->dyndrift; new->size = sofar * CD_FRAMEWORDS; new->flags = flags; } else { if (new) free_c_block(new); if (bufbase) _pfree(bufbase); if (flags) _pfree(flags); new = NULL; bufbase = NULL; flags = NULL; } return (new); } /* * The returned buffer is *not* to be freed by the caller. It will * persist only until the next call to paranoia_read() for this p */ Int16_t *paranoia_read(cdrom_paranoia *p, void (*callback)(long, int)) { return (paranoia_read_limited(p, callback, 20)); } /* * I added max_retry functionality this way in order to avoid breaking any * old apps using the nerw libs. cdparanoia 9.8 will need the updated libs, * but nothing else will require it. */ Int16_t *paranoia_read_limited(cdrom_paranoia *p, void (*callback)(long, int), int max_retries) { long beginword = p->cursor * (CD_FRAMEWORDS); long endword = beginword + CD_FRAMEWORDS; long retry_count = 0; long lastend = -2; root_block *root = &p->root; if (beginword > p->root.returnedlimit) p->root.returnedlimit = beginword; lastend = re(root); /* * First, is the sector we want already in the root? */ while (rv(root) == NULL || rb(root) > beginword || (re(root) < endword + p->maxdynoverlap && p->enable & (PARANOIA_MODE_VERIFY | PARANOIA_MODE_OVERLAP)) || re(root) < endword) { /* * Nope; we need to build or extend the root verified range */ if (p->enable & (PARANOIA_MODE_VERIFY | PARANOIA_MODE_OVERLAP)) { i_paranoia_trim(p, beginword, endword); recover_cache(p); if (rb(root) != -1 && p->root.lastsector) i_end_case(p, endword + p->maxdynoverlap, callback); else i_stage2(p, beginword, endword + p->maxdynoverlap, callback); } else i_end_case(p, endword + p->maxdynoverlap, callback); /* only trips if we're already */ /* done */ if (!(rb(root) == -1 || rb(root) > beginword || re(root) < endword + p->maxdynoverlap)) break; /* * Hmm, need more. Read another block */ { c_block *new = i_read_c_block(p, beginword, endword, callback); if (new) { if (p->enable & (PARANOIA_MODE_OVERLAP | PARANOIA_MODE_VERIFY)) { if (p->enable & PARANOIA_MODE_VERIFY) i_stage1(p, new, callback); else { /* * just make v_fragments from the * boundary information. */ long begin = 0, end = 0; while (begin < cs(new)) { while (end < cs(new) && (new->flags[begin] & 1)) begin++; end = begin + 1; while (end < cs(new) && (new->flags[end] & 1) == 0) end++; { new_v_fragment(p, new, begin + cb(new), end + cb(new), (new->lastsector && cb(new) + end == ce(new))); } begin = end; } } } else { if (p->root.vector) i_cblock_destructor(p->root.vector); free_elem(new->e, 0); p->root.vector = new; i_end_case(p, endword + p->maxdynoverlap, callback); } } } /* * Are we doing lots of retries? ********************** * * Check unaddressable sectors first. There's no backoff * here; jiggle and minimum backseek handle that for us */ if (rb(root) != -1 && lastend + 588 < re(root)) { /* * If we've not grown half a sector */ lastend = re(root); retry_count = 0; } else { /* * increase overlap or bail */ retry_count++; /* * The better way to do this is to look at how many * actual matches we're getting and what kind of gap */ if (retry_count % 5 == 0) { if (p->dynoverlap == p->maxdynoverlap || retry_count == max_retries) { verify_skip_case(p, callback); retry_count = 0; } else { if (p->stage1.offpoints != -1) { /* hack */ p->dynoverlap *= 1.5; if (p->dynoverlap > p->maxdynoverlap) p->dynoverlap = p->maxdynoverlap; if (callback) (*callback) (p->dynoverlap, PARANOIA_CB_OVERLAP); } } } } } p->cursor++; return (rv(root) + (beginword - rb(root))); } /* * a temporary hack */ void paranoia_overlapset(cdrom_paranoia *p, long overlap) { p->dynoverlap = overlap * CD_FRAMEWORDS; p->stage1.offpoints = -1; } cdrkit-1.1.11/libparanoia/overlapdef.txt0000644000372500001440000000051110471375025017276 0ustar steveusers# @(#)overlapdef.txt 1.1 98/08/19 J. Schilling from Monty (xiphmont@mit.edu) 0 70 100 A |----------|-----| B |-----|---------| 0 40 100 offset=-30 begin=30 end=100 0 70 100 A |----------|-----| B |-----|---------| 50 90 150 offset=20 begin=30 end=100 cdrkit-1.1.11/libparanoia/README.paranoia0000644000372500001440000000747610471375025017100 0ustar steveusers# @(#)README.paranoia 1.1 97/04/04 J. Schilling from Monty (xiphmont@mit.edu) README.paranoia Paranoia II: (c) Monty xiphmont@mit.edu Hi there. All CDROM drives are not created equal. You're probably using this patch because yours is a little less equal than others-- or maybe you just keep your CD collection in a box of full of gravel. Jewel cases are for wimps; you know what I'm talking about. This patch adds extra-robust interframe syncronization, code to detect scratches (and hold sync across the scratch) and finally routines to filter out scratches as best possible. These are all handled automatically by fairly modular code. 1) extra interframe syncronization ------------------------------------- Some CD drives can read audio data from an exact starting point to an exact ending point flawlessly; these are rare. A larger number of drives read from only an approximately correct starting point, but do manage to get all the data in-tact from wherever they manage to begin the read. Stock cdda2wav is coded with this in mind. More drives, especially IDE-like and recent ATAPI drives, suffer from framing misalignments within atomic multi-sector read operations. Cdda2wav is also set, by default, to read 75 sectors at a time from ATAPI drives, which Linux's IDE driver breaks into multiple 8 sector reads to conserve kernel memory. Both of these things will break cdda2wav; the symptoms include cracks or pops within the read sample. The "Paranoia" patch will verify the alignment of *every* byte read by cdda2wav. The goal is data integrity, not performance: a minimum 50% speed hit will result from the patch, likely more if your CDROM suffers from the framing bugs the patch corrects. 2) scratch detection and tolerance ------------------------------------ Because overlap syncronization requires matching exact, perfect sample sections, scratched CDs typically cause normal cdda2wav to bail when overlap syncronization is turned on. The second part of the "Paranoia" patch ignores scratches in the read bitstream and syncronizes using the data that can still be "trusted". This step also collects first-pass scratch detection information used by the third section of the patch. Expect performance to drop through the floor on a badly scratched CD; the code can no longer use a simple case of exact matching for speedy correlation. Maintaining solid sync across a scratch is processor bound; later I'll add speedier algorithms for correlation than the brute force method currently used. Scratch detection imposes little additional overhead on a non-scratched CD. 3) scratch repair ----------------------------------------------------- Scratches are an irrevocable loss of data. Still, it's usually possible to reconstruct a sample closer to the original data than the raw hissing, fluttering and crackling that severe scratches in the CD surface produce. Scratch filtering is the 'hard part' of this patch. It needs to do two things; first, find the 'pops' that escaped detection in section 2 of the patch and secondly fill in the gaps. Both are acheived using delta (slew) averaging and forward and backward linear predictive interpolation (with IIR filters) to fill in known gaps as well as look for 'problem values' in stretches of sample known to be scratched. THE SCRATCH DETECTION IS NOT PERFECT. Nor is the repair perfect, although it is easier than detecting scratches reliably. Both are cases of coming arbitrarily close to perfection; Paranoia is designed with light to moderate damage in mind, but will still recover a listenable sample from heavy damage. Paranoia still has quite a bit of room for improvement in the scratch repair code... If cdda2wav + Paranoia is not doing an acceptable job on CDs that you just gotta have, drop me a line; I didn't want to sink months into a project I wasn't certain anyone would ever use :-) Monty cdrkit-1.1.11/libparanoia/gap.h0000644000372500001440000000307610513514665015341 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)gap.h 1.10 04/02/18 J. Schilling from cdparanoia-III-alpha9.8 */ /* * Modifications to make the code portable Copyright (c) 2002 J. Schilling */ /* * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Monty (xiphmont@mit.edu) */ #ifndef _GAP_H_ #define _GAP_H_ extern long i_paranoia_overlap_r(Int16_t * buffA, Int16_t * buffB, long offsetA, long offsetB); extern long i_paranoia_overlap_f(Int16_t * buffA, Int16_t * buffB, long offsetA, long offsetB, long sizeA, long sizeB); extern int i_stutter_or_gap(Int16_t * A, Int16_t * B, long offA, long offB, long gap); extern void i_analyze_rift_f(Int16_t * A, Int16_t * B, long sizeA, long sizeB, long aoffset, long boffset, long *matchA, long *matchB, long *matchC); extern void i_analyze_rift_r(Int16_t * A, Int16_t * B, long sizeA, long sizeB, long aoffset, long boffset, long *matchA, long *matchB, long *matchC); extern void analyze_rift_silence_f(Int16_t * A, Int16_t * B, long sizeA, long sizeB, long aoffset, long boffset, long *matchA, long *matchB); #endif cdrkit-1.1.11/libparanoia/gap.c0000644000372500001440000001354010536265343015332 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)gap.c 1.12 04/02/18 J. Schilling from cdparanoia-III-alpha9.8 */ /* * Modifications to make the code portable Copyright (c) 2002 J. Schilling */ /* * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Monty (xiphmont@mit.edu) * * Gapa analysis support code for paranoia * */ #include #include #include #include #include "p_block.h" #include "cdda_paranoia.h" #include "gap.h" long i_paranoia_overlap_r(Int16_t * buffA, Int16_t * buffB, long offsetA, long offsetB); long i_paranoia_overlap_f(Int16_t * buffA, Int16_t * buffB, long offsetA, long offsetB, long sizeA, long sizeB); int i_stutter_or_gap(Int16_t * A, Int16_t * B, long offA, long offB, long gap); void i_analyze_rift_f(Int16_t * A, Int16_t * B, long sizeA, long sizeB, long aoffset, long boffset, long *matchA, long *matchB, long *matchC); void i_analyze_rift_r(Int16_t * A, Int16_t * B, long sizeA, long sizeB, long aoffset, long boffset, long *matchA, long *matchB, long *matchC); void analyze_rift_silence_f(Int16_t * A, Int16_t * B, long sizeA, long sizeB, long aoffset, long boffset, long *matchA, long *matchB); /* * Gap analysis code */ long i_paranoia_overlap_r(Int16_t *buffA, Int16_t *buffB, long offsetA, long offsetB) { long beginA = offsetA; long beginB = offsetB; for (; beginA >= 0 && beginB >= 0; beginA--, beginB--) if (buffA[beginA] != buffB[beginB]) break; beginA++; beginB++; return (offsetA - beginA); } long i_paranoia_overlap_f(Int16_t *buffA, Int16_t *buffB, long offsetA, long offsetB, long sizeA, long sizeB) { long endA = offsetA; long endB = offsetB; for (; endA < sizeA && endB < sizeB; endA++, endB++) if (buffA[endA] != buffB[endB]) break; return (endA - offsetA); } int i_stutter_or_gap(Int16_t *A, Int16_t *B, long offA, long offB, long gap) { long a1 = offA; long b1 = offB; if (a1 < 0) { b1 -= a1; gap += a1; a1 = 0; } return (memcmp(A + a1, B + b1, gap * 2)); } /* * riftv is the first value into the rift -> or <- */ void i_analyze_rift_f(Int16_t *A, Int16_t *B, long sizeA, long sizeB, long aoffset, long boffset, long *matchA, long *matchB, long *matchC) { long apast = sizeA - aoffset; long bpast = sizeB - boffset; long i; *matchA = 0, *matchB = 0, *matchC = 0; /* * Look for three possible matches... (A) Ariftv->B, * (B) Briftv->A and (c) AB->AB. */ for (i = 0; ; i++) { if (i < bpast) /* A */ if (i_paranoia_overlap_f(A, B, aoffset, boffset + i, sizeA, sizeB) >= MIN_WORDS_RIFT) { *matchA = i; break; } if (i < apast) { /* B */ if (i_paranoia_overlap_f(A, B, aoffset + i, boffset, sizeA, sizeB) >= MIN_WORDS_RIFT) { *matchB = i; break; } if (i < bpast) /* C */ if (i_paranoia_overlap_f(A, B, aoffset + i, boffset + i, sizeA, sizeB) >= MIN_WORDS_RIFT) { *matchC = i; break; } } else if (i >= bpast) break; } if (*matchA == 0 && *matchB == 0 && *matchC == 0) return; if (*matchC) return; if (*matchA) { if (i_stutter_or_gap(A, B, aoffset - *matchA, boffset, *matchA)) return; *matchB = -*matchA; /* signify we need to remove n bytes */ /* from B */ *matchA = 0; return; } else { if (i_stutter_or_gap(B, A, boffset - *matchB, aoffset, *matchB)) return; *matchA = -*matchB; *matchB = 0; return; } } /* * riftv must be first even val of rift moving back */ void i_analyze_rift_r(Int16_t *A, Int16_t *B, long sizeA, long sizeB, long aoffset, long boffset, long *matchA, long *matchB, long *matchC) { long apast = aoffset + 1; long bpast = boffset + 1; long i; *matchA = 0, *matchB = 0, *matchC = 0; /* * Look for three possible matches... (A) Ariftv->B, (B) Briftv->A and * (c) AB->AB. */ for (i = 0; ; i++) { if (i < bpast) /* A */ if (i_paranoia_overlap_r(A, B, aoffset, boffset - i) >= MIN_WORDS_RIFT) { *matchA = i; break; } if (i < apast) { /* B */ if (i_paranoia_overlap_r(A, B, aoffset - i, boffset) >= MIN_WORDS_RIFT) { *matchB = i; break; } if (i < bpast) /* C */ if (i_paranoia_overlap_r(A, B, aoffset - i, boffset - i) >= MIN_WORDS_RIFT) { *matchC = i; break; } } else if (i >= bpast) break; } if (*matchA == 0 && *matchB == 0 && *matchC == 0) return; if (*matchC) return; if (*matchA) { if (i_stutter_or_gap(A, B, aoffset + 1, boffset - *matchA + 1, *matchA)) return; *matchB = -*matchA; /* signify we need to remove n bytes */ /* from B */ *matchA = 0; return; } else { if (i_stutter_or_gap(B, A, boffset + 1, aoffset - *matchB + 1, *matchB)) return; *matchA = -*matchB; *matchB = 0; return; } } void analyze_rift_silence_f(Int16_t *A, Int16_t *B, long sizeA, long sizeB, long aoffset, long boffset, long *matchA, long *matchB) { *matchA = -1; *matchB = -1; sizeA = min(sizeA, aoffset + MIN_WORDS_RIFT); sizeB = min(sizeB, boffset + MIN_WORDS_RIFT); aoffset++; boffset++; while (aoffset < sizeA) { if (A[aoffset] != A[aoffset - 1]) { *matchA = 0; break; } aoffset++; } while (boffset < sizeB) { if (B[boffset] != B[boffset - 1]) { *matchB = 0; break; } boffset++; } } cdrkit-1.1.11/libunls/0000755000372500001440000000000011456674330013605 5ustar steveuserscdrkit-1.1.11/libunls/nls_cp775.c0000644000372500001440000004436110536265343015500 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp775.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp775.c * * Charset cp775 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x06, 0x01}, {0xfc, 0x00}, {0xe9, 0x00}, {0x01, 0x01}, {0xe4, 0x00}, {0x23, 0x01}, {0xe5, 0x00}, {0x07, 0x01}, {0x42, 0x01}, {0x13, 0x01}, {0x56, 0x01}, {0x57, 0x01}, {0x2b, 0x01}, {0x79, 0x01}, {0xc4, 0x00}, {0xc5, 0x00}, /* 0x90*/ {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0x4d, 0x01}, {0xf6, 0x00}, {0x22, 0x01}, {0xa2, 0x00}, {0x5a, 0x01}, {0x5b, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00}, {0xa3, 0x00}, {0xd8, 0x00}, {0xd7, 0x00}, {0xa4, 0x00}, /* 0xa0*/ {0x00, 0x01}, {0x2a, 0x01}, {0xf3, 0x00}, {0x7b, 0x01}, {0x7c, 0x01}, {0x7a, 0x01}, {0x1d, 0x20}, {0xa6, 0x00}, {0xa9, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00}, {0xbc, 0x00}, {0x41, 0x01}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x04, 0x01}, {0x0c, 0x01}, {0x18, 0x01}, {0x16, 0x01}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x2e, 0x01}, {0x60, 0x01}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x72, 0x01}, {0x6a, 0x01}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x7d, 0x01}, /* 0xd0*/ {0x05, 0x01}, {0x0d, 0x01}, {0x19, 0x01}, {0x17, 0x01}, {0x2f, 0x01}, {0x61, 0x01}, {0x73, 0x01}, {0x6b, 0x01}, {0x7e, 0x01}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, /* 0xe0*/ {0xd3, 0x00}, {0xdf, 0x00}, {0x4c, 0x01}, {0x43, 0x01}, {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0x44, 0x01}, {0x36, 0x01}, {0x37, 0x01}, {0x3b, 0x01}, {0x3c, 0x01}, {0x46, 0x01}, {0x12, 0x01}, {0x45, 0x01}, {0x19, 0x20}, /* 0xf0*/ {0xad, 0x00}, {0xb1, 0x00}, {0x1c, 0x20}, {0xbe, 0x00}, {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0x1e, 0x20}, {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0xb9, 0x00}, {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0x00, 0x96, 0x9c, 0x9f, 0x00, 0xa7, 0xf5, /* 0xa0-0xa7 */ 0x00, 0xa8, 0x00, 0xae, 0xaa, 0xf0, 0xa9, 0x00, /* 0xa8-0xaf */ 0xf8, 0xf1, 0xfd, 0xfc, 0x00, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */ 0x00, 0xfb, 0x00, 0xaf, 0xac, 0xab, 0xf3, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x00, /* 0xc0-0xc7 */ 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0xe0, 0x00, 0xe5, 0x99, 0x9e, /* 0xd0-0xd7 */ 0x9d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x84, 0x86, 0x91, 0x00, /* 0xe0-0xe7 */ 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0xa2, 0x00, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */ 0x9b, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0xa0, 0x83, 0x00, 0x00, 0xb5, 0xd0, 0x80, 0x87, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd1, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0xed, 0x89, 0x00, 0x00, 0xb8, 0xd3, /* 0x10-0x17 */ 0xb7, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x95, 0x85, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0xa1, 0x8c, 0x00, 0x00, 0xbd, 0xd4, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xe9, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0xea, 0xeb, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0xad, 0x88, 0xe3, 0xe7, 0xee, 0xec, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0xe2, 0x93, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x8b, /* 0x50-0x57 */ 0x00, 0x00, 0x97, 0x98, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xbe, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0xc7, 0xd7, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0xc6, 0xd6, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x8d, 0xa5, 0xa3, 0xa4, 0xcf, 0xd8, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0xef, 0x00, 0x00, 0xf2, 0xa6, 0xf7, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, page22, NULL, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x8a, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x00, 0x00, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0x00, 0xa3, 0x00, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */ 0xe8, 0x00, 0xea, 0x00, 0x00, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp775", page_uni2charset, charset2uni, NULL }; int init_unls_cp775() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls.h0000644000372500001440000000771710513514665014563 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls.h 1.7 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * Thanks to Georgy Salnikov * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _NLS_H #define _NLS_H #include #ifndef NULL #define NULL ((void *)0) #endif #define MOD_INC_USE_COUNT #define MOD_DEC_USE_COUNT #define CONFIG_NLS_CODEPAGE_437 #define CONFIG_NLS_CODEPAGE_737 #define CONFIG_NLS_CODEPAGE_775 #define CONFIG_NLS_CODEPAGE_850 #define CONFIG_NLS_CODEPAGE_852 #define CONFIG_NLS_CODEPAGE_855 #define CONFIG_NLS_CODEPAGE_857 #define CONFIG_NLS_CODEPAGE_860 #define CONFIG_NLS_CODEPAGE_861 #define CONFIG_NLS_CODEPAGE_862 #define CONFIG_NLS_CODEPAGE_863 #define CONFIG_NLS_CODEPAGE_864 #define CONFIG_NLS_CODEPAGE_865 #define CONFIG_NLS_CODEPAGE_866 #define CONFIG_NLS_CODEPAGE_869 #define CONFIG_NLS_CODEPAGE_874 #define CONFIG_NLS_CODEPAGE_1250 #define CONFIG_NLS_CODEPAGE_1251 #define CONFIG_NLS_ISO8859_1 #define CONFIG_NLS_ISO8859_2 #define CONFIG_NLS_ISO8859_3 #define CONFIG_NLS_ISO8859_4 #define CONFIG_NLS_ISO8859_5 #define CONFIG_NLS_ISO8859_6 #define CONFIG_NLS_ISO8859_7 #define CONFIG_NLS_ISO8859_8 #define CONFIG_NLS_ISO8859_9 #define CONFIG_NLS_ISO8859_14 #define CONFIG_NLS_ISO8859_15 #define CONFIG_NLS_KOI8_R #define CONFIG_NLS_KOI8_U #define CONFIG_NLS_CODEPAGE_10000 #define CONFIG_NLS_CODEPAGE_10006 #define CONFIG_NLS_CODEPAGE_10007 #define CONFIG_NLS_CODEPAGE_10029 #define CONFIG_NLS_CODEPAGE_10079 #define CONFIG_NLS_CODEPAGE_10081 extern int init_unls_iso8859_1(void); extern int init_unls_iso8859_2(void); extern int init_unls_iso8859_3(void); extern int init_unls_iso8859_4(void); extern int init_unls_iso8859_5(void); extern int init_unls_iso8859_6(void); extern int init_unls_iso8859_7(void); extern int init_unls_iso8859_8(void); extern int init_unls_iso8859_9(void); extern int init_unls_iso8859_14(void); extern int init_unls_iso8859_15(void); extern int init_unls_cp437(void); extern int init_unls_cp737(void); extern int init_unls_cp775(void); extern int init_unls_cp850(void); extern int init_unls_cp852(void); extern int init_unls_cp855(void); extern int init_unls_cp857(void); extern int init_unls_cp860(void); extern int init_unls_cp861(void); extern int init_unls_cp862(void); extern int init_unls_cp863(void); extern int init_unls_cp864(void); extern int init_unls_cp865(void); extern int init_unls_cp866(void); extern int init_unls_cp869(void); extern int init_unls_cp874(void); extern int init_unls_cp1250(void); extern int init_unls_cp1251(void); extern int init_unls_koi8_r(void); extern int init_unls_koi8_u(void); extern int init_unls_cp10000(void); extern int init_unls_cp10006(void); extern int init_unls_cp10007(void); extern int init_unls_cp10029(void); extern int init_unls_cp10079(void); extern int init_unls_cp10081(void); extern int init_unls_file(char *name); #ifdef USE_ICONV extern int init_nls_iconv(char *name); #endif #endif /* _NLS_H */ cdrkit-1.1.11/libunls/nls_cp863.c0000644000372500001440000005460510536265343015500 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp863.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp863.c * * Charset cp863 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, {0xc2, 0x00}, {0xe0, 0x00}, {0xb6, 0x00}, {0xe7, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00}, {0xee, 0x00}, {0x17, 0x20}, {0xc0, 0x00}, {0xa7, 0x00}, /* 0x90*/ {0xc9, 0x00}, {0xc8, 0x00}, {0xca, 0x00}, {0xf4, 0x00}, {0xcb, 0x00}, {0xcf, 0x00}, {0xfb, 0x00}, {0xf9, 0x00}, {0xa4, 0x00}, {0xd4, 0x00}, {0xdc, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xd9, 0x00}, {0xdb, 0x00}, {0x92, 0x01}, /* 0xa0*/ {0xa6, 0x00}, {0xb4, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, {0xa8, 0x00}, {0xb8, 0x00}, {0xb3, 0x00}, {0xaf, 0x00}, {0xce, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00}, {0xbc, 0x00}, {0xbe, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, /* 0xd0*/ {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, /* 0xe0*/ {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, /* 0xf0*/ {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0x00, 0x9b, 0x9c, 0x98, 0x00, 0xa0, 0x8f, /* 0xa0-0xa7 */ 0xa4, 0x00, 0x00, 0xae, 0xaa, 0x00, 0x00, 0xa7, /* 0xa8-0xaf */ 0xf8, 0xf1, 0xfd, 0xa6, 0xa1, 0xe6, 0x86, 0xfa, /* 0xb0-0xb7 */ 0xa5, 0x00, 0x00, 0xaf, 0xac, 0xab, 0xad, 0x00, /* 0xb8-0xbf */ 0x8e, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */ 0x91, 0x90, 0x92, 0x94, 0x00, 0x00, 0xa8, 0x95, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x9d, 0x00, 0x9e, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ 0x85, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */ 0x8a, 0x82, 0x88, 0x89, 0x00, 0x00, 0x8c, 0x8b, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */ 0x00, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page23[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, page22, page23, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x00, 0x00, 0x84, 0x00, 0x86, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x00, 0x94, 0x95, 0x00, 0x00, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ 0xa0, 0xa1, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp863", page_uni2charset, charset2uni, NULL }; int init_unls_cp863() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp737.c0000644000372500001440000004436110536265343015476 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp737.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp737.c * * Charset cp737 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, {0x94, 0x03}, {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, {0x98, 0x03}, {0x99, 0x03}, {0x9a, 0x03}, {0x9b, 0x03}, {0x9c, 0x03}, {0x9d, 0x03}, {0x9e, 0x03}, {0x9f, 0x03}, {0xa0, 0x03}, /* 0x90*/ {0xa1, 0x03}, {0xa3, 0x03}, {0xa4, 0x03}, {0xa5, 0x03}, {0xa6, 0x03}, {0xa7, 0x03}, {0xa8, 0x03}, {0xa9, 0x03}, {0xb1, 0x03}, {0xb2, 0x03}, {0xb3, 0x03}, {0xb4, 0x03}, {0xb5, 0x03}, {0xb6, 0x03}, {0xb7, 0x03}, {0xb8, 0x03}, /* 0xa0*/ {0xb9, 0x03}, {0xba, 0x03}, {0xbb, 0x03}, {0xbc, 0x03}, {0xbd, 0x03}, {0xbe, 0x03}, {0xbf, 0x03}, {0xc0, 0x03}, {0xc1, 0x03}, {0xc3, 0x03}, {0xc2, 0x03}, {0xc4, 0x03}, {0xc5, 0x03}, {0xc6, 0x03}, {0xc7, 0x03}, {0xc8, 0x03}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, /* 0xd0*/ {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, /* 0xe0*/ {0xc9, 0x03}, {0xac, 0x03}, {0xad, 0x03}, {0xae, 0x03}, {0xca, 0x03}, {0xaf, 0x03}, {0xcc, 0x03}, {0xcd, 0x03}, {0xcb, 0x03}, {0xce, 0x03}, {0x86, 0x03}, {0x88, 0x03}, {0x89, 0x03}, {0x8a, 0x03}, {0x8c, 0x03}, {0x8e, 0x03}, /* 0xf0*/ {0x8f, 0x03}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, {0xaa, 0x03}, {0xab, 0x03}, {0xf7, 0x00}, {0x48, 0x22}, {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, /* 0x80-0x87 */ 0xeb, 0xec, 0xed, 0x00, 0xee, 0x00, 0xef, 0xf0, /* 0x88-0x8f */ 0x00, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, /* 0x90-0x97 */ 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, /* 0x98-0x9f */ 0x8f, 0x90, 0x00, 0x91, 0x92, 0x93, 0x94, 0x95, /* 0xa0-0xa7 */ 0x96, 0x97, 0xf4, 0xf5, 0xe1, 0xe2, 0xe3, 0xe5, /* 0xa8-0xaf */ 0x00, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, /* 0xb0-0xb7 */ 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, /* 0xb8-0xbf */ 0xa7, 0xa8, 0xaa, 0xa9, 0xab, 0xac, 0xad, 0xae, /* 0xc0-0xc7 */ 0xaf, 0xe0, 0xe4, 0xe8, 0xe6, 0xe7, 0xe9, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, page22, NULL, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp737", page_uni2charset, charset2uni, NULL }; int init_unls_cp737() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp850.c0000644000372500001440000004024710536265343015471 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp850.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp850.c * * Charset cp850 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00}, {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, /* 0x90*/ {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00}, {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00}, {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00}, {0xa3, 0x00}, {0xd8, 0x00}, {0xd7, 0x00}, {0x92, 0x01}, /* 0xa0*/ {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00}, {0xbf, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00}, {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc0, 0x00}, {0xa9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0xa2, 0x00}, {0xa5, 0x00}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0xe3, 0x00}, {0xc3, 0x00}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00}, /* 0xd0*/ {0xf0, 0x00}, {0xd0, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, {0xc8, 0x00}, {0x31, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0xa6, 0x00}, {0xcc, 0x00}, {0x80, 0x25}, /* 0xe0*/ {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0xd2, 0x00}, {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0xfe, 0x00}, {0xde, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00}, {0xfd, 0x00}, {0xdd, 0x00}, {0xaf, 0x00}, {0xb4, 0x00}, /* 0xf0*/ {0xad, 0x00}, {0xb1, 0x00}, {0x17, 0x20}, {0xbe, 0x00}, {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00}, {0xb0, 0x00}, {0xa8, 0x00}, {0xb7, 0x00}, {0xb9, 0x00}, {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0xad, 0xbd, 0x9c, 0xcf, 0xbe, 0xdd, 0xf5, /* 0xa0-0xa7 */ 0xf9, 0xb8, 0xa6, 0xae, 0xaa, 0xf0, 0xa9, 0xee, /* 0xa8-0xaf */ 0xf8, 0xf1, 0xfd, 0xfc, 0xef, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */ 0xf7, 0xfb, 0xa7, 0xaf, 0xac, 0xab, 0xf3, 0xa8, /* 0xb8-0xbf */ 0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */ 0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, /* 0xc8-0xcf */ 0xd1, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0x9e, /* 0xd0-0xd7 */ 0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0xed, 0xe8, 0xe1, /* 0xd8-0xdf */ 0x85, 0xa0, 0x83, 0xc6, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */ 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */ 0xd0, 0xa4, 0x95, 0xa2, 0x93, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */ 0x9b, 0x97, 0xa3, 0x96, 0x81, 0xec, 0xe7, 0x98, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, NULL, NULL, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp850", page_uni2charset, charset2uni, NULL }; int init_unls_cp850() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_koi8-r.c0000644000372500001440000004436610536265343015751 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_koi8-r.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_koi8-r.c * * Charset koi8-r translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x25}, {0x02, 0x25}, {0x0c, 0x25}, {0x10, 0x25}, {0x14, 0x25}, {0x18, 0x25}, {0x1c, 0x25}, {0x24, 0x25}, {0x2c, 0x25}, {0x34, 0x25}, {0x3c, 0x25}, {0x80, 0x25}, {0x84, 0x25}, {0x88, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, /* 0x90*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x20, 0x23}, {0xa0, 0x25}, {0x19, 0x22}, {0x1a, 0x22}, {0x48, 0x22}, {0x64, 0x22}, {0x65, 0x22}, {0xa0, 0x00}, {0x21, 0x23}, {0xb0, 0x00}, {0xb2, 0x00}, {0xb7, 0x00}, {0xf7, 0x00}, /* 0xa0*/ {0x50, 0x25}, {0x51, 0x25}, {0x52, 0x25}, {0x51, 0x04}, {0x53, 0x25}, {0x54, 0x25}, {0x55, 0x25}, {0x56, 0x25}, {0x57, 0x25}, {0x58, 0x25}, {0x59, 0x25}, {0x5a, 0x25}, {0x5b, 0x25}, {0x5c, 0x25}, {0x5d, 0x25}, {0x5e, 0x25}, /* 0xb0*/ {0x5f, 0x25}, {0x60, 0x25}, {0x61, 0x25}, {0x01, 0x04}, {0x62, 0x25}, {0x63, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x66, 0x25}, {0x67, 0x25}, {0x68, 0x25}, {0x69, 0x25}, {0x6a, 0x25}, {0x6b, 0x25}, {0x6c, 0x25}, {0xa9, 0x00}, /* 0xc0*/ {0x4e, 0x04}, {0x30, 0x04}, {0x31, 0x04}, {0x46, 0x04}, {0x34, 0x04}, {0x35, 0x04}, {0x44, 0x04}, {0x33, 0x04}, {0x45, 0x04}, {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04}, {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, /* 0xd0*/ {0x3f, 0x04}, {0x4f, 0x04}, {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04}, {0x36, 0x04}, {0x32, 0x04}, {0x4c, 0x04}, {0x4b, 0x04}, {0x37, 0x04}, {0x48, 0x04}, {0x4d, 0x04}, {0x49, 0x04}, {0x47, 0x04}, {0x4a, 0x04}, /* 0xe0*/ {0x2e, 0x04}, {0x10, 0x04}, {0x11, 0x04}, {0x26, 0x04}, {0x14, 0x04}, {0x15, 0x04}, {0x24, 0x04}, {0x13, 0x04}, {0x25, 0x04}, {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04}, {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, /* 0xf0*/ {0x1f, 0x04}, {0x2f, 0x04}, {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04}, {0x16, 0x04}, {0x12, 0x04}, {0x2c, 0x04}, {0x2b, 0x04}, {0x17, 0x04}, {0x28, 0x04}, {0x2d, 0x04}, {0x29, 0x04}, {0x27, 0x04}, {0x2a, 0x04}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x9c, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page04[256] = { 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */ 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, /* 0x18-0x1f */ 0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, /* 0x20-0x27 */ 0xfb, 0xfd, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1, /* 0x28-0x2f */ 0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda, /* 0x30-0x37 */ 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, /* 0x38-0x3f */ 0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, /* 0x40-0x47 */ 0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1, /* 0x48-0x4f */ 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x95, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x98, 0x99, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page23[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x93, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x85, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xa0, 0xa1, 0xa2, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, /* 0x50-0x57 */ 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, /* 0x58-0x5f */ 0xb1, 0xb2, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, /* 0x60-0x67 */ 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x8b, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x8d, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x8f, 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page22, page23, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "koi8-r", page_uni2charset, charset2uni, NULL }; int init_unls_koi8_r() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_iso8859-8.c0000644000372500001440000003416110536265343016125 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-8.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-8.c * * Charset iso8859-8 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0x00, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00}, {0xa8, 0x00}, {0xa9, 0x00}, {0xd7, 0x00}, {0xab, 0x00}, {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0x3e, 0x20}, /* 0xb0*/ {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00}, {0xb8, 0x00}, {0xb9, 0x00}, {0xf7, 0x00}, {0xbb, 0x00}, {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0x00, 0x00}, /* 0xc0*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xd0*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x17, 0x20}, /* 0xe0*/ {0xd0, 0x05}, {0xd1, 0x05}, {0xd2, 0x05}, {0xd3, 0x05}, {0xd4, 0x05}, {0xd5, 0x05}, {0xd6, 0x05}, {0xd7, 0x05}, {0xd8, 0x05}, {0xd9, 0x05}, {0xda, 0x05}, {0xdb, 0x05}, {0xdc, 0x05}, {0xdd, 0x05}, {0xde, 0x05}, {0xdf, 0x05}, /* 0xf0*/ {0xe0, 0x05}, {0xe1, 0x05}, {0xe2, 0x05}, {0xe3, 0x05}, {0xe4, 0x05}, {0xe5, 0x05}, {0xe6, 0x05}, {0xe7, 0x05}, {0xe8, 0x05}, {0xe9, 0x05}, {0xea, 0x05}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0xae, 0x00, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0x00, 0xbb, 0xbc, 0xbd, 0xbe, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page05[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xd0-0xd7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xd8-0xdf */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xe0-0xe7 */ 0xf8, 0xf9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, NULL, NULL, page05, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "iso8859-8", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_8() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_iconv.c0000644000372500001440000000524610536265343015750 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iconv.c 1.0 02/04/20 2002 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * nls_iconv: create a pseudo-charset table to use iconv() provided by C * library or libiconv by Bruno Haible * The Unicode to charset table has only exact mappings. * * * Jungshik Shin (jshin@mailaps.org) 04-Feb-2002 */ #ifdef USE_ICONV #include #include #include #include #include "nls.h" #include static void inc_use_count(void); static void dec_use_count(void); static void inc_use_count() { MOD_INC_USE_COUNT; } static void dec_use_count() { MOD_DEC_USE_COUNT; } int init_nls_iconv(char *charset) { iconv_t iconv_d; /* iconv conversion descriptor */ struct unls_table *table; /* give up if no charset is given */ if (charset == NULL) return -1; /* see if we already have a table with this name - built in tables have precedence over iconv() - i.e. can't have the name of an existing table. Also, we may have already registered this file table */ if (find_unls(charset) != NULL) return -1; if ((iconv_d = iconv_open("UCS-2BE", charset)) == (iconv_t) -1) return -1; /* set up the table */ if ((table = (struct unls_table *)malloc(sizeof (struct unls_table))) == NULL) { return -1; } /* give the table the file name, so we can find it again if needed */ table->unls_name = strdup(charset); table->unls_uni2cs = NULL; table->unls_cs2uni = NULL; table->unls_next = NULL; table->iconv_d = iconv_d; /* register the table */ return register_unls(table); } #endif cdrkit-1.1.11/libunls/nls_iso8859-1.c0000644000372500001440000002334110536265343016114 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-1.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-1.c * * Charset iso8859-1 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00}, {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00}, {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00}, /* 0xb0*/ {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00}, {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00}, {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00}, /* 0xc0*/ {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00}, {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, /* 0xd0*/ {0xd0, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00}, {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00}, {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xdc, 0x00}, {0xdd, 0x00}, {0xde, 0x00}, {0xdf, 0x00}, /* 0xe0*/ {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00}, {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00}, /* 0xf0*/ {0xf0, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00}, {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00}, {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, {0xfd, 0x00}, {0xfe, 0x00}, {0xff, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "iso8859-1", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_1() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_iso8859-3.c0000644000372500001440000003356510536265343016127 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-3.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-3.c * * Charset iso8859-3 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0x26, 0x01}, {0xd8, 0x02}, {0xa3, 0x00}, {0xa4, 0x00}, {0x00, 0x00}, {0x24, 0x01}, {0xa7, 0x00}, {0xa8, 0x00}, {0x30, 0x01}, {0x5e, 0x01}, {0x1e, 0x01}, {0x34, 0x01}, {0xad, 0x00}, {0x00, 0x00}, {0x7b, 0x01}, /* 0xb0*/ {0xb0, 0x00}, {0x27, 0x01}, {0xb2, 0x00}, {0xb3, 0x00}, {0xb4, 0x00}, {0xb5, 0x00}, {0x25, 0x01}, {0xb7, 0x00}, {0xb8, 0x00}, {0x31, 0x01}, {0x5f, 0x01}, {0x1f, 0x01}, {0x35, 0x01}, {0xbd, 0x00}, {0x00, 0x00}, {0x7c, 0x01}, /* 0xc0*/ {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0x00, 0x00}, {0xc4, 0x00}, {0x0a, 0x01}, {0x08, 0x01}, {0xc7, 0x00}, {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, /* 0xd0*/ {0x00, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00}, {0xd4, 0x00}, {0x20, 0x01}, {0xd6, 0x00}, {0xd7, 0x00}, {0x1c, 0x01}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xdc, 0x00}, {0x6c, 0x01}, {0x5c, 0x01}, {0xdf, 0x00}, /* 0xe0*/ {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0x00, 0x00}, {0xe4, 0x00}, {0x0b, 0x01}, {0x09, 0x01}, {0xe7, 0x00}, {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00}, /* 0xf0*/ {0x00, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00}, {0xf4, 0x00}, {0x21, 0x01}, {0xf6, 0x00}, {0xf7, 0x00}, {0x1d, 0x01}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, {0x6d, 0x01}, {0x5d, 0x01}, {0xd9, 0x02}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0x00, 0xa3, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ 0xb0, 0x00, 0xb2, 0xb3, 0xb4, 0xb5, 0x00, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0x00, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0xc6, 0xe6, 0xc5, 0xe5, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0xd8, 0xf8, 0xab, 0xbb, /* 0x18-0x1f */ 0xd5, 0xf5, 0x00, 0x00, 0xa6, 0xb6, 0xa1, 0xb1, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0xa9, 0xb9, 0x00, 0x00, 0xac, 0xbc, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0xde, 0xfe, 0xaa, 0xba, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0xdd, 0xfd, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0xaf, 0xbf, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page02[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0xa2, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, page02, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0x00, 0xb2, 0xb3, 0xb4, 0xb5, 0x00, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xbe, 0x00, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "iso8859-3", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_3() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_config.c0000644000372500001440000000711610536265343016075 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_config.c 1.5 05/05/01 2000,2001 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * This file contains code taken from nls_base.c to avoid loops * in dependency reported by tsort. * * Thanks to Georgy Salnikov * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "nls.h" int init_unls() { #ifdef CONFIG_NLS_ISO8859_1 init_unls_iso8859_1(); #endif #ifdef CONFIG_NLS_ISO8859_2 init_unls_iso8859_2(); #endif #ifdef CONFIG_NLS_ISO8859_3 init_unls_iso8859_3(); #endif #ifdef CONFIG_NLS_ISO8859_4 init_unls_iso8859_4(); #endif #ifdef CONFIG_NLS_ISO8859_5 init_unls_iso8859_5(); #endif #ifdef CONFIG_NLS_ISO8859_6 init_unls_iso8859_6(); #endif #ifdef CONFIG_NLS_ISO8859_7 init_unls_iso8859_7(); #endif #ifdef CONFIG_NLS_ISO8859_8 init_unls_iso8859_8(); #endif #ifdef CONFIG_NLS_ISO8859_9 init_unls_iso8859_9(); #endif #ifdef CONFIG_NLS_ISO8859_14 init_unls_iso8859_14(); #endif #ifdef CONFIG_NLS_ISO8859_15 init_unls_iso8859_15(); #endif #ifdef CONFIG_NLS_CODEPAGE_437 init_unls_cp437(); #endif #ifdef CONFIG_NLS_CODEPAGE_737 init_unls_cp737(); #endif #ifdef CONFIG_NLS_CODEPAGE_775 init_unls_cp775(); #endif #ifdef CONFIG_NLS_CODEPAGE_850 init_unls_cp850(); #endif #ifdef CONFIG_NLS_CODEPAGE_852 init_unls_cp852(); #endif #ifdef CONFIG_NLS_CODEPAGE_855 init_unls_cp855(); #endif #ifdef CONFIG_NLS_CODEPAGE_857 init_unls_cp857(); #endif #ifdef CONFIG_NLS_CODEPAGE_860 init_unls_cp860(); #endif #ifdef CONFIG_NLS_CODEPAGE_861 init_unls_cp861(); #endif #ifdef CONFIG_NLS_CODEPAGE_862 init_unls_cp862(); #endif #ifdef CONFIG_NLS_CODEPAGE_863 init_unls_cp863(); #endif #ifdef CONFIG_NLS_CODEPAGE_864 init_unls_cp864(); #endif #ifdef CONFIG_NLS_CODEPAGE_865 init_unls_cp865(); #endif #ifdef CONFIG_NLS_CODEPAGE_866 init_unls_cp866(); #endif #ifdef CONFIG_NLS_CODEPAGE_869 init_unls_cp869(); #endif #ifdef CONFIG_NLS_CODEPAGE_874 init_unls_cp874(); #endif #ifdef CONFIG_NLS_CODEPAGE_1250 init_unls_cp1250(); #endif #ifdef CONFIG_NLS_CODEPAGE_1251 init_unls_cp1251(); #endif #ifdef CONFIG_NLS_KOI8_R init_unls_koi8_r(); #endif #ifdef CONFIG_NLS_KOI8_U init_unls_koi8_u(); #endif #ifdef CONFIG_NLS_CODEPAGE_10000 init_unls_cp10000(); #endif #ifdef CONFIG_NLS_CODEPAGE_10006 init_unls_cp10006(); #endif #ifdef CONFIG_NLS_CODEPAGE_10007 init_unls_cp10007(); #endif #ifdef CONFIG_NLS_CODEPAGE_10029 init_unls_cp10029(); #endif #ifdef CONFIG_NLS_CODEPAGE_10079 init_unls_cp10079(); #endif #ifdef CONFIG_NLS_CODEPAGE_10081 init_unls_cp10081(); #endif return (0); } cdrkit-1.1.11/libunls/nls_cp10079.c0000644000372500001440000007460410536265343015641 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp10079.c 1.3 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code generated by James Pearson j.pearson@ge.ucl.ac.uk 17/8/2000 * based on a script by Gordon Chaffee */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp10079.c * * Charset cp10079 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x10*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x00, 0x00}, /* 0x80*/ {0xc4, 0x00}, {0xc5, 0x00}, {0xc7, 0x00}, {0xc9, 0x00}, {0xd1, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xe1, 0x00}, {0xe0, 0x00}, {0xe2, 0x00}, {0xe4, 0x00}, {0xe3, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, {0xe9, 0x00}, {0xe8, 0x00}, /* 0x90*/ {0xea, 0x00}, {0xeb, 0x00}, {0xed, 0x00}, {0xec, 0x00}, {0xee, 0x00}, {0xef, 0x00}, {0xf1, 0x00}, {0xf3, 0x00}, {0xf2, 0x00}, {0xf4, 0x00}, {0xf6, 0x00}, {0xf5, 0x00}, {0xfa, 0x00}, {0xf9, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, /* 0xa0*/ {0xdd, 0x00}, {0xb0, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xa7, 0x00}, {0x22, 0x20}, {0xb6, 0x00}, {0xdf, 0x00}, {0xae, 0x00}, {0xa9, 0x00}, {0x22, 0x21}, {0xb4, 0x00}, {0xa8, 0x00}, {0x60, 0x22}, {0xc6, 0x00}, {0xd8, 0x00}, /* 0xb0*/ {0x1e, 0x22}, {0xb1, 0x00}, {0x64, 0x22}, {0x65, 0x22}, {0xa5, 0x00}, {0xb5, 0x00}, {0x02, 0x22}, {0x11, 0x22}, {0x0f, 0x22}, {0xc0, 0x03}, {0x2b, 0x22}, {0xaa, 0x00}, {0xba, 0x00}, {0xa9, 0x03}, {0xe6, 0x00}, {0xf8, 0x00}, /* 0xc0*/ {0xbf, 0x00}, {0xa1, 0x00}, {0xac, 0x00}, {0x1a, 0x22}, {0x92, 0x01}, {0x48, 0x22}, {0x06, 0x22}, {0xab, 0x00}, {0xbb, 0x00}, {0x26, 0x20}, {0xa0, 0x00}, {0xc0, 0x00}, {0xc3, 0x00}, {0xd5, 0x00}, {0x52, 0x01}, {0x53, 0x01}, /* 0xd0*/ {0x13, 0x20}, {0x14, 0x20}, {0x1c, 0x20}, {0x1d, 0x20}, {0x18, 0x20}, {0x19, 0x20}, {0xf7, 0x00}, {0xca, 0x25}, {0xff, 0x00}, {0x78, 0x01}, {0x44, 0x20}, {0xac, 0x20}, {0xd0, 0x00}, {0xf0, 0x00}, {0xde, 0x00}, {0xfe, 0x00}, /* 0xe0*/ {0xfd, 0x00}, {0xb7, 0x00}, {0x1a, 0x20}, {0x1e, 0x20}, {0x30, 0x20}, {0xc2, 0x00}, {0xca, 0x00}, {0xc1, 0x00}, {0xcb, 0x00}, {0xc8, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, {0xcc, 0x00}, {0xd3, 0x00}, {0xd4, 0x00}, /* 0xf0*/ {0xff, 0xf8}, {0xd2, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00}, {0x31, 0x01}, {0xc6, 0x02}, {0xdc, 0x02}, {0xaf, 0x00}, {0xd8, 0x02}, {0xd9, 0x02}, {0xda, 0x02}, {0xb8, 0x00}, {0xdd, 0x02}, {0xdb, 0x02}, {0xc7, 0x02}, }; static unsigned char page00[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xca, 0xc1, 0xa2, 0xa3, 0x00, 0xb4, 0x00, 0xa4, /* 0xa0-0xa7 */ 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0x00, 0xa8, 0xf8, /* 0xa8-0xaf */ 0xa1, 0xb1, 0x00, 0x00, 0xab, 0xb5, 0xa6, 0xe1, /* 0xb0-0xb7 */ 0xfc, 0x00, 0xbc, 0xc8, 0x00, 0x00, 0x00, 0xc0, /* 0xb8-0xbf */ 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, /* 0xc0-0xc7 */ 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, /* 0xc8-0xcf */ 0xdc, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x00, /* 0xd0-0xd7 */ 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0xa0, 0xde, 0xa7, /* 0xd8-0xdf */ 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, /* 0xe0-0xe7 */ 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, /* 0xe8-0xef */ 0xdd, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, /* 0xf0-0xf7 */ 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xe0, 0xdf, 0xd8, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0xce, 0xcf, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page02[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xff, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0xf9, 0xfa, 0xfb, 0xfe, 0xf7, 0xfd, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xb9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0xe2, 0x00, 0xd2, 0xd3, 0xe3, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, /* 0x08-0x0f */ 0x00, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xb0, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char pagef8[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, page02, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, page21, page22, NULL, NULL, page25, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pagef8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x60-0x67 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x68-0x6f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x70-0x77 */ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0xe7, /* 0x80-0x87 */ 0xcb, 0xe5, 0x80, 0xcc, 0x81, 0x82, 0x83, 0xe9, /* 0x88-0x8f */ 0xe6, 0xe8, 0xea, 0xed, 0xeb, 0xec, 0x84, 0xee, /* 0x90-0x97 */ 0xf1, 0xef, 0x85, 0xcd, 0xf2, 0xf4, 0xf3, 0x86, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x53, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0x50, 0xba, 0xbb, 0xbc, 0xbd, 0xae, 0xaf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0x46, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd9, 0xd9, 0xda, 0xdb, 0xdc, 0xdc, 0xde, 0xde, /* 0xd8-0xdf */ 0xa0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0x49, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; static unsigned char charset2lower[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x40-0x47 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x48-0x4f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x50-0x57 */ 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x8a, 0x8c, 0x8d, 0x8e, 0x96, 0x9a, 0x9f, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xe0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xbe, 0xbf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0x00, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0x88, 0x8b, 0x9b, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd8, 0xda, 0xdb, 0xdd, 0xdd, 0xdf, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0x89, 0x90, 0x87, /* 0xe0-0xe7 */ 0x91, 0x8f, 0x92, 0x94, 0x95, 0x93, 0x97, 0x99, /* 0xe8-0xef */ 0xf0, 0x98, 0x9c, 0x9e, 0x9d, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp10079", page_uni2charset, charset2uni, NULL }; int init_unls_cp10079() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp852.c0000644000372500001440000004024710536265343015473 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp852.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp852.c * * Charset cp852 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, {0xe4, 0x00}, {0x6f, 0x01}, {0x07, 0x01}, {0xe7, 0x00}, {0x42, 0x01}, {0xeb, 0x00}, {0x50, 0x01}, {0x51, 0x01}, {0xee, 0x00}, {0x79, 0x01}, {0xc4, 0x00}, {0x06, 0x01}, /* 0x90*/ {0xc9, 0x00}, {0x39, 0x01}, {0x3a, 0x01}, {0xf4, 0x00}, {0xf6, 0x00}, {0x3d, 0x01}, {0x3e, 0x01}, {0x5a, 0x01}, {0x5b, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0x64, 0x01}, {0x65, 0x01}, {0x41, 0x01}, {0xd7, 0x00}, {0x0d, 0x01}, /* 0xa0*/ {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, {0x04, 0x01}, {0x05, 0x01}, {0x7d, 0x01}, {0x7e, 0x01}, {0x18, 0x01}, {0x19, 0x01}, {0xac, 0x00}, {0x7a, 0x01}, {0x0c, 0x01}, {0x5f, 0x01}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0x1a, 0x01}, {0x5e, 0x01}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x7b, 0x01}, {0x7c, 0x01}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x02, 0x01}, {0x03, 0x01}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00}, /* 0xd0*/ {0x11, 0x01}, {0x10, 0x01}, {0x0e, 0x01}, {0xcb, 0x00}, {0x0f, 0x01}, {0x47, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0x1b, 0x01}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x62, 0x01}, {0x6e, 0x01}, {0x80, 0x25}, /* 0xe0*/ {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0x43, 0x01}, {0x44, 0x01}, {0x48, 0x01}, {0x60, 0x01}, {0x61, 0x01}, {0x54, 0x01}, {0xda, 0x00}, {0x55, 0x01}, {0x70, 0x01}, {0xfd, 0x00}, {0xdd, 0x00}, {0x63, 0x01}, {0xb4, 0x00}, /* 0xf0*/ {0xad, 0x00}, {0xdd, 0x02}, {0xdb, 0x02}, {0xc7, 0x02}, {0xd8, 0x02}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00}, {0xb0, 0x00}, {0xa8, 0x00}, {0xd9, 0x02}, {0x71, 0x01}, {0x58, 0x01}, {0x59, 0x01}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0xf5, /* 0xa0-0xa7 */ 0xf9, 0x00, 0x00, 0xae, 0xaa, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */ 0xf8, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0xf7, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0xb5, 0xb6, 0x00, 0x8e, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */ 0x00, 0x90, 0x00, 0xd3, 0x00, 0xd6, 0xd7, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0xe0, 0xe2, 0x00, 0x99, 0x9e, /* 0xd0-0xd7 */ 0x00, 0x00, 0xe9, 0x00, 0x9a, 0xed, 0x00, 0xe1, /* 0xd8-0xdf */ 0x00, 0xa0, 0x83, 0x00, 0x84, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */ 0x00, 0x82, 0x00, 0x89, 0x00, 0xa1, 0x8c, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */ 0x00, 0x00, 0xa3, 0x00, 0x81, 0xec, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0xc6, 0xc7, 0xa4, 0xa5, 0x8f, 0x86, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xac, 0x9f, 0xd2, 0xd4, /* 0x08-0x0f */ 0xd1, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xa8, 0xa9, 0xb7, 0xd8, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x91, 0x92, 0x00, 0x00, 0x95, 0x96, 0x00, /* 0x38-0x3f */ 0x00, 0x9d, 0x88, 0xe3, 0xe4, 0x00, 0x00, 0xd5, /* 0x40-0x47 */ 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x8a, 0x8b, 0x00, 0x00, 0xe8, 0xea, 0x00, 0x00, /* 0x50-0x57 */ 0xfc, 0xfd, 0x97, 0x98, 0x00, 0x00, 0xb8, 0xad, /* 0x58-0x5f */ 0xe6, 0xe7, 0xdd, 0xee, 0x9b, 0x9c, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x85, /* 0x68-0x6f */ 0xeb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x8d, 0xab, 0xbd, 0xbe, 0xa6, 0xa7, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page02[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0xf4, 0xfa, 0x00, 0xf2, 0x00, 0xf1, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, page02, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x8a, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x00, 0x00, 0x00, 0x95, 0x00, 0x97, /* 0x90-0x97 */ 0x00, 0x99, 0x9a, 0x9b, 0x00, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0x00, /* 0xa0-0xa7 */ 0xa8, 0x00, 0xaa, 0x00, 0xac, 0x00, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0x00, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0x00, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0x00, 0xd1, 0xd2, 0xd3, 0x00, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0x00, 0xe2, 0xe3, 0x00, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0x00, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0x00, 0xfc, 0x00, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp852", page_uni2charset, charset2uni, NULL }; int init_unls_cp852() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_file.c0000644000372500001440000001175310536265343015551 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_file.c 1.3 05/05/01 2000 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * nls_file: create a charset table from a input table file * from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. * * Only reads single byte to word matches. * * James Pearson (j.pearson@ge.ucl.ac.uk) 16-Aug-2000 */ #include #include #include #include #include #include "nls.h" #define NUM 256 static void free_mem(struct unls_unicode *, unsigned char **); static void free_mem(struct unls_unicode *charset2uni, unsigned char **page_uni2charset) { int i; if (charset2uni) free(charset2uni); if (page_uni2charset) { for (i = 0; i < NUM; i++) { if (page_uni2charset[i]) { free(page_uni2charset[i]); } } free(page_uni2charset); } } int init_unls_file(char *filename) { FILE *fp; struct unls_unicode *charset2uni = NULL; unsigned char **page_uni2charset = NULL; char buf[1024]; char *p; unsigned int cp, uc; struct unls_table *table; int i, ok = 0; /* give up if no filename is given */ if (filename == NULL) return (-1); /* * see if we already have a table with this name - built in tables * have precedence of file tables - i.e. can't have the name of an * existing table. Also, we may have already registered this file table */ if (find_unls(filename) != NULL) return (-1); if ((fp = fopen(filename, "r")) == NULL) return (-1); /* allocate memory for the forward conversion table */ if ((charset2uni = (struct unls_unicode *) malloc(sizeof (struct unls_unicode) * NUM)) == NULL) { free_mem(charset2uni, page_uni2charset); return (-1); } /* any unknown character should be mapped to NULL */ memset(charset2uni, 0, sizeof (struct unls_unicode) * NUM); /* * some source files don't set the control characters 0x00 - 0x1f * so set these by default */ for (i = 0; i < 32; i++) { charset2uni[i].unls_low = i; } /* also set DELETE (0x7f) by default */ charset2uni[0x7f].unls_low = 0x7f; /* read each line of the file */ while (fgets(buf, sizeof (buf), fp) != NULL) { /* cut off any comments */ if ((p = strchr(buf, '#')) != NULL) *p = '\0'; /* look for two hex values */ if (sscanf(buf, "%x%x", &cp, &uc) == 2) { /* if they are not in range - fail */ if (cp > 0xff || uc > 0xffff) { continue; } /* set the Unicode value for the given code point */ charset2uni[cp].unls_low = uc & 0xff; charset2uni[cp].unls_high = (uc >> 8) & 0xff; /* make sure we find at least one pair ... */ ok = 1; } } fclose(fp); if (!ok) { /* we haven't found anything ... */ free_mem(charset2uni, page_uni2charset); return (-1); } /* allocate memory for the reverse table */ if ((page_uni2charset = (unsigned char **) malloc(sizeof (unsigned char *) * NUM)) == NULL) { free_mem(charset2uni, page_uni2charset); return (-1); } memset(page_uni2charset, 0, sizeof (unsigned char *) * NUM); /* loop through the forward table, setting the reverse value */ for (i = 0; i < NUM; i++) { uc = charset2uni[i].unls_high; cp = charset2uni[i].unls_low; /* if the page doesn't exist, create a page */ if (page_uni2charset[uc] == NULL) { if ((page_uni2charset[uc] = (unsigned char *) malloc(NUM)) == NULL) { free_mem(charset2uni, page_uni2charset); return (-1); } memset(page_uni2charset[uc], 0, NUM); } /* set the reverse point in the page */ page_uni2charset[uc][cp] = i; } /* set up the table */ if ((table = (struct unls_table *)malloc(sizeof (struct unls_table))) == NULL) { free_mem(charset2uni, page_uni2charset); return (-1); } /* give the table the file name, so we can find it again if needed */ table->unls_name = strdup(filename); table->unls_uni2cs = page_uni2charset; table->unls_cs2uni = charset2uni; table->unls_next = NULL; /* register the table */ return (register_unls(table)); } cdrkit-1.1.11/libunls/nls_cp864.c0000644000372500001440000005374010536265343015500 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp864.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp864.c * * Charset cp864 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x6a, 0x06}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xb0, 0x00}, {0xb7, 0x00}, {0x19, 0x22}, {0x1a, 0x22}, {0x92, 0x25}, {0x00, 0x25}, {0x02, 0x25}, {0x3c, 0x25}, {0x24, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x34, 0x25}, {0x10, 0x25}, {0x0c, 0x25}, {0x14, 0x25}, {0x18, 0x25}, /* 0x90*/ {0xb2, 0x03}, {0x1e, 0x22}, {0xc6, 0x03}, {0xb1, 0x00}, {0xbd, 0x00}, {0xbc, 0x00}, {0x48, 0x22}, {0xab, 0x00}, {0xbb, 0x00}, {0xf7, 0xfe}, {0xf8, 0xfe}, {0x00, 0x00}, {0x00, 0x00}, {0xfb, 0xfe}, {0xfc, 0xfe}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0xad, 0x00}, {0x82, 0xfe}, {0xa3, 0x00}, {0xa4, 0x00}, {0x84, 0xfe}, {0x00, 0x00}, {0x00, 0x00}, {0x8e, 0xfe}, {0x8f, 0xfe}, {0x95, 0xfe}, {0x99, 0xfe}, {0x0c, 0x06}, {0x9d, 0xfe}, {0xa1, 0xfe}, {0xa5, 0xfe}, /* 0xb0*/ {0x60, 0x06}, {0x61, 0x06}, {0x62, 0x06}, {0x63, 0x06}, {0x64, 0x06}, {0x65, 0x06}, {0x66, 0x06}, {0x67, 0x06}, {0x68, 0x06}, {0x69, 0x06}, {0xd1, 0xfe}, {0x1b, 0x06}, {0xb1, 0xfe}, {0xb5, 0xfe}, {0xb9, 0xfe}, {0x1f, 0x06}, /* 0xc0*/ {0xa2, 0x00}, {0x80, 0xfe}, {0x81, 0xfe}, {0x83, 0xfe}, {0x85, 0xfe}, {0xca, 0xfe}, {0x8b, 0xfe}, {0x8d, 0xfe}, {0x91, 0xfe}, {0x93, 0xfe}, {0x97, 0xfe}, {0x9b, 0xfe}, {0x9f, 0xfe}, {0xa3, 0xfe}, {0xa7, 0xfe}, {0xa9, 0xfe}, /* 0xd0*/ {0xab, 0xfe}, {0xad, 0xfe}, {0xaf, 0xfe}, {0xb3, 0xfe}, {0xb7, 0xfe}, {0xbb, 0xfe}, {0xbf, 0xfe}, {0xc1, 0xfe}, {0xc5, 0xfe}, {0xcb, 0xfe}, {0xcf, 0xfe}, {0xa6, 0x00}, {0xac, 0x00}, {0xf7, 0x00}, {0xd7, 0x00}, {0xc9, 0xfe}, /* 0xe0*/ {0x40, 0x06}, {0xd3, 0xfe}, {0xd7, 0xfe}, {0xdb, 0xfe}, {0xdf, 0xfe}, {0xe3, 0xfe}, {0xe7, 0xfe}, {0xeb, 0xfe}, {0xed, 0xfe}, {0xef, 0xfe}, {0xf3, 0xfe}, {0xbd, 0xfe}, {0xcc, 0xfe}, {0xce, 0xfe}, {0xcd, 0xfe}, {0xe1, 0xfe}, /* 0xf0*/ {0x7d, 0xfe}, {0x51, 0x06}, {0xe5, 0xfe}, {0xe9, 0xfe}, {0xec, 0xfe}, {0xf0, 0xfe}, {0xf2, 0xfe}, {0xd0, 0xfe}, {0xd5, 0xfe}, {0xf5, 0xfe}, {0xf6, 0xfe}, {0xdd, 0xfe}, {0xd9, 0xfe}, {0xf1, 0xfe}, {0xa0, 0x25}, {0x00, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x00, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0xc0, 0xa3, 0xa4, 0x00, 0xdb, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x97, 0xdc, 0xa1, 0x00, 0x00, /* 0xa8-0xaf */ 0x80, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x98, 0x95, 0x94, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page06[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x60-0x67 */ 0xb8, 0xb9, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x82, 0x83, 0x00, 0x00, 0x00, 0x91, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0x85, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x8c, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x8f, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char pagefe[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, /* 0x78-0x7f */ 0xc1, 0xc2, 0xa2, 0xc3, 0xa5, 0xc4, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc7, 0xa8, 0xa9, /* 0x88-0x8f */ 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xaa, 0x00, 0xca, /* 0x90-0x97 */ 0x00, 0xab, 0x00, 0xcb, 0x00, 0xad, 0x00, 0xcc, /* 0x98-0x9f */ 0x00, 0xae, 0x00, 0xcd, 0x00, 0xaf, 0x00, 0xce, /* 0xa0-0xa7 */ 0x00, 0xcf, 0x00, 0xd0, 0x00, 0xd1, 0x00, 0xd2, /* 0xa8-0xaf */ 0x00, 0xbc, 0x00, 0xd3, 0x00, 0xbd, 0x00, 0xd4, /* 0xb0-0xb7 */ 0x00, 0xbe, 0x00, 0xd5, 0x00, 0xeb, 0x00, 0xd6, /* 0xb8-0xbf */ 0x00, 0xd7, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0xdf, 0xc5, 0xd9, 0xec, 0xee, 0xed, 0xda, /* 0xc8-0xcf */ 0xf7, 0xba, 0x00, 0xe1, 0x00, 0xf8, 0x00, 0xe2, /* 0xd0-0xd7 */ 0x00, 0xfc, 0x00, 0xe3, 0x00, 0xfb, 0x00, 0xe4, /* 0xd8-0xdf */ 0x00, 0xef, 0x00, 0xe5, 0x00, 0xf2, 0x00, 0xe6, /* 0xe0-0xe7 */ 0x00, 0xf3, 0x00, 0xe7, 0xf4, 0xe8, 0x00, 0xe9, /* 0xe8-0xef */ 0xf5, 0xfd, 0xf6, 0xea, 0x00, 0xf9, 0xfa, 0x99, /* 0xf0-0xf7 */ 0x9a, 0x00, 0x00, 0x9d, 0x9e, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, page03, NULL, NULL, page06, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page22, NULL, NULL, page25, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pagefe, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp864", page_uni2charset, charset2uni, NULL }; int init_unls_cp864() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_iso8859-6.c0000644000372500001440000002745310536265343016131 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-6.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-6.c * * Charset iso8859-6 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x60, 0x06}, {0x61, 0x06}, {0x62, 0x06}, {0x63, 0x06}, {0x64, 0x06}, {0x65, 0x06}, {0x66, 0x06}, {0x67, 0x06}, {0x68, 0x06}, {0x69, 0x06}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0xa4, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x0c, 0x06}, {0xad, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xb0*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x1b, 0x06}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x1f, 0x06}, /* 0xc0*/ {0x00, 0x00}, {0x21, 0x06}, {0x22, 0x06}, {0x23, 0x06}, {0x24, 0x06}, {0x25, 0x06}, {0x26, 0x06}, {0x27, 0x06}, {0x28, 0x06}, {0x29, 0x06}, {0x2a, 0x06}, {0x2b, 0x06}, {0x2c, 0x06}, {0x2d, 0x06}, {0x2e, 0x06}, {0x2f, 0x06}, /* 0xd0*/ {0x30, 0x06}, {0x31, 0x06}, {0x32, 0x06}, {0x33, 0x06}, {0x34, 0x06}, {0x35, 0x06}, {0x36, 0x06}, {0x37, 0x06}, {0x38, 0x06}, {0x39, 0x06}, {0x3a, 0x06}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xe0*/ {0x40, 0x06}, {0x41, 0x06}, {0x42, 0x06}, {0x43, 0x06}, {0x44, 0x06}, {0x45, 0x06}, {0x46, 0x06}, {0x47, 0x06}, {0x48, 0x06}, {0x49, 0x06}, {0x4a, 0x06}, {0x4b, 0x06}, {0x4c, 0x06}, {0x4d, 0x06}, {0x4e, 0x06}, {0x4f, 0x06}, /* 0xf0*/ {0x50, 0x06}, {0x51, 0x06}, {0x52, 0x06}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page06[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 0x18-0x1f */ 0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */ 0xd8, 0xd9, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */ 0xf0, 0xf1, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x60-0x67 */ 0x38, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, NULL, NULL, NULL, page06, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "iso8859-6", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_6() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp860.c0000644000372500001440000005047310536265343015474 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp860.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp860.c * * Charset cp860 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, {0xe0, 0x00}, {0xc1, 0x00}, {0xe7, 0x00}, {0xea, 0x00}, {0xca, 0x00}, {0xe8, 0x00}, {0xcd, 0x00}, {0xd4, 0x00}, {0xec, 0x00}, {0xc3, 0x00}, {0xc2, 0x00}, /* 0x90*/ {0xc9, 0x00}, {0xc0, 0x00}, {0xc8, 0x00}, {0xf4, 0x00}, {0xf5, 0x00}, {0xf2, 0x00}, {0xda, 0x00}, {0xf9, 0x00}, {0xcc, 0x00}, {0xd5, 0x00}, {0xdc, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xd9, 0x00}, {0xa7, 0x20}, {0xd3, 0x00}, /* 0xa0*/ {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00}, {0xbf, 0x00}, {0xd2, 0x00}, {0xac, 0x00}, {0xbd, 0x00}, {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, /* 0xd0*/ {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, /* 0xe0*/ {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, /* 0xf0*/ {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0xad, 0x9b, 0x9c, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */ 0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */ 0x91, 0x86, 0x8f, 0x8e, 0x00, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */ 0x92, 0x90, 0x89, 0x00, 0x98, 0x8b, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0xa5, 0xa9, 0x9f, 0x8c, 0x99, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x9d, 0x96, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ 0x85, 0xa0, 0x83, 0x84, 0x00, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */ 0x8a, 0x82, 0x88, 0x00, 0x8d, 0xa1, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0xa4, 0x95, 0xa2, 0x93, 0x94, 0x00, 0xf6, /* 0xf0-0xf7 */ 0x00, 0x97, 0xa3, 0x00, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page23[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, page22, page23, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, /* 0x80-0x87 */ 0x00, 0x89, 0x00, 0x8b, 0x8c, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x96, 0x00, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp860", page_uni2charset, charset2uni, NULL }; int init_unls_cp860() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp10081.c0000644000372500001440000007460410536265343015632 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp10081.c 1.3 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code generated by James Pearson j.pearson@ge.ucl.ac.uk 17/8/2000 * based on a script by Gordon Chaffee */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp10081.c * * Charset cp10081 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x10*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x00, 0x00}, /* 0x80*/ {0xc4, 0x00}, {0xc5, 0x00}, {0xc7, 0x00}, {0xc9, 0x00}, {0xd1, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xe1, 0x00}, {0xe0, 0x00}, {0xe2, 0x00}, {0xe4, 0x00}, {0xe3, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, {0xe9, 0x00}, {0xe8, 0x00}, /* 0x90*/ {0xea, 0x00}, {0xeb, 0x00}, {0xed, 0x00}, {0xec, 0x00}, {0xee, 0x00}, {0xef, 0x00}, {0xf1, 0x00}, {0xf3, 0x00}, {0xf2, 0x00}, {0xf4, 0x00}, {0xf6, 0x00}, {0xf5, 0x00}, {0xfa, 0x00}, {0xf9, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, /* 0xa0*/ {0x20, 0x20}, {0xb0, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xa7, 0x00}, {0x22, 0x20}, {0xb6, 0x00}, {0xdf, 0x00}, {0xae, 0x00}, {0xa9, 0x00}, {0x22, 0x21}, {0xb4, 0x00}, {0xa8, 0x00}, {0x60, 0x22}, {0xc6, 0x00}, {0xd8, 0x00}, /* 0xb0*/ {0x1e, 0x22}, {0xb1, 0x00}, {0x64, 0x22}, {0x65, 0x22}, {0xa5, 0x00}, {0xb5, 0x00}, {0x02, 0x22}, {0x11, 0x22}, {0x0f, 0x22}, {0xc0, 0x03}, {0x2b, 0x22}, {0xaa, 0x00}, {0xba, 0x00}, {0xa9, 0x03}, {0xe6, 0x00}, {0xf8, 0x00}, /* 0xc0*/ {0xbf, 0x00}, {0xa1, 0x00}, {0xac, 0x00}, {0x1a, 0x22}, {0x92, 0x01}, {0x48, 0x22}, {0x06, 0x22}, {0xab, 0x00}, {0xbb, 0x00}, {0x26, 0x20}, {0xa0, 0x00}, {0xc0, 0x00}, {0xc3, 0x00}, {0xd5, 0x00}, {0x52, 0x01}, {0x53, 0x01}, /* 0xd0*/ {0x13, 0x20}, {0x14, 0x20}, {0x1c, 0x20}, {0x1d, 0x20}, {0x18, 0x20}, {0x19, 0x20}, {0xf7, 0x00}, {0xca, 0x25}, {0xff, 0x00}, {0x78, 0x01}, {0x1e, 0x01}, {0x1f, 0x01}, {0x30, 0x01}, {0x31, 0x01}, {0x5e, 0x01}, {0x5f, 0x01}, /* 0xe0*/ {0x21, 0x20}, {0xb7, 0x00}, {0x1a, 0x20}, {0x1e, 0x20}, {0x30, 0x20}, {0xc2, 0x00}, {0xca, 0x00}, {0xc1, 0x00}, {0xcb, 0x00}, {0xc8, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, {0xcc, 0x00}, {0xd3, 0x00}, {0xd4, 0x00}, /* 0xf0*/ {0xff, 0xf8}, {0xd2, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00}, {0xa0, 0xf8}, {0xc6, 0x02}, {0xdc, 0x02}, {0xaf, 0x00}, {0xd8, 0x02}, {0xd9, 0x02}, {0xda, 0x02}, {0xb8, 0x00}, {0xdd, 0x02}, {0xdb, 0x02}, {0xc7, 0x02}, }; static unsigned char page00[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xca, 0xc1, 0xa2, 0xa3, 0x00, 0xb4, 0x00, 0xa4, /* 0xa0-0xa7 */ 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0x00, 0xa8, 0xf8, /* 0xa8-0xaf */ 0xa1, 0xb1, 0x00, 0x00, 0xab, 0xb5, 0xa6, 0xe1, /* 0xb0-0xb7 */ 0xfc, 0x00, 0xbc, 0xc8, 0x00, 0x00, 0x00, 0xc0, /* 0xb8-0xbf */ 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, /* 0xc0-0xc7 */ 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, /* 0xc8-0xcf */ 0x00, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x00, /* 0xd0-0xd7 */ 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0x00, 0x00, 0xa7, /* 0xd8-0xdf */ 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, /* 0xe0-0xe7 */ 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, /* 0xe8-0xef */ 0x00, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, /* 0xf0-0xf7 */ 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0x00, 0x00, 0xd8, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xda, 0xdb, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0xdc, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0xce, 0xcf, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xdf, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page02[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xff, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0xf9, 0xfa, 0xfb, 0xfe, 0xf7, 0xfd, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xb9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0xe2, 0x00, 0xd2, 0xd3, 0xe3, 0x00, /* 0x18-0x1f */ 0xa0, 0xe0, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, /* 0x08-0x0f */ 0x00, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xb0, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char pagef8[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, page02, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, page21, page22, NULL, NULL, page25, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pagef8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x60-0x67 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x68-0x6f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x70-0x77 */ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0xe7, /* 0x80-0x87 */ 0xcb, 0xe5, 0x80, 0xcc, 0x81, 0x82, 0x83, 0xe9, /* 0x88-0x8f */ 0xe6, 0xe8, 0xea, 0xed, 0xeb, 0xec, 0x84, 0xee, /* 0x90-0x97 */ 0xf1, 0xef, 0x85, 0xcd, 0xf2, 0xf4, 0xf3, 0x86, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x53, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0x50, 0xba, 0xbb, 0xbc, 0xbd, 0xae, 0xaf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0x46, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd9, 0xd9, 0xda, 0xda, 0xdc, 0x49, 0xde, 0xde, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; static unsigned char charset2lower[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x40-0x47 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x48-0x4f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x50-0x57 */ 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x8a, 0x8c, 0x8d, 0x8e, 0x96, 0x9a, 0x9f, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xbe, 0xbf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0x00, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0x88, 0x8b, 0x9b, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd8, 0xdb, 0xdb, 0x69, 0xdd, 0xdf, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0x89, 0x90, 0x87, /* 0xe0-0xe7 */ 0x91, 0x8f, 0x92, 0x94, 0x95, 0x93, 0x97, 0x99, /* 0xe8-0xef */ 0xf0, 0x98, 0x9c, 0x9e, 0x9d, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp10081", page_uni2charset, charset2uni, NULL }; int init_unls_cp10081() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp1250.c0000644000372500001440000004123110536265343015536 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp1250.c 1.2 05/05/01 2002 Petr Balas */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp1250.c * * Charset cp1250 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xac, 0x20}, {0x00, 0x00}, {0x1a, 0x20}, {0x00, 0x00}, {0x1e, 0x20}, {0x26, 0x20}, {0x20, 0x20}, {0x21, 0x20}, {0x00, 0x00}, {0x30, 0x20}, {0x60, 0x01}, {0x39, 0x20}, {0x5a, 0x01}, {0x64, 0x01}, {0x7d, 0x01}, {0x79, 0x01}, /* 0x90*/ {0x00, 0x00}, {0x18, 0x20}, {0x19, 0x20}, {0x1c, 0x20}, {0x1d, 0x20}, {0x22, 0x20}, {0x13, 0x20}, {0x14, 0x20}, {0x00, 0x00}, {0x22, 0x21}, {0x61, 0x01}, {0x3a, 0x20}, {0x5b, 0x01}, {0x65, 0x01}, {0x7e, 0x01}, {0x7a, 0x01}, /* 0xa0*/ {0xa0, 0x00}, {0xc7, 0x02}, {0xd8, 0x02}, {0x41, 0x01}, {0xa4, 0x00}, {0x04, 0x01}, {0xa6, 0x00}, {0xa7, 0x00}, {0xa8, 0x00}, {0xa9, 0x00}, {0x5e, 0x01}, {0xab, 0x00}, {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0x7b, 0x01}, /* 0xb0*/ {0xb0, 0x00}, {0xb1, 0x00}, {0xdb, 0x02}, {0x42, 0x01}, {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00}, {0xb8, 0x00}, {0x05, 0x01}, {0x5f, 0x01}, {0xbb, 0x00}, {0x3d, 0x01}, {0xdd, 0x02}, {0x3e, 0x01}, {0x7c, 0x01}, /* 0xc0*/ {0x54, 0x01}, {0xc1, 0x00}, {0xc2, 0x00}, {0x02, 0x01}, {0xc4, 0x00}, {0x39, 0x01}, {0x06, 0x01}, {0xc7, 0x00}, {0x0c, 0x01}, {0xc9, 0x00}, {0x18, 0x01}, {0xcb, 0x00}, {0x1a, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0x0e, 0x01}, /* 0xd0*/ {0x10, 0x01}, {0x43, 0x01}, {0x47, 0x01}, {0xd3, 0x00}, {0xd4, 0x00}, {0x50, 0x01}, {0xd6, 0x00}, {0xd7, 0x00}, {0x58, 0x01}, {0x6e, 0x01}, {0xda, 0x00}, {0x70, 0x01}, {0xdc, 0x00}, {0xdd, 0x00}, {0x62, 0x01}, {0xdf, 0x00}, /* 0xe0*/ {0x55, 0x01}, {0xe1, 0x00}, {0xe2, 0x00}, {0x03, 0x01}, {0xe4, 0x00}, {0x3a, 0x01}, {0x07, 0x01}, {0xe7, 0x00}, {0x0d, 0x01}, {0xe9, 0x00}, {0x19, 0x01}, {0xeb, 0x00}, {0x1b, 0x01}, {0xed, 0x00}, {0xee, 0x00}, {0x0f, 0x01}, /* 0xf0*/ {0x11, 0x01}, {0x44, 0x01}, {0x48, 0x01}, {0xf3, 0x00}, {0xf4, 0x00}, {0x51, 0x01}, {0xf6, 0x00}, {0xf7, 0x00}, {0x59, 0x01}, {0x6f, 0x01}, {0xfa, 0x00}, {0x71, 0x01}, {0xfc, 0x00}, {0xfd, 0x00}, {0x63, 0x01}, {0xd9, 0x02}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0xae, 0x00, /* 0xa8-0xaf */ 0xb0, 0xb1, 0x00, 0x00, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, /* 0xc0-0xc7 */ 0x00, 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0xce, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0x00, 0x00, 0xda, 0x00, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */ 0x00, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, /* 0xe0-0xe7 */ 0x00, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0xee, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0x00, 0x00, 0xfa, 0x00, 0xfc, 0xfd, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0xc3, 0xe3, 0xa5, 0xb9, 0xc6, 0xe6, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0xcf, 0xef, /* 0x08-0x0f */ 0xd0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xca, 0xea, 0xcc, 0xec, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0xc5, 0xe5, 0x00, 0x00, 0xbc, 0xbe, 0x00, /* 0x38-0x3f */ 0x00, 0xa3, 0xb3, 0xd1, 0xf1, 0x00, 0x00, 0xd2, /* 0x40-0x47 */ 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xd5, 0xf5, 0x00, 0x00, 0xc0, 0xe0, 0x00, 0x00, /* 0x50-0x57 */ 0xd8, 0xf8, 0x8c, 0x9c, 0x00, 0x00, 0xaa, 0xba, /* 0x58-0x5f */ 0x8a, 0x9a, 0xde, 0xfe, 0x8d, 0x9d, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd9, 0xf9, /* 0x68-0x6f */ 0xdb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x8f, 0x9f, 0xaf, 0xbf, 0x8e, 0x9e, 0x00, /* 0x78-0x7f */ }; static unsigned char page02[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0xa2, 0xff, 0x00, 0xb2, 0x00, 0xbd, 0x00, 0x00, /* 0xd8-0xdf */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x91, 0x92, 0x82, 0x00, 0x93, 0x94, 0x84, 0x00, /* 0x18-0x1f */ 0x86, 0x87, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x8b, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ }; static unsigned char *page_uni2charset[256] = { page00, page01, page02, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, page21, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2lower[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x40-0x47 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x48-0x4f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x50-0x57 */ 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x82, 0x00, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x00, 0x89, 0x9a, 0x8b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x88-0x8f */ 0x00, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x00, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xb3, 0xa4, 0xb9, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xba, 0xab, 0xac, 0xad, 0xae, 0xbf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbe, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xc0-0xc7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xc8-0xcf */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xd7, /* 0xd0-0xd7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x60-0x67 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x68-0x6f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x70-0x77 */ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x82, 0x00, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x00, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x00, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x00, 0x99, 0x8a, 0x9b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xa3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xa5, 0xaa, 0xbb, 0xbc, 0xbd, 0xbc, 0xaf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xe0-0xe7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xe8-0xef */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xf7, /* 0xf0-0xf7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp1250", page_uni2charset, charset2uni, NULL }; int init_unls_cp1250() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp857.c0000644000372500001440000003413510536265343015477 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp857.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp857.c * * Charset cp857 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00}, {0xee, 0x00}, {0x31, 0x01}, {0xc4, 0x00}, {0xc5, 0x00}, /* 0x90*/ {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00}, {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00}, {0x30, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00}, {0xa3, 0x00}, {0xd8, 0x00}, {0x5e, 0x01}, {0x5f, 0x01}, /* 0xa0*/ {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, {0xf1, 0x00}, {0xd1, 0x00}, {0x1e, 0x01}, {0x1f, 0x01}, {0xbf, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00}, {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc0, 0x00}, {0xa9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0xa2, 0x00}, {0xa5, 0x00}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0xe3, 0x00}, {0xc3, 0x00}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00}, /* 0xd0*/ {0xba, 0x00}, {0xaa, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, {0xc8, 0x00}, {0x00, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0xa6, 0x00}, {0xcc, 0x00}, {0x80, 0x25}, /* 0xe0*/ {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0xd2, 0x00}, {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0x00, 0x00}, {0xd7, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00}, {0xec, 0x00}, {0xff, 0x00}, {0xaf, 0x00}, {0xb4, 0x00}, /* 0xf0*/ {0xad, 0x00}, {0xb1, 0x00}, {0x00, 0x00}, {0xbe, 0x00}, {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00}, {0xb0, 0x00}, {0xa8, 0x00}, {0xb7, 0x00}, {0xb9, 0x00}, {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0xad, 0xbd, 0x9c, 0xcf, 0xbe, 0xdd, 0xf5, /* 0xa0-0xa7 */ 0xf9, 0xb8, 0xd1, 0xae, 0xaa, 0xf0, 0xa9, 0xee, /* 0xa8-0xaf */ 0xf8, 0xf1, 0xfd, 0xfc, 0xef, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */ 0xf7, 0xfb, 0xd0, 0xaf, 0xac, 0xab, 0xf3, 0xa8, /* 0xb8-0xbf */ 0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */ 0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, /* 0xc8-0xcf */ 0x00, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0xe8, /* 0xd0-0xd7 */ 0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ 0x85, 0xa0, 0x83, 0xc6, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */ 0x8a, 0x82, 0x88, 0x89, 0xec, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */ 0x00, 0xa4, 0x95, 0xa2, 0x93, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */ 0x9b, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0xed, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa7, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x98, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x9f, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0x00, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0x00, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp857", page_uni2charset, charset2uni, NULL }; int init_unls_cp857() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_koi8-u.c0000644000372500001440000004441110536265343015743 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_koi8-u.c 1.2 05/05/01 2002 J. Schilling by Andy Shevchenko */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_koi8-u.c * * Charset koi8-u translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x25}, {0x02, 0x25}, {0x0c, 0x25}, {0x10, 0x25}, {0x14, 0x25}, {0x18, 0x25}, {0x1c, 0x25}, {0x24, 0x25}, {0x2c, 0x25}, {0x34, 0x25}, {0x3c, 0x25}, {0x80, 0x25}, {0x84, 0x25}, {0x88, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, /* 0x90*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x20, 0x23}, {0xa0, 0x25}, {0x19, 0x22}, {0x1a, 0x22}, {0x48, 0x22}, {0x64, 0x22}, {0x65, 0x22}, {0xa0, 0x00}, {0x21, 0x23}, {0xb0, 0x00}, {0xb2, 0x00}, {0xb7, 0x00}, {0xf7, 0x00}, /* 0xa0*/ {0x50, 0x25}, {0x51, 0x25}, {0x52, 0x25}, {0x51, 0x04}, {0x54, 0x04}, {0x54, 0x25}, {0x56, 0x04}, {0x57, 0x04}, {0x57, 0x25}, {0x58, 0x25}, {0x59, 0x25}, {0x5a, 0x25}, {0x5b, 0x25}, {0x91, 0x04}, {0x5d, 0x25}, {0x5e, 0x25}, /* 0xb0*/ {0x5f, 0x25}, {0x60, 0x25}, {0x61, 0x25}, {0x01, 0x04}, {0x04, 0x04}, {0x63, 0x25}, {0x06, 0x04}, {0x07, 0x04}, {0x66, 0x25}, {0x67, 0x25}, {0x68, 0x25}, {0x69, 0x25}, {0x6a, 0x25}, {0x90, 0x04}, {0x6c, 0x25}, {0xa9, 0x00}, /* 0xc0*/ {0x4e, 0x04}, {0x30, 0x04}, {0x31, 0x04}, {0x46, 0x04}, {0x34, 0x04}, {0x35, 0x04}, {0x44, 0x04}, {0x33, 0x04}, {0x45, 0x04}, {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04}, {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, /* 0xd0*/ {0x3f, 0x04}, {0x4f, 0x04}, {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04}, {0x36, 0x04}, {0x32, 0x04}, {0x4c, 0x04}, {0x4b, 0x04}, {0x37, 0x04}, {0x48, 0x04}, {0x4d, 0x04}, {0x49, 0x04}, {0x47, 0x04}, {0x4a, 0x04}, /* 0xe0*/ {0x2e, 0x04}, {0x10, 0x04}, {0x11, 0x04}, {0x26, 0x04}, {0x14, 0x04}, {0x15, 0x04}, {0x24, 0x04}, {0x13, 0x04}, {0x25, 0x04}, {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04}, {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, /* 0xf0*/ {0x1f, 0x04}, {0x2f, 0x04}, {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04}, {0x16, 0x04}, {0x12, 0x04}, {0x2c, 0x04}, {0x2b, 0x04}, {0x17, 0x04}, {0x28, 0x04}, {0x2d, 0x04}, {0x29, 0x04}, {0x27, 0x04}, {0x2a, 0x04}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x9c, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page04[256] = { 0x00, 0xb3, 0x00, 0x00, 0xb4, 0x00, 0xb6, 0xb7, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */ 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, /* 0x18-0x1f */ 0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, /* 0x20-0x27 */ 0xfb, 0xfd, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1, /* 0x28-0x2f */ 0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda, /* 0x30-0x37 */ 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, /* 0x38-0x3f */ 0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, /* 0x40-0x47 */ 0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1, /* 0x48-0x4f */ 0x00, 0xa3, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0xa7, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xbd, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x95, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x98, 0x99, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page23[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x93, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x85, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xa0, 0xa1, 0xa2, 0x00, 0xa5, 0x00, 0x00, 0xa8, /* 0x50-0x57 */ 0xa9, 0xaa, 0xab, 0xac, 0x00, 0xae, 0xaf, 0xb0, /* 0x58-0x5f */ 0xb1, 0xb2, 0x00, 0xb5, 0x00, 0x00, 0xb8, 0xb9, /* 0x60-0x67 */ 0xba, 0xbb, 0xbc, 0x00, 0xbe, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x8b, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x8d, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x8f, 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page22, page23, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xb3, 0xa4, 0xa5, 0xb6, 0xb7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xbd, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "koi8-u", page_uni2charset, charset2uni, NULL }; int init_unls_koi8_u() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp10007.c0000644000372500001440000005500110536265343015616 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp10007.c 1.3 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code generated by James Pearson j.pearson@ge.ucl.ac.uk 17/8/2000 * based on a script by Gordon Chaffee */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp10007.c * * Charset cp10007 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x10*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x00, 0x00}, /* 0x80*/ {0x10, 0x04}, {0x11, 0x04}, {0x12, 0x04}, {0x13, 0x04}, {0x14, 0x04}, {0x15, 0x04}, {0x16, 0x04}, {0x17, 0x04}, {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04}, {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, {0x1f, 0x04}, /* 0x90*/ {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04}, {0x24, 0x04}, {0x25, 0x04}, {0x26, 0x04}, {0x27, 0x04}, {0x28, 0x04}, {0x29, 0x04}, {0x2a, 0x04}, {0x2b, 0x04}, {0x2c, 0x04}, {0x2d, 0x04}, {0x2e, 0x04}, {0x2f, 0x04}, /* 0xa0*/ {0x20, 0x20}, {0xb0, 0x00}, {0x90, 0x04}, {0xa3, 0x00}, {0xa7, 0x00}, {0x22, 0x20}, {0xb6, 0x00}, {0x06, 0x04}, {0xae, 0x00}, {0xa9, 0x00}, {0x22, 0x21}, {0x02, 0x04}, {0x52, 0x04}, {0x60, 0x22}, {0x03, 0x04}, {0x53, 0x04}, /* 0xb0*/ {0x1e, 0x22}, {0xb1, 0x00}, {0x64, 0x22}, {0x65, 0x22}, {0x56, 0x04}, {0xb5, 0x00}, {0x91, 0x04}, {0x08, 0x04}, {0x04, 0x04}, {0x54, 0x04}, {0x07, 0x04}, {0x57, 0x04}, {0x09, 0x04}, {0x59, 0x04}, {0x0a, 0x04}, {0x5a, 0x04}, /* 0xc0*/ {0x58, 0x04}, {0x05, 0x04}, {0xac, 0x00}, {0x1a, 0x22}, {0x92, 0x01}, {0x48, 0x22}, {0x06, 0x22}, {0xab, 0x00}, {0xbb, 0x00}, {0x26, 0x20}, {0xa0, 0x00}, {0x0b, 0x04}, {0x5b, 0x04}, {0x0c, 0x04}, {0x5c, 0x04}, {0x55, 0x04}, /* 0xd0*/ {0x13, 0x20}, {0x14, 0x20}, {0x1c, 0x20}, {0x1d, 0x20}, {0x18, 0x20}, {0x19, 0x20}, {0xf7, 0x00}, {0x1e, 0x20}, {0x0e, 0x04}, {0x5e, 0x04}, {0x0f, 0x04}, {0x5f, 0x04}, {0x16, 0x21}, {0x01, 0x04}, {0x51, 0x04}, {0x4f, 0x04}, /* 0xe0*/ {0x30, 0x04}, {0x31, 0x04}, {0x32, 0x04}, {0x33, 0x04}, {0x34, 0x04}, {0x35, 0x04}, {0x36, 0x04}, {0x37, 0x04}, {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04}, {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, {0x3f, 0x04}, /* 0xf0*/ {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04}, {0x44, 0x04}, {0x45, 0x04}, {0x46, 0x04}, {0x47, 0x04}, {0x48, 0x04}, {0x49, 0x04}, {0x4a, 0x04}, {0x4b, 0x04}, {0x4c, 0x04}, {0x4d, 0x04}, {0x4e, 0x04}, {0xac, 0x20}, }; static unsigned char page00[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xca, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa4, /* 0xa0-0xa7 */ 0x00, 0xa9, 0x00, 0xc7, 0xc2, 0x00, 0xa8, 0x00, /* 0xa8-0xaf */ 0xa1, 0xb1, 0x00, 0x00, 0x00, 0xb5, 0xa6, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page04[256] = { 0x00, 0xdd, 0xab, 0xae, 0xb8, 0xc1, 0xa7, 0xba, /* 0x00-0x07 */ 0xb7, 0xbc, 0xbe, 0xcb, 0xcd, 0x00, 0xd8, 0xda, /* 0x08-0x0f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x30-0x37 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x38-0x3f */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x40-0x47 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, /* 0x48-0x4f */ 0x00, 0xde, 0xac, 0xaf, 0xb9, 0xcf, 0xb4, 0xbb, /* 0x50-0x57 */ 0xc0, 0xbd, 0xbf, 0xcc, 0xce, 0x00, 0xd9, 0xdb, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xa2, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0x00, 0x00, 0xd2, 0xd3, 0xd7, 0x00, /* 0x18-0x1f */ 0xa0, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xb0, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, NULL, page04, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, page21, page22, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x60-0x67 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x68-0x6f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x70-0x77 */ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xab, 0xad, 0xae, 0xae, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xa7, 0xb5, 0xa2, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb8, 0xba, 0xba, 0xbc, 0xbc, 0xbe, 0xbe, /* 0xb8-0xbf */ 0xb7, 0xc1, 0xc2, 0xc3, 0x46, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcb, 0xcd, 0xcd, 0xc1, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd8, 0xda, 0xda, 0xdc, 0xdd, 0xdd, 0x9f, /* 0xd8-0xdf */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0xe0-0xe7 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0xe8-0xef */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0xf0-0xf7 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0xff, /* 0xf8-0xff */ }; static unsigned char charset2lower[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x40-0x47 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x48-0x4f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x50-0x57 */ 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x80-0x87 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x88-0x8f */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x90-0x97 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, /* 0x98-0x9f */ 0xa0, 0xa1, 0xb6, 0xa3, 0xa4, 0xa5, 0xa6, 0xb4, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xac, 0xac, 0xad, 0xaf, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xc0, /* 0xb0-0xb7 */ 0xb9, 0xb9, 0xbb, 0xbb, 0xbd, 0xbd, 0xbf, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xcf, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcc, 0xcc, 0xce, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd9, 0xd9, 0xdb, 0xdb, 0xdc, 0xde, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp10007", page_uni2charset, charset2uni, NULL }; int init_unls_cp10007() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp10029.c0000644000372500001440000006111310536265343015623 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp10029.c 1.3 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code generated by James Pearson j.pearson@ge.ucl.ac.uk 17/8/2000 * based on a script by Gordon Chaffee */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp10029.c * * Charset cp10029 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x10*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x00, 0x00}, /* 0x80*/ {0xc4, 0x00}, {0x00, 0x01}, {0x01, 0x01}, {0xc9, 0x00}, {0x04, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0xe1, 0x00}, {0x05, 0x01}, {0x0c, 0x01}, {0xe4, 0x00}, {0x0d, 0x01}, {0x06, 0x01}, {0x07, 0x01}, {0xe9, 0x00}, {0x79, 0x01}, /* 0x90*/ {0x7a, 0x01}, {0x0e, 0x01}, {0xed, 0x00}, {0x0f, 0x01}, {0x12, 0x01}, {0x13, 0x01}, {0x16, 0x01}, {0xf3, 0x00}, {0x17, 0x01}, {0xf4, 0x00}, {0xf6, 0x00}, {0xf5, 0x00}, {0xfa, 0x00}, {0x1a, 0x01}, {0x1b, 0x01}, {0xfc, 0x00}, /* 0xa0*/ {0x20, 0x20}, {0xb0, 0x00}, {0x18, 0x01}, {0xa3, 0x00}, {0xa7, 0x00}, {0x22, 0x20}, {0xb6, 0x00}, {0xdf, 0x00}, {0xae, 0x00}, {0xa9, 0x00}, {0x22, 0x21}, {0x19, 0x01}, {0xa8, 0x00}, {0x60, 0x22}, {0x23, 0x01}, {0x2e, 0x01}, /* 0xb0*/ {0x2f, 0x01}, {0x2a, 0x01}, {0x64, 0x22}, {0x65, 0x22}, {0x2b, 0x01}, {0x36, 0x01}, {0x02, 0x22}, {0x11, 0x22}, {0x42, 0x01}, {0x3b, 0x01}, {0x3c, 0x01}, {0x3d, 0x01}, {0x3e, 0x01}, {0x39, 0x01}, {0x3a, 0x01}, {0x45, 0x01}, /* 0xc0*/ {0x46, 0x01}, {0x43, 0x01}, {0xac, 0x00}, {0x1a, 0x22}, {0x44, 0x01}, {0x47, 0x01}, {0x06, 0x22}, {0xab, 0x00}, {0xbb, 0x00}, {0x26, 0x20}, {0xa0, 0x00}, {0x48, 0x01}, {0x50, 0x01}, {0xd5, 0x00}, {0x51, 0x01}, {0x4c, 0x01}, /* 0xd0*/ {0x13, 0x20}, {0x14, 0x20}, {0x1c, 0x20}, {0x1d, 0x20}, {0x18, 0x20}, {0x19, 0x20}, {0xf7, 0x00}, {0xca, 0x25}, {0x4d, 0x01}, {0x54, 0x01}, {0x55, 0x01}, {0x58, 0x01}, {0x39, 0x20}, {0x3a, 0x20}, {0x59, 0x01}, {0x56, 0x01}, /* 0xe0*/ {0x57, 0x01}, {0x60, 0x01}, {0x1a, 0x20}, {0x1e, 0x20}, {0x61, 0x01}, {0x5a, 0x01}, {0x5b, 0x01}, {0xc1, 0x00}, {0x64, 0x01}, {0x65, 0x01}, {0xcd, 0x00}, {0x7d, 0x01}, {0x7e, 0x01}, {0x6a, 0x01}, {0xd3, 0x00}, {0xd4, 0x00}, /* 0xf0*/ {0x6b, 0x01}, {0x6e, 0x01}, {0xda, 0x00}, {0x6f, 0x01}, {0x70, 0x01}, {0x71, 0x01}, {0x72, 0x01}, {0x73, 0x01}, {0xdd, 0x00}, {0xfd, 0x00}, {0x37, 0x01}, {0x7b, 0x01}, {0x41, 0x01}, {0x7c, 0x01}, {0x22, 0x01}, {0xc7, 0x02}, }; static unsigned char page00[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xca, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa4, /* 0xa0-0xa7 */ 0xac, 0xa9, 0x00, 0xc7, 0xc2, 0x00, 0xa8, 0x00, /* 0xa8-0xaf */ 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0xe7, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x83, 0x00, 0x00, 0x00, 0xea, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0xee, 0xef, 0xcd, 0x85, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0xf2, 0x00, 0x86, 0xf8, 0x00, 0xa7, /* 0xd8-0xdf */ 0x00, 0x87, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x8e, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x97, 0x99, 0x9b, 0x9a, 0xd6, /* 0xf0-0xf7 */ 0x00, 0x00, 0x9c, 0x00, 0x9f, 0xf9, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x81, 0x82, 0x00, 0x00, 0x84, 0x88, 0x8c, 0x8d, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x89, 0x8b, 0x91, 0x93, /* 0x08-0x0f */ 0x00, 0x00, 0x94, 0x95, 0x00, 0x00, 0x96, 0x98, /* 0x10-0x17 */ 0xa2, 0xab, 0x9d, 0x9e, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0xfe, 0xae, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0xb1, 0xb4, 0x00, 0x00, 0xaf, 0xb0, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0xfa, /* 0x30-0x37 */ 0x00, 0xbd, 0xbe, 0xb9, 0xba, 0xbb, 0xbc, 0x00, /* 0x38-0x3f */ 0x00, 0xfc, 0xb8, 0xc1, 0xc4, 0xbf, 0xc0, 0xc5, /* 0x40-0x47 */ 0xcb, 0x00, 0x00, 0x00, 0xcf, 0xd8, 0x00, 0x00, /* 0x48-0x4f */ 0xcc, 0xce, 0x00, 0x00, 0xd9, 0xda, 0xdf, 0xe0, /* 0x50-0x57 */ 0xdb, 0xde, 0xe5, 0xe6, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xe1, 0xe4, 0x00, 0x00, 0xe8, 0xe9, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0xed, 0xf0, 0x00, 0x00, 0xf1, 0xf3, /* 0x68-0x6f */ 0xf4, 0xf5, 0xf6, 0xf7, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x8f, 0x90, 0xfb, 0xfd, 0xeb, 0xec, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page02[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0xe2, 0x00, 0xd2, 0xd3, 0xe3, 0x00, /* 0x18-0x1f */ 0xa0, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0xdc, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, page02, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, page21, page22, NULL, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x60-0x67 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x68-0x6f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x70-0x77 */ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x81, 0x83, 0x84, 0x85, 0x86, 0xe7, /* 0x80-0x87 */ 0x84, 0x89, 0x80, 0x89, 0x8c, 0x8c, 0x83, 0x8f, /* 0x88-0x8f */ 0x8f, 0x91, 0xea, 0x91, 0x94, 0x94, 0x96, 0xee, /* 0x90-0x97 */ 0x96, 0xef, 0x85, 0xcd, 0xf2, 0x9d, 0x9d, 0x86, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x53, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xa2, 0xac, 0xad, 0xfe, 0xaf, /* 0xa8-0xaf */ 0xaf, 0xb1, 0xb2, 0xb3, 0xb1, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xfc, 0xb9, 0xb9, 0xbb, 0xbb, 0xbd, 0xbd, 0xbf, /* 0xb8-0xbf */ 0xbf, 0xc1, 0xc2, 0xc3, 0xc1, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xc5, 0xcc, 0xcd, 0xcc, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xcf, 0xd9, 0xd9, 0xdb, 0xdc, 0xdd, 0xdb, 0xdf, /* 0xd8-0xdf */ 0xdf, 0xe1, 0xe2, 0xe3, 0xe1, 0xe5, 0xe5, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe8, 0xea, 0xeb, 0xeb, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xed, 0xf1, 0xf2, 0xf1, 0xf4, 0xf4, 0xf6, 0xf6, /* 0xf0-0xf7 */ 0xf8, 0xf8, 0xb5, 0xfb, 0xfc, 0xfb, 0xfe, 0xff, /* 0xf8-0xff */ }; static unsigned char charset2lower[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x40-0x47 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x48-0x4f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x50-0x57 */ 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x8a, 0x82, 0x82, 0x8e, 0x88, 0x9a, 0x9f, 0x87, /* 0x80-0x87 */ 0x88, 0x8b, 0x8a, 0x8b, 0x8d, 0x8d, 0x8e, 0x90, /* 0x88-0x8f */ 0x90, 0x93, 0x92, 0x93, 0x95, 0x95, 0x98, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9e, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xab, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xb0, /* 0xa8-0xaf */ 0xb0, 0xb4, 0xb2, 0xb3, 0xb4, 0xfa, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xba, 0xba, 0xbc, 0xbc, 0xbe, 0xbe, 0xc0, /* 0xb8-0xbf */ 0xc0, 0xc4, 0xc2, 0xc3, 0xc4, 0xcb, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xce, 0x9b, 0xce, 0xd8, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xda, 0xda, 0xde, 0xdc, 0xdd, 0xde, 0xe0, /* 0xd8-0xdf */ 0xe0, 0xe4, 0xe2, 0xe3, 0xe4, 0xe6, 0xe6, 0x87, /* 0xe0-0xe7 */ 0xe9, 0xe9, 0x92, 0xec, 0xec, 0xf0, 0x97, 0x99, /* 0xe8-0xef */ 0xf0, 0xf3, 0x9c, 0xf3, 0xf5, 0xf5, 0xf7, 0xf7, /* 0xf0-0xf7 */ 0xf9, 0xf9, 0xfa, 0xfd, 0xb8, 0xfd, 0xae, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp10029", page_uni2charset, charset2uni, NULL }; int init_unls_cp10029() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_iso8859-14.c0000644000372500001440000003017010536265343016176 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-14.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-14.c * * Charset iso8859-14 translation tables. * * Generated automatically from the Unicode and charset table * provided by the Unicode Organisation at * http://www.unicode.org/ * The Unicode to charset table has only exact mappings. * * Rhys Jones, Swansea University Computer Society * rhys@sucs.swan.ac.uk */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0x02, 0x1e}, {0x03, 0x1e}, {0xa3, 0x00}, {0x0a, 0x01}, {0x0b, 0x01}, {0x0a, 0x1e}, {0xa7, 0x00}, {0x80, 0x1e}, {0xa9, 0x00}, {0x82, 0x1e}, {0x0b, 0x1e}, {0xf2, 0x1e}, {0xad, 0x00}, {0xae, 0x00}, {0x78, 0x01}, /* 0xb0*/ {0x1e, 0x1e}, {0x1f, 0x1e}, {0x20, 0x01}, {0x21, 0x01}, {0x40, 0x1e}, {0x41, 0x1e}, {0xb6, 0x00}, {0x56, 0x1e}, {0x81, 0x1e}, {0x57, 0x1e}, {0x83, 0x1e}, {0x60, 0x1e}, {0xf3, 0x1e}, {0x84, 0x1e}, {0x85, 0x1e}, {0x61, 0x1e}, /* 0xc0*/ {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00}, {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, /* 0xd0*/ {0x74, 0x01}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00}, {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0x6a, 0x1e}, {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xdc, 0x00}, {0xdd, 0x00}, {0x76, 0x01}, {0xdf, 0x00}, /* 0xe0*/ {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00}, {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00}, /* 0xf0*/ {0x75, 0x01}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00}, {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0x6b, 0x1e}, {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, {0xfd, 0x00}, {0x77, 0x01}, {0xff, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */ 0x00, 0xa9, 0x00, 0x00, 0x00, 0xad, 0xae, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0x00, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0x00, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0x00, 0xff, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0xa1, 0xa2, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0xa6, 0xab, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xb1, /* 0x18-0x1f */ 0xb2, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0xb4, 0xb5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0xb9, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xbb, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0xd7, 0xf7, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0xd0, 0xf0, 0xde, 0xfe, /* 0x70-0x77 */ 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xa8, 0xb8, 0xaa, 0xba, 0xbd, 0xbe, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0xac, 0xbc, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page1e[256] = { 0x00, 0x00, 0xa1, 0xa2, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0xa6, 0xab, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xb1, /* 0x18-0x1f */ 0xb2, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0xb4, 0xb5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0xb9, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xbb, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0xd7, 0xf7, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0xd0, 0xf0, 0xde, 0xfe, /* 0x70-0x77 */ 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xa8, 0xb8, 0xaa, 0xba, 0xbd, 0xbe, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0xac, 0xbc, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page1e, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; static struct unls_table table = { "iso8859-14", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_14() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp874.c0000644000372500001440000003413510536265343015476 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp874.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp874.c * * Charset cp874 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x26, 0x20}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x18, 0x20}, {0x19, 0x20}, {0x1c, 0x20}, {0x1d, 0x20}, {0x22, 0x20}, {0x13, 0x20}, {0x14, 0x20}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0x01, 0x0e}, {0x02, 0x0e}, {0x03, 0x0e}, {0x04, 0x0e}, {0x05, 0x0e}, {0x06, 0x0e}, {0x07, 0x0e}, {0x08, 0x0e}, {0x09, 0x0e}, {0x0a, 0x0e}, {0x0b, 0x0e}, {0x0c, 0x0e}, {0x0d, 0x0e}, {0x0e, 0x0e}, {0x0f, 0x0e}, /* 0xb0*/ {0x10, 0x0e}, {0x11, 0x0e}, {0x12, 0x0e}, {0x13, 0x0e}, {0x14, 0x0e}, {0x15, 0x0e}, {0x16, 0x0e}, {0x17, 0x0e}, {0x18, 0x0e}, {0x19, 0x0e}, {0x1a, 0x0e}, {0x1b, 0x0e}, {0x1c, 0x0e}, {0x1d, 0x0e}, {0x1e, 0x0e}, {0x1f, 0x0e}, /* 0xc0*/ {0x20, 0x0e}, {0x21, 0x0e}, {0x22, 0x0e}, {0x23, 0x0e}, {0x24, 0x0e}, {0x25, 0x0e}, {0x26, 0x0e}, {0x27, 0x0e}, {0x28, 0x0e}, {0x29, 0x0e}, {0x2a, 0x0e}, {0x2b, 0x0e}, {0x2c, 0x0e}, {0x2d, 0x0e}, {0x2e, 0x0e}, {0x2f, 0x0e}, /* 0xd0*/ {0x30, 0x0e}, {0x31, 0x0e}, {0x32, 0x0e}, {0x33, 0x0e}, {0x34, 0x0e}, {0x35, 0x0e}, {0x36, 0x0e}, {0x37, 0x0e}, {0x38, 0x0e}, {0x39, 0x0e}, {0x3a, 0x0e}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x3f, 0x0e}, /* 0xe0*/ {0x40, 0x0e}, {0x41, 0x0e}, {0x42, 0x0e}, {0x43, 0x0e}, {0x44, 0x0e}, {0x45, 0x0e}, {0x46, 0x0e}, {0x47, 0x0e}, {0x48, 0x0e}, {0x49, 0x0e}, {0x4a, 0x0e}, {0x4b, 0x0e}, {0x4c, 0x0e}, {0x4d, 0x0e}, {0x4e, 0x0e}, {0x4f, 0x0e}, /* 0xf0*/ {0x50, 0x0e}, {0x51, 0x0e}, {0x52, 0x0e}, {0x53, 0x0e}, {0x54, 0x0e}, {0x55, 0x0e}, {0x56, 0x0e}, {0x57, 0x0e}, {0x58, 0x0e}, {0x59, 0x0e}, {0x5a, 0x0e}, {0x5b, 0x0e}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page0e[256] = { 0x00, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x00-0x07 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x08-0x0f */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x10-0x17 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x18-0x1f */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */ 0xd8, 0xd9, 0xda, 0x00, 0x00, 0x00, 0x00, 0xdf, /* 0x38-0x3f */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x50-0x57 */ 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x91, 0x92, 0x00, 0x00, 0x93, 0x94, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page0e, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp874", page_uni2charset, charset2uni, NULL }; int init_unls_cp874() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp1251.c0000644000372500001440000003415710536265343015550 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp1251.c 1.2 05/05/01 2002 */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp1251.c * * Charset cp1251 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0A, 0x00}, {0x0B, 0x00}, {0x0C, 0x00}, {0x0D, 0x00}, {0x0E, 0x00}, {0x0F, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1A, 0x00}, {0x1B, 0x00}, {0x1C, 0x00}, {0x1D, 0x00}, {0x1E, 0x00}, {0x1F, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2A, 0x00}, {0x2B, 0x00}, {0x2C, 0x00}, {0x2D, 0x00}, {0x2E, 0x00}, {0x2F, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3A, 0x00}, {0x3B, 0x00}, {0x3C, 0x00}, {0x3D, 0x00}, {0x3E, 0x00}, {0x3F, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4A, 0x00}, {0x4B, 0x00}, {0x4C, 0x00}, {0x4D, 0x00}, {0x4E, 0x00}, {0x4F, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5A, 0x00}, {0x5B, 0x00}, {0x5C, 0x00}, {0x5D, 0x00}, {0x5E, 0x00}, {0x5F, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6A, 0x00}, {0x6B, 0x00}, {0x6C, 0x00}, {0x6D, 0x00}, {0x6E, 0x00}, {0x6F, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7A, 0x00}, {0x7B, 0x00}, {0x7C, 0x00}, {0x7D, 0x00}, {0x7E, 0x00}, {0x7F, 0x00}, /* 0x80*/ {0x02, 0x04}, {0x03, 0x04}, {0x1A, 0x20}, {0x53, 0x04}, {0x1E, 0x20}, {0x26, 0x20}, {0x20, 0x20}, {0x21, 0x20}, {0xAC, 0x20}, {0x30, 0x20}, {0x09, 0x04}, {0x39, 0x20}, {0x0A, 0x04}, {0x0C, 0x04}, {0x0B, 0x04}, {0x0F, 0x04}, /* 0x90*/ {0x52, 0x04}, {0x18, 0x20}, {0x19, 0x20}, {0x1C, 0x20}, {0x1D, 0x20}, {0x22, 0x20}, {0x13, 0x20}, {0x14, 0x20}, {0x00, 0x00}, {0x22, 0x21}, {0x59, 0x04}, {0x3A, 0x20}, {0x5A, 0x04}, {0x5C, 0x04}, {0x5B, 0x04}, {0x5F, 0x04}, /* 0xA0*/ {0xA0, 0x00}, {0x0E, 0x04}, {0x5E, 0x04}, {0x08, 0x04}, {0xA4, 0x00}, {0x90, 0x04}, {0xA6, 0x00}, {0xA7, 0x00}, {0x01, 0x04}, {0xA9, 0x00}, {0x04, 0x04}, {0xAB, 0x00}, {0xAC, 0x00}, {0xAD, 0x00}, {0xAE, 0x00}, {0x07, 0x04}, /* 0xB0*/ {0xB0, 0x00}, {0xB1, 0x00}, {0x06, 0x04}, {0x56, 0x04}, {0x91, 0x04}, {0xB5, 0x00}, {0xB6, 0x00}, {0xB7, 0x00}, {0x51, 0x04}, {0x16, 0x21}, {0x54, 0x04}, {0xBB, 0x00}, {0x58, 0x04}, {0x05, 0x04}, {0x55, 0x04}, {0x57, 0x04}, /* 0xC0*/ {0x10, 0x04}, {0x11, 0x04}, {0x12, 0x04}, {0x13, 0x04}, {0x14, 0x04}, {0x15, 0x04}, {0x16, 0x04}, {0x17, 0x04}, {0x18, 0x04}, {0x19, 0x04}, {0x1A, 0x04}, {0x1B, 0x04}, {0x1C, 0x04}, {0x1D, 0x04}, {0x1E, 0x04}, {0x1F, 0x04}, /* 0xD0*/ {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04}, {0x24, 0x04}, {0x25, 0x04}, {0x26, 0x04}, {0x27, 0x04}, {0x28, 0x04}, {0x29, 0x04}, {0x2A, 0x04}, {0x2B, 0x04}, {0x2C, 0x04}, {0x2D, 0x04}, {0x2E, 0x04}, {0x2F, 0x04}, /* 0xE0*/ {0x30, 0x04}, {0x31, 0x04}, {0x32, 0x04}, {0x33, 0x04}, {0x34, 0x04}, {0x35, 0x04}, {0x36, 0x04}, {0x37, 0x04}, {0x38, 0x04}, {0x39, 0x04}, {0x3A, 0x04}, {0x3B, 0x04}, {0x3C, 0x04}, {0x3D, 0x04}, {0x3E, 0x04}, {0x3F, 0x04}, /* 0xF0*/ {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04}, {0x44, 0x04}, {0x45, 0x04}, {0x46, 0x04}, {0x47, 0x04}, {0x48, 0x04}, {0x49, 0x04}, {0x4A, 0x04}, {0x4B, 0x04}, {0x4C, 0x04}, {0x4D, 0x04}, {0x4E, 0x04}, {0x4F, 0x04} }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0x00, 0xa9, 0x00, 0xab, 0xac, 0xad, 0xae, 0x00, /* 0xa8-0xaf */ 0xb0, 0xb1, 0x00, 0x00, 0x00, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page04[256] = { 0x00, 0xa8, 0x80, 0x81, 0xaa, 0xbd, 0xb2, 0xaf, /* 0x00-0x07 */ 0xa3, 0x8a, 0x8c, 0x8e, 0x8d, 0x00, 0xa1, 0x8f, /* 0x08-0x0f */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x10-0x17 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x18-0x1f */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x20-0x27 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0x28-0x2f */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x30-0x37 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x38-0x3f */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x40-0x47 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0x48-0x4f */ 0x00, 0xb8, 0x90, 0x83, 0xba, 0xbe, 0xb3, 0xbf, /* 0x50-0x57 */ 0xbc, 0x9a, 0x9c, 0x9e, 0x9d, 0x00, 0xa2, 0x9f, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0xa5, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x91, 0x92, 0x82, 0x00, 0x93, 0x94, 0x84, 0x00, /* 0x18-0x1f */ 0x86, 0x87, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x8b, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, page21, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2lower[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x60-0x67 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x68-0x6f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x70-0x77 */ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x90, 0x83, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x9a, 0x8b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa2, 0xa2, 0xbc, 0xa4, 0xb4, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xb8, 0xa9, 0xba, 0xab, 0xac, 0xad, 0xae, 0xbf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb3, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbe, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xc0-0xc7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xc8-0xcf */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xd0-0xd7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x60-0x67 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x68-0x6f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x70-0x77 */ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x81, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x80, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x8a, 0x9b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa1, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb2, 0xa5, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xa8, 0xb9, 0xaa, 0xbb, 0xa3, 0xbd, 0xbd, 0xaf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xe0-0xe7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xe8-0xef */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xf0-0xf7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp1251", page_uni2charset, charset2uni, NULL }; int init_unls_cp1251() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp437.c0000644000372500001440000005460510536265343015475 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp437.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp437.c * * Charset cp437 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00}, {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, /* 0x90*/ {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00}, {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00}, {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xa5, 0x00}, {0xa7, 0x20}, {0x92, 0x01}, /* 0xa0*/ {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00}, {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00}, {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, /* 0xd0*/ {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, /* 0xe0*/ {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, /* 0xf0*/ {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0xad, 0x9b, 0x9c, 0x00, 0x9d, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */ 0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */ 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ 0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */ 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */ 0x00, 0xa4, 0x95, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */ 0x00, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x98, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page23[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, page22, page23, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp437", page_uni2charset, charset2uni, NULL }; int init_unls_cp437() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp869.c0000644000372500001440000004024710536265343015503 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp869.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp869.c * * Charset cp869 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x86, 0x03}, {0x00, 0x00}, {0xb7, 0x00}, {0xac, 0x00}, {0xa6, 0x00}, {0x18, 0x20}, {0x19, 0x20}, {0x88, 0x03}, {0x15, 0x20}, {0x89, 0x03}, /* 0x90*/ {0x8a, 0x03}, {0xaa, 0x03}, {0x8c, 0x03}, {0x00, 0x00}, {0x00, 0x00}, {0x8e, 0x03}, {0xab, 0x03}, {0xa9, 0x00}, {0x8f, 0x03}, {0xb2, 0x00}, {0xb3, 0x00}, {0xac, 0x03}, {0xa3, 0x00}, {0xad, 0x03}, {0xae, 0x03}, {0xaf, 0x03}, /* 0xa0*/ {0xca, 0x03}, {0x90, 0x03}, {0xcc, 0x03}, {0xcd, 0x03}, {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, {0x94, 0x03}, {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, {0xbd, 0x00}, {0x98, 0x03}, {0x99, 0x03}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x9a, 0x03}, {0x9b, 0x03}, {0x9c, 0x03}, {0x9d, 0x03}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x9e, 0x03}, {0x9f, 0x03}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0xa0, 0x03}, {0xa1, 0x03}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa3, 0x03}, /* 0xd0*/ {0xa4, 0x03}, {0xa5, 0x03}, {0xa6, 0x03}, {0xa7, 0x03}, {0xa8, 0x03}, {0xa9, 0x03}, {0xb1, 0x03}, {0xb2, 0x03}, {0xb3, 0x03}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0xb4, 0x03}, {0xb5, 0x03}, {0x80, 0x25}, /* 0xe0*/ {0xb6, 0x03}, {0xb7, 0x03}, {0xb8, 0x03}, {0xb9, 0x03}, {0xba, 0x03}, {0xbb, 0x03}, {0xbc, 0x03}, {0xbd, 0x03}, {0xbe, 0x03}, {0xbf, 0x03}, {0xc0, 0x03}, {0xc1, 0x03}, {0xc3, 0x03}, {0xc2, 0x03}, {0xc4, 0x03}, {0x84, 0x03}, /* 0xf0*/ {0xad, 0x00}, {0xb1, 0x00}, {0xc5, 0x03}, {0xc6, 0x03}, {0xc7, 0x03}, {0xa7, 0x00}, {0xc8, 0x03}, {0x85, 0x03}, {0xb0, 0x00}, {0xa8, 0x00}, {0xc9, 0x03}, {0xcb, 0x03}, {0xb0, 0x03}, {0xce, 0x03}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x8a, 0xf5, /* 0xa0-0xa7 */ 0xf9, 0x97, 0x00, 0xae, 0x89, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */ 0xf8, 0xf1, 0x99, 0x9a, 0x00, 0x00, 0x00, 0x88, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xaf, 0x00, 0xab, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0xef, 0xf7, 0x86, 0x00, /* 0x80-0x87 */ 0x8d, 0x8f, 0x90, 0x00, 0x92, 0x00, 0x95, 0x98, /* 0x88-0x8f */ 0xa1, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, /* 0x90-0x97 */ 0xac, 0xad, 0xb5, 0xb6, 0xb7, 0xb8, 0xbd, 0xbe, /* 0x98-0x9f */ 0xc6, 0xc7, 0x00, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, /* 0xa0-0xa7 */ 0xd4, 0xd5, 0x91, 0x96, 0x9b, 0x9d, 0x9e, 0x9f, /* 0xa8-0xaf */ 0xfc, 0xd6, 0xd7, 0xd8, 0xdd, 0xde, 0xe0, 0xe1, /* 0xb0-0xb7 */ 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, /* 0xb8-0xbf */ 0xea, 0xeb, 0xed, 0xec, 0xee, 0xf2, 0xf3, 0xf4, /* 0xc0-0xc7 */ 0xf6, 0xfa, 0xa0, 0xfb, 0xa2, 0xa3, 0xfd, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, /* 0x10-0x17 */ 0x8b, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, NULL, NULL, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x00, 0x9c, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0x00, 0x00, 0x00, 0xf5, 0x00, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp869", page_uni2charset, charset2uni, NULL }; int init_unls_cp869() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/CMakeLists.txt0000644000372500001440000000161111304054475016336 0ustar steveusersPROJECT (LIBunls C) INCLUDE_DIRECTORIES(../include ../libhfs_iso ../wodim ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include) ADD_DEFINITIONS(-DHAVE_CONFIG_H) IF(HAVE_ICONV_H) ADD_DEFINITIONS(-DUSE_ICONV) ENDIF(HAVE_ICONV_H) SET(LIBunls_SRCS nls_base.c nls_config.c nls_cp10000.c nls_cp10006.c nls_cp10007.c nls_cp10029.c nls_cp10079.c nls_cp10081.c nls_cp1250.c nls_cp1251.c nls_cp437.c nls_cp737.c nls_cp775.c nls_cp850.c nls_cp852.c nls_cp855.c nls_cp857.c nls_cp860.c nls_cp861.c nls_cp862.c nls_cp863.c nls_cp864.c nls_cp865.c nls_cp866.c nls_cp869.c nls_cp874.c nls_file.c nls_iso8859-1.c nls_iso8859-14.c nls_iso8859-15.c nls_iso8859-2.c nls_iso8859-3.c nls_iso8859-4.c nls_iso8859-5.c nls_iso8859-6.c nls_iso8859-7.c nls_iso8859-8.c nls_iso8859-9.c nls_koi8-r.c nls_koi8-u.c nls_iconv.c) #SET_SOURCE_FILES_PROPERTIES(${LIBunls_SRCS} PROPERTIES ) ADD_LIBRARY (unls STATIC ${LIBunls_SRCS}) cdrkit-1.1.11/libunls/nls_iso8859-15.c0000644000372500001440000002764310536265343016212 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-15.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-15.c * * Charset iso8859-15 translation tables. * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xac, 0x20}, {0xa5, 0x00}, {0x60, 0x01}, {0xa7, 0x00}, {0x61, 0x01}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00}, {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00}, /* 0xb0*/ {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, {0x7d, 0x01}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00}, {0x7e, 0x01}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00}, {0x52, 0x01}, {0x53, 0x01}, {0x78, 0x01}, {0xbf, 0x00}, /* 0xc0*/ {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00}, {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, /* 0xd0*/ {0xd0, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00}, {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00}, {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xdc, 0x00}, {0xdd, 0x00}, {0xde, 0x00}, {0xdf, 0x00}, /* 0xe0*/ {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00}, {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00}, /* 0xf0*/ {0xf0, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00}, {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00}, {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, {0xfd, 0x00}, {0xfe, 0x00}, {0xff, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0x00, 0xa5, 0x00, 0xa7, /* 0xa0-0xa7 */ 0x00, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0x00, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0x00, 0xb9, 0xba, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0xbc, 0xbd, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xa6, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0xbe, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xb8, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; static struct unls_table table = { "iso8859-15", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_15() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp866.c0000644000372500001440000004436110536265343015501 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp866.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp866.c * * Charset cp866 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x10, 0x04}, {0x11, 0x04}, {0x12, 0x04}, {0x13, 0x04}, {0x14, 0x04}, {0x15, 0x04}, {0x16, 0x04}, {0x17, 0x04}, {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04}, {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, {0x1f, 0x04}, /* 0x90*/ {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04}, {0x24, 0x04}, {0x25, 0x04}, {0x26, 0x04}, {0x27, 0x04}, {0x28, 0x04}, {0x29, 0x04}, {0x2a, 0x04}, {0x2b, 0x04}, {0x2c, 0x04}, {0x2d, 0x04}, {0x2e, 0x04}, {0x2f, 0x04}, /* 0xa0*/ {0x30, 0x04}, {0x31, 0x04}, {0x32, 0x04}, {0x33, 0x04}, {0x34, 0x04}, {0x35, 0x04}, {0x36, 0x04}, {0x37, 0x04}, {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04}, {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, {0x3f, 0x04}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, /* 0xd0*/ {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, /* 0xe0*/ {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04}, {0x44, 0x04}, {0x45, 0x04}, {0x46, 0x04}, {0x47, 0x04}, {0x48, 0x04}, {0x49, 0x04}, {0x4a, 0x04}, {0x4b, 0x04}, {0x4c, 0x04}, {0x4d, 0x04}, {0x4e, 0x04}, {0x4f, 0x04}, /* 0xf0*/ {0x01, 0x04}, {0x51, 0x04}, {0x04, 0x04}, {0x54, 0x04}, {0x07, 0x04}, {0x57, 0x04}, {0x0e, 0x04}, {0x5e, 0x04}, {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, {0x16, 0x21}, {0xa4, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page04[256] = { 0x00, 0xf0, 0x00, 0x00, 0xf2, 0x00, 0x00, 0xf4, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, /* 0x08-0x0f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x30-0x37 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x38-0x3f */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */ 0x00, 0xf1, 0x00, 0x00, 0xf3, 0x00, 0x00, 0xf5, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page21, page22, NULL, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0xf0, 0x00, 0xf2, 0x00, 0xf4, 0x00, 0xf6, 0x00, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp866", page_uni2charset, charset2uni, NULL }; int init_unls_cp866() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp10000.c0000644000372500001440000010071110536265343015606 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp10000.c 1.3 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code generated by James Pearson j.pearson@ge.ucl.ac.uk 26/4/2000 * based on a script by Gordon Chaffee */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp10000.c * * Charset cp10000 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xc4, 0x00}, {0xc5, 0x00}, {0xc7, 0x00}, {0xc9, 0x00}, {0xd1, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xe1, 0x00}, {0xe0, 0x00}, {0xe2, 0x00}, {0xe4, 0x00}, {0xe3, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, {0xe9, 0x00}, {0xe8, 0x00}, /* 0x90*/ {0xea, 0x00}, {0xeb, 0x00}, {0xed, 0x00}, {0xec, 0x00}, {0xee, 0x00}, {0xef, 0x00}, {0xf1, 0x00}, {0xf3, 0x00}, {0xf2, 0x00}, {0xf4, 0x00}, {0xf6, 0x00}, {0xf5, 0x00}, {0xfa, 0x00}, {0xf9, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, /* 0xa0*/ {0x20, 0x20}, {0xb0, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xa7, 0x00}, {0x22, 0x20}, {0xb6, 0x00}, {0xdf, 0x00}, {0xae, 0x00}, {0xa9, 0x00}, {0x22, 0x21}, {0xb4, 0x00}, {0xa8, 0x00}, {0x60, 0x22}, {0xc6, 0x00}, {0xd8, 0x00}, /* 0xb0*/ {0x1e, 0x22}, {0xb1, 0x00}, {0x64, 0x22}, {0x65, 0x22}, {0xa5, 0x00}, {0xb5, 0x00}, {0x02, 0x22}, {0x11, 0x22}, {0x0f, 0x22}, {0xc0, 0x03}, {0x2b, 0x22}, {0xaa, 0x00}, {0xba, 0x00}, {0xa9, 0x03}, {0xe6, 0x00}, {0xf8, 0x00}, /* 0xc0*/ {0xbf, 0x00}, {0xa1, 0x00}, {0xac, 0x00}, {0x1a, 0x22}, {0x92, 0x01}, {0x48, 0x22}, {0x06, 0x22}, {0xab, 0x00}, {0xbb, 0x00}, {0x26, 0x20}, {0xa0, 0x00}, {0xc0, 0x00}, {0xc3, 0x00}, {0xd5, 0x00}, {0x52, 0x01}, {0x53, 0x01}, /* 0xd0*/ {0x13, 0x20}, {0x14, 0x20}, {0x1c, 0x20}, {0x1d, 0x20}, {0x18, 0x20}, {0x19, 0x20}, {0xf7, 0x00}, {0xca, 0x25}, {0xff, 0x00}, {0x78, 0x01}, {0x44, 0x20}, {0xac, 0x20}, {0x39, 0x20}, {0x3a, 0x20}, {0x01, 0xfb}, {0x02, 0xfb}, /* 0xe0*/ {0x21, 0x20}, {0xb7, 0x00}, {0x1a, 0x20}, {0x1e, 0x20}, {0x30, 0x20}, {0xc2, 0x00}, {0xca, 0x00}, {0xc1, 0x00}, {0xcb, 0x00}, {0xc8, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, {0xcc, 0x00}, {0xd3, 0x00}, {0xd4, 0x00}, /* 0xf0*/ {0xff, 0xf8}, {0xd2, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00}, {0x31, 0x01}, {0xc6, 0x02}, {0xdc, 0x02}, {0xaf, 0x00}, {0xd8, 0x02}, {0xd9, 0x02}, {0xda, 0x02}, {0xb8, 0x00}, {0xdd, 0x02}, {0xdb, 0x02}, {0xc7, 0x02}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xca, 0xc1, 0xa2, 0xa3, 0x00, 0xb4, 0x00, 0xa4, /* 0xa0-0xa7 */ 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0x00, 0xa8, 0xf8, /* 0xa8-0xaf */ 0xa1, 0xb1, 0x00, 0x00, 0xab, 0xb5, 0xa6, 0xe1, /* 0xb0-0xb7 */ 0xfc, 0x00, 0xbc, 0xc8, 0x00, 0x00, 0x00, 0xc0, /* 0xb8-0xbf */ 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, /* 0xc0-0xc7 */ 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, /* 0xc8-0xcf */ 0x00, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x00, /* 0xd0-0xd7 */ 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0x00, 0x00, 0xa7, /* 0xd8-0xdf */ 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, /* 0xe0-0xe7 */ 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, /* 0xe8-0xef */ 0x00, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, /* 0xf0-0xf7 */ 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0x00, 0x00, 0xd8, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0xce, 0xcf, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0xd9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page02[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xff, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0xf9, 0xfa, 0xfb, 0xfe, 0xf7, 0xfd, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xb9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0xe2, 0x00, 0xd2, 0xd3, 0xe3, 0x00, /* 0x18-0x1f */ 0xa0, 0xe0, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0xdc, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0xc6, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, /* 0x08-0x0f */ 0x00, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0xb0, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char pagef8[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, /* 0xf8-0xff */ }; static unsigned char pagefb[256] = { 0x00, 0xde, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, page02, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, page21, page22, NULL, NULL, page25, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pagef8, NULL, NULL, pagefb, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x60-0x67 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x68-0x6f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x70-0x77 */ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0xe7, /* 0x80-0x87 */ 0xcb, 0xe5, 0x80, 0xcc, 0x81, 0x82, 0x83, 0xe9, /* 0x88-0x8f */ 0xe6, 0xe8, 0xea, 0xed, 0xeb, 0xec, 0x84, 0xee, /* 0x90-0x97 */ 0xf1, 0xef, 0x85, 0xcd, 0xf2, 0xf4, 0xf3, 0x86, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x53, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0x50, 0xba, 0xbb, 0xbc, 0xbd, 0xae, 0xaf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0x46, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd9, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0x49, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; static unsigned char charset2lower[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x40-0x47 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x48-0x4f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x50-0x57 */ 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x8a, 0x8c, 0x8d, 0x8e, 0x96, 0x9a, 0x9f, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xbe, 0xbf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0x00, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0x88, 0x8b, 0x9b, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd8, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0x89, 0x90, 0x87, /* 0xe0-0xe7 */ 0x91, 0x8f, 0x92, 0x94, 0x95, 0x93, 0x97, 0x99, /* 0xe8-0xef */ 0xf0, 0x98, 0x9c, 0x9e, 0x9d, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp10000", page_uni2charset, charset2uni, NULL }; int init_unls_cp10000() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_iso8859-4.c0000644000372500001440000003356510536265343016130 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-4.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-4.c * * Charset iso8859-4 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0x04, 0x01}, {0x38, 0x01}, {0x56, 0x01}, {0xa4, 0x00}, {0x28, 0x01}, {0x3b, 0x01}, {0xa7, 0x00}, {0xa8, 0x00}, {0x60, 0x01}, {0x12, 0x01}, {0x22, 0x01}, {0x66, 0x01}, {0xad, 0x00}, {0x7d, 0x01}, {0xaf, 0x00}, /* 0xb0*/ {0xb0, 0x00}, {0x05, 0x01}, {0xdb, 0x02}, {0x57, 0x01}, {0xb4, 0x00}, {0x29, 0x01}, {0x3c, 0x01}, {0xc7, 0x02}, {0xb8, 0x00}, {0x61, 0x01}, {0x13, 0x01}, {0x23, 0x01}, {0x67, 0x01}, {0x4a, 0x01}, {0x7e, 0x01}, {0x4b, 0x01}, /* 0xc0*/ {0x00, 0x01}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0x2e, 0x01}, {0x0c, 0x01}, {0xc9, 0x00}, {0x18, 0x01}, {0xcb, 0x00}, {0x16, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0x2a, 0x01}, /* 0xd0*/ {0x10, 0x01}, {0x45, 0x01}, {0x4c, 0x01}, {0x36, 0x01}, {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00}, {0xd8, 0x00}, {0x72, 0x01}, {0xda, 0x00}, {0xdb, 0x00}, {0xdc, 0x00}, {0x68, 0x01}, {0x6a, 0x01}, {0xdf, 0x00}, /* 0xe0*/ {0x01, 0x01}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0x2f, 0x01}, {0x0d, 0x01}, {0xe9, 0x00}, {0x19, 0x01}, {0xeb, 0x00}, {0x17, 0x01}, {0xed, 0x00}, {0xee, 0x00}, {0x2b, 0x01}, /* 0xf0*/ {0x11, 0x01}, {0x46, 0x01}, {0x4d, 0x01}, {0x37, 0x01}, {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00}, {0xf8, 0x00}, {0x73, 0x01}, {0xfa, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, {0x69, 0x01}, {0x6b, 0x01}, {0xd9, 0x02}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0xaf, /* 0xa8-0xaf */ 0xb0, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0x00, /* 0xc0-0xc7 */ 0x00, 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0xce, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0x00, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */ 0x00, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */ 0x00, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0xee, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0x00, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0xc0, 0xe0, 0x00, 0x00, 0xa1, 0xb1, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0x00, 0x00, /* 0x08-0x0f */ 0xd0, 0xf0, 0xaa, 0xba, 0x00, 0x00, 0xcc, 0xec, /* 0x10-0x17 */ 0xca, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0xab, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0xa5, 0xb5, 0xcf, 0xef, 0x00, 0x00, 0xc7, 0xe7, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0xf3, /* 0x30-0x37 */ 0xa2, 0x00, 0x00, 0xa6, 0xb6, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xf1, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0xbd, 0xbf, 0xd2, 0xf2, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0xb3, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xa9, 0xb9, 0x00, 0x00, 0x00, 0x00, 0xac, 0xbc, /* 0x60-0x67 */ 0xdd, 0xfd, 0xde, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0xd9, 0xf9, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0xbe, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page02[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0xff, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, page02, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0x00, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0x00, 0xb2, 0x00, 0xb4, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "iso8859-4", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_4() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_iso8859-5.c0000644000372500001440000003416110536265343016122 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-5.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-5.c * * Charset iso8859-5 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0x01, 0x04}, {0x02, 0x04}, {0x03, 0x04}, {0x04, 0x04}, {0x05, 0x04}, {0x06, 0x04}, {0x07, 0x04}, {0x08, 0x04}, {0x09, 0x04}, {0x0a, 0x04}, {0x0b, 0x04}, {0x0c, 0x04}, {0xad, 0x00}, {0x0e, 0x04}, {0x0f, 0x04}, /* 0xb0*/ {0x10, 0x04}, {0x11, 0x04}, {0x12, 0x04}, {0x13, 0x04}, {0x14, 0x04}, {0x15, 0x04}, {0x16, 0x04}, {0x17, 0x04}, {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04}, {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, {0x1f, 0x04}, /* 0xc0*/ {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04}, {0x24, 0x04}, {0x25, 0x04}, {0x26, 0x04}, {0x27, 0x04}, {0x28, 0x04}, {0x29, 0x04}, {0x2a, 0x04}, {0x2b, 0x04}, {0x2c, 0x04}, {0x2d, 0x04}, {0x2e, 0x04}, {0x2f, 0x04}, /* 0xd0*/ {0x30, 0x04}, {0x31, 0x04}, {0x32, 0x04}, {0x33, 0x04}, {0x34, 0x04}, {0x35, 0x04}, {0x36, 0x04}, {0x37, 0x04}, {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04}, {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, {0x3f, 0x04}, /* 0xe0*/ {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04}, {0x44, 0x04}, {0x45, 0x04}, {0x46, 0x04}, {0x47, 0x04}, {0x48, 0x04}, {0x49, 0x04}, {0x4a, 0x04}, {0x4b, 0x04}, {0x4c, 0x04}, {0x4d, 0x04}, {0x4e, 0x04}, {0x4f, 0x04}, /* 0xf0*/ {0x16, 0x21}, {0x51, 0x04}, {0x52, 0x04}, {0x53, 0x04}, {0x54, 0x04}, {0x55, 0x04}, {0x56, 0x04}, {0x57, 0x04}, {0x58, 0x04}, {0x59, 0x04}, {0x5a, 0x04}, {0x5b, 0x04}, {0x5c, 0x04}, {0xa7, 0x00}, {0x5e, 0x04}, {0x5f, 0x04}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page04[256] = { 0x00, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x00-0x07 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0x00, 0xae, 0xaf, /* 0x08-0x0f */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x10-0x17 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x18-0x1f */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0x38-0x3f */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */ 0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x50-0x57 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0xfe, 0xff, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page21, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "iso8859-5", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_5() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_iso8859-2.c0000644000372500001440000003356510536265343016126 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-2.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-2.c * * Charset iso8859-2 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0x04, 0x01}, {0xd8, 0x02}, {0x41, 0x01}, {0xa4, 0x00}, {0x3d, 0x01}, {0x5a, 0x01}, {0xa7, 0x00}, {0xa8, 0x00}, {0x60, 0x01}, {0x5e, 0x01}, {0x64, 0x01}, {0x79, 0x01}, {0xad, 0x00}, {0x7d, 0x01}, {0x7b, 0x01}, /* 0xb0*/ {0xb0, 0x00}, {0x05, 0x01}, {0xdb, 0x02}, {0x42, 0x01}, {0xb4, 0x00}, {0x3e, 0x01}, {0x5b, 0x01}, {0xc7, 0x02}, {0xb8, 0x00}, {0x61, 0x01}, {0x5f, 0x01}, {0x65, 0x01}, {0x7a, 0x01}, {0xdd, 0x02}, {0x7e, 0x01}, {0x7c, 0x01}, /* 0xc0*/ {0x54, 0x01}, {0xc1, 0x00}, {0xc2, 0x00}, {0x02, 0x01}, {0xc4, 0x00}, {0x39, 0x01}, {0x06, 0x01}, {0xc7, 0x00}, {0x0c, 0x01}, {0xc9, 0x00}, {0x18, 0x01}, {0xcb, 0x00}, {0x1a, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0x0e, 0x01}, /* 0xd0*/ {0x10, 0x01}, {0x43, 0x01}, {0x47, 0x01}, {0xd3, 0x00}, {0xd4, 0x00}, {0x50, 0x01}, {0xd6, 0x00}, {0xd7, 0x00}, {0x58, 0x01}, {0x6e, 0x01}, {0xda, 0x00}, {0x70, 0x01}, {0xdc, 0x00}, {0xdd, 0x00}, {0x62, 0x01}, {0xdf, 0x00}, /* 0xe0*/ {0x55, 0x01}, {0xe1, 0x00}, {0xe2, 0x00}, {0x03, 0x01}, {0xe4, 0x00}, {0x3a, 0x01}, {0x07, 0x01}, {0xe7, 0x00}, {0x0d, 0x01}, {0xe9, 0x00}, {0x19, 0x01}, {0xeb, 0x00}, {0x1b, 0x01}, {0xed, 0x00}, {0xee, 0x00}, {0x0f, 0x01}, /* 0xf0*/ {0x11, 0x01}, {0x44, 0x01}, {0x48, 0x01}, {0xf3, 0x00}, {0xf4, 0x00}, {0x51, 0x01}, {0xf6, 0x00}, {0xf7, 0x00}, {0x59, 0x01}, {0x6f, 0x01}, {0xfa, 0x00}, {0x71, 0x01}, {0xfc, 0x00}, {0xfd, 0x00}, {0x63, 0x01}, {0xd9, 0x02}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ 0xb0, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, /* 0xc0-0xc7 */ 0x00, 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0xce, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0x00, 0x00, 0xda, 0x00, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */ 0x00, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, /* 0xe0-0xe7 */ 0x00, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0xee, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0x00, 0x00, 0xfa, 0x00, 0xfc, 0xfd, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0xc3, 0xe3, 0xa1, 0xb1, 0xc6, 0xe6, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0xcf, 0xef, /* 0x08-0x0f */ 0xd0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xca, 0xea, 0xcc, 0xec, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0xc5, 0xe5, 0x00, 0x00, 0xa5, 0xb5, 0x00, /* 0x38-0x3f */ 0x00, 0xa3, 0xb3, 0xd1, 0xf1, 0x00, 0x00, 0xd2, /* 0x40-0x47 */ 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xd5, 0xf5, 0x00, 0x00, 0xc0, 0xe0, 0x00, 0x00, /* 0x50-0x57 */ 0xd8, 0xf8, 0xa6, 0xb6, 0x00, 0x00, 0xaa, 0xba, /* 0x58-0x5f */ 0xa9, 0xb9, 0xde, 0xfe, 0xab, 0xbb, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd9, 0xf9, /* 0x68-0x6f */ 0xdb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0xac, 0xbc, 0xaf, 0xbf, 0xae, 0xbe, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page02[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0xa2, 0xff, 0x00, 0xb2, 0x00, 0xbd, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, page02, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0x00, 0xb2, 0x00, 0xb4, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "iso8859-2", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_2() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_base.c0000644000372500001440000002137110536265343015541 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_base.c 1.5 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * Thanks to Georgy Salnikov * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls.c * * Native language support--charsets and unicode translations. * By Gordon Chaffee 1996, 1997 * */ #include #include #include #include #include "nls.h" static struct unls_table *tables = (struct unls_table *) NULL; int register_unls(struct unls_table *unls) { struct unls_table ** tmp = &tables; if (!unls) return (-EINVAL); if (unls->unls_next) return (-EBUSY); while (*tmp) { if (unls == *tmp) { return (-EBUSY); } tmp = &(*tmp)->unls_next; } unls->unls_next = tables; tables = unls; return (0); } int unregister_unls(struct unls_table *unls) { struct unls_table ** tmp = &tables; while (*tmp) { if (unls == *tmp) { *tmp = unls->unls_next; return (0); } tmp = &(*tmp)->unls_next; } return (-EINVAL); } struct unls_table * find_unls(char *charset) { struct unls_table *unls = tables; while (unls) { if (strcmp(unls->unls_name, charset) == 0) return (unls); unls = unls->unls_next; } return (NULL); } void list_unls() { struct unls_table *unls = tables; while (unls) { fprintf(stderr, "%s\n", unls->unls_name); unls = unls->unls_next; } } struct unls_table * load_unls(char *charset) { struct unls_table *unls; unls = find_unls(charset); if (unls) { return (unls); } return (NULL); } void unload_unls(struct unls_table *nls) { } static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x80, 0x00}, {0x81, 0x00}, {0x82, 0x00}, {0x83, 0x00}, {0x84, 0x00}, {0x85, 0x00}, {0x86, 0x00}, {0x87, 0x00}, {0x88, 0x00}, {0x89, 0x00}, {0x8a, 0x00}, {0x8b, 0x00}, {0x8c, 0x00}, {0x8d, 0x00}, {0x8e, 0x00}, {0x8f, 0x00}, /* 0x90*/ {0x90, 0x00}, {0x91, 0x00}, {0x92, 0x00}, {0x93, 0x00}, {0x94, 0x00}, {0x95, 0x00}, {0x96, 0x00}, {0x97, 0x00}, {0x98, 0x00}, {0x99, 0x00}, {0x9a, 0x00}, {0x9b, 0x00}, {0x9c, 0x00}, {0x9d, 0x00}, {0x9e, 0x00}, {0x9f, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00}, {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00}, {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00}, /* 0xb0*/ {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00}, {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00}, {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00}, /* 0xc0*/ {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00}, {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, /* 0xd0*/ {0xd0, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00}, {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00}, {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xdc, 0x00}, {0xdd, 0x00}, {0xde, 0x00}, {0xdf, 0x00}, /* 0xe0*/ {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00}, {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00}, /* 0xf0*/ {0xf0, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00}, {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00}, {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, {0xfd, 0x00}, {0xfe, 0x00}, {0xff, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00 }; static struct unls_table default_table = { "default", page_uni2charset, charset2uni, NULL }; /* Returns a simple default translation table */ struct unls_table * load_unls_default() { return (&default_table); } cdrkit-1.1.11/libunls/nls_cp861.c0000644000372500001440000005460510536265343015476 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp861.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp861.c * * Charset cp861 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xd0, 0x00}, {0xf0, 0x00}, {0xde, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, /* 0x90*/ {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00}, {0xf6, 0x00}, {0xfe, 0x00}, {0xfb, 0x00}, {0xdd, 0x00}, {0xfd, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00}, {0xa3, 0x00}, {0xd8, 0x00}, {0xa7, 0x20}, {0x92, 0x01}, /* 0xa0*/ {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, {0xc1, 0x00}, {0xcd, 0x00}, {0xd3, 0x00}, {0xda, 0x00}, {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00}, {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, /* 0xd0*/ {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, /* 0xe0*/ {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, /* 0xf0*/ {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0xad, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */ 0x00, 0xa4, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */ 0x00, 0x90, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, /* 0xc8-0xcf */ 0x8b, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */ 0x9d, 0x00, 0xa7, 0x00, 0x9a, 0x97, 0x8d, 0xe1, /* 0xd8-0xdf */ 0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */ 0x8a, 0x82, 0x88, 0x89, 0x00, 0xa1, 0x00, 0x00, /* 0xe8-0xef */ 0x8c, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */ 0x9b, 0x00, 0xa3, 0x96, 0x81, 0x98, 0x95, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page23[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, page22, page23, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x8b, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x97, /* 0x90-0x97 */ 0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp861", page_uni2charset, charset2uni, NULL }; int init_unls_cp861() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp10006.c0000644000372500001440000006436010536265343015625 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp10006.c 1.3 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code generated by James Pearson j.pearson@ge.ucl.ac.uk 17/8/2000 * based on a script by Gordon Chaffee */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp10006.c * * Charset cp10006 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x10*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x00, 0x00}, /* 0x80*/ {0xc4, 0x00}, {0xb9, 0x00}, {0xb2, 0x00}, {0xc9, 0x00}, {0xb3, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0x85, 0x03}, {0xe0, 0x00}, {0xe2, 0x00}, {0xe4, 0x00}, {0x84, 0x03}, {0xa8, 0x00}, {0xe7, 0x00}, {0xe9, 0x00}, {0xe8, 0x00}, /* 0x90*/ {0xea, 0x00}, {0xeb, 0x00}, {0xa3, 0x00}, {0x22, 0x21}, {0xee, 0x00}, {0xef, 0x00}, {0x22, 0x20}, {0xbd, 0x00}, {0x30, 0x20}, {0xf4, 0x00}, {0xf6, 0x00}, {0xa6, 0x00}, {0xad, 0x00}, {0xf9, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, /* 0xa0*/ {0x20, 0x20}, {0x93, 0x03}, {0x94, 0x03}, {0x98, 0x03}, {0x9b, 0x03}, {0x9e, 0x03}, {0xa0, 0x03}, {0xdf, 0x00}, {0xae, 0x00}, {0xa9, 0x00}, {0xa3, 0x03}, {0xaa, 0x03}, {0xa7, 0x00}, {0x60, 0x22}, {0xb0, 0x00}, {0xb7, 0x00}, /* 0xb0*/ {0x91, 0x03}, {0xb1, 0x00}, {0x64, 0x22}, {0x65, 0x22}, {0xa5, 0x00}, {0x92, 0x03}, {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, {0x99, 0x03}, {0x9a, 0x03}, {0x9c, 0x03}, {0xa6, 0x03}, {0xab, 0x03}, {0xa8, 0x03}, {0xa9, 0x03}, /* 0xc0*/ {0xac, 0x03}, {0x9d, 0x03}, {0xac, 0x00}, {0x9f, 0x03}, {0xa1, 0x03}, {0x48, 0x22}, {0xa4, 0x03}, {0xab, 0x00}, {0xbb, 0x00}, {0x26, 0x20}, {0xa0, 0x00}, {0xa5, 0x03}, {0xa7, 0x03}, {0x86, 0x03}, {0x88, 0x03}, {0x53, 0x01}, /* 0xd0*/ {0x13, 0x20}, {0x15, 0x20}, {0x1c, 0x20}, {0x1d, 0x20}, {0x18, 0x20}, {0x19, 0x20}, {0xf7, 0x00}, {0x89, 0x03}, {0x8a, 0x03}, {0x8c, 0x03}, {0x8e, 0x03}, {0xad, 0x03}, {0xae, 0x03}, {0xaf, 0x03}, {0xcc, 0x03}, {0x8f, 0x03}, /* 0xe0*/ {0xcd, 0x03}, {0xb1, 0x03}, {0xb2, 0x03}, {0xc8, 0x03}, {0xb4, 0x03}, {0xb5, 0x03}, {0xc6, 0x03}, {0xb3, 0x03}, {0xb7, 0x03}, {0xb9, 0x03}, {0xbe, 0x03}, {0xba, 0x03}, {0xbb, 0x03}, {0xbc, 0x03}, {0xbd, 0x03}, {0xbf, 0x03}, /* 0xf0*/ {0xc0, 0x03}, {0xce, 0x03}, {0xc1, 0x03}, {0xc3, 0x03}, {0xc4, 0x03}, {0xb8, 0x03}, {0xc9, 0x03}, {0xc2, 0x03}, {0xc7, 0x03}, {0xc5, 0x03}, {0xb6, 0x03}, {0xca, 0x03}, {0xcb, 0x03}, {0x90, 0x03}, {0xb0, 0x03}, {0xa0, 0xf8}, }; static unsigned char page00[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xca, 0x00, 0x00, 0x92, 0x00, 0xb4, 0x9b, 0xac, /* 0xa0-0xa7 */ 0x8c, 0xa9, 0x00, 0xc7, 0xc2, 0x9c, 0xa8, 0x00, /* 0xa8-0xaf */ 0xae, 0xb1, 0x82, 0x84, 0x00, 0x00, 0x00, 0xaf, /* 0xb0-0xb7 */ 0x00, 0x81, 0x00, 0xc8, 0x00, 0x97, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0xa7, /* 0xd8-0xdf */ 0x88, 0x00, 0x89, 0x00, 0x8a, 0x00, 0x00, 0x8d, /* 0xe0-0xe7 */ 0x8f, 0x8e, 0x90, 0x91, 0x00, 0x00, 0x94, 0x95, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, 0x9a, 0xd6, /* 0xf0-0xf7 */ 0x00, 0x9d, 0x00, 0x9e, 0x9f, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x8b, 0x87, 0xcd, 0x00, /* 0x80-0x87 */ 0xce, 0xd7, 0xd8, 0x00, 0xd9, 0x00, 0xda, 0xdf, /* 0x88-0x8f */ 0xfd, 0xb0, 0xb5, 0xa1, 0xa2, 0xb6, 0xb7, 0xb8, /* 0x90-0x97 */ 0xa3, 0xb9, 0xba, 0xa4, 0xbb, 0xc1, 0xa5, 0xc3, /* 0x98-0x9f */ 0xa6, 0xc4, 0x00, 0xaa, 0xc6, 0xcb, 0xbc, 0xcc, /* 0xa0-0xa7 */ 0xbe, 0xbf, 0xab, 0xbd, 0xc0, 0xdb, 0xdc, 0xdd, /* 0xa8-0xaf */ 0xfe, 0xe1, 0xe2, 0xe7, 0xe4, 0xe5, 0xfa, 0xe8, /* 0xb0-0xb7 */ 0xf5, 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xea, 0xef, /* 0xb8-0xbf */ 0xf0, 0xf2, 0xf7, 0xf3, 0xf4, 0xf9, 0xe6, 0xf8, /* 0xc0-0xc7 */ 0xe3, 0xf6, 0xfb, 0xfc, 0xde, 0xe0, 0xf1, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0xd0, 0x00, 0xd1, 0x00, 0x00, /* 0x10-0x17 */ 0xd4, 0xd5, 0x00, 0x00, 0xd2, 0xd3, 0x00, 0x00, /* 0x18-0x1f */ 0xa0, 0x00, 0x96, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0xad, 0x00, 0x00, 0x00, 0xb2, 0xb3, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char pagef8[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, page21, page22, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pagef8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x60-0x67 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x68-0x6f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x70-0x77 */ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x41, 0x41, 0x80, 0x8b, 0x8c, 0x43, 0x83, 0x45, /* 0x88-0x8f */ 0x45, 0x45, 0x92, 0x93, 0x49, 0x49, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x4f, 0x85, 0x9b, 0x9c, 0x55, 0x55, 0x86, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x53, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xcd, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xce, 0xd7, 0xd8, 0xd9, 0xdf, /* 0xd8-0xdf */ 0xda, 0xb0, 0xb5, 0xbe, 0xa2, 0xb6, 0xbc, 0xa1, /* 0xe0-0xe7 */ 0xb8, 0xb9, 0xa5, 0xba, 0xa4, 0xbb, 0xc1, 0xc3, /* 0xe8-0xef */ 0xa6, 0xdf, 0xc4, 0xaa, 0xc6, 0xa3, 0xbf, 0xaa, /* 0xf0-0xf7 */ 0xcc, 0xcb, 0xb7, 0xab, 0xbd, 0xb9, 0xcb, 0xff, /* 0xf8-0xff */ }; static unsigned char charset2lower[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x40-0x47 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x48-0x4f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x50-0x57 */ 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x8a, 0x81, 0x82, 0x8e, 0x84, 0x9a, 0x9f, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xe7, 0xe4, 0xf5, 0xec, 0xea, 0xf0, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xf3, 0xfb, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xe1, 0xb1, 0xb2, 0xb3, 0xb4, 0xe2, 0xe5, 0xfa, /* 0xb0-0xb7 */ 0xe8, 0xe9, 0xeb, 0xed, 0xe6, 0xfc, 0xe3, 0xf6, /* 0xb8-0xbf */ 0xc0, 0xee, 0xc2, 0xef, 0xf2, 0xc5, 0xf4, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xf9, 0xf8, 0xc0, 0xdb, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xdc, /* 0xd0-0xd7 */ 0xdd, 0xde, 0xe0, 0xdb, 0xdc, 0xdd, 0xde, 0xf1, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp10006", page_uni2charset, charset2uni, NULL }; int init_unls_cp10006() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp855.c0000644000372500001440000004024710536265343015476 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp855.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp855.c * * Charset cp855 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x52, 0x04}, {0x02, 0x04}, {0x53, 0x04}, {0x03, 0x04}, {0x51, 0x04}, {0x01, 0x04}, {0x54, 0x04}, {0x04, 0x04}, {0x55, 0x04}, {0x05, 0x04}, {0x56, 0x04}, {0x06, 0x04}, {0x57, 0x04}, {0x07, 0x04}, {0x58, 0x04}, {0x08, 0x04}, /* 0x90*/ {0x59, 0x04}, {0x09, 0x04}, {0x5a, 0x04}, {0x0a, 0x04}, {0x5b, 0x04}, {0x0b, 0x04}, {0x5c, 0x04}, {0x0c, 0x04}, {0x5e, 0x04}, {0x0e, 0x04}, {0x5f, 0x04}, {0x0f, 0x04}, {0x4e, 0x04}, {0x2e, 0x04}, {0x4a, 0x04}, {0x2a, 0x04}, /* 0xa0*/ {0x30, 0x04}, {0x10, 0x04}, {0x31, 0x04}, {0x11, 0x04}, {0x46, 0x04}, {0x26, 0x04}, {0x34, 0x04}, {0x14, 0x04}, {0x35, 0x04}, {0x15, 0x04}, {0x44, 0x04}, {0x24, 0x04}, {0x33, 0x04}, {0x13, 0x04}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x45, 0x04}, {0x25, 0x04}, {0x38, 0x04}, {0x18, 0x04}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x39, 0x04}, {0x19, 0x04}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x3a, 0x04}, {0x1a, 0x04}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00}, /* 0xd0*/ {0x3b, 0x04}, {0x1b, 0x04}, {0x3c, 0x04}, {0x1c, 0x04}, {0x3d, 0x04}, {0x1d, 0x04}, {0x3e, 0x04}, {0x1e, 0x04}, {0x3f, 0x04}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x1f, 0x04}, {0x4f, 0x04}, {0x80, 0x25}, /* 0xe0*/ {0x2f, 0x04}, {0x40, 0x04}, {0x20, 0x04}, {0x41, 0x04}, {0x21, 0x04}, {0x42, 0x04}, {0x22, 0x04}, {0x43, 0x04}, {0x23, 0x04}, {0x36, 0x04}, {0x16, 0x04}, {0x32, 0x04}, {0x12, 0x04}, {0x4c, 0x04}, {0x2c, 0x04}, {0x16, 0x21}, /* 0xf0*/ {0xad, 0x00}, {0x4b, 0x04}, {0x2b, 0x04}, {0x37, 0x04}, {0x17, 0x04}, {0x48, 0x04}, {0x28, 0x04}, {0x4d, 0x04}, {0x2d, 0x04}, {0x49, 0x04}, {0x29, 0x04}, {0x47, 0x04}, {0x27, 0x04}, {0xa7, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0xfd, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0xae, 0x00, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page04[256] = { 0x00, 0x85, 0x81, 0x83, 0x87, 0x89, 0x8b, 0x8d, /* 0x00-0x07 */ 0x8f, 0x91, 0x93, 0x95, 0x97, 0x00, 0x99, 0x9b, /* 0x08-0x0f */ 0xa1, 0xa3, 0xec, 0xad, 0xa7, 0xa9, 0xea, 0xf4, /* 0x10-0x17 */ 0xb8, 0xbe, 0xc7, 0xd1, 0xd3, 0xd5, 0xd7, 0xdd, /* 0x18-0x1f */ 0xe2, 0xe4, 0xe6, 0xe8, 0xab, 0xb6, 0xa5, 0xfc, /* 0x20-0x27 */ 0xf6, 0xfa, 0x9f, 0xf2, 0xee, 0xf8, 0x9d, 0xe0, /* 0x28-0x2f */ 0xa0, 0xa2, 0xeb, 0xac, 0xa6, 0xa8, 0xe9, 0xf3, /* 0x30-0x37 */ 0xb7, 0xbd, 0xc6, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, /* 0x38-0x3f */ 0xe1, 0xe3, 0xe5, 0xe7, 0xaa, 0xb5, 0xa4, 0xfb, /* 0x40-0x47 */ 0xf5, 0xf9, 0x9e, 0xf1, 0xed, 0xf7, 0x9c, 0xde, /* 0x48-0x4f */ 0x00, 0x84, 0x80, 0x82, 0x86, 0x88, 0x8a, 0x8c, /* 0x50-0x57 */ 0x8e, 0x90, 0x92, 0x94, 0x96, 0x00, 0x98, 0x9a, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page21[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page21, NULL, NULL, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x81, 0x00, 0x83, 0x00, 0x85, 0x00, 0x87, /* 0x80-0x87 */ 0x00, 0x89, 0x00, 0x8b, 0x00, 0x8d, 0x00, 0x8f, /* 0x88-0x8f */ 0x00, 0x91, 0x00, 0x93, 0x00, 0x95, 0x00, 0x97, /* 0x90-0x97 */ 0x00, 0x99, 0x00, 0x9b, 0x00, 0x9d, 0x00, 0x9f, /* 0x98-0x9f */ 0x00, 0xa1, 0x00, 0xa3, 0x00, 0xa5, 0x00, 0xa7, /* 0xa0-0xa7 */ 0x00, 0xa9, 0x00, 0xab, 0x00, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0x00, 0xb6, 0x00, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0x00, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0x00, 0xd1, 0x00, 0xd3, 0x00, 0xd5, 0x00, 0xd7, /* 0xd0-0xd7 */ 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */ 0xe0, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ 0xe8, 0x00, 0xea, 0x00, 0xec, 0x00, 0xee, 0xef, /* 0xe8-0xef */ 0xf0, 0x00, 0xf2, 0x00, 0xf4, 0x00, 0xf6, 0x00, /* 0xf0-0xf7 */ 0xf8, 0x00, 0xfa, 0x00, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp855", page_uni2charset, charset2uni, NULL }; int init_unls_cp855() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_iso8859-7.c0000644000372500001440000004027310536265343016125 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-7.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-7.c * * Charset iso8859-7 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0xbd, 0x02}, {0xbc, 0x02}, {0xa3, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0xa6, 0x00}, {0xa7, 0x00}, {0xa8, 0x00}, {0xa9, 0x00}, {0x00, 0x00}, {0xab, 0x00}, {0xac, 0x00}, {0xad, 0x00}, {0x00, 0x00}, {0x15, 0x20}, /* 0xb0*/ {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, {0x84, 0x03}, {0x85, 0x03}, {0x86, 0x03}, {0xb7, 0x00}, {0x88, 0x03}, {0x89, 0x03}, {0x8a, 0x03}, {0xbb, 0x00}, {0x8c, 0x03}, {0xbd, 0x00}, {0x8e, 0x03}, {0x8f, 0x03}, /* 0xc0*/ {0x90, 0x03}, {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, {0x94, 0x03}, {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, {0x98, 0x03}, {0x99, 0x03}, {0x9a, 0x03}, {0x9b, 0x03}, {0x9c, 0x03}, {0x9d, 0x03}, {0x9e, 0x03}, {0x9f, 0x03}, /* 0xd0*/ {0xa0, 0x03}, {0xa1, 0x03}, {0x00, 0x00}, {0xa3, 0x03}, {0xa4, 0x03}, {0xa5, 0x03}, {0xa6, 0x03}, {0xa7, 0x03}, {0xa8, 0x03}, {0xa9, 0x03}, {0xaa, 0x03}, {0xab, 0x03}, {0xac, 0x03}, {0xad, 0x03}, {0xae, 0x03}, {0xaf, 0x03}, /* 0xe0*/ {0xb0, 0x03}, {0xb1, 0x03}, {0xb2, 0x03}, {0xb3, 0x03}, {0xb4, 0x03}, {0xb5, 0x03}, {0xb6, 0x03}, {0xb7, 0x03}, {0xb8, 0x03}, {0xb9, 0x03}, {0xba, 0x03}, {0xbb, 0x03}, {0xbc, 0x03}, {0xbd, 0x03}, {0xbe, 0x03}, {0xbf, 0x03}, /* 0xf0*/ {0xc0, 0x03}, {0xc1, 0x03}, {0xc2, 0x03}, {0xc3, 0x03}, {0xc4, 0x03}, {0xc5, 0x03}, {0xc6, 0x03}, {0xc7, 0x03}, {0xc8, 0x03}, {0xc9, 0x03}, {0xca, 0x03}, {0xcb, 0x03}, {0xcc, 0x03}, {0xcd, 0x03}, {0xce, 0x03}, {0x00, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0x00, 0x00, 0xa3, 0x00, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0x00, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0xbb, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page02[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0xa2, 0xa1, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0xb5, 0xb6, 0x00, /* 0x80-0x87 */ 0xb8, 0xb9, 0xba, 0x00, 0xbc, 0x00, 0xbe, 0xbf, /* 0x88-0x8f */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x90-0x97 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x98-0x9f */ 0xd0, 0xd1, 0x00, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xa0-0xa7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xa8-0xaf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xb0-0xb7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xb8-0xbf */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xc0-0xc7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, NULL, page02, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "iso8859-7", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_7() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp865.c0000644000372500001440000005460510536265343015502 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp865.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp865.c * * Charset cp865 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00}, {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, /* 0x90*/ {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00}, {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00}, {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00}, {0xa3, 0x00}, {0xd8, 0x00}, {0xa7, 0x20}, {0x92, 0x01}, /* 0xa0*/ {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00}, {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00}, {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xa4, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, /* 0xd0*/ {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, /* 0xe0*/ {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, /* 0xf0*/ {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0xad, 0x00, 0x9c, 0xaf, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */ 0x00, 0x00, 0xa7, 0x00, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */ 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */ 0x9d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ 0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */ 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */ 0x00, 0xa4, 0x95, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */ 0x9b, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x98, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page23[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, page03, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, page22, page23, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp865", page_uni2charset, charset2uni, NULL }; int init_unls_cp865() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_iso8859-9.c0000644000372500001440000002745310536265343016134 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_iso8859-9.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_iso8859-9.c * * Charset iso8859-9 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0x90*/ {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, /* 0xa0*/ {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00}, {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00}, {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00}, /* 0xb0*/ {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00}, {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00}, {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00}, /* 0xc0*/ {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00}, {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, /* 0xd0*/ {0x1e, 0x01}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00}, {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00}, {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xdc, 0x00}, {0x30, 0x01}, {0x5e, 0x01}, {0xdf, 0x00}, /* 0xe0*/ {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00}, {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00}, /* 0xf0*/ {0x1f, 0x01}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00}, {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00}, {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00}, {0xfc, 0x00}, {0x31, 0x01}, {0x5f, 0x01}, {0xff, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */ 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xf0, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0xdd, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xfe, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "iso8859-9", page_uni2charset, charset2uni, NULL }; int init_unls_iso8859_9() { return (register_unls(&table)); } cdrkit-1.1.11/libunls/nls_cp862.c0000644000372500001440000006071710536265343015500 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nls_cp862.c 1.2 05/05/01 2000 J. Schilling */ /* * Modifications to make the code portable Copyright (c) 2000 J. Schilling * * Code taken from the Linux kernel. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * linux/fs/nls_cp862.c * * Charset cp862 translation tables. * Generated automatically from the Unicode and charset * tables from the Unicode Organization (www.unicode.org). * The Unicode to charset table has only exact mappings. */ #include #include "nls.h" static struct unls_unicode charset2uni[256] = { /* 0x00*/ {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, /* 0x10*/ {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, /* 0x20*/ {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, /* 0x30*/ {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, /* 0x40*/ {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, /* 0x50*/ {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, /* 0x60*/ {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, /* 0x70*/ {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, /* 0x80*/ {0xd0, 0x05}, {0xd1, 0x05}, {0xd2, 0x05}, {0xd3, 0x05}, {0xd4, 0x05}, {0xd5, 0x05}, {0xd6, 0x05}, {0xd7, 0x05}, {0xd8, 0x05}, {0xd9, 0x05}, {0xda, 0x05}, {0xdb, 0x05}, {0xdc, 0x05}, {0xdd, 0x05}, {0xde, 0x05}, {0xdf, 0x05}, /* 0x90*/ {0xe0, 0x05}, {0xe1, 0x05}, {0xe2, 0x05}, {0xe3, 0x05}, {0xe4, 0x05}, {0xe5, 0x05}, {0xe6, 0x05}, {0xe7, 0x05}, {0xe8, 0x05}, {0xe9, 0x05}, {0xea, 0x05}, {0xa2, 0x00}, {0xa3, 0x00}, {0xa5, 0x00}, {0xa7, 0x20}, {0x92, 0x01}, /* 0xa0*/ {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00}, {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00}, {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, /* 0xb0*/ {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, /* 0xc0*/ {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, /* 0xd0*/ {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, /* 0xe0*/ {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, /* 0xf0*/ {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, }; static unsigned char page00[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xff, 0xad, 0x9b, 0x9c, 0x00, 0x9d, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */ 0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0xa4, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */ 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page01[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page03[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page05[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0xd0-0xd7 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0xd8-0xdf */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0xe0-0xe7 */ 0x98, 0x99, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page20[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page22[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page23[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char page25[256] = { 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ }; static unsigned char *page_uni2charset[256] = { page00, page01, NULL, page03, NULL, page05, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, page20, NULL, page22, page23, NULL, page25, NULL, NULL, }; #if 0 static unsigned char charset2upper[256] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ }; #endif static struct unls_table table = { "cp862", page_uni2charset, charset2uni, NULL }; int init_unls_cp862() { return (register_unls(&table)); } cdrkit-1.1.11/FORK0000644000372500001440000000622610517750703012623 0ustar steveusersForking cdrtools as cdrkit -------------------------- So, why the fork? CD/DVD burning is a complicated business that needs a lot of knowledge, so forking such a big collection isn't a step to be taken lightly. It requires a lot of development effort that could be put to better use elsewhere. In the past, we, the Debian maintainers of cdrtools, had a good and mutually cooperative relationship with Jörg Schilling. He even commented on Debian bug reports, which is one of the best things an upstream maintainer can do. Naturally, there were occasionally disagreements, but this is normal. Unfortunately Sun then developed the CDDL[1] and Jörg Schilling released parts of recent versions of cdrtools under this license. The CDDL is incompatible with the GPL. The FSF itself says that this is the case as do people who helped draft the CDDL. One current and one former Sun employee visited the annual Debian conference in Mexico in 2006. Danese Cooper clearly stated there that the CDDL was intentionally modelled on the MPL in order to make it GPL- incompatible. For everyone who wants to hear this first-hand, we have video from that talk available at [2]. You can read the FSF position about the CDDL at [3]. The thread behind [4] contains statements on the issue made by Debian people; for more context also see the other mails in that thread. In short - the CDDL has extra restrictions, which the GPL does not allow. Jörg has a different opinion about this and has repeatedly stated that the CDDL is not incompatible, interpreting a facial expression in the above-mentioned video, calling us liars and generally appearing unwilling to consider our concerns (he never replied to the parts where we explained why it is incompatible). As he has basically ignored what we have said, we have no choice but to fork. While the CDDL *may* be a free license, we never questioned if it is free or not, as it is not our place to decide this as the Debian cdrtools maintainers. However, having been approved by OSI doesn't mean it's ok for any usage, as Jörg unfortunately seems to assume. There are several OSI-approved licenses that are GPL-incompatible and CDDL is one of them. That is and always was our point. For our fork we used the last GPL-licensed version of the program code from Cdrtools [5] and killed the incompatibly licensed build system. It is now replaced by a cmake system, and the whole source we distribute should be free of other incompatibilities, as to the best of our current knowledge. Anyone who wants to help with this fork, particularly developers of other distributions, is welcome to join our efforts. You can contact us on IRC, server irc.oftc.net, channel #debburn, or via mail at debburn-devel@lists.alioth.debian.org. Our svn repository is http://svn.debian.org/wsvn/debburn. [1] http://www.opensource.org/licenses/cddl1.php [2] http://meetings-archive.debian.net/pub/debian-meetings/2006/debconf6/theora-small/2006-05-14/tower/OpenSolaris_Java_and_Debian-Simon_Phipps__Alvaro_Lopez_Ortega.ogg [3] http://www.gnu.org/licenses/license-list.html [4] http://lists.debian.org/debian-devel/2006/08/msg00552.html [5] Cdrtools 2.01.01a08 from May 2006, http://cdrecord.berlios.de cdrkit-1.1.11/netscsid/0000755000372500001440000000000011456674330013751 5ustar steveuserscdrkit-1.1.11/netscsid/netscsid.c0000644000372500001440000005061110536265343015732 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)rscsi.c 1.29 05/05/16 Copyright 1994,2000-2002 J. Schilling*/ /* * Remote SCSI server * * Copyright (c) 1994,2000-2002 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*#define FORCE_DEBUG*/ #include #include #include #include /* includes */ #include #include #include #include #ifdef HAVE_SYS_SOCKET_H #define USE_REMOTE #include #endif #ifdef HAVE_SYS_PARAM_H #include /* BSD-4.2 & Linux need this for MAXHOSTNAMELEN */ #endif #include #include #include #include #include #include #include #include #include #ifdef HAVE_ARPA_INET_H #include /* BeOS does not have */ #endif /* but inet_ntaoa() is in */ #ifdef HAVE_NETDB_H #include #endif #ifdef USE_REMOTE static void checkuser(void); static char *getpeer(void); static BOOL checktarget(void); static void dorscsi(void); static void scsiversion(void); static void openscsi(void); static void closescsi(void); static void maxdma(void); static void getbuf(void); static void freebuf(void); static void havebus(void); static void scsifileno(void); static void initiator_id(void); static void isatapi(void); static void scsireset(void); static void sendcmd(void); static int fillrdbuf(void); static int readchar(char *cp); static void readbuf(char *buf, int n); static void voidarg(int n); static void readarg(char *buf, int n); static char *preparebuffer(int size); static int checkscsi(char *decive); static void rscsirespond(int ret, int err); static void rscsireply(int ret); static void rscsierror(int err, char *str, char *xstr); #define CMD_SIZE 80 static SCSI *scsi_ptr = NULL; static char *Sbuf; static long Sbufsize; static char *username; static char *peername; static char *debug_name; static FILE *debug_file; #define DEBUG(fmt) if (debug_file) fprintf(debug_file, fmt) #define DEBUG1(fmt,a) if (debug_file) fprintf(debug_file, fmt, a) #define DEBUG2(fmt,a1,a2) if (debug_file) fprintf(debug_file, fmt, a1, a2) #define DEBUG3(fmt,a1,a2,a3) if (debug_file) fprintf(debug_file, fmt, a1, a2, a3) #define DEBUG4(fmt,a1,a2,a3,a4) if (debug_file) fprintf(debug_file, fmt, a1, a2, a3, a4) #define DEBUG5(fmt,a1,a2,a3,a4,a5) if (debug_file) fprintf(debug_file, fmt, a1, a2, a3, a4, a5) #define DEBUG6(fmt,a1,a2,a3,a4,a5,a6) if (debug_file) fprintf(debug_file, fmt, a1, a2, a3, a4, a5, a6) #endif /* USE_REMOTE */ int main(int argc, char *argv[]) { save_args(argc, argv); #ifndef USE_REMOTE comerrno(EX_BAD, "No remote SCSI support on this platform.\n"); #else argc--, argv++; if (argc > 0 && strcmp(*argv, "-c") == 0) { /* * Skip params in case we have been installed as shell. */ argc--, argv++; argc--, argv++; } /* * WARNING you are only allowed to change the defaults configuration * filename if you also change the documentation and add a statement * that makes clear where the official location of the file is, why you * did choose a nonstandard location and that the nonstandard location * only refers to inofficial rscsi versions. * * I was forced to add this because some people change cdrecord without * rational reason and then publish the result. As those people * don't contribute work and don't give support, they are causing extra * work for me and this way slow down the development. */ if (cfg_open("/etc/netscsid.conf") < 0) { rscsierror(geterrno(), errmsgstr(geterrno()), "Remote configuration error: Cannot open /etc/netscsid.conf"); /* rscsirespond(-1, geterrno());*/ exit(EX_BAD); } debug_name=cfg_get("DEBUG"); #ifdef FORCE_DEBUG if (debug_name == NULL && argc <= 0) debug_name = "/tmp/RSCSI"; #endif #ifdef NONONO /* * Should we allow root to shoot himself into the foot? * Allowing to write arbitrary files may be a security risk. */ if (argc > 0 && getuid() == 0) debug_name = *argv; #endif /* * XXX If someone sets up debugging and allows the debug file to be * XXX replaced by a symlink to e.g. /etc/passwd this would be a * XXX security risk. But /etc/rscsi.conf is only writable by root * XXX and for this reason a possible security risk would have been * XXX introduced by the administrator. */ if (debug_name != NULL) { /* Try to be careful when opening debug files, might be * created in an unsafe location * */ int fd = open(debug_name, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0600); if (fd > -1) debug_file = fdopen(fd, "w"); else { rscsirespond(-1, geterrno()); exit(EX_BAD); } } if (argc > 0) { if (debug_file == 0) { rscsirespond(-1, geterrno()); exit(EX_BAD); } (void) setbuf(debug_file, (char *)0); } checkuser(); /* Check if we are called by a bad guy */ peername = getpeer(); /* Get host name of caller */ dorscsi(); #endif /* USE_REMOTE */ return (0); } #ifdef USE_REMOTE static void checkuser() { uid_t uid = getuid(); char *uname; struct passwd *pw; if (uid == 0) { username = "root"; DEBUG("rscsid: user id 0, name root\n"); return; } pw = getpwuid(uid); if (pw == NULL) goto notfound; username = pw->pw_name; DEBUG2("rscsid: user id %ld, name %s\n", (long)uid, username); cfg_restart(); while ((uname = cfg_get_next("USER")) != NULL) { if (0==strcmp(username, uname)) return; } notfound: DEBUG2("rscsid: Illegal user '%s' id %ld for RSCSI server\n", username, (long)uid); rscsierror(0, "Illegal user id for RSCSI server", NULL); exit(EX_BAD); } #ifndef NI_MAXHOST #ifdef MAXHOSTNAMELEN /* XXX remove this and sys/param.h */ #define NI_MAXHOST MAXHOSTNAMELEN #else #define NI_MAXHOST 64 #endif #endif static char * getpeer() { #ifdef HAVE_GETNAMEINFO #ifdef HAVE_SOCKADDR_STORAGE struct sockaddr_storage sa; #else char sa[256]; #endif #else struct sockaddr sa; struct hostent *he; #endif struct sockaddr *sap; struct sockaddr_in *s; socklen_t sasize = sizeof (sa); static char buffer[NI_MAXHOST]; sap = (struct sockaddr *)&sa; if (getpeername(STDIN_FILENO, sap, &sasize) < 0) { int errsav = geterrno(); struct stat sb; if (fstat(STDIN_FILENO, &sb) >= 0) { if (S_ISFIFO(sb.st_mode)) { DEBUG("rmt: stdin is a PIPE\n"); return ("PIPE"); } DEBUG1("rscsid: stdin st_mode %0llo\n", (Llong)sb.st_mode); } DEBUG1("rscsid: peername %s\n", errmsgstr(errsav)); return ("ILLEGAL_SOCKET"); } else { s = (struct sockaddr_in *)&sa; #ifdef AF_INET6 if (s->sin_family != AF_INET && s->sin_family != AF_INET6) { #else if (s->sin_family != AF_INET) { #endif #ifdef AF_UNIX /* * AF_UNIX is not defined on BeOS */ if (s->sin_family == AF_UNIX) { DEBUG("rmt: stdin is a PIPE (UNIX domain socket)\n"); return ("PIPE"); } #endif DEBUG1("rmt: stdin NOT_IP socket (sin_family: %d)\n", s->sin_family); return ("NOT_IP"); } #ifdef HAVE_GETNAMEINFO buffer[0] = '\0'; if (debug_file && getnameinfo(sap, sasize, buffer, sizeof (buffer), NULL, 0, NI_NUMERICHOST) == 0) { DEBUG1("rmt: peername %s\n", buffer); } buffer[0] = '\0'; if (getnameinfo(sap, sasize, buffer, sizeof (buffer), NULL, 0, 0) == 0) { DEBUG1("rmt: peername %s\n", buffer); return (buffer); } return ("CANNOT_MAP_ADDRESS"); #else /* HAVE_GETNAMEINFO */ #ifdef HAVE_INET_NTOA (void) snprintf(buffer, sizeof(buffer), "%s", inet_ntoa(s->sin_addr)); #else (void) snprintf(buffer, sizeof(buffer), "%x", s->sin_addr.s_addr); #endif DEBUG1("rscsid: peername %s\n", buffer); he = gethostbyaddr((char *)&s->sin_addr.s_addr, 4, AF_INET); DEBUG1("rscsid: peername %s\n", he!=NULL?he->h_name:buffer); if (he != NULL) return (he->h_name); return (buffer); #endif /* HAVE_GETNAMEINFO */ } } static BOOL checktarget() { char *target; char *user; char *host; char *p; int bus; int chan; int tgt; int lun; if (peername == NULL) return (FALSE); cfg_restart(); while ((target = cfg_get_next("ACCESS")) != NULL) { p = target; while (*p == '\t') p++; user = p; if ((p = strchr(p, '\t')) != NULL) *p++ = '\0'; else continue; if (0!=strcmp(username, user)) continue; while (*p == '\t') p++; host = p; if ((p = strchr(p, '\t')) != NULL) *p++ = '\0'; else continue; if (0!=strcmp(peername, host)) continue; p = astoi(p, &bus); if (*p != '\t') continue; p = astoi(p, &chan); if (*p != '\t') continue; p = astoi(p, &tgt); if (*p != '\t') continue; p = astoi(p, &lun); if (*p != '\t' && *p != '\n' && *p != '\r' && *p != '\0') continue; DEBUG6("ACCESS %s %s %d.%d,%d,%d\n", user, host, bus, chan, tgt, lun); if (bus != -1 && bus != usal_scsibus(scsi_ptr)) continue; if (tgt != -1 && tgt != usal_target(scsi_ptr)) continue; if (lun != -1 && lun != usal_lun(scsi_ptr)) continue; return (TRUE); } return (FALSE); } static void dorscsi() { char c; while (readchar(&c) == 1) { seterrno(0); switch (c) { case 'V': /* "V" ersion */ scsiversion(); break; case 'O': /* "O" pen */ openscsi(); break; case 'C': /* "C" lose */ closescsi(); break; case 'D': /* "D" MA */ maxdma(); break; case 'M': /* "M" alloc */ getbuf(); break; case 'F': /* "F" free */ freebuf(); break; case 'B': /* "B" us */ havebus(); break; case 'T': /* "T" arget */ scsifileno(); break; case 'I': /* "I" nitiator */ initiator_id(); break; case 'A': /* "A" tapi */ isatapi(); break; case 'R': /* "R" eset */ scsireset(); break; case 'S': /* "S" end */ sendcmd(); break; default: DEBUG1("rscsid: garbage command '%c'\n", c); rscsierror(0, "Garbage command", NULL); exit(EX_BAD); } } exit(0); } static void scsiversion() { int ret; char *str; char what[CMD_SIZE]; readarg(what, sizeof(what)); DEBUG1("rscsid: V %s\n", what); if (scsi_ptr == NULL) { rscsirespond(-1, EBADF); return; } str = usal_version(scsi_ptr, atoi(what)); ret = strlen(str); ret++; /* Include null char */ rscsirespond(ret, geterrno()); _nixwrite(STDOUT_FILENO, str, ret); } static void openscsi() { char device[CMD_SIZE]; char errstr[80]; int debug = 0; int lverbose = 0; int ret = 0; char rbuf[1600]; if (scsi_ptr != NULL) (void) usal_close(scsi_ptr); readarg(device, sizeof(device)); DEBUG1("rscsid: O %s\n", device); if (strncmp(device, "REMOTE", 6) == 0) { scsi_ptr = NULL; seterrno(EINVAL); } else if (!checkscsi(device)) { scsi_ptr = NULL; seterrno(EACCES); } else { scsi_ptr = usal_open(device, errstr, sizeof(errstr), debug, lverbose); if (scsi_ptr == NULL) { ret = -1; } else { scsi_ptr->silent = 1; scsi_ptr->verbose = 0; scsi_ptr->debug = 0; scsi_ptr->kdebug = 0; } } if (ret < 0) { /* * XXX This is currently the only place where we use the * XXX extended error string. */ rscsierror(geterrno(), errmsgstr(geterrno()), errstr); /* rscsirespond(ret, geterrno());*/ return; } DEBUG4("rscsid:>A 0 %d.%d,%d,%d\n", usal_scsibus(scsi_ptr), 0, usal_target(scsi_ptr), usal_lun(scsi_ptr)); ret = snprintf(rbuf, sizeof(rbuf), "A0\n%d\n%d\n%d\n%d\n", usal_scsibus(scsi_ptr), 0, usal_target(scsi_ptr), usal_lun(scsi_ptr)); (void) _nixwrite(STDOUT_FILENO, rbuf, ret); } static void closescsi() { int ret; char device[CMD_SIZE]; readarg(device, sizeof(device)); DEBUG1("rscsid: C %s\n", device); ret = usal_close(scsi_ptr); rscsirespond(ret, geterrno()); scsi_ptr = NULL; } static void maxdma() { int ret; char amt[CMD_SIZE]; readarg(amt, sizeof(amt)); DEBUG1("rscsid: D %s\n", amt); if (scsi_ptr == NULL) { rscsirespond(-1, EBADF); return; } ret = usal_bufsize(scsi_ptr, atol(amt)); rscsirespond(ret, geterrno()); } static void getbuf() { int ret = 0; char amt[CMD_SIZE]; readarg(amt, sizeof(amt)); DEBUG1("rscsid: M %s\n", amt); if (scsi_ptr == NULL) { rscsirespond(-1, EBADF); return; } ret = usal_bufsize(scsi_ptr, atol(amt)); if (preparebuffer(ret) == NULL) ret = -1; rscsirespond(ret, geterrno()); } static void freebuf() { int ret = 0; char dummy[CMD_SIZE]; readarg(dummy, sizeof(dummy)); DEBUG1("rscsid: F %s\n", dummy); if (scsi_ptr == NULL) { rscsirespond(-1, EBADF); return; } usal_freebuf(scsi_ptr); Sbuf = NULL; rscsirespond(ret, geterrno()); } static void havebus() { int ret; char bus[CMD_SIZE]; char chan[CMD_SIZE]; readarg(bus, sizeof(bus)); readarg(chan, sizeof(chan)); DEBUG2("rscsid: B %s.%s\n", bus, chan); if (scsi_ptr == NULL) { rscsirespond(-1, EBADF); return; } ret = usal_havebus(scsi_ptr, atol(bus)); rscsirespond(ret, geterrno()); } static void scsifileno() { int ret; char bus[CMD_SIZE]; char chan[CMD_SIZE]; char tgt[CMD_SIZE]; char lun[CMD_SIZE]; readarg(bus, sizeof(bus)); readarg(chan, sizeof(chan)); readarg(tgt, sizeof(tgt)); readarg(lun, sizeof(lun)); DEBUG4("rscsid: T %s.%s,%s,%s\n", bus, chan, tgt, lun); if (scsi_ptr == NULL) { rscsirespond(-1, EBADF); return; } seterrno(0); ret = usal_settarget(scsi_ptr, atoi(bus), atoi(tgt), atoi(lun)); if (!checktarget()) { usal_settarget(scsi_ptr, -1, -1, -1); ret = -1; } if (geterrno() != 0) rscsirespond(ret, geterrno()); else rscsireply(ret); } static void initiator_id() { int ret; char dummy[CMD_SIZE]; readarg(dummy, sizeof(dummy)); DEBUG1("rscsid: I %s\n", dummy); if (scsi_ptr == NULL) { rscsirespond(-1, EBADF); return; } seterrno(0); ret = usal_initiator_id(scsi_ptr); if (geterrno() != 0) rscsirespond(ret, geterrno()); else rscsireply(ret); } static void isatapi() { int ret; char dummy[CMD_SIZE]; readarg(dummy, sizeof(dummy)); DEBUG1("rscsid: A %s\n", dummy); if (scsi_ptr == NULL) { rscsirespond(-1, EBADF); return; } seterrno(0); ret = usal_isatapi(scsi_ptr); if (geterrno() != 0) rscsirespond(ret, geterrno()); else rscsireply(ret); } static void scsireset() { int ret; char what[CMD_SIZE]; readarg(what, sizeof(what)); DEBUG1("rscsid: R %s\n", what); if (scsi_ptr == NULL) { rscsirespond(-1, EBADF); return; } ret = usal_reset(scsi_ptr, atoi(what)); rscsirespond(ret, geterrno()); } static void sendcmd() { register struct usal_cmd *scmd; int n; int ret; char count[CMD_SIZE]; char flags[CMD_SIZE]; char cdb_len[CMD_SIZE]; char sense_len[CMD_SIZE]; char timeout[CMD_SIZE]; int csize; int cflags; int clen; int ctimeout; char rbuf[1600]; char *p; /* * S count\n * flags\n * cdb_len\n * sense_len\n * timeout\n * * * Timeout: * - sss (e.g. 10) * - sss.uuu (e.g. 10.23) */ readarg(count, sizeof(count)); readarg(flags, sizeof(flags)); readarg(cdb_len, sizeof(cdb_len)); readarg(sense_len, sizeof(sense_len)); readarg(timeout, sizeof(timeout)); DEBUG5("rscsid: S %s %s %s %s %s", count, flags, cdb_len, sense_len, timeout); csize = atoi(count); cflags = atoi(flags); clen = atoi(cdb_len); p = strchr(timeout, '.'); if (p) *p = '\0'; ctimeout = atoi(timeout); if (scsi_ptr == NULL || clen > SCG_MAX_CMD || csize > Sbufsize) { DEBUG("\n"); voidarg(clen); if ((cflags & SCG_RECV_DATA) == 0 && csize > 0) voidarg(csize); rscsirespond(-1, scsi_ptr==NULL ? EBADF : EINVAL); return; } scmd = scsi_ptr->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)Sbuf; scmd->size = csize; scmd->flags = cflags; scmd->cdb_len = clen; scmd->sense_len = atoi(sense_len); scmd->timeout = ctimeout; readbuf((char *)scmd->cdb.cmd_cdb, clen); DEBUG6(" 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X\n", scmd->cdb.cmd_cdb[0], scmd->cdb.cmd_cdb[1], scmd->cdb.cmd_cdb[2], scmd->cdb.cmd_cdb[3], scmd->cdb.cmd_cdb[4], scmd->cdb.cmd_cdb[5]); if ((cflags & SCG_RECV_DATA) == 0 && csize > 0) readbuf(Sbuf, scmd->size); scsi_ptr->cmdname = ""; ret = usal_cmd(scsi_ptr); n = 0; if ((csize - scmd->resid) > 0) n = csize - scmd->resid; /* * A count\n * error\n * errno\n * scb\n * sense_count\n * */ DEBUG5("rscsid:>A %d %d %d %d %d\n", n, scmd->error, scmd->ux_errno, *(Uchar *)&scmd->scb, scmd->sense_count); ret = snprintf(rbuf, sizeof(rbuf), "A%d\n%d\n%d\n%d\n%d\n", n, scmd->error, scmd->ux_errno, *(Uchar *)&scmd->scb, scmd->sense_count); if (scmd->sense_count > 0) { movebytes(scmd->u_sense.cmd_sense, &rbuf[ret], scmd->sense_count); ret += scmd->sense_count; } if ((cflags & SCG_RECV_DATA) == 0) n = 0; if (n > 0 && ((ret + n) <= sizeof(rbuf))) { movebytes(Sbuf, &rbuf[ret], n); ret += n; n = 0; } (void) _nixwrite(STDOUT_FILENO, rbuf, ret); if (n > 0) (void) _nixwrite(STDOUT_FILENO, Sbuf, n); } #define READB_SIZE 128 static char readb[READB_SIZE]; static char *readbptr; static int readbcnt; static int fillrdbuf() { readbptr = readb; return (readbcnt = _niread(STDIN_FILENO, readb, READB_SIZE)); } static int readchar(char *cp) { if (--readbcnt < 0) { if (fillrdbuf() <= 0) return (readbcnt); --readbcnt; } *cp = *readbptr++; return (1); } static void readbuf(register char *buf, register int n) { register int i = 0; register int amt; if (readbcnt > 0) { amt = readbcnt; if (amt > n) amt = n; movebytes(readbptr, buf, amt); readbptr += amt; readbcnt -= amt; i += amt; } for (; i < n; i += amt) { amt = _niread(STDIN_FILENO, &buf[i], n - i); if (amt <= 0) { DEBUG("rscsid: premature eof\n"); rscsierror(0, "Premature eof", NULL); exit(EX_BAD); } } } static void voidarg(register int n) { register int i; register int amt; char buf[512]; for (i = 0; i < n; i += amt) { amt = sizeof(buf); if ((n - i) < amt) amt = n - i; readbuf(buf, amt); } } static void readarg(char *buf, int n) { int i; for (i = 0; i < n; i++) { if (readchar(&buf[i]) != 1) exit(0); if (buf[i] == '\n') break; } buf[i] = '\0'; } static char * preparebuffer(int size) { Sbufsize = size; if ((Sbuf = usal_getbuf(scsi_ptr, Sbufsize)) == NULL) { Sbufsize = 0L; return (Sbuf); } size = Sbufsize + 1024; /* Add protocol overhead */ #ifdef SO_SNDBUF while (size > 512 && setsockopt(STDOUT_FILENO, SOL_SOCKET, SO_SNDBUF, (char *)&size, sizeof (size)) < 0) size -= 512; DEBUG1("rscsid: sndsize: %d\n", size); #endif #ifdef SO_RCVBUF while (size > 512 && setsockopt(STDIN_FILENO, SOL_SOCKET, SO_RCVBUF, (char *)&size, sizeof (size)) < 0) size -= 512; DEBUG1("rscsid: rcvsize: %d\n", size); #endif return (Sbuf); } static int checkscsi(char *device) { #ifdef CHECKTAPE if (strncmp(device, "/dev/rst", 8) == 0 || strncmp(device, "/dev/nrst", 9) == 0 || strcmp(device, "/dev/zero") == 0 || strcmp(device, "/dev/null") == 0) return (1); return (0); #else return (1); #endif } static void rscsirespond(int ret, int err) { if (ret < 0) { rscsierror(err, errmsgstr(err), NULL); } else { rscsireply(ret); } } static void rscsireply(int ret) { char rbuf[CMD_SIZE]; DEBUG1("rscsid:>A %d\n", ret); (void) snprintf(rbuf, sizeof(rbuf), "A%d\n", ret); (void) _nixwrite(STDOUT_FILENO, rbuf, strlen(rbuf)); } static void rscsierror(int err, char *str, char *xstr) { char rbuf[1600]; int xlen = 0; int n; if (xstr != NULL) xlen = strlen(xstr) + 1; DEBUG3("rscsid:>E %d (%s) [%s]\n", err, str, xstr?xstr:""); n = snprintf(rbuf, sizeof(rbuf), "E%d\n%s\n%d\n", err, str, xlen); if (xlen > 0 && ((xlen + n) <= sizeof(rbuf))) { movebytes(xstr, &rbuf[n], xlen); n += xlen; xlen = 0; } (void) _nixwrite(STDOUT_FILENO, rbuf, n); if (xlen > 0) (void) _nixwrite(STDOUT_FILENO, xstr, xlen); } #endif /* USE_REMOTE */ cdrkit-1.1.11/netscsid/CMakeLists.txt0000644000372500001440000000077311304054475016512 0ustar steveusersPROJECT (netscsid C) INCLUDE_DIRECTORIES(../include ../wodim ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include) INCLUDE(../include/AddScgBits.cmake) INCLUDE(../include/AddSchilyBits.cmake) INCLUDE(../include/AddNetworkBits.cmake) LINK_DIRECTORIES(../librols ../libusal ) ADD_EXECUTABLE (netscsid netscsid.c) #SET_SOURCE_FILES_PROPERTIES(netscsid.c ) TARGET_LINK_LIBRARIES(netscsid ${EXTRA_LIBS} ) #SET_TARGET_PROPERTIES(netscsid PROPERTIES SKIP_BUILD_RPATH TRUE) INSTALL(TARGETS netscsid DESTINATION sbin) cdrkit-1.1.11/netscsid/netscsid.dfl0000644000372500001440000000402010531373566016250 0ustar steveusers#ident @(#)rscsi.dfl 1.3 05/08/09 Copyr 2000 J. Schilling # # This file is /etc/rscsi.conf # # NOTE: If this file is not present, rscsi will reject to work. # # If no USER= entry is present, only root is allowed to run rscsi. # If no ACCESS= entry is present, no device may to be used by remote users. # # The file where debug info should go to. # This is commented out by default to speed up the program. # If you enable it make sure you substitute SAFE_DIR to a safe directory # to debug to. # # Note that rscsi runs as root and thus may be able to overwrite any file. # Be sure not to allow other people to replace the debug file by a symlink # to e.g. /etc/passwd. # #DEBUG=SAFE_DIR/rscsi.dbg # # Each USER= entry adds the listed user to the users who may run rscsi # # A typical passwd entry looks like this: # rscsi:x:1999:1000:Remote SCSI:/export/home/rscsi:/opt/schily/sbin/rscsi # # Add entries for all valid remote users to /export/home/rscsi/.rhosts # # USER= entries are checked with a pattern matcher. USER=* matches all users. # USER=rscsi #USER=joerg # # Each ACCESS= entry adds a target or group of targets to the list of visible # targets for all users that do remote SCSI access from a specific host. # # Username is the name of the user that runs rscsi. If you create # different users, you may assign different permissions to different # users from the same host. # # Hostname must be in the same notation as needed for .rhosts (e.g. in # the way you will be listed by 'who' if you log in from this host). # # bus/chan/target/lun are the numbers from the scanbus output from # cdrecord or sformat. If you use -1, you allow any value for this # placeholder. # # local user name and remote host name are checked with a pattern matcher. # ACCESS=* * .... matches all users from all hosts. # # NOTE: chan is currently not implementd (set it to 0 or -1) # # local remote # user host bus chan target lun # name name # #ACCESS=rscsi sparky -1 -1 -1 -1 #ACCESS=rscsi sparky 0 -1 6 -1 #ACCESS=rscsi sparky 1 -1 3 -1 #ACCESS=rscsi sparky 1 -1 4 -1 cdrkit-1.1.11/icedax/0000755000372500001440000000000011456674325013376 5ustar steveuserscdrkit-1.1.11/icedax/sha.h0000644000372500001440000000563310513514665014322 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)sha.h 1.4 03/06/28 Copyright 1998,1999 Heiko Eissfeldt */ /*____________________________________________________________________________ // // CD Index - The Internet CD Index // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // $Id: sha.h,v 1.1.1.2 1999/04/29 00:53:34 marc Exp $ //____________________________________________________________________________ */ #ifndef SHA_H #define SHA_H /* NIST Secure Hash Algorithm */ /* heavily modified by Uwe Hollerbach */ /* from Peter C. Gutmann's implementation as found in */ /* Applied Cryptography by Bruce Schneier */ /* This code is in the public domain */ /* Useful defines & typedefs */ typedef unsigned char BYTE; /* 8-bit quantity */ typedef unsigned long ULONG; /* 32-or-more-bit quantity */ #define SHA_BLOCKSIZE 64 #define SHA_DIGESTSIZE 20 typedef struct { ULONG digest[5]; /* message digest */ ULONG count_lo, count_hi; /* 64-bit bit count */ BYTE data[SHA_BLOCKSIZE]; /* SHA data buffer */ int local; /* unprocessed amount in data */ } SHA_INFO; void sha_init(SHA_INFO *); void sha_update(SHA_INFO *, BYTE *, int); void sha_final(unsigned char [20], SHA_INFO *); #ifdef SHA_FOR_C #include #include #include void sha_stream(unsigned char [20], SHA_INFO *, FILE *); void sha_print(unsigned char [20]); char *sha_version(void); #endif /* SHA_FOR_C */ #define SHA_VERSION 1 #ifndef WIN32 #ifdef WORDS_BIGENDIAN # if SIZEOF_UNSIGNED_LONG_INT == 4 # define SHA_BYTE_ORDER 4321 # else # if SIZEOF_UNSIGNED_LONG_INT == 8 # define SHA_BYTE_ORDER 87654321 # endif # endif #else # if SIZEOF_UNSIGNED_LONG_INT == 4 # define SHA_BYTE_ORDER 1234 # else # if SIZEOF_UNSIGNED_LONG_INT == 8 # define SHA_BYTE_ORDER 12345678 # endif # endif #endif #else #define SHA_BYTE_ORDER 1234 #endif #endif /* SHA_H */ cdrkit-1.1.11/icedax/setuid.c0000644000372500001440000002261110536265343015033 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)setuid.c 1.11 06/02/19 Copyright 1998,1999,2004 Heiko Eissfeldt, Copyright 2004-2006 J. Schilling */ /* Security functions by zblaxell If these functions fail, it is because there was an installation error or a programming error, and we can't be sure about what privileges we do or do not have. This means we might not be able to recover the privileges we need to fix anything that may be broken (e.g. the CDDA state of some interface types), and we may in fact do something quite dangerous (like write to the WAV file as root). In any case, it is unsafe to do anything but exit *now*. Ideally we'd kill -9 our process group too, just to be sure. Root privileges are not something you want floating around at random in user-level applications. If any signal handlers or child processes are introduced into this program, it will be necessary to call dontneedroot() or neverneedroot() on entry, respectively; otherwise, it will be possible to trick the program into executing the signal handler or child process with root privileges by sending signals at the right time. */ #include "config.h" #include #include #include #include "exitcodes.h" #include "setuid.h" /*#undef DEBUG*/ /*#define DEBUG*/ /* True at return from initsecurity */ static uid_t real_uid = (uid_t) (-1); static uid_t effective_uid = (uid_t) (-1); static gid_t real_gid = (gid_t) (-1); static gid_t effective_gid = (gid_t) (-1); /* Run this at the beginning of the program to initialize this code and to drop privileges before someone uses them to shoot us in the foot. Do not pass(go), do not dollars += 200. */ void initsecurity() { int leffective_uid; alarm(0); /* can be inherited from parent process */ real_uid = getuid(); leffective_uid = geteuid(); if ((int) real_uid != leffective_uid && leffective_uid != 0) { /* sanity check */ fprintf(stderr, "Warning: setuid but not to root (uid=%ld, euid=%d)\n", (long) real_uid, leffective_uid); fprintf(stderr, "Dropping setuid privileges now.\n"); neverneedroot(); } else { effective_uid = leffective_uid; } real_gid = getgid(); effective_gid = getegid(); dontneedroot(); dontneedgroup(); } /* Temporarily gain root privileges. */ #if defined _POSIX_SAVED_IDS && defined (HAVE_SETEUID) && defined SCO /* SCO seems to lack the prototypes... */ int seteuid(uid_t euid); int setegid(gid_t guid); #endif void needroot(int necessary) { #ifdef DEBUG fprintf(stderr, "call to needroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); #endif if (effective_uid) { if (necessary) { fprintf(stderr, "Fatal error: require root privilege but not setuid root.\n"); exit(PERM_ERROR); } else return; } if (real_uid == (uid_t) (-1)) { fprintf(stderr, "Fatal error: initsecurity() not called.\n"); exit(INTERNAL_ERROR); } if (geteuid() == 0) return; /* nothing to do */ #if defined _POSIX_SAVED_IDS && defined (HAVE_SETEUID) if (seteuid(effective_uid)) { perror("seteuid in needroot()"); exit(PERM_ERROR); } #else #if defined (HAVE_SETREUID) if (setreuid(real_uid, effective_uid)) { perror("setreuid in needroot()"); exit(PERM_ERROR); } #endif #endif if (geteuid() != 0 && necessary) { fprintf(stderr, "Fatal error: did not get root privilege.\n"); exit(PERM_ERROR); } #ifdef DEBUG fprintf(stderr, "exit of needroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); #endif } /* Temporarily drop root privileges. */ void dontneedroot() { #ifdef DEBUG fprintf(stderr, "call to dontneedroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); #endif if (real_uid == (uid_t) (-1)) { fprintf(stderr, "Fatal error: initsecurity() not called.\n"); exit(INTERNAL_ERROR); } if (effective_uid) return; if (geteuid() != 0) return; /* nothing to do */ #if defined _POSIX_SAVED_IDS && defined (HAVE_SETEUID) if (seteuid(real_uid)) { perror("seteuid in dontneedroot()"); exit(PERM_ERROR); } #else #if defined (HAVE_SETREUID) if (setreuid(effective_uid, real_uid)) { perror("setreuid in dontneedroot()"); exit(PERM_ERROR); } #endif #endif if (geteuid() != real_uid) { fprintf(stderr, "Fatal error: did not drop root privilege.\n"); #ifdef DEBUG fprintf(stderr, "in to dontneedroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); #endif exit(PERM_ERROR); } } /* Permanently drop root privileges. */ void neverneedroot() { #ifdef DEBUG fprintf(stderr, "call to neverneedroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); #endif if (real_uid == (uid_t) (-1)) { fprintf(stderr, "Fatal error: initsecurity() not called.\n"); exit(INTERNAL_ERROR); } if (geteuid() == effective_uid) { #if defined (HAVE_SETUID) if (setuid(real_uid)) { perror("setuid in neverneedroot()"); exit(PERM_ERROR); } #endif } #if defined(__FreeBSD__) || defined(__DragonFly__) /* XXX this is a big hack and and not a permanent solution */ else { #if defined (HAVE_SETUID) if (setuid(real_uid)) { perror("setuid in neverneedroot()"); exit(PERM_ERROR); } #endif } #endif if (geteuid() != real_uid || getuid() != real_uid) { fprintf(stderr, "Fatal error: did not drop root privilege.\n"); #ifdef DEBUG fprintf(stderr, "in to neverneedroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); #endif exit(PERM_ERROR); } effective_uid = real_uid; #ifdef DEBUG fprintf(stderr, "exit of neverneedroot (_euid_=%d, uid=%d), current=%d/%d, pid=%d\n", effective_uid, real_uid, geteuid(), getuid(), getpid()); #endif } /* Temporarily gain group privileges. */ void needgroup(int necessary) { #ifdef DEBUG fprintf(stderr, "call to needgroup (egid=%d, gid=%d), current=%d/%d, pid=%d\n", effective_gid, real_gid, getegid(), getgid(), getpid()); #endif if (real_gid == (gid_t) (-1)) { fprintf(stderr, "Fatal error: initsecurity() not called.\n"); exit(INTERNAL_ERROR); } if (getegid() == effective_gid) return; /* nothing to do */ #if defined _POSIX_SAVED_IDS && defined (HAVE_SETEGID) if (setegid(effective_gid)) { perror("setegid in needgroup()"); exit(PERM_ERROR); } #else #if defined (HAVE_SETREGID) if (setregid(real_gid, effective_gid)) { perror("setregid in needgroup()"); exit(PERM_ERROR); } #endif #endif if (necessary && getegid() != effective_gid) { fprintf(stderr, "Fatal error: did not get group privilege.\n"); exit(PERM_ERROR); } } /* Temporarily drop group privileges. */ void dontneedgroup() { #ifdef DEBUG fprintf(stderr, "call to dontneedgroup (egid=%d, gid=%d), current=%d/%d, pid=%d\n", effective_gid, real_gid, getegid(), getgid(), getpid()); #endif if (real_gid == (gid_t) (-1)) { fprintf(stderr, "Fatal error: initsecurity() not called.\n"); exit(INTERNAL_ERROR); } if (getegid() != effective_gid) return; /* nothing to do */ #if defined _POSIX_SAVED_IDS && defined (HAVE_SETEGID) if (setegid(real_gid)) { perror("setegid in dontneedgroup()"); exit(PERM_ERROR); } #else #if defined (HAVE_SETREGID) if (setregid(effective_gid, real_gid)) { perror("setregid in dontneedgroup()"); exit(PERM_ERROR); } #endif #endif if (getegid() != real_gid) { fprintf(stderr, "Fatal error: did not drop group privilege.\n"); exit(PERM_ERROR); } #ifdef DEBUG fprintf(stderr, "exit if dontneedgroup (egid=%d, gid=%d), current=%d/%d, pid=%d\n", effective_gid, real_gid, getegid(), getgid(), getpid()); #endif } /* Permanently drop group privileges. */ void neverneedgroup() { #ifdef DEBUG fprintf(stderr, "call to neverneedgroup (egid=%d, gid=%d), current=%d/%d, pid=%d\n", effective_gid, real_gid, getegid(), getgid(), getpid()); #endif if (real_gid == (gid_t) (-1)) { fprintf(stderr, "Fatal error: initsecurity() not called.\n"); exit(INTERNAL_ERROR); } if (getegid() == effective_gid) { #if defined (HAVE_SETGID) if (setgid(real_gid)) { perror("setgid in neverneedgroup()"); exit(PERM_ERROR); } #endif } #if defined(__FreeBSD__) || defined(__DragonFly__) /* XXX this is a big hack and and not a permanent solution */ else { #if defined (HAVE_SETGID) if (setgid(real_gid)) { perror("setgid in neverneedgroup()"); exit(PERM_ERROR); } #endif } #endif if (getegid() != real_gid || getgid() != real_gid) { fprintf(stderr, "Fatal error: did not drop group privilege.\n"); exit(PERM_ERROR); } effective_gid = real_gid; } #if defined (HPUX) int seteuid(uid_t uid) { return setresuid(-1, uid, -1); } int setreuid(uid_t uid1, uid_t uid2) { return setresuid(uid2, uid2, uid1 == uid2 ? uid2 : 0); } int setregid(gid_t gid1, gid_t gid2) { return setresgid(gid2, gid2, gid1 == gid2 ? gid2 : 0); } #endif cdrkit-1.1.11/icedax/cdda2ogg.10000644000372500001440000000617510532031045015117 0ustar steveusers'\" .TH "cdda2ogg" "1" .SH "NAME" cdda2ogg, cdda2mp3 \(em extract audio CD audio tracks and encode them .SH "SYNOPSIS" .PP .B cdda2ogg .PP .B cdda2mp3 .SH "DESCRIPTION" .PP .B cdda2ogg is a simple script that uses the .B icedax command to extract all audio tracks with the .B icedax command and encode them using the .B ogg123 respective .I MP3 encoder. The scripts are not intended to be full-featured music archiving programs, but only for quick storing of few audio data. It does not use databases like CDDB or have any extra features. You may look at .B icedax if you need them. .PP .B ogg123 is provided by the .B vorbis-tools which needs to be installed separately. See .B www.ogg.org for more information. .SH "CONFIGURATION" .PP .B cdda2ogg and .B cdda2mp3 have predefined values for reading and labeling of the target files. You can overwrite them with following environment variables: .IP "CDDA_DEVICE" 10 Source device specification to get the data from. .IP "LIST" 10 List of track numbers to be read, separated by spaces. .IP "CDDA2WAV" 10 Defines the command to run the cdda2wav program .IP "CDDA2WAV_OPTS" 10 Miscellaneous options passed to .IR $CDDA2WAV . .IP "MP_CODER" 10 The encoder program. .IP "MP_OPTIONS" 10 Additional options passed to .IR $MP_CODER . .IP "FILEPREFIX" 10 The base part of the filename of resulting audio files. This can also be specified as the first argument to the script. .PP See cdda2ogg (cdda2mp3) script file to get the default values .PP System administrator can also set default values by creating of a shell include file, defining the variables for the POSIX shell, and storing them as /etc/default/cdda2ogg (resp. cdda2mp3). .SH "EXAMPLES" .PP .B CDDA_DEVICE=/dev/cdrom1 cdda2ogg .br just stores every track in this device in audiotrackNUMBER.ogg .PP .PP .B LIST="1 5 7" cdda2ogg PartsOfBestOfFoo .br stores the selected tracks from the default cdrom device as 01-PartsOfBestOfFoo.ogg, 05-PartsOfBestOfFoo.ogg, 07-PartsOfBestOfFoo.ogg. .SH "SEE ALSO" .BR icedax (1) .SH "AUTHOR" .PP This manpage describes the program implementation of .B cdda2ogg as shipped by the cdrkit distribution. See .B http://alioth.debian.org/projects/debburn/ for details. It is a spinoff from the original program distributed by the cdrtools project. However, the cdrtools developers are not involved in the development of this spinoff and therefore shall not be made responsible for any problem caused by it. Do not try to get support for this program by contacting the original authors. .PP If you have support questions, send them to .PP .B debburn-devel@lists.alioth.debian.org .br .PP If you have definitely found a bug, send a mail to this list or to .PP .B submit@bugs.debian.org .br .PP writing at least a short description into the Subject and "Package: cdrkit" into the first line of the mail body. .PP This manual page was written by Eduard Bloch (blade@debian.org) for the .B "Debian GNU/Linux system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 as published by the Free Software Foundation. cdrkit-1.1.11/icedax/pitchplay0000755000372500001440000000175510532031045015305 0ustar steveusers#! /bin/sh # # Script to play audio tracks with different pitches # through a soundcard (cdda2wav must have soundcard # support enabled). # # Pitches are specified in percentage with 100% being # the original pitch, 50% being one octave lower, 200% # one octave higher. # # based on a script from Raul Sobon, who created the pitch # feature. Thanks Raul. # # usage: pitchplay ... # # example: pitchplay 1 90 3 140 5 50 # will play track 1 with a pitch of 90%, # track 3 with a pitch of 140%, and # track 5 with a pitch of 50%. # CDDA2WAV=icedax #CDDA2WAVOPTS="-qeNP0 -n75" CDDA2WAVOPTS="-qeNP0 -n40" if [ $(( $# % 2 )) -eq 0 ]; then while [ $# -ge 2 ]; do echo playing track $1 with a pitch of $2% $CDDA2WAV $CDDA2WAVOPTS -t $1 -p $2 RES=$? if [ $RES -ne 0 ]; then echo "$CDDA2WAV error, return value "$RES". Aborted." >&2 break fi shift 2 done else echo "usage: $0 [ ] ..." >&2 fi cdrkit-1.1.11/icedax/interface.c0000644000372500001440000007202410676753364015513 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)interface.c 1.40 06/02/19 Copyright 1998-2002 Heiko Eissfeldt, Copyright 2006 J. Schilling */ /*** * CopyPolicy: GNU Public License 2 applies * Copyright (C) 1994-1997 Heiko Eissfeldt heiko@colossus.escape.de * * Interface module for cdrom drive access * * Two interfaces are possible. * * 1. using 'cooked' ioctls() (Linux only) * : available for atapi, sbpcd and cdu31a drives only. * * 2. using the generic scsi device (for details see SCSI Prog. HOWTO). * NOTE: a bug/misfeature in the kernel requires blocking signal * SIGINT during SCSI command handling. Once this flaw has * been removed, the sigprocmask SIG_BLOCK and SIG_UNBLOCK calls * should removed, thus saving context switches. * * For testing purposes I have added a third simulation interface. * * Version 0.8: used experiences of Jochen Karrer. * SparcLinux port fixes * AlphaLinux port fixes * */ #if 0 #define SIM_CD #endif #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "mycdrom.h" #include "lowlevel.h" /* some include file locations have changed with newer kernels */ #if defined (__linux__) # if LINUX_VERSION_CODE > 0x10300 + 97 # if LINUX_VERSION_CODE < 0x200ff # include # include # endif # if !defined(CDROM_SELECT_SPEED) # include # endif # endif #endif #include #include "mytype.h" #include "byteorder.h" #include "interface.h" #include "icedax.h" #include "semshm.h" #include "setuid.h" #include "ringbuff.h" #include "toc.h" #include "global.h" #include "ioctl.h" #include "exitcodes.h" #include "scsi_cmds.h" #include #include #include "scsi_scan.h" unsigned interface; int trackindex_disp = 0; void priv_init(void); void priv_on(void); void priv_off(void); void (*EnableCdda)(SCSI *, int Switch, unsigned uSectorsize); unsigned (*doReadToc)(SCSI *usalp); void (*ReadTocText)(SCSI *usalp); unsigned (*ReadLastAudio)(SCSI *usalp); int (*ReadCdRom)(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); int (*ReadCdRomData)(SCSI *usalp, unsigned char *p, unsigned lSector, unsigned SectorBurstVal); int (*ReadCdRomSub)(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); subq_chnl *(*ReadSubChannels)(SCSI *usalp, unsigned lSector); subq_chnl *(*ReadSubQ)(SCSI *usalp, unsigned char sq_format, unsigned char track); void (*SelectSpeed)(SCSI *usalp, unsigned speed); int (*Play_at)(SCSI *usalp, unsigned int from_sector, unsigned int sectors); int (*StopPlay)(SCSI *usalp); void (*trash_cache)(UINT4 *p, unsigned lSector, unsigned SectorBurstVal); #if defined USE_PARANOIA long cdda_read(void *d, void *buffer, long beginsector, long sectors); long cdda_read(void *d, void *buffer, long beginsector, long sectors) { long ret = ReadCdRom(d, buffer, beginsector, sectors); return ret; } #endif typedef struct string_len { char *str; unsigned int sl; } mystring; static mystring drv_is_not_mmc[] = { {"DEC RRD47 (C) DEC ",24}, /* {"SONY CD-ROM CDU625 1.0",28}, */ {NULL,0} /* must be last entry */ }; static mystring drv_has_mmc_cdda[] = { {"HITACHI CDR-7930",16}, /* {"TOSHIBA CD-ROM XM-5402TA3605",28}, */ {NULL,0} /* must be last entry */ }; static int Is_a_Toshiba3401; int Toshiba3401(void); int Toshiba3401() { return Is_a_Toshiba3401; } /* hook */ static void Dummy(void); static void Dummy() { } static SCSI *usalp; SCSI *get_scsi_p(void); SCSI *get_scsi_p() { return usalp; } #if !defined(SIM_CD) static void trash_cache_SCSI(UINT4 *p, unsigned lSector, unsigned SectorBurstVal); static void trash_cache_SCSI(UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { /* trash the cache */ ReadCdRom(get_scsi_p(), p, find_an_off_sector(lSector, SectorBurstVal), min(global.nsectors,6)); } static void Check_interface_for_device(struct stat *statstruct, char *pdev_name); static int OpenCdRom(char *pdev_name); static void SetupSCSI(void); static void SetupSCSI() { unsigned char *p; if (interface != GENERIC_SCSI) { /* unfortunately we have the wrong interface and are * not able to change on the fly */ fprintf(stderr, "The generic SCSI interface and devices are required\n"); exit(SYNTAX_ERROR); } /* do a test unit ready to 'init' the device. */ TestForMedium(usalp); /* check for the correct type of unit. */ p = Inquiry(usalp); #undef TYPE_ROM #define TYPE_ROM 5 #undef TYPE_WORM #define TYPE_WORM 4 if (p == NULL) { fprintf(stderr, "Inquiry command failed. Aborting...\n"); exit(DEVICE_ERROR); } if ((*p != TYPE_ROM && *p != TYPE_WORM)) { fprintf(stderr, "this is neither a scsi cdrom nor a worm device\n"); exit(SYNTAX_ERROR); } if (global.quiet == 0) { fprintf(stderr, "Type: %s, Vendor '%8.8s' Model '%16.16s' Revision '%4.4s' ", *p == TYPE_ROM ? "ROM" : "WORM" ,p+8 ,p+16 ,p+32); } /* generic Sony type defaults */ density = 0x0; accepts_fua_bit = -1; EnableCdda = (void (*)(SCSI *, int, unsigned))Dummy; ReadCdRom = ReadCdda12; ReadCdRomSub = ReadCddaSubSony; ReadCdRomData = (int (*)(SCSI *, unsigned char *, unsigned, unsigned))ReadStandardData; ReadLastAudio = ReadFirstSessionTOCSony; SelectSpeed = SpeedSelectSCSISony; Play_at = Play_atSCSI; StopPlay = StopPlaySCSI; trash_cache = trash_cache_SCSI; ReadTocText = ReadTocTextSCSIMMC; doReadToc = ReadTocSCSI; ReadSubQ = ReadSubQSCSI; ReadSubChannels = NULL; /* check for brands and adjust special peculiaritites */ /* If your drive is not treated correctly, you can adjust some things here: global.in_lendian: should be to 1, if the CDROM drive or CD-Writer delivers the samples in the native byteorder of the audio cd (LSB first). HP CD-Writers need it set to 0. NOTE: If you get correct wav files when using sox with the '-x' option, the endianess is wrong. You can use the -C option to specify the value of global.in_lendian. */ { int mmc_code; usalp->silent ++; allow_atapi(usalp, 1); if (*p == TYPE_ROM) { mmc_code = heiko_mmc(usalp); } else { mmc_code = 0; } usalp->silent --; /* Exceptions for drives that report incorrect MMC capability */ if (mmc_code != 0) { /* these drives are NOT capable of MMC commands */ mystring *pp = drv_is_not_mmc; while (pp->str != NULL) { if (!strncmp(pp->str, (char *)p+8,pp->sl)) { mmc_code = 0; break; } pp++; } } { /* these drives flag themselves as non-MMC, but offer CDDA reading only with a MMC method. */ mystring *pp = drv_has_mmc_cdda; while (pp->str != NULL) { if (!strncmp(pp->str, (char *)p+8,pp->sl)) { mmc_code = 1; break; } pp++; } } switch (mmc_code) { case 2: /* SCSI-3 cdrom drive with accurate audio stream */ /* fall through */ case 1: /* SCSI-3 cdrom drive with no accurate audio stream */ /* fall through */ lost_toshibas: global.in_lendian = 1; if (mmc_code == 2) global.overlap = 0; else global.overlap = 1; ReadCdRom = ReadCddaFallbackMMC; ReadCdRomSub = ReadCddaSubSony; ReadLastAudio = ReadFirstSessionTOCMMC; SelectSpeed = SpeedSelectSCSIMMC; ReadTocText = ReadTocTextSCSIMMC; doReadToc = ReadTocMMC; ReadSubChannels = ReadSubChannelsFallbackMMC; if (!memcmp(p+8,"SONY CD-RW CRX100E 1.0", 27)) ReadTocText = NULL; if (!global.quiet) fprintf(stderr, "MMC+CDDA\n"); break; case -1: /* "MMC drive does not support cdda reading, sorry\n." */ doReadToc = ReadTocMMC; if (!global.quiet) fprintf(stderr, "MMC-CDDA\n"); /* FALLTHROUGH */ case 0: /* non SCSI-3 cdrom drive */ if (!global.quiet) fprintf(stderr, "no MMC\n"); ReadLastAudio = NULL; if (!memcmp(p+8,"TOSHIBA", 7) || !memcmp(p+8,"IBM", 3) || !memcmp(p+8,"DEC", 3)) { /* * older Toshiba ATAPI drives don't identify themselves as MMC. * The last digit of the model number is '2' for ATAPI drives. * These are treated as MMC. */ if (!memcmp(p+15, " CD-ROM XM-", 11) && p[29] == '2') { goto lost_toshibas; } density = 0x82; EnableCdda = EnableCddaModeSelect; ReadSubChannels = ReadStandardSub; ReadCdRom = ReadStandard; SelectSpeed = SpeedSelectSCSIToshiba; if (!memcmp(p+15, " CD-ROM XM-3401",15)) { Is_a_Toshiba3401 = 1; } global.in_lendian = 1; } else if (!memcmp(p+8,"IMS",3) || !memcmp(p+8,"KODAK",5) || !memcmp(p+8,"RICOH",5) || !memcmp(p+8,"HP",2) || !memcmp(p+8,"PHILIPS",7) || !memcmp(p+8,"PLASMON",7) || !memcmp(p+8,"GRUNDIG CDR100IPW",17) || !memcmp(p+8,"MITSUMI CD-R ",13)) { EnableCdda = EnableCddaModeSelect; ReadCdRom = ReadStandard; SelectSpeed = SpeedSelectSCSIPhilipsCDD2600; /* treat all of these as bigendian */ global.in_lendian = 0; /* no overlap reading for cd-writers */ global.overlap = 0; } else if (!memcmp(p+8,"NRC",3)) { SelectSpeed = NULL; } else if (!memcmp(p+8,"YAMAHA",6)) { EnableCdda = EnableCddaModeSelect; SelectSpeed = SpeedSelectSCSIYamaha; /* no overlap reading for cd-writers */ global.overlap = 0; global.in_lendian = 1; } else if (!memcmp(p+8,"PLEXTOR",7)) { global.in_lendian = 1; global.overlap = 0; ReadLastAudio = ReadFirstSessionTOCSony; ReadTocText = ReadTocTextSCSIMMC; doReadToc = ReadTocSony; ReadSubChannels = ReadSubChannelsSony; } else if (!memcmp(p+8,"SONY",4)) { global.in_lendian = 1; if (!memcmp(p+16, "CD-ROM CDU55E",13)) { ReadCdRom = ReadCddaMMC12; } ReadLastAudio = ReadFirstSessionTOCSony; ReadTocText = ReadTocTextSCSIMMC; doReadToc = ReadTocSony; ReadSubChannels = ReadSubChannelsSony; } else if (!memcmp(p+8,"NEC",3)) { ReadCdRom = ReadCdda10; ReadTocText = NULL; SelectSpeed = SpeedSelectSCSINEC; global.in_lendian = 1; if (!memcmp(p+29,"5022.0r",3)) /* I assume all versions of the 502 require this? */ global.overlap = 0; /* no overlap reading for NEC CD-ROM 502 */ } else if (!memcmp(p+8,"MATSHITA",8)) { ReadCdRom = ReadCdda12Matsushita; global.in_lendian = 1; } } /* switch (get_mmc) */ } /* look if caddy is loaded */ if (interface == GENERIC_SCSI) { usalp->silent++; while (!wait_unit_ready(usalp, 60)) { fprintf(stderr,"load cdrom please and press enter"); getchar(); } usalp->silent--; } } /* Check to see if the device will support SCSI generic commands. A * better check than simply looking at the device name. Open the * device, issue an inquiry. If they both succeed, there's a good * chance that the device works... */ #if defined(__linux__) static int check_linux_scsi_interface(char *pdev_name) { SCSI *dev = NULL; unsigned char *p = NULL; char errstr[80]; dev = usal_open(pdev_name, errstr, sizeof(errstr), 0, 0); if (NULL == dev) return EINVAL; p = Inquiry(dev); if (p) { usal_close(dev); return 0; } usal_close(dev); return EINVAL; } #endif /********************** General setup *******************************/ /* As the name implies, interfaces and devices are checked. We also adjust nsectors, overlap, and interface for the first time here. Any unnecessary privileges (setuid, setgid) are also dropped here. */ static void Check_interface_for_device(struct stat *statstruct, char *pdev_name) { #if defined(__linux__) int is_scsi = 1; #endif #ifndef STAT_MACROS_BROKEN if (!S_ISCHR(statstruct->st_mode) && !S_ISBLK(statstruct->st_mode)) { fprintf(stderr, "%s is not a device\n",pdev_name); exit(SYNTAX_ERROR); } #endif /* Check what type of device we have */ #if defined (__linux__) if (check_linux_scsi_interface(pdev_name)) is_scsi = 0; if (interface == GENERIC_SCSI && !is_scsi) { fprintf(stderr, "device %s does not support generic_scsi; falling back to cooked_ioctl instead\n", pdev_name); interface = COOKED_IOCTL; } if ((interface == COOKED_IOCTL) && is_scsi && (SCSI_GENERIC_MAJOR == major(statstruct->st_rdev))) { fprintf(stderr, "device %s is generic_scsi NOT cooked_ioctl\n", pdev_name); interface = GENERIC_SCSI; } #else #if defined (HAVE_ST_RDEV) switch (major(statstruct->st_rdev)) { #if defined (__linux__) case SCSI_GENERIC_MAJOR: /* generic */ #else default: /* ??? what is the proper value here */ #endif #ifndef STAT_MACROS_BROKEN #if defined (__linux__) if (!S_ISCHR(statstruct->st_mode)) { fprintf(stderr, "%s is not a char device\n",pdev_name); exit(SYNTAX_ERROR); } if (interface != GENERIC_SCSI) { fprintf(stderr, "wrong interface (cooked_ioctl) for this device (%s)\nset to generic_scsi\n", pdev_name); interface = GENERIC_SCSI; } #endif #else default: /* ??? what is the proper value here */ #endif break; #if defined (__linux__) || defined (__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) #if defined (__linux__) case SCSI_CDROM_MAJOR: /* scsi cd */ default: /* for example ATAPI cds */ #else #if defined (__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) #if __FreeBSD_version >= 600021 case 0: /* majors abandoned */ /* FALLTHROUGH */ #endif #if __FreeBSD_version >= 501113 case 4: /* GEOM */ /* FALLTHROUGH */ #endif case 117: /* pre-GEOM atapi cd */ if (!S_ISCHR(statstruct->st_mode)) { fprintf(stderr, "%s is not a char device\n",pdev_name); exit(SYNTAX_ERROR); } if (interface != COOKED_IOCTL) { fprintf(stderr, "cdrom device (%s) is not of type generic SCSI. \ Setting interface to cooked_ioctl.\n", pdev_name); interface = COOKED_IOCTL; } break; case 19: /* first atapi cd */ #endif #endif if (!S_ISBLK(statstruct->st_mode)) { fprintf(stderr, "%s is not a block device\n",pdev_name); exit(SYNTAX_ERROR); } #if defined (__linux__) #if LINUX_VERSION_CODE >= 0x20600 /* In Linux kernel 2.6 it is better to use the SCSI interface * with the device. */ break; #endif #endif if (interface != COOKED_IOCTL) { fprintf(stderr, "cdrom device (%s) is not of type generic SCSI. \ Setting interface to cooked_ioctl.\n", pdev_name); interface = COOKED_IOCTL; } if (interface == COOKED_IOCTL) { fprintf(stderr, "\nW: The cooked_ioctl interface is functionally very limited!!\n"); #if defined (__linux__) fprintf(stderr, "\nW: For good sampling quality simply use the generic SCSI interface!\n" "For example dev=ATA:1,0,0\n"); #endif } break; #endif } #endif #endif if (global.overlap >= global.nsectors) global.overlap = global.nsectors-1; } /* open the cdrom device */ static int OpenCdRom(char *pdev_name) { int retval = 0; struct stat fstatstruct; /* The device (given by pdevname) can be: a. an SCSI device specified with a /dev/xxx name, b. an SCSI device specified with bus,target,lun numbers, c. a non-SCSI device such as ATAPI or proprietary CDROM devices. */ #ifdef HAVE_IOCTL_INTERFACE struct stat statstruct; int have_named_device = 0; have_named_device = FALSE; if (pdev_name) { have_named_device = strchr(pdev_name, ':') == NULL && memcmp(pdev_name, "/dev/", 5) == 0; } if (have_named_device) { if (stat(pdev_name, &statstruct)) { fprintf(stderr, "cannot stat device %s\n", pdev_name); exit(STAT_ERROR); } else { Check_interface_for_device( &statstruct, pdev_name ); } } #endif if (interface == GENERIC_SCSI) { char errstr[80]; priv_on(); needroot(0); needgroup(0); /* * Call usal_remote() to force loading the remote SCSI transport library * code that is located in librusal instead of the dummy remote routines * that are located inside libusal. */ usal_remote(); if (pdev_name != NULL && ((strncmp(pdev_name, "HELP", 4) == 0) || (strncmp(pdev_name, "help", 4) == 0))) { usal_help(stderr); exit(NO_ERROR); } /* device name, debug, verboseopen */ usalp = usal_open(pdev_name, errstr, sizeof(errstr), 0, 0); if (usalp == NULL) { int err = geterrno(); errmsgno(err, "%s%sCannot open SCSI driver.\n", errstr, errstr[0]?". ":""); errmsgno(EX_BAD, "For possible targets try 'wodim -scanbus'.%s\n", geteuid() ? " Make sure you are root.":""); priv_off(); dontneedgroup(); dontneedroot(); #if defined(sun) || defined(__sun) fprintf(stderr, "On SunOS/Solaris make sure you have Joerg Schillings usal SCSI driver installed.\n"); #endif #if defined (__linux__) fprintf(stderr, "Use the script scan_scsi.linux to find out more.\n"); #endif fprintf(stderr, "Probably you did not define your SCSI device.\n"); fprintf(stderr, "Set the CDDA_DEVICE environment variable or use the -D option.\n"); fprintf(stderr, "You can also define the default device in the Makefile.\n"); fprintf(stderr, "For possible transport specifiers try 'wodim dev=help'.\n"); exit(SYNTAX_ERROR); } usal_settimeout(usalp, 300); usal_settimeout(usalp, 60); usalp->silent = global.scsi_silent; usalp->verbose = global.scsi_verbose; if (global.nsectors > (unsigned) usal_bufsize(usalp, 3*1024*1024)/CD_FRAMESIZE_RAW) global.nsectors = usal_bufsize(usalp, 3*1024*1024)/CD_FRAMESIZE_RAW; if (global.overlap >= global.nsectors) global.overlap = global.nsectors-1; /* * Newer versions of Linux seem to introduce an incompatible change * and require root privileges or limit RLIMIT_MEMLOCK infinity * in order to get a SCSI buffer in case we did call mlockall(MCL_FUTURE). */ init_scsibuf(usalp, global.nsectors*CD_FRAMESIZE_RAW); priv_off(); dontneedgroup(); dontneedroot(); if (global.scandevs) { list_devices(usalp, stdout, 0); exit(0); } if (global.scanbus) { select_target(usalp, stdout); exit(0); } } else { needgroup(0); retval = open(pdev_name,O_RDONLY #ifdef linux | O_NONBLOCK #endif ); dontneedgroup(); if (retval < 0) { fprintf(stderr, "while opening %s :", pdev_name); perror(""); exit(DEVICEOPEN_ERROR); } /* Do final security checks here */ if (fstat(retval, &fstatstruct)) { fprintf(stderr, "Could not fstat %s (fd %d): ", pdev_name, retval); perror(""); exit(STAT_ERROR); } Check_interface_for_device( &fstatstruct, pdev_name ); #if defined HAVE_IOCTL_INTERFACE /* Watch for race conditions */ if (have_named_device && (fstatstruct.st_dev != statstruct.st_dev || fstatstruct.st_ino != statstruct.st_ino)) { fprintf(stderr,"Race condition attempted in OpenCdRom. Exiting now.\n"); exit(RACE_ERROR); } #endif /* * The structure looks like a desaster :-( * We do this more than once as it is impossible to understand where * the right place would be to do this.... */ if (usalp != NULL) { usalp->verbose = global.scsi_verbose; } } return retval; } #endif /* SIM_CD */ /******************* Simulation interface *****************/ #if defined SIM_CD #include "toc.h" static unsigned long sim_pos=0; /* read 'SectorBurst' adjacent sectors of audio sectors * to Buffer '*p' beginning at sector 'lSector' */ static int ReadCdRom_sim(SCSI *x, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); static int ReadCdRom_sim(SCSI *x, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { unsigned int loop=0; Int16_t *q = (Int16_t *) p; int joffset = 0; if (lSector > g_toc[cdtracks].dwStartSector || lSector + SectorBurstVal > g_toc[cdtracks].dwStartSector + 1) { fprintf(stderr, "Read request out of bounds: %u - %u (%d - %d allowed)\n", lSector, lSector + SectorBurstVal, 0, g_toc[cdtracks].dwStartSector); } #if 0 /* jitter with a probability of jprob */ if (random() <= jprob) { /* jitter up to jmax samples */ joffset = random(); } #endif #ifdef DEBUG_SHM fprintf(stderr, ", last_b = %p\n", *last_buffer); #endif for (loop = lSector*CD_FRAMESAMPLES + joffset; loop < (lSector+SectorBurstVal)*CD_FRAMESAMPLES + joffset; loop++) { *q++ = loop; *q++ = ~loop; } #ifdef DEBUG_SHM fprintf(stderr, "sim wrote from %p upto %p - 4 (%d), last_b = %p\n", p, q, SectorBurstVal*CD_FRAMESAMPLES, *last_buffer); #endif sim_pos = (lSector+SectorBurstVal)*CD_FRAMESAMPLES + joffset; return SectorBurstVal; } static int Play_at_sim(SCSI *x, unsigned int from_sector, unsigned int sectors); static int Play_at_sim(SCSI *x, unsigned int from_sector, unsigned int sectors) { sim_pos = from_sector*CD_FRAMESAMPLES; return 0; } static unsigned sim_indices; /* read the table of contents (toc) via the ioctl interface */ static unsigned ReadToc_sim(SCSI *x, TOC *toc); static unsigned ReadToc_sim(SCSI *x, TOC *toc) { unsigned int scenario; int scen[12][3] = { {1,1,500}, {1,2,500}, {1,99,150*99}, {2,1,500}, {2,2,500}, {2,99,150*99}, {2,1,500}, {5,2,500}, {5,99,150*99}, {99,1,1000}, {99,2,1000}, {99,99,150*99}, }; unsigned int i; unsigned trcks; #if 0 fprintf(stderr, "select one of the following TOCs\n" "0 : 1 track with 1 index\n" "1 : 1 track with 2 indices\n" "2 : 1 track with 99 indices\n" "3 : 2 tracks with 1 index each\n" "4 : 2 tracks with 2 indices each\n" "5 : 2 tracks with 99 indices each\n" "6 : 2 tracks (data and audio) with 1 index each\n" "7 : 5 tracks with 2 indices each\n" "8 : 5 tracks with 99 indices each\n" "9 : 99 tracks with 1 index each\n" "10: 99 tracks with 2 indices each\n" "11: 99 tracks with 99 indices each\n" ); do { scanf("%u", &scenario); } while (scenario > sizeof(scen)/2/sizeof(int)); #else scenario = 6; #endif /* build table of contents */ #if 0 trcks = scen[scenario][0] + 1; sim_indices = scen[scenario][1]; for (i = 0; i < trcks; i++) { toc[i].bFlags = (scenario == 6 && i == 0) ? 0x40 : 0xb1; toc[i].bTrack = i + 1; toc[i].dwStartSector = i * scen[scenario][2]; toc[i].mins = (toc[i].dwStartSector+150) / (60*75); toc[i].secs = (toc[i].dwStartSector+150 / 75) % (60); toc[i].frms = (toc[i].dwStartSector+150) % (75); } toc[i].bTrack = 0xaa; toc[i].dwStartSector = i * scen[scenario][2]; toc[i].mins = (toc[i].dwStartSector+150) / (60*75); toc[i].secs = (toc[i].dwStartSector+150 / 75) % (60); toc[i].frms = (toc[i].dwStartSector+150) % (75); #else { int starts[15] = { 23625, 30115, 39050, 51777, 67507, 88612, 112962, 116840, 143387, 162662, 173990, 186427, 188077, 209757, 257120}; trcks = 14 + 1; sim_indices = 1; for (i = 0; i < trcks; i++) { toc[i].bFlags = 0x0; toc[i].bTrack = i + 1; toc[i].dwStartSector = starts[i]; toc[i].mins = (starts[i]+150) / (60*75); toc[i].secs = (starts[i]+150 / 75) % (60); toc[i].frms = (starts[i]+150) % (75); } toc[i].bTrack = 0xaa; toc[i].dwStartSector = starts[i]; toc[i].mins = (starts[i]) / (60*75); toc[i].secs = (starts[i] / 75) % (60); toc[i].frms = (starts[i]) % (75); } #endif return --trcks; /* without lead-out */ } static subq_chnl *ReadSubQ_sim(SCSI *usalp, unsigned char sq_format, unsigned char track); /* request sub-q-channel information. This function may cause confusion * for a drive, when called in the sampling process. */ static subq_chnl *ReadSubQ_sim(SCSI *usalp, unsigned char sq_format, unsigned char track) { subq_chnl *SQp = (subq_chnl *) (SubQbuffer); subq_position *SQPp = (subq_position *) &SQp->data; unsigned long sim_pos1; unsigned long sim_pos2; if ( sq_format != GET_POSITIONDATA ) return NULL; /* not supported by sim */ /* simulate CDROMSUBCHNL ioctl */ /* copy to SubQbuffer */ SQp->audio_status = 0; SQp->format = 0xff; SQp->control_adr = 0xff; sim_pos1 = sim_pos/CD_FRAMESAMPLES; sim_pos2 = sim_pos1 % 150; SQp->track = (sim_pos1 / 5000) + 1; SQp->index = ((sim_pos1 / 150) % sim_indices) + 1; sim_pos1 += 150; SQPp->abs_min = sim_pos1 / (75*60); SQPp->abs_sec = (sim_pos1 / 75) % 60; SQPp->abs_frame = sim_pos1 % 75; SQPp->trel_min = sim_pos2 / (75*60); SQPp->trel_sec = (sim_pos2 / 75) % 60; SQPp->trel_frame = sim_pos2 % 75; return (subq_chnl *)(SubQbuffer); } static void SelectSpeed_sim(SCSI *x, unsigned sp); /* ARGSUSED */ static void SelectSpeed_sim(SCSI *x, unsigned sp) { } static void trash_cache_sim(UINT4 *p, unsigned lSector, unsigned SectorBurstVal); /* ARGSUSED */ static void trash_cache_sim(UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { } static void SetupSimCd(void); static void SetupSimCd() { EnableCdda = (void (*)(SCSI *, int, unsigned))Dummy; ReadCdRom = ReadCdRom_sim; ReadCdRomData = (int (*)(SCSI *, unsigned char *, unsigned, unsigned))ReadCdRom_sim; doReadToc = ReadToc_sim; ReadTocText = NULL; ReadSubQ = ReadSubQ_sim; ReadSubChannels = NULL; ReadLastAudio = NULL; SelectSpeed = SelectSpeed_sim; Play_at = Play_at_sim; StopPlay = (int (*)(SCSI *))Dummy; trash_cache = trash_cache_sim; } #endif /* def SIM_CD */ /* perform initialization depending on the interface used. */ void SetupInterface() { #if defined SIM_CD fprintf( stderr, "SIMULATION MODE !!!!!!!!!!!\n"); #else /* ensure interface is setup correctly */ global.cooked_fd = OpenCdRom ( global.dev_name ); #endif global.pagesize = getpagesize(); /* request one sector for table of contents */ bufferTOC = malloc( CD_FRAMESIZE_RAW + 96 ); /* assumes sufficient aligned addresses */ /* SubQchannel buffer */ SubQbuffer = malloc( 48 ); /* assumes sufficient aligned addresses */ cmd = malloc( 18 ); /* assumes sufficient aligned addresses */ if ( !bufferTOC || !SubQbuffer || !cmd ) { fprintf( stderr, "Too low on memory. Giving up.\n"); exit(NOMEM_ERROR); } #if defined SIM_CD usalp = malloc(sizeof(* usalp)); if (usalp == NULL) { FatalError("No memory for SCSI structure.\n"); } usalp->silent = 0; SetupSimCd(); #else /* if drive is of type scsi, get vendor name */ if (interface == GENERIC_SCSI) { unsigned sector_size; SetupSCSI(); sector_size = get_orig_sectorsize(usalp, &orgmode4, &orgmode10, &orgmode11); if (!SCSI_emulated_ATAPI_on(usalp)) { if ( sector_size != 2048 && set_sectorsize(usalp, 2048) ) { fprintf( stderr, "Could not change sector size from %d to 2048\n", sector_size ); } } else { sector_size = 2048; } /* get cache setting */ /* set cache to zero */ } else { #if defined (HAVE_IOCTL_INTERFACE) usalp = malloc(sizeof(* usalp)); if (usalp == NULL) { FatalError("No memory for SCSI structure.\n"); } usalp->silent = 0; SetupCookedIoctl( global.dev_name ); #else FatalError("Sorry, there is no known method to access the device.\n"); #endif } #endif /* if def SIM_CD */ /* * The structure looks like a desaster :-( * We do this more than once as it is impossible to understand where * the right place would be to do this.... */ if (usalp != NULL) { usalp->verbose = global.scsi_verbose; } } #ifdef HAVE_PRIV_H #include #endif void priv_init() { #ifdef HAVE_PRIV_SET /* * Give up privs we do not need anymore. * We no longer need: * file_dac_read,sys_devices,proc_priocntl,net_privaddr */ priv_set(PRIV_OFF, PRIV_EFFECTIVE, PRIV_FILE_DAC_READ, PRIV_PROC_PRIOCNTL, PRIV_NET_PRIVADDR, NULL); priv_set(PRIV_OFF, PRIV_INHERITABLE, PRIV_FILE_DAC_READ, PRIV_PROC_PRIOCNTL, PRIV_NET_PRIVADDR, PRIV_SYS_DEVICES, NULL); #endif } void priv_on() { #ifdef HAVE_PRIV_SET /* * Get back privs we may need now. * We need: * file_dac_read,sys_devices,proc_priocntl,net_privaddr */ priv_set(PRIV_ON, PRIV_EFFECTIVE, PRIV_FILE_DAC_READ, PRIV_PROC_PRIOCNTL, PRIV_NET_PRIVADDR, NULL); #endif } void priv_off() { #ifdef HAVE_PRIV_SET /* * Give up privs we do not need anymore. * We no longer need: * file_dac_read,sys_devices,proc_priocntl,net_privaddr */ priv_set(PRIV_OFF, PRIV_EFFECTIVE, PRIV_FILE_DAC_READ, PRIV_PROC_PRIOCNTL, PRIV_NET_PRIVADDR, NULL); #endif } cdrkit-1.1.11/icedax/ringbuff.h0000644000372500001440000000571710513514665015354 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)ringbuff.h 1.5 01/10/20 Copyright 1998,1999,2000 Heiko Eissfeldt */ /* This file contains data structures that reside in the shared memory * segment. */ /* the linux semctl prototype is broken as is the definition of union semun in sys/sem.h. */ #ifdef HAVE_UNION_SEMUN # define my_semun semun #else union my_semun { int val; struct semid_ds *pid; unsigned short *array; }; #endif /* Ringbuffer structures. Space for the ringbuffer is allocated page aligned and contains the following -------------------- start of page header (once for the ring buffer) \\ space for page alignment ||+- HEADER_SIZE RB_BASE -+v || myringbuffer.offset |/ -------------------- start of page/-- pagesize myringbuffer.data (SEGMENT_SIZE)\ space for page alignment |+- ENTRY_SIZE_PAGE_AL myringbuffer.offset / -------------------- start of page myringbuffer.data space for page alignment ... */ typedef struct { int offset; UINT4 data[CD_FRAMESAMPLES]; } myringbuff; struct ringbuffheader { myringbuff *p1; myringbuff *p2; volatile unsigned long total_read; volatile unsigned long total_written; volatile int child_waitstate; volatile int parent_waitstate; volatile int input_littleendian; volatile int end_is_reached; volatile unsigned long nSamplesToDo; int offset; UINT4 data[CD_FRAMESAMPLES]; }; extern myringbuff **he_fill_buffer; extern myringbuff **last_buffer; extern volatile unsigned long *total_segments_read; extern volatile unsigned long *total_segments_written; extern volatile int *child_waits; extern volatile int *parent_waits; extern volatile int *in_lendian; extern volatile int *eorecording; #define palign(x, a) (((char *)(x)) + ((a) - 1 - (((unsigned)((x)-1))%(a)))) #define multpage(x, a) ((((x) + (a) - 1) / (a)) * (a)) #define HEADER_SIZE multpage(offset_of(struct ringbuffheader, data), global.pagesize) #define SEGMENT_SIZE (global.nsectors*CD_FRAMESIZE_RAW) #define ENTRY_SIZE_PAGE_AL multpage(SEGMENT_SIZE + offset_of(myringbuff, data), global.pagesize) #define RB_BASE ((myringbuff *)(((unsigned char *)he_fill_buffer) + HEADER_SIZE - offset_of(myringbuff, data))) #define INC(a) (myringbuff *)(((char *)RB_BASE) + (((((char *) (a))-((char *)RB_BASE))/ENTRY_SIZE_PAGE_AL + 1) % total_buffers)*ENTRY_SIZE_PAGE_AL) void set_total_buffers(unsigned int num_buffers, int mysem_id); const myringbuff *get_previous_read_buffer(void); const myringbuff *get_he_fill_buffer(void); myringbuff *get_next_buffer(void); myringbuff *get_oldest_buffer(void); void define_buffer(void); void drop_buffer(void); void drop_all_buffers(void); cdrkit-1.1.11/icedax/version.sed0000644000372500001440000000006010471375025015543 0ustar steveusers/cdr_version\[\] = /{ s/.*"\(.*\)";/\1/ p } cdrkit-1.1.11/icedax/cdda2mp3.new0000644000372500001440000000323310471375025015476 0ustar steveusers#!/bin/sh # Demo script for processing all audio tracks with a mp3 encoder # This variant creates temporary wav files. There is another # variant of this script (cdda2mp3), which uses a named pipe # instead. This variant needs more disk space than the other one. # # usage: cdda2mp3.new # # list_audio_tracks is a (symbolic) link to cdda2wav # and used to generate a list of audio track numbers and start # sectors, which in turn are used in a loop to spawn cdda2wav # and the post processor on a track by track basis. # # feedback needed!!!!!!!!!!!!!!!!! # # specify the audio track listing program and its options LAT=list_audio_tracks LAT_OPTIONS= # specify the sampling program and its options # do not specify the track option here! CDDA2WAV=cdda2wav CDDA2WAV_OPTS='-Owav -H -P0 -q' # for normal use, comment out the next line with a # #DEBUG='-d1' # specify the post processing program and its options MP_CODER=l3enc #MP_OPTIONS='2>/dev/null 1>/dev/null' MP_OPTIONS='-br 128000' #MP_OPTIONS='-hq' WAVFILE=$$".wav" FILEPREFIX=${1:-audiotrack} # clean up wav file on exit, abort, ... trap "rm -rf $WAVFILE" 0 2 3 4 6 7 8 10 11 12 13 15 # feed track numbers and start sectors into loop $LAT $LAT_OPTIONS | while read TRACK STARTSECTOR; do $CDDA2WAV $CDDA2WAV_OPTS -t$TRACK $DEBUG $WAVFILE # echo n | $MP_CODER $WAVFILE $FILEPREFIX$TRACK.mp3 $MP_OPTIONS $MP_CODER $WAVFILE $FILEPREFIX$TRACK.mp3 $MP_OPTIONS # check result code RES=$? if [ $RES = 0 ] ; then echo File $FILEPREFIX$TRACK.mp3 finished successfully. rm $WAVFILE else echo File $FILEPREFIX$TRACK.mp3 failed \(result $RES\). Aborted. >&2 break fi done cdrkit-1.1.11/icedax/readmult.10000644000372500001440000000322310505343313015255 0ustar steveusers.TH "READMULT" "1" "Tue Feb 15 12:34:06 MST 2005" "" "readmult" .PP .SH "NAME" readmult \- a multitrack wrapper for cdda2wav .PP .SH "SYNOPSIS" .PP \fBreadmult\fP <track b> <title b> ... .PP .SH "DESCRIPTION" .PP \fBreadmult\fP allows simultaneous extraction and naming of multiple tracks with cdda2wav .PP .SH SEE ALSO cdda2wav(1) .PP .SH "AUTHOR" .PP \fBcdda2was\fP was written by Joerg Schilling <js@cs\&.tu-berlin\&.de> and others. .PP This describes the program as shipped with cdrkit, see This manpage describes the program implementation of .B readmult as shipped by the cdrkit distribution. See .B http://alioth.debian.org/projects/debburn/ for details. It is a spinoff from the original program distributed by the cdrtools project. However, the cdrtools developers are not involved in the development of this spinoff and therefore shall not be made responsible for any problem caused by it. Do not try to get support for this program by contacting the original authors. .PP If you have support questions, send them to .PP .B debburn-devel@lists.alioth.debian.org .br .PP If you have definitely found a bug, send a mail to this list or to .PP .B submit@bugs.debian.org .br .PP writing at least a short description into the Subject and "Package: cdrkit" into the first line of the mail body. .PP This manual page was written by Oleksandr Moskalenko <malex@tagancha\&.org>, for the Debian GNU/Linux system\&. It may be used by other distributions without contacting the author\&. Any mistakes or omissions in the manual page are my fault; inquiries about or corrections to this manual page should be directed to me (and not to the primary author)\&. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/mycdrom.h����������������������������������������������������������������������0000644�0003725�0000144�00000010056�10476554276�015226� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)mycdrom.h 1.10 06/05/07 Copyright 1998,1999 Heiko Eissfeldt, Copyright 2005-2006 J. Schilling */ #if defined(__linux__) # include <linux/cdrom.h> #else # if defined HAVE_SYS_CDIO_H # include <sys/cdio.h> # if defined(__FreeBSD__) && __FreeBSD__ >= 2 # include <osreldate.h> # endif # if defined HAVE_SYS_CDRIO_H /* Was: if __FreeBSD_version >= 400014 */ # include <sys/cdrio.h> # endif # if (defined (__sun) && defined (SVR4)) # if 0 /* just for info */ /* Sun has this cdda reading ioctl: CDROMCDDA */ /* * Definition of CD-DA structure */ struct cdrom_cdda { unsigned int cdda_addr; unsigned int cdda_length; caddr_t cdda_data; unsigned char cdda_subcode; }; /* To get the subcode information related to CD-DA data, the following values are appropriate for the cdda_subcode field: CDROM_DA_NO_SUBCODE CD-DA data with no subcode. CDROM_DA_SUBQ CD-DA data with sub Q code. CDROM_DA_ALL_SUBCODE CD-DA data with all subcode. CDROM_DA_SUBCODE_ONLY All subcode only. To allocate the memory related to CD-DA and/or subcode data, the following values are appropriate for each data block transferred: CD-DA data with no subcode 2352 bytes CD-DA data with sub Q code 2368 bytes CD-DA data with all subcode 2448 bytes All subcode only 96 bytes */ # endif /* if 0 */ # else /* not Sun SVR4 */ # if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __DragonFly__ || defined __OpenBSD__ # if (defined(__FreeBSD__) && __FreeBSD_version < 228000) || !defined(CDIOCREADAUDIO) /* * FreeBSD_version >= 501112 has no CDIOCREADAUDIO but uses pread() */ # if !(defined(__FreeBSD__) && __FreeBSD_version >= 501112) # undef HAVE_IOCTL_INTERFACE # endif # endif /* __FreeBSD_version < 228000 || !CDIOCREADAUDIO */ #ifdef HAVE_IOCTL_INTERFACE #define CDROM_LBA CD_LBA_FORMAT #define CDROM_MSF CD_MSF_FORMAT #define CDROM_DATA_TRACK 0x04 #define CDROM_LEADOUT 0xAA #define CDROMSTOP CDIOCSTOP #define CDROMSTART CDIOCSTART #define CDROMREADTOCHDR CDIOREADTOCHEADER #define CDROMREADTOCENTRY CDIOREADTOCENTRY #define CDROMPLAYMSF CDIOCPLAYMSF #define CDROMREADAUDIO CDIOCREADAUDIO #define CDROM_GET_MCN CDIOCREADSUBCHANNEL #define CDROMSUBCHNL CDIOCREADSUBCHANNEL #ifndef CDIOREADTOCENTRY #define CDIOREADTOCENTRY CDIOREADTOCENTRYS #endif #define cdrom_tochdr ioc_toc_header #define cdth_trk0 starting_track #define cdth_trk1 ending_track #define cdrom_tocentry ioc_read_toc_single_entry #define cdte_track track #define cdte_format address_format #define cdte_adr entry.addr_type #define cdte_ctrl entry.control #define cdte_addr entry.addr #define cdrom_read_audio ioc_read_audio #define addr_format address_format #define buff buffer #define cdrom_msf ioc_play_msf #define cdmsf_min0 start_m #define cdmsf_sec0 start_s #define cdmsf_frame0 start_f #define cdmsf_min1 end_m #define cdmsf_sec1 end_s #define cdmsf_frame1 end_f #define cdrom_subchnl ioc_read_subchannel #define cdsc_audiostatus data->header.audio_status #define cdsc_format data->what.position.data_format #define cdsc_adr data->what.position.addr_type #define cdsc_ctrl data->what.position.control #define cdsc_trk data->what.position.track_number #define cdsc_ind data->what.position.index_number #define cdsc_absaddr data->what.position.absaddr #define cdsc_reladdr data->what.position.reladdr # endif /* HAVE_IOCTL_INTERFACE */ # else /* not *BSD */ # undef HAVE_IOCTL_INTERFACE # endif /* not *BSD */ # endif /* not SUN SVR4 */ # else /* HAVE_SYS_CDIO_H */ # if defined HAVE_SUNDEV_SRREG_H # include <sundev/srreg.h> # if !defined CDROMCDDA # undef HAVE_IOCTL_INTERFACE # endif # else # undef HAVE_IOCTL_INTERFACE # endif # endif /* not HAVE_SYS_CDIO_H */ #endif /* not linux */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/resample.h���������������������������������������������������������������������0000644�0003725�0000144�00000002112�10513514665�015344� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)resample.h 1.3 02/08/02 Copyright 1998,1999 Heiko Eissfeldt */ #define SYNC_SIZE 600 /* has to be smaller than CD_FRAMESAMPLES */ extern int waitforsignal; /* flag: wait for any audio response */ extern int any_signal; extern short undersampling; /* conversion factor */ extern short samples_to_do; /* loop variable for conversion */ extern int Halved; /* interpolate due to non integral divider */ extern int jitterShift; /* track accumulated jitter */ long SaveBuffer(UINT4 *p, unsigned long SecsToDo, unsigned long *BytesDone); unsigned char *synchronize(UINT4 *p, unsigned SamplesToDo, unsigned TotSamplesDone); void handle_inputendianess(UINT4 *p, unsigned SamplesToDo); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/cd_text.c����������������������������������������������������������������������0000644�0003725�0000144�00000034053�10513514665�015172� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)cd_text.c 1.5 03/12/31 Copyright 2000-2001 Heiko Eissfeldt */ /* This is an include file! */ /**************** CD-Text special treatment **********************************/ typedef struct { unsigned char headerfield[4]; unsigned char textdatafield[12]; unsigned char crcfield[2]; } cdtextpackdata; static unsigned short crctab[1<<8] = { /* as calculated by initcrctab() */ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, }; #define SUBSIZE 18*8 static unsigned short updcrc(unsigned int p_crc, register unsigned char *cp, register size_t cnt); static unsigned short updcrc(unsigned int p_crc, register unsigned char *cp, register size_t cnt) { register unsigned short crc = (unsigned short)p_crc; while( cnt-- ) { crc = (crc<<8) ^ crctab[(crc>>(16-8)) ^ (*cp++)]; } return( crc ); } static unsigned short calcCRC(unsigned char *buf, unsigned bsize); static unsigned short calcCRC(unsigned char *buf, unsigned bsize) { return updcrc( 0x0, (unsigned char *)buf, bsize ); } static unsigned char fliptab[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, }; static int flip_error_corr(unsigned char *b, int crc); static int flip_error_corr(unsigned char *b, int crc) { if (crc != 0) { int i; for (i = 0; i < SUBSIZE; i++) { char c; c = fliptab[i%8]; b[i / 8] ^= c; if ((crc = calcCRC(b, SUBSIZE/8)) == 0) { return crc; } b[i / 8] ^= c; } } return crc & 0xffff; } static int cdtext_crc_ok(cdtextpackdata *c); static int cdtext_crc_ok(cdtextpackdata *c) { int crc; int retval; c->crcfield[0] ^= 0xff; c->crcfield[1] ^= 0xff; crc = calcCRC(((unsigned char *)c), 18); retval = (0 == flip_error_corr((unsigned char *)c, crc)); c->crcfield[0] ^= 0xff; c->crcfield[1] ^= 0xff; #if 0 fprintf(stderr, "%02x %02x %02x %02x ", c->headerfield[0], c->headerfield[1], c->headerfield[2], c->headerfield[3]); fprintf(stderr, "%c %c %c %c %c %c %c %c %c %c %c %c " , c->textdatafield[0] , c->textdatafield[1] , c->textdatafield[2] , c->textdatafield[3] , c->textdatafield[4] , c->textdatafield[5] , c->textdatafield[6] , c->textdatafield[7] , c->textdatafield[8] , c->textdatafield[9] , c->textdatafield[10] , c->textdatafield[11] ); fprintf(stderr, "%02x %02x \n" , c->crcfield[0] , c->crcfield[1] ); #endif return retval; } #define DETAILED 0 #if DETAILED static void dump_binary(cdtextpackdata *c); static void dump_binary(cdtextpackdata *c) { fprintf(stderr, ": header fields %02x %02x %02x ", c->headerfield[1], c->headerfield[2], c->headerfield[3]); fprintf(stderr, "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x" , c->textdatafield[0] , c->textdatafield[1] , c->textdatafield[2] , c->textdatafield[3] , c->textdatafield[4] , c->textdatafield[5] , c->textdatafield[6] , c->textdatafield[7] , c->textdatafield[8] , c->textdatafield[9] , c->textdatafield[10] , c->textdatafield[11] ); } #endif static int process_header(cdtextpackdata *c, unsigned tracknr, int dbcc, unsigned char *line); static int process_header(cdtextpackdata *c, unsigned tracknr, int dbcc, unsigned char *line) { switch ((int)c->headerfield[0]) { case 0x80: /* Title of album or track */ #if DETAILED fprintf (stderr, "Title"); #endif if (tracknr > 0 && tracknr < 100 && global.tracktitle[tracknr] == NULL) { unsigned len; len = strlen((char *)line); if (len > 0) global.tracktitle[tracknr] = malloc(len + 1); if (global.tracktitle[tracknr] != NULL) { memcpy(global.tracktitle[tracknr], line, len); global.tracktitle[tracknr][len] = '\0'; } } else if (tracknr == 0 && global.disctitle == NULL) { unsigned len; len = strlen((char *)line); if (len > 0) global.disctitle = malloc(len + 1); if (global.disctitle != NULL) { memcpy(global.disctitle, line, len); global.disctitle[len] = '\0'; } } break; case 0x81: /* Name(s) of the performer(s) */ #if DETAILED fprintf(stderr, "Performer(s)"); #endif if (tracknr > 0 && tracknr < 100 && global.trackcreator[tracknr] == NULL) { unsigned len; len = strlen((char *)line); if (len > 0) global.trackcreator[tracknr] = malloc(len + 1); if (global.trackcreator[tracknr] != NULL) { memcpy(global.trackcreator[tracknr], line, len); global.trackcreator[tracknr][len] = '\0'; } } else if (tracknr == 0 && global.creator == NULL) { unsigned len; len = strlen((char *)line); if (len > 0) global.creator = malloc(len + 1); if (global.creator != NULL) { memcpy(global.creator, line, len); global.creator[len] = '\0'; } } break; case 0x82: /* Name(s) of the songwriter(s) */ #if DETAILED fprintf(stderr, "Songwriter(s)"); #endif break; case 0x83: /* Name(s) of the composer(s) */ #if DETAILED fprintf(stderr, "Composer(s)"); #endif break; case 0x84: /* Name(s) of the arranger(s) */ #if DETAILED fprintf(stderr, "Arranger(s)"); #endif break; case 0x85: /* Message from content provider and/or artist */ #if DETAILED fprintf(stderr, "Message"); #endif break; case 0x86: /* Disc Identification and information */ #if DETAILED fprintf(stderr, "Disc identification"); #endif if (tracknr == 0 && line[0] != '\0') { fprintf(stderr, "Disc identification: %s\n", line); } break; case 0x87: /* Genre Identification and information */ #if DETAILED fprintf(stderr, "Genre identification"); #endif break; case 0x8e: /* UPC/EAN code or ISRC code */ #if DETAILED fprintf(stderr, "UPC or ISRC"); #endif if (tracknr > 0 && tracknr < 100) { Set_ISRC(tracknr, line); } else if (tracknr == 0 && line[0] != '\0') { Set_MCN(line); } break; case 0x88: /* Table of Content information */ #if DETAILED fprintf(stderr, "Table of Content identification"); dump_binary(c); #endif return 0; case 0x89: /* Second Table of Content information */ #if DETAILED fprintf(stderr, "Second Table of Content identification"); dump_binary(c); #endif return 0; case 0x8f: /* Size information of the block */ #if DETAILED == 0 break; #else switch (tracknr) { case 0: fprintf(stderr, "first track is %d, last track is %d\n", c->textdatafield[1], c->textdatafield[2]); if (c->textdatafield[3] & 0x80) { fprintf(stderr, "Program Area CD Text information available\n"); if (c->textdatafield[3] & 0x40) { fprintf(stderr, "Program Area copy protection available\n"); } } if (c->textdatafield[3] & 0x07) { fprintf(stderr, "message information is %scopyrighted\n", c->textdatafield[3] & 0x04 ? "": "not "); fprintf(stderr, "Names of performer/songwriter/composer/arranger(s) are %scopyrighted\n", c->textdatafield[3] & 0x02 ? "": "not "); fprintf(stderr, "album and track names are %scopyrighted\n", c->textdatafield[3] & 0x01 ? "": "not "); } fprintf(stderr, "%d packs with album/track names\n", c->textdatafield[4]); fprintf(stderr, "%d packs with performer names\n", c->textdatafield[5]); fprintf(stderr, "%d packs with songwriter names\n", c->textdatafield[6]); fprintf(stderr, "%d packs with composer names\n", c->textdatafield[7]); fprintf(stderr, "%d packs with arranger names\n", c->textdatafield[8]); fprintf(stderr, "%d packs with artist or content provider messages\n", c->textdatafield[9]); fprintf(stderr, "%d packs with disc identification information\n", c->textdatafield[10]); fprintf(stderr, "%d packs with genre identification/information\n", c->textdatafield[11]); break; case 1: fprintf(stderr, "%d packs with table of contents information\n", c->textdatafield[0]); fprintf(stderr, "%d packs with second table of contents information\n", c->textdatafield[1]); fprintf(stderr, "%d packs with reserved information\n", c->textdatafield[2]); fprintf(stderr, "%d packs with reserved information\n", c->textdatafield[3]); fprintf(stderr, "%d packs with reserved information\n", c->textdatafield[4]); fprintf(stderr, "%d packs with closed information\n", c->textdatafield[5]); fprintf(stderr, "%d packs with UPC/EAN ISRC information\n", c->textdatafield[6]); fprintf(stderr, "%d packs with size information\n", c->textdatafield[7]); fprintf(stderr, "last sequence numbers for blocks 1-8: %d %d %d %d " ,c->textdatafield[8] ,c->textdatafield[9] ,c->textdatafield[10] ,c->textdatafield[11] ); break; case 2: fprintf(stderr, "%d %d %d %d\n" ,c->textdatafield[0] ,c->textdatafield[1] ,c->textdatafield[2] ,c->textdatafield[3] ); fprintf(stderr, "Language codes for blocks 1-8: %d %d %d %d %d %d %d %d\n" ,c->textdatafield[4] ,c->textdatafield[5] ,c->textdatafield[6] ,c->textdatafield[7] ,c->textdatafield[8] ,c->textdatafield[9] ,c->textdatafield[10] ,c->textdatafield[11] ); break; } fprintf(stderr, "Blocksize"); dump_binary(c); return 0; #if !defined DEBUG_CDTEXT default: #else } #endif fprintf(stderr, ": header fields %02x %02x %02x ", c->headerfield[1], c->headerfield[2], c->headerfield[3]); #endif /* DETAILED */ #if !defined DEBUG_CDTEXT } #if DETAILED if (tracknr == 0) { fprintf(stderr, " for album : ->"); } else { fprintf(stderr, " for track %2u: ->", tracknr); } fputs ((char *) line, stderr); fputs ("<-", stderr); #endif if (dbcc != 0) { #else { #endif /* EMPTY */ #if DETAILED fprintf(stderr, " %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x" , c->textdatafield[0] , c->textdatafield[1] , c->textdatafield[2] , c->textdatafield[3] , c->textdatafield[4] , c->textdatafield[5] , c->textdatafield[6] , c->textdatafield[7] , c->textdatafield[8] , c->textdatafield[9] , c->textdatafield[10] , c->textdatafield[11] ); #endif } return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/sndfile.h����������������������������������������������������������������������0000644�0003725�0000144�00000001724�10513514665�015170� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)sndfile.h 1.4 06/02/19 Copyright 1998,1999 Heiko Eissfeldt, Copyright 2006 J. Schilling */ /* * generic soundfile structure */ #ifndef _SNDFILE_H #define _SNDFILE_H #include <utypes.h> struct soundfile { int (* InitSound)(int audio, long channels, Ulong rate, long nBitsPerSample, Ulong expected_bytes); int (* ExitSound)(int audio, Ulong nBytesDone); Ulong (* GetHdrSize)(void); int (* WriteSound)(int audio, unsigned char *buf, Ulong BytesToDo); Ulong (* InSizeToOutSize)(Ulong BytesToDo); int need_big_endian; }; #endif /* _SNDFILE_H */ ��������������������������������������������cdrkit-1.1.11/icedax/interface.h��������������������������������������������������������������������0000644�0003725�0000144�00000007334�10531367430�015503� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)interface.h 1.14 06/02/19 Copyright 1998-2001 Heiko Eissfeldt, Copyright 2005-2006 J. Schilling */ /*** * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Heiko Eissfeldt * * header file interface.h for cdda2wav */ #ifndef CD_FRAMESIZE #define CD_FRAMESIZE 2048 #endif #ifndef CD_FRAMESIZE_RAW #define CD_FRAMESIZE_RAW 2352 #endif #define CD_FRAMESAMPLES (CD_FRAMESIZE_RAW / 4) extern unsigned interface; extern int trackindex_disp; #ifndef NSECTORS #define NSECTORS 75 #endif /* interface types */ #define GENERIC_SCSI 0 #define COOKED_IOCTL 1 /* constants for sub-q-channel info */ #define GET_ALL 0 #define GET_POSITIONDATA 1 #define GET_CATALOGNUMBER 2 #define GET_TRACK_ISRC 3 typedef struct subq_chnl { unsigned char reserved; unsigned char audio_status; unsigned short subq_length; unsigned char format; unsigned char control_adr; unsigned char track; unsigned char index; unsigned char data[40]; /* this has subq_all, subq_position, subq_catalog or subq_track_isrc format */ } subq_chnl; typedef struct subq_all { unsigned char abs_min; unsigned char abs_sec; unsigned char abs_frame; unsigned char abs_reserved; unsigned char trel_min; unsigned char trel_sec; unsigned char trel_frame; unsigned char trel_reserved; unsigned char mc_valid; /* MSB */ unsigned char media_catalog_number[13]; unsigned char zero; unsigned char aframe; unsigned char tc_valid; /* MSB */ unsigned char track_ISRC[15]; } subq_all; typedef struct subq_position { unsigned char abs_reserved; unsigned char abs_min; unsigned char abs_sec; unsigned char abs_frame; unsigned char trel_reserved; unsigned char trel_min; unsigned char trel_sec; unsigned char trel_frame; } subq_position; typedef struct subq_catalog { unsigned char mc_valid; /* MSB */ unsigned char media_catalog_number[13]; unsigned char zero; unsigned char aframe; } subq_catalog; typedef struct subq_track_isrc { unsigned char tc_valid; /* MSB */ unsigned char track_isrc[15]; } subq_track_isrc; #if !defined NO_SCSI_STUFF struct TOC; /* cdrom access function pointer */ extern void (*EnableCdda)(SCSI *usalp, int Switch, unsigned uSectorsize); extern unsigned (*doReadToc)(SCSI *usalp); extern void (*ReadTocText)(SCSI *usalp); extern unsigned (*ReadLastAudio)(SCSI *usalp); extern int (*ReadCdRom)(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); extern int (*ReadCdRomSub)(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); extern int (*ReadCdRomData)(SCSI *usalp, unsigned char *p, unsigned lSector, unsigned SectorBurstVal); extern subq_chnl *(*ReadSubQ)(SCSI *usalp, unsigned char sq_format, unsigned char track); extern subq_chnl *(*ReadSubChannels)(SCSI *usalp, unsigned lSector); extern void (*SelectSpeed)(SCSI *usalp, unsigned speed); extern int (*Play_at)(SCSI *usalp, unsigned from_sector, unsigned sectors); extern int (*StopPlay)(SCSI *usalp); extern void (*trash_cache)(UINT4 *p, unsigned lSector, unsigned SectorBurstVal); SCSI *get_scsi_p(void); #endif extern unsigned char *bufferTOC; extern subq_chnl *SubQbuffer; void SetupInterface(void); int Toshiba3401(void); void priv_init(void); void priv_on(void); void priv_off(void); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/scsi_cmds.h��������������������������������������������������������������������0000644�0003725�0000144�00000005760�10531367430�015513� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)scsi_cmds.h 1.11 03/03/02 Copyright 1998,1999 Heiko Eissfeldt */ /* header file for scsi_cmds.c */ extern unsigned char *cmd; struct TOC; int SCSI_emulated_ATAPI_on(SCSI *usalp); unsigned char *Inquiry(SCSI *usalp); int TestForMedium(SCSI *usalp); void SpeedSelectSCSIMMC(SCSI *usalp, unsigned speed); void SpeedSelectSCSIYamaha(SCSI *usalp, unsigned speed); void SpeedSelectSCSISony(SCSI *usalp, unsigned speed); void SpeedSelectSCSIPhilipsCDD2600(SCSI *usalp, unsigned speed); void SpeedSelectSCSINEC(SCSI *usalp, unsigned speed); void SpeedSelectSCSIToshiba(SCSI *usalp, unsigned speed); subq_chnl *ReadSubQSCSI(SCSI *usalp, unsigned char sq_format, unsigned char ltrack); subq_chnl *ReadSubChannelsSony(SCSI *usalp, unsigned lSector); subq_chnl *ReadSubChannelsFallbackMMC(SCSI *usalp, unsigned lSector); subq_chnl *ReadStandardSub(SCSI *usalp, unsigned lSector); int ReadCddaMMC12(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); int ReadCdda12Matsushita(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); int ReadCdda12(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SecorBurstVal); int ReadCdda10(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SecorBurstVal); int ReadStandard(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SctorBurstVal); int ReadStandardData(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SctorBurstVal); int ReadCddaFallbackMMC(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SctorBurstVal); int ReadCddaSubSony(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); int ReadCddaSub96Sony(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); int ReadCddaSubMMC12(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); unsigned ReadTocSony(SCSI *usalp); unsigned ReadTocMMC(SCSI *usalp); unsigned ReadTocSCSI(SCSI *usalp); unsigned ReadFirstSessionTOCSony(SCSI *usalp); unsigned ReadFirstSessionTOCMMC(SCSI *usalp); void ReadTocTextSCSIMMC(SCSI *usalp); int Play_atSCSI(SCSI *usalp, unsigned int from_sector, unsigned int sectors); int StopPlaySCSI(SCSI *usalp); void EnableCddaModeSelect(SCSI *usalp, int fAudioMode, unsigned uSectorsize); int set_sectorsize(SCSI *usalp, unsigned int secsize); unsigned int get_orig_sectorsize(SCSI *usalp, unsigned char *m4, unsigned char *m10, unsigned char *m11); int heiko_mmc(SCSI *usalp); void init_scsibuf(SCSI *usalp, unsigned amt); int myscsierr(SCSI *usalp); extern int accepts_fua_bit; extern unsigned char density; extern unsigned char orgmode4; extern unsigned char orgmode10, orgmode11; ����������������cdrkit-1.1.11/icedax/pitchplay.1��������������������������������������������������������������������0000644�0003725�0000144�00000003717�10505343313�015445� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH "PITCHPLAY" "1" "Tue Feb 15 12:53:23 MST 2005" "" "pitchplay" .PP .SH "NAME" pitchplay \- wrapper script to play audio tracks with cdda2wav with different pitches through a soundcard (cdda2wav must have soundcard support enabled). .PP .SH "SYNOPSIS" .PP \fBpitchplay\fP <track a> <pitch a> <track b> <pitch b>... .PP .SH "DESCRIPTION" .PP \fBpitchplay\fP allows playback of audio tracks with cdda2wav with pitches specified in percentage with 100% being the original pitch, 50% being one octave lower, 200% one octave higher. .PP .SH "EXAMPLES" .PP \fBpitchplay\fP 1 90 3 140 5 50 .br will play track 1 with a pitch of 90%, track 3 with a pitch of 140%, and track 5 with a pitch of 50%. .PP .SH SEE ALSO cdda2wav(1) .PP .SH "AUTHOR" .PP \fBcdda2was\fP was written by Joerg Schilling <js@cs\&.tu-berlin\&.de> and others. .PP This manpage describes the program implementation of .B pitchplay as shipped by the cdrkit distribution. See .B http://alioth.debian.org/projects/debburn/ for details. It is a spinoff from the original program distributed by the cdrtools project. However, the cdrtools developers are not involved in the development of this spinoff and therefore shall not be made responsible for any problem caused by it. Do not try to get support for this program by contacting the original authors. .PP If you have support questions, send them to .PP .B debburn-devel@lists.alioth.debian.org .br .PP If you have definitely found a bug, send a mail to this list or to .PP .B submit@bugs.debian.org .br .PP writing at least a short description into the Subject and "Package: cdrkit" into the first line of the mail body. .PP This manual page was written by Oleksandr Moskalenko <malex@tagancha\&.org>, for the Debian GNU/Linux system\&. It may be used by other distributions without contacting the author\&. Any mistakes or omissions in the manual page are my fault; inquiries about or corrections to this manual page should be directed to me (and not to the primary author)\&. �������������������������������������������������cdrkit-1.1.11/icedax/cdda2mp3�����������������������������������������������������������������������0000777�0003725�0000144�00000000000�11456674325�016310� 2cdda2ogg��������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/local.cnf.in�������������������������������������������������������������������0000644�0003725�0000144�00000012316�10471375025�015557� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# @(#)local.cnf.in 1.6 03/09/04 Copyright 1998-2002 Heiko Eissfeldt # # Makefile for cdda2wav, a sampling utility. # # ############ interface # choose one of the following interfacing and device types. # generic_scsi is for scsi cdrom devices. # uncomment one INTERFACE and one DEF_DEVICE line # (for details consult the README) INTERFACE='"generic_scsi"' #INTERFACE='"cooked_ioctl"' # set the default cdrom device SUN_OS_DEFAULT_DEV= '"0,6,0"' YOUR_DEFAULT_DEV= '"yourSCSI_Bus,yourSCSI_ID,yourSCSI_LUN"' _DEF_DEVICE= $(_UNIQ)$(HAVE_SUN_OS) __DEF_DEVICE= $(_DEF_DEVICE:$(_UNIQ)=$(YOUR_DEFAULT_DEV)) DEF_DEVICE= $(__DEF_DEVICE:$(_UNIQ)$(HAVE_SUN_OS)=$(SUN_OS_DEFAULT_DEV)) # optional matching device used for a MULTISESSION ioctl LINUX_AUX_DEV= '"/dev/cdrom"' _AUX_DEVICE= $(_UNIQ)$(HAVE_LINUX) __AUX_DEVICE= $(_AUX_DEVICE:$(_UNIQ)='""') AUX_DEVICE= $(__AUX_DEVICE:$(_UNIQ)$(HAVE_LINUX)=$(LINUX_AUX_DEV)) # number of sectors to request # under BSD better use < 128 K of shared memory SECTORS=75 BSD_SECTORS=27 _SECTORS= $(_UNIQ)$(HAVE_BSD_OS) __SECTORS= $(_SECTORS:$(_UNIQ)=$(SECTORS)) NSECTORS= $(__SECTORS:$(_UNIQ)$(HAVE_BSD_OS)=$(BSD_SECTORS)) # some architectures can use the ioctl() interface cooked_ioctl HAVE_SUN_IOCTL= @HAVE_SUN_IOCTL@ _HAVE_IOCTL= $(_UNIQ)$(HAVE_BSD_OS)$(HAVE_SUN_IOCTL)$(HAVE_LINUX) __HAVE_IOCTL= $(_HAVE_IOCTL:$(_UNIQ)=) HAVE_IOCTL= $(__HAVE_IOCTL:$(_UNIQ)$(HAVE_BSD_OS)$(HAVE_SUN_IOCTL)$(HAVE_LINUX)=-DHAVE_IOCTL_INTERFACE) ############# Sound device support #to disable sound support comment out the corresponding line with HAVE_SOUND OSS_SOUND_DEV= '"/dev/dsp"' SUN_SOUND_DEV= '"/dev/audio"' HAVE_OSS= @HAVE_OSS@ HAVE_SUNSOUND= @HAVE_SUNSOUND@ HAVE_WINSOUND= @HAVE_WINSOUND@ HAVE_OS2SOUND= @HAVE_OS2SOUND@ HAVE_QNXSOUND= @HAVE_SYS_ASOUNDLIB_H@ #_HAVE_SOUND= $(_UNIQ)$(HAVE_OSS)$(HAVE_SUNSOUND) _HAVE_SOUND= $(_UNIQ)$(HAVE_OSS)$(HAVE_SUNSOUND)$(HAVE_WINSOUND)$(HAVE_OS2SOUND)$(HAVE_QNXSOUND) __HAVE_SOUND= $(_HAVE_SOUND:$(_UNIQ)=) #HAVE_SOUND= $(__HAVE_SOUND:$(_UNIQ)$(HAVE_OSS)$(HAVE_SUNSOUND)=-DECHO_TO_SOUNDCARD) HAVE_SOUND= $(__HAVE_SOUND:$(_UNIQ)$(HAVE_OSS)$(HAVE_SUNSOUND)$(HAVE_WINSOUND)$(HAVE_OS2SOUND)$(HAVE_QNXSOUND)=-DECHO_TO_SOUNDCARD) _SOUND_DEVICE= $(_UNIQ)$(HAVE_OSS)$(HAVE_SOUND)$(HAVE_SUNSOUND) __SOUND_DEVICE= $(_SOUND_DEVICE:$(_UNIQ)='""') ___SOUND_DEVICE= $(__SOUND_DEVICE:$(_UNIQ)$(HAVE_OSS)$(HAVE_SOUND)=$(OSS_SOUND_DEV)) ____SOUND_DEVICE= $(___SOUND_DEVICE:$(_UNIQ)$(HAVE_SOUND)$(HAVE_SUNSOUND)=$(SUN_SOUND_DEV)) SOUND_DEVICE= $(____SOUND_DEVICE:$(_UNIQ)$(HAVE_OSS)$(HAVE_SOUND)$(HAVE_SUNSOUND)=$(OSS_SOUND_DEV)) _EXTRALIB= $(_UNIQ)$(HAVE_WINSOUND)$(HAVE_OS2SOUND)$(HAVE_QNXSOUND) __EXTRALIB= $(_EXTRALIB:$(_UNIQ)=@EXTRALIBS@) ___EXTRALIB= $(__EXTRALIB:$(_UNIQ)$(HAVE_WINSOUND)=@EXTRALIBS@ -lwinmm) ____EXTRALIB= $(___EXTRALIB:$(_UNIQ)$(HAVE_QNXSOUND)=@EXTRALIBS@ -lasound) EXTRALIB= $(____EXTRALIB:$(_UNIQ)$(HAVE_OS2SOUND)=@EXTRALIBS@ -los2me) ############# sound file defaults # Defaults for wav/au/cdr output file formats # default divider for 44.1 KHz DEF_UNDERSAMPLING=1 # 16, 12 or 8 bits per sample DEF_BITS=16 # 1 = mono, 2 = stereo DEF_CHANNELS=2 DEF_TIME=0 # number of seconds to record DEF_SPEED=0 # default reading speed #DEF_SPEED=0xFFFF # default reading speed ############## output file types: wav, aiff, aifc, sun au or cdr ########### # enable one DEF_TYPE and one DEF_FILE # first are for wav sound files, second are for sun au pcm sound files, # third are for headerless sound files (raw samples in bigendian format) # default audio file type _DEF_TYPE= $(_UNIQ)$(HAVE_SUN_OS) __DEF_TYPE= $(_DEF_TYPE:$(_UNIQ)='"wav"') DEF_TYPE= $(__DEF_TYPE:$(_UNIQ)$(HAVE_SUN_OS)='"au"') #DEF_TYPE= "wav" #DEF_TYPE= "au" #DEF_TYPE= "cdr" #DEF_TYPE= "aiff" #DEF_TYPE= "aifc" # default file name for sound file DEF_FILE='"audio"' ############## enable/disable info files #################################### # Info files contain date/time, track, recording time, ISRC, optional MD5 # signature and more, each item in one line. These files are generated one # per track. # Comment out if you don't want this. WANT_INFOFILES=-DINFOFILES ############## enable/disable MD5 signatures in info files ################## # Comment out if you don't want this. WANT_MD5=-DMD5_SIGNATURES MD5OBJECTS=md5c.o # CDINDEX server support # Comment out if you don't want a disk description file for the cdindex server WANT_CDINDEX_SUPPORT=-DCDINDEX_SUPPORT # CDDB server support # Comment out if you don't want a network access to the cddb server WANT_CDDB_SUPPORT=-DCDDB_SUPPORT CDDB_SERVERHOST='"freedb.freedb.org"' CDDB_SERVERPORT=8880 # end of tunable parameters # CDDA2WAVDEFS=-DCD_DEVICE=$(DEF_DEVICE) -DFILENAME=$(DEF_FILE) \ -DUNDERSAMPLING=$(DEF_UNDERSAMPLING) -DVERSION=$(CUR_VERSION) \ -DBITS_P_S=$(DEF_BITS) -DCHANNELS=$(DEF_CHANNELS) -DAUDIOTYPE=$(DEF_TYPE) \ -DDURATION=$(DEF_TIME) -DDEF_INTERFACE=$(INTERFACE) -DUSE_PARANOIA=1 \ -DDEFAULT_SPEED=$(DEF_SPEED) $(WANT_CDINDEX_SUPPORT) $(WANT_CDDB_SUPPORT) \ -DCDDBHOST=$(CDDB_SERVERHOST) -DCDDBPORT=$(CDDB_SERVERPORT) $(HAVE_IOCTL) \ $(HAVE_SOUND) -DSOUND_DEV=$(SOUND_DEVICE) -DNSECTORS=$(NSECTORS) \ $(WANT_INFOFILES) $(WANT_MD5) -DAUX_DEVICE=$(AUX_DEVICE) LIBS += @LIBS@ VERSION_OS=@CDRTOOLS_VERSION@_$(O_ARCH)_$(OSREL)_$(K_ARCH)_$(P_ARCH) CUR_VERSION='"$(VERSION_OS)"' ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/list_audio_tracks.1������������������������������������������������������������0000644�0003725�0000144�00000003126�10532031045�017141� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH "LIST_AUDIO_TRACKS" "1" "Tue Feb 15 13:03:51 MST 2005" "" "list_audio_tracks" .PP .SH "NAME" list_audio_tracks is an alias for icedax. .PP .SH "SYNOPSIS" .PP \fBlist_audio-tracks\fP .PP .SH "DESCRIPTION" .PP \fBlist_audio_tracks\fP equals to the invocation of icedax, so all the arguments for the latter can be used. .PP .SH SEE ALSO icedax(1) .PP .SH "AUTHOR" .PP \fBicedax\fP was written by Heiko Eissfeldt and others. .PP This manpage describes the program implementation of .B list_audio_tracks as shipped by the cdrkit distribution. See .B http://alioth.debian.org/projects/debburn/ for details. It is a spinoff from the original program called cdda2wav distributed by the cdrtools project. However, the cdrtools developers are not involved in the development of this spinoff and therefore shall not be made responsible for any problem caused by it. Do not try to get support for this program by contacting the original authors. .PP If you have support questions, send them to .PP .B debburn-devel@lists.alioth.debian.org .br .PP If you have definitely found a bug, send a mail to this list or to .PP .B submit@bugs.debian.org .br .PP writing at least a short description into the Subject and "Package: cdrkit" into the first line of the mail body. .PP This manual page was written by Oleksandr Moskalenko <malex@tagancha\&.org>, for the Debian GNU/Linux system\&. It may be used by other distributions without contacting the author\&. Any mistakes or omissions in the manual page are my fault; inquiries about or corrections to this manual page should be directed to me (and not to the primary author)\&. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/ringbuff.c���������������������������������������������������������������������0000644�0003725�0000144�00000012510�10536265343�015335� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)ringbuff.c 1.8 02/11/21 Copyright 1998,1999,2000 Heiko Eissfeldt */ #include "config.h" #include <stdxlib.h> #include <stdio.h> #include <standard.h> #include <unixstd.h> #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) #include <sys/ipc.h> #include <sys/sem.h> #endif #include <usal/scsitransp.h> #include "mytype.h" #include "global.h" #include "interface.h" #include "ringbuff.h" #include "semshm.h" #include "exitcodes.h" #undef WARN_INTERRUPT #undef _DEBUG #include <assert.h> static void occupy_buffer(void); myringbuff **he_fill_buffer; myringbuff **last_buffer; volatile unsigned long *total_segments_read; volatile unsigned long *total_segments_written; volatile int *child_waits; volatile int *parent_waits; volatile int *in_lendian; volatile int *eorecording; static myringbuff *previous_read_buffer; static unsigned int total_buffers; #define SEMS 2 #define defined_buffers() ((*total_segments_read) - (*total_segments_written)) #define free_buffers() (total_buffers - defined_buffers()) #define occupied_buffers() (defined_buffers()) /* ARGSUSED */ void set_total_buffers(unsigned int num_buffers, int mysem_id) { #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) union my_semun mysemun; mysemun.val = 0; if (semctl(mysem_id,(int) DEF_SEM,SETVAL,mysemun) < 0) { perror("semctl DEF_SEM"); } mysemun.val = num_buffers; if (semctl(mysem_id,(int) FREE_SEM,SETVAL,mysemun) < 0) { perror("semctl FREE_SEM"); } #endif total_buffers = num_buffers; /* initialize pointers */ *he_fill_buffer = *last_buffer = previous_read_buffer = NULL; #ifdef DEBUG_SHM fprintf(stderr, "init: fill_b = %p, last_b = %p\n", *he_fill_buffer, *last_buffer); #endif } const myringbuff *get_previous_read_buffer() { assert(previous_read_buffer != NULL); assert(previous_read_buffer != *he_fill_buffer); return previous_read_buffer; } const myringbuff *get_he_fill_buffer() { assert(*he_fill_buffer != NULL); assert(previous_read_buffer != *he_fill_buffer); return *he_fill_buffer; } void define_buffer() { assert(defined_buffers() < total_buffers); #ifdef _DEBUG #if 0 fprintf(stderr,"stop reading %p - %p\n", *he_fill_buffer, (char *)(*he_fill_buffer) + ENTRY_SIZE -1); #endif #endif if (*last_buffer == NULL) *last_buffer = *he_fill_buffer; #ifdef DEBUG_SHM fprintf(stderr, "define: fill_b = %p, last_b = %p\n", *he_fill_buffer, *last_buffer); #endif (*total_segments_read)++; semrelease(sem_id,DEF_SEM,1); } void drop_buffer() { assert(free_buffers() < total_buffers); assert(occupied_buffers() > 0); #ifdef _DEBUG #if 0 fprintf(stderr," stop writing %p - %p ", *last_buffer, (char *)(*last_buffer) + ENTRY_SIZE -1); #endif #endif if (*last_buffer == NULL) *last_buffer = *he_fill_buffer; else *last_buffer = INC(*last_buffer); #ifdef DEBUG_SHM fprintf(stderr, "drop: fill_b = %p, last_b = %p\n", *he_fill_buffer, *last_buffer); #endif (*total_segments_written)++; semrelease(sem_id,FREE_SEM, 1); } void drop_all_buffers() { (*total_segments_written) = (*total_segments_read); semrelease(sem_id,FREE_SEM, total_buffers); } static void occupy_buffer() { assert(occupied_buffers() <= total_buffers); previous_read_buffer = *he_fill_buffer; if (*he_fill_buffer == NULL) { *he_fill_buffer = RB_BASE; } else { *he_fill_buffer = INC(*he_fill_buffer); } } #if defined HAVE_FORK_AND_SHAREDMEM myringbuff * get_next_buffer() { #ifdef WARN_INTERRUPT if (free_buffers() <= 0) { fprintf(stderr, "READER waits!! r=%lu, w=%lu\n", *total_segments_read, *total_segments_written); } #endif /* wait for a new buffer to become available */ if (semrequest(sem_id,FREE_SEM) != 0) { /* semaphore operation failed. try again... */ fprintf(stderr, "child reader sem request failed\n"); exit(SEMAPHORE_ERROR); } #if 0 fprintf(stderr,"start reading %p - %p\n", *he_fill_buffer, (char *)(*fill_buffer) + ENTRY_SIZE -1); #endif occupy_buffer(); #ifdef DEBUG_SHM fprintf(stderr, "next: fill_b = %p, last_b = %p, @last = %p\n", *he_fill_buffer, *last_buffer, last_buffer); #endif return *he_fill_buffer; } myringbuff *get_oldest_buffer() { myringbuff *retval; #ifdef WARN_INTERRUPT if (free_buffers() == total_buffers) { fprintf(stderr, "WRITER waits!! r=%lu, w=%lu\n", *total_segments_read, *total_segments_written); } #endif /* wait for buffer to be defined */ if (semrequest(sem_id,DEF_SEM) != 0) { /* semaphore operation failed. */ perror("request defined buff:"); fprintf(stderr, "parent writer sem request failed\n"); } retval = *last_buffer; #if 0 fprintf(stderr," begin writing %p - %p\n", retval, (char *)retval + ENTRY_SIZE -1); #endif return retval; } #else /* HAVE_FORK_AND_SHAREDMEM */ myringbuff * get_next_buffer() { occupy_buffer(); return *he_fill_buffer; } myringbuff * get_oldest_buffer() { return *he_fill_buffer; } #endif /* HAVE_FORK_AND_SHAREDMEM */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/base64.h�����������������������������������������������������������������������0000644�0003725�0000144�00000007061�10513514665�014630� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)base64.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ /*____________________________________________________________________________ // // CD Index - The Internet CD Index // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // $Id: base64.h,v 1.1.1.2 1999/04/29 00:53:34 marc Exp $ //____________________________________________________________________________ */ /* * Program: RFC-822 routines (originally from SMTP) * * Author: Mark Crispin * Networks and Distributed Computing * Computing & Communications * University of Washington * Administration Building, AG-44 * Seattle, WA 98195 * Internet: MRC@CAC.Washington.EDU * * Date: 27 July 1988 * Last Edited: 10 September 1998 * * Sponsorship: The original version of this work was developed in the * Symbolic Systems Resources Group of the Knowledge Systems * Laboratory at Stanford University in 1987-88, and was funded * by the Biomedical Research Technology Program of the National * Institutes of Health under grant number RR-00785. * * Original version Copyright 1988 by The Leland Stanford Junior University * Copyright 1998 by the University of Washington * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notices appear in all copies and that both the * above copyright notices and this permission notice appear in supporting * documentation, and that the name of the University of Washington or The * Leland Stanford Junior University not be used in advertising or publicity * pertaining to distribution of the software without specific, written prior * permission. This software is made available "as is", and * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE, * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #ifndef BASE64_H #define BASE64_H unsigned char *rfc822_binary(char *src,unsigned long srcl,unsigned long *len); #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/raw.h��������������������������������������������������������������������������0000644�0003725�0000144�00000000764�10477233650�014341� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)raw.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ extern struct soundfile rawsound; ������������cdrkit-1.1.11/icedax/sun.c��������������������������������������������������������������������������0000644�0003725�0000144�00000005411�10536265343�014342� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)sun.c 1.4 01/10/27 Copyright 1998,1999 Heiko Eissfeldt */ /*** * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Heiko Eissfeldt * * * --------------------------------------------------------------------- * definitions for sun pcm output * --------------------------------------------------------------------- */ #include "config.h" #include "mytype.h" #include <stdio.h> #include <unixstd.h> #include "byteorder.h" #include "sndfile.h" typedef struct SUNHDR { unsigned int magic; /* dns. a la .snd */ unsigned int data_location; /* offset to data */ unsigned int size; /* # of data bytes */ unsigned int format; /* format code */ unsigned int sample_rate; /* in Hertz */ unsigned int channelcount; /* 1 for mono, 2 for stereo */ char info[8]; /* comments */ } SUNHDR; static SUNHDR sunHdr; static int InitSound(int audio, long channels, unsigned long rate, long nBitsPerSample, unsigned long expected_bytes); static int InitSound(int audio, long channels, unsigned long rate, long nBitsPerSample, unsigned long expected_bytes) { unsigned long format = nBitsPerSample > 8 ? 0x03 : 0x02; sunHdr.magic = cpu_to_le32(UINT4_C(0x646e732e)); sunHdr.data_location = cpu_to_be32(0x20); sunHdr.size = cpu_to_be32(expected_bytes); sunHdr.format = cpu_to_be32(format); sunHdr.sample_rate = cpu_to_be32(rate); sunHdr.channelcount = cpu_to_be32(channels); return write (audio, &sunHdr, sizeof (sunHdr)); } static int ExitSound(int audio, unsigned long nBytesDone); static int ExitSound(int audio, unsigned long nBytesDone) { sunHdr.size = cpu_to_be32(nBytesDone); /* goto beginning */ if (lseek(audio, 0L, SEEK_SET) == -1) { return 0; } return write (audio, &sunHdr, sizeof (sunHdr)); } static unsigned long GetHdrSize(void); static unsigned long GetHdrSize() { return sizeof( sunHdr ); } static unsigned long InSizeToOutSize(unsigned long BytesToDo); static unsigned long InSizeToOutSize(unsigned long BytesToDo) { return BytesToDo; } struct soundfile sunsound = { InitSound, /* init header method */ ExitSound, /* exit header method */ GetHdrSize, /* report header size method */ /* get sound samples out */ (int (*)(int audio, unsigned char *buf, unsigned long BytesToDo)) write, InSizeToOutSize, /* compressed? output file size */ 1 /* needs big endian samples */ }; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/Changelog����������������������������������������������������������������������0000644�0003725�0000144�00000043367�10531367430�015212� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������210 Einträge Fri Apr 6 15:58:32 2001 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.16 bugfix symbolic constant 'linux' -> 'LINUX', code cleanup Sun Mar 11 17:55:25 2001 Heiko Eissfeldt <heiko@colossus.escape.de> * scsi_cmds.c 1.11 schily changes Sun Mar 11 17:25:14 2001 Heiko Eissfeldt <heiko@colossus.escape.de> * semshm.c 1.6 change to new shared memory scheme. Mon Dec 25 11:13:42 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * config.h 1.3 get rid of PRETEND_TO_USE, use ARGSUSED instead Sun Dec 10 16:49:56 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * scsi_cmds.c 1.10 Large file type fix: u_char -> Uchar Sat Dec 9 23:41:42 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * Makefile 1.2 add libraries for remote scsi Sat Dec 9 23:39:59 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * ioctl.c 1.9 read toc in msf AND lba format. Use mins,secs,frms fields. Sat Dec 9 23:38:25 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.h 1.6 portability fix: change signed char to int for mins,secs,frms Sat Dec 9 23:37:18 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * scsi_cmds.c 1.9 change mins, secs, frms to type int; use conversion function lba_2_msf Sat Dec 9 23:35:43 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.15 add conversion function lba_2_msf Fri Dec 1 14:37:10 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.15 change ReadToc_sim to define new toc struc members mins, secs, frms. Fri Dec 1 14:36:22 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * scsi_cmds.c 1.8 change ReadToc to read in MSF as well as in LBA format. Store seperately. Fri Dec 1 14:35:04 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.h 1.5 add seperate fields in toc structure: mins, secs, frms for msf can hold different data than lba (as seen by dvds) Mon Nov 6 21:14:11 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.23 fix from Joerg Schilling for better Cygwin old/new compatibility Wed Oct 25 23:48:02 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.22 don't try to get cd text info on discs with data tracks only Wed Oct 25 23:47:20 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.14 disable Read TOC cd text for Sony CRX100E reported by George Fisher (fisher@ssl.berkeley.edu) Tue Sep 19 21:30:57 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.21 fix from js for wait() declarations Fri Sep 15 12:51:43 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.20 adapt for Cygwin 1.0 header files Wed Sep 13 23:06:25 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.19 * interface.c 1.13 * scsi_cmds.c 1.7 (r)scsi interface changes Sun Aug 20 17:29:02 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * scsi_cmds.c 1.6 * cdda2wav.c 1.18 * interface.c 1.12 adapt for new libscsi Sat Jun 24 07:57:38 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.17 use setpriority if available before nice Sat Jun 24 07:56:40 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.14 ISRC hardening II Fri Jun 16 00:12:21 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * mycdrom.h 1.4 bugfix: FreeBSD should get the ioctl interface again Fri Jun 16 00:11:39 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * ioctl.c 1.8 bugfix: FreeBSD ioctl should work again Sat Jun 10 22:27:43 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.13 recorder id detection and extended character range for ISRC Fri Jun 2 08:56:22 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.11 added schily header files interface change for ReadCdRom* functions now allocate always a SCSI structure for use of silent and verbose thats it. Fri Jun 2 08:49:08 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.16 added schily header files major changes for cds with illegal leadout positions moved nSamplesToDo into the shared memory segment added exit wrapper for portability under Max-OS-X cleaned up ring buffer handling bugfix for silent mode (call DisplayToc and Read_MCN_ISRC was needed) Fri Jun 2 08:37:12 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.12 added schily header files made cd text detection more reliable for plextor/sony non-mmc drives hardened cdda2wav against illegal ISRC codes major changes for cds with illegal leadout positions protected the index scan against illegal leadout positions *** CHANGED *** 00/06/02 07:43:08 heiko added schilys header files Fri Jun 2 08:33:44 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * aifc.c 1.4 * aiff.c 1.4 include schilys header files Fri Jun 2 08:32:28 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * semshm.c 1.5 added schily headerfile Fri Jun 2 08:31:53 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.h 1.4 interface change for ReadCdRom*. Return int instead of void Fri Jun 2 08:30:51 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * scsi_cmds.c 1.5 interface change: Read* function do not exit the program, when sectors could not be read. Instead they signal this through the return value. Fri Jun 2 08:28:37 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * scsi_cmds.h 1.3 interface change: Read* functions now return number of sectors read added myscsierr function for scsi result checking Fri Jun 2 08:26:46 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * ioctl.c 1.7 interface change: ReadCdrom and ReadCdromData return number of read sectors schily include file added default buffer size set to 8 sectors for ide on Linux suppress errors when usalp->silent > 0 Fri Jun 2 07:39:55 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * ringbuff.c 1.4 added a pointer for the new shared memory reference eorecording Fri Jun 2 07:38:48 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * ringbuff.h 1.4 new variables in shared memory: end_is_reached is set when the previously unknown leadout is encountered. nSamplesToDo has been moved into shared memory to be visible for the writer. Fri Jun 2 07:36:11 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * local.cnf.in 1.3 bugfixes: SunOS sound device, NetBSD inclusion of extralibs Fri Jun 2 07:34:37 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * configure.in 1.2 bugfix. include detected libs in EXTRALIBS Fri Jun 2 07:29:12 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * global.h 1.4 added two globals for detection of cds with illegal lead out positions and one for a drive capability to read beyond the wrong leadout position. Tue May 2 21:41:40 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * resample.c 1.9 fixed an signedness warning for buffer pointer for WriteSound() Thu Apr 27 23:53:49 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.15 -t4+4 -B now records only one track +4 is interpreted as a limit Sat Apr 22 23:37:57 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * setuid.c 1.3 fixed a drop root forever bug, when we were currently nonroot Mon Apr 17 08:27:51 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * resample.c 1.8 fixed 'wait for signal' Mon Apr 17 08:27:23 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.14 fixed info files generation, added warnings Mon Apr 17 08:26:37 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.11 fixed empty title display Thu Apr 13 00:38:04 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.13 added some consistency checks for info file generation Wed Apr 12 22:54:37 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * scsi_cmds.c 1.4 fixed read cd text wrt reserved track/session field (now 0) Mon Apr 10 07:49:11 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * sndfile.h 1.3 new interface methods for mp3 Thu Mar 30 00:03:38 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.10 add isrc and mcn retrieval for cd-extra Wed Mar 29 23:12:09 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.9 fixed a bug with gui-mode and quote() function usage Wed Mar 29 21:24:04 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * ioctl.c 1.6 allow for sun type ioctl even on non_suns (HAVE_SYS_CDIO_H) Wed Mar 29 21:21:51 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * mycdrom.h 1.3 disable HAVE_IOCTL_INTERFACE even if HAVE_SYS_CDIO_H (for Mac OS X) Sun Mar 26 23:17:47 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * resample.c 1.7 change write call for sndfile to new sndfile method WriteSound Sun Mar 26 23:14:47 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.12 variable name change 'fill_buffer' -> 'he_fill_buffer' prepare for new output format mp3 with lame (disabled with #ifdef USE_LAME) Sun Mar 26 23:10:19 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * ringbuff.c 1.3 * ringbuff.h 1.3 variable name change to avoid collision with fill_buffer from lame Sun Mar 26 23:09:14 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.h 1.3 mask SCSI depend declarations with NO_SCSI_STUFF define Sun Mar 26 23:08:27 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.8 fix an unimportant typo in resolve_id not active Sun Mar 26 22:14:53 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * aifc.c 1.3 * aiff.c 1.3 * raw.c 1.3 * sun.c 1.3 * wav.c 1.3 prepared sndfile interface for additional functions needed for mp3 Tue Mar 21 21:42:10 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.10 added the DEC RRD47 drive as not mmc/readCD capable Tue Mar 21 20:25:44 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.11 fixed an cd extra detection bug disabled .cddb and .cdindex file generation with --gui Tue Mar 21 20:22:26 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * Makefile.man 1.1 date and time created 00/03/21 20:22:26 by heiko Tue Mar 21 20:17:28 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.7 added cactus data shield copy protection recognition fixed display for cd extra (track times) fix for sony crx140s (delivers Qsubchannel position data in bcd instead of hex) fixed screen output during index scan cosmetically Tue Mar 21 20:06:19 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * ioctl.c 1.5 added rough debugging messages for -V fixed index scanning for Linux and FreeBSD Tue Mar 21 18:45:30 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.9 included inquiry message, added rough ioctl debugging messages Sun Feb 20 23:07:27 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * resample.c 1.6 fixed a compiler warning Sun Feb 20 23:07:16 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.8 fixed missing global.in_lendian substitutes Thu Feb 17 22:00:32 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.10 made deemphasizing automatic adjusted info files accordingly allow non-root users to fail on realtimescheduling (and continue) get shared memory initialization from interface.c now based on nsectors and overlap values. add more checks for buffers and nsectors. increase buffers and nsectors, if necessary Thu Feb 17 21:56:22 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.7 moved shared memory allocation to cdda2wav.c open linux ioctl devices with O_NONBLOCK Thu Feb 17 21:52:15 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * resample.c 1.5 fix synchronization with channel swaps or deemphasizing Thu Feb 17 21:50:59 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * scsi_cmds.c 1.3 avoid error message, if speedselectMMC fails (is optional) Thu Feb 17 21:50:00 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.6 fix compiler warnings, fix index scanning Thu Feb 17 21:48:43 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * semshm.c 1.4 moved free_sem() in order to compile properly Thu Feb 17 21:47:04 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * global.h 1.3 add input endianess variable for SCSI setup Wed Feb 16 21:26:40 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * semshm.c 1.3 fixed comments and variable names for child/parent role swap Sun Feb 13 22:28:42 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * resample.c 1.4 changed deemphasizing (now for marked tracks) Sun Feb 13 22:27:34 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.9 automatic handling of -T (with index scanning) Sun Feb 13 22:26:38 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.h 1.4 new get_current_track() function Sun Feb 13 22:21:04 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.1 1.5 document new -T, cleanup Thu Feb 10 18:35:26 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.5 implemented reading of cdplus/info.cdp through ISO file system Mon Feb 7 22:47:24 2000 root * interface.c 1.6 added Hitachi drive to mmc exception list Mon Feb 7 18:17:40 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.5 explicitly let Toshiba ATAPI drives use the mmc command set. Sat Feb 5 11:47:00 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.8 fixed percentage display for the 100% case Sat Feb 5 11:46:38 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.4 extended simulation interface Thu Feb 3 20:59:12 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.c 1.4 added the missing ascii to html character mapper added check for valid cd extra Wed Feb 2 23:54:48 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.7 fixed mixed mode multinaming allow nonroot users , do not abort for failing prioctl() Tue Jan 25 18:57:39 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.h 1.3 * toc.h 1.3 prototype change with index scanning function Tue Jan 25 18:55:58 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * ioctl.c 1.4 fixed dumb warning Tue Jan 25 18:43:49 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * interface.c 1.3 extend ioctl interface for FreeBSD-4.x atapi driver Sat Jan 22 21:24:16 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * ioctl.c 1.3 fixed data reading for cd-Extra+ATAPI+Linux Tue Jan 11 23:16:11 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.6 * toc.c 1.3 Sun Jan 9 12:11:21 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.5 index scanning limited to single tracks, if requested. changed vfprintf() to Joerg Schillings error() for better portability. modified error handling for wrong parameters. no more long usage listing. Mon Jan 3 22:53:51 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.4 * resample.c 1.3 * mmsystem.h 1.4 *_h -> *_H Sun Jan 2 23:22:23 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * mmsystem.h 1.3 delete ctrl-m lineends Sun Jan 2 23:18:58 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.1 1.4 new fix for SCCS (@(x)) Sun Jan 2 18:20:36 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.1 1.3 fixed man page for SCCS header Sun Jan 2 18:07:17 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * mmsystem.h 1.2 put under SCCS Sun Jan 2 18:02:48 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * lconfig.h.in 1.3 * sndconfig.c 1.3 OSS sound support added for NetBSD Sun Jan 2 17:56:13 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * mmsystem.h 1.1 date and time created 00/01/02 17:56:13 by heiko Sun Jan 2 17:53:10 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * Makefile 1.1 date and time created 00/01/02 17:53:10 by heiko Sun Jan 2 17:24:41 2000 Heiko Eissfeldt <heiko@colossus.escape.de> * configure.in 1.1 date and time created 00/01/02 17:24:41 by heiko Sun Dec 19 22:34:34 1999 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.c 1.3 multiple file names Sun Dec 19 21:52:00 1999 Heiko Eissfeldt <heiko@colossus.escape.de> * toc.h 1.2 * wav.c 1.2 * wav.h 1.2 * sha_func.c 1.2 * sndconfig.c 1.2 * sndconfig.h 1.2 * sndfile.h 1.2 * sun.c 1.2 * sun.h 1.2 * toc.c 1.2 * ringbuff.h 1.2 * saveargs.h 1.2 * scsi_cmds.c 1.2 * scsi_cmds.h 1.2 * semshm.c 1.2 * semshm.h 1.2 * setuid.c 1.2 * setuid.h 1.2 * sha.h 1.2 * md5c.c 1.2 * mycdrom.h 1.2 * mytype.h 1.2 * raw.c 1.2 * raw.h 1.2 * resample.c 1.2 * resample.h 1.2 * ringbuff.c 1.2 * global.h 1.2 * interface.c 1.2 * interface.h 1.2 * ioctl.c 1.2 * ioctl.h 1.2 * lconfig.h.in 1.2 * local.cnf.in 1.2 * lowlevel.h 1.2 * md5.h 1.2 * aiff.h 1.2 * base64.c 1.2 * base64.h 1.2 * byteorder.h 1.2 * cdda2wav.1 1.2 * cdda2wav.c 1.2 * cdda2wav.h 1.2 * config.h 1.2 * aifc.c 1.2 * aifc.h 1.2 * aiff.c 1.2 first Sat Nov 13 19:30:21 1999 Heiko Eissfeldt <heiko@colossus.escape.de> * cdda2wav.1 1.1 date and time created 99/11/13 19:30:21 by heiko Sat Nov 13 19:25:02 1999 Heiko Eissfeldt <heiko@colossus.escape.de> * lconfig.h.in 1.1 * local.cnf.in 1.1 date and time created 99/11/13 19:25:02 by heiko Sat Nov 13 19:24:29 1999 Heiko Eissfeldt <heiko@colossus.escape.de> * aifc.h 1.1 * aiff.h 1.1 * base64.h 1.1 * byteorder.h 1.1 * cdda2wav.h 1.1 * config.h 1.1 * global.h 1.1 * interface.h 1.1 * ioctl.h 1.1 * lowlevel.h 1.1 * md5.h 1.1 * mycdrom.h 1.1 * mytype.h 1.1 * raw.h 1.1 * resample.h 1.1 * ringbuff.h 1.1 * saveargs.h 1.1 * scsi_cmds.h 1.1 * semshm.h 1.1 * setuid.h 1.1 * sha.h 1.1 * sndconfig.h 1.1 * sndfile.h 1.1 * sun.h 1.1 * toc.h 1.1 * wav.c 1.1 * wav.h 1.1 date and time created 99/11/13 19:24:29 by heiko Sat Nov 13 19:24:28 1999 Heiko Eissfeldt <heiko@colossus.escape.de> * aifc.c 1.1 * aiff.c 1.1 * base64.c 1.1 * cdda2wav.c 1.1 * interface.c 1.1 * ioctl.c 1.1 * md5c.c 1.1 * raw.c 1.1 * resample.c 1.1 * ringbuff.c 1.1 * scsi_cmds.c 1.1 * semshm.c 1.1 * setuid.c 1.1 * sha_func.c 1.1 * sndconfig.c 1.1 * sun.c 1.1 * toc.c 1.1 date and time created 99/11/13 19:24:28 by heiko �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/sndconfig.h��������������������������������������������������������������������0000644�0003725�0000144�00000001266�10513514665�015517� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)sndconfig.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ #define NONBLOCKING_AUDIO int set_snd_device(const char *devicename); int init_soundcard(double rate, int bits); int open_snd_device(void); int close_snd_device(void); int write_snd_device(char *buffer, unsigned length); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/GPL����������������������������������������������������������������������������0000644�0003725�0000144�00000043076�10471375025�013744� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) 19yy <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/lconfig.h.in�������������������������������������������������������������������0000644�0003725�0000144�00000002432�10471375025�015565� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#if 0 /* @(#)lconfig.h.in 1.6 06/02/15 Copyright 1998-2003 Heiko Eissfeldt */ #endif #undef HAVE_SYS_CDIO_H /* if we should use sys/cdio.h */ #undef HAVE_SYS_CDRIO_H /* if we should use sys/cdrio.h */ #undef HAVE_SUNDEV_SRREG_H /* if we should use sundev/srreg.h */ #undef HAVE_SYS_AUDIOIO_H /* if we should use sys/audioio.h */ #undef HAVE_SUN_AUDIOIO_H /* if we should use sun/audioio.h */ #undef HAVE_SOUNDCARD_H /* if we should use soundcard.h */ #undef HAVE_SYS_SOUNDCARD_H /* if we should use sys/soundcard.h */ #undef HAVE_LINUX_SOUNDCARD_H /* if we should use linux/soundcard.h */ #undef HAVE_MACHINE_SOUNDCARD_H /* if we should use machine/soundcard.h */ #undef HAVE_SYS_ASOUNDLIB_H /* if we should use sys/asoundlib.h */ #undef HAVE_WINDOWS_H /* if we should use windows.h */ #undef HAVE_MMSYSTEM_H /* if we should use mmsystem.h */ #undef HAVE_OS2_H /* if we should use os2.h */ #undef HAVE_OS2ME_H /* if we should use os2me.h */ #if defined HAVE_SOUNDCARD_H || defined HAVE_SYS_SOUNDCARD_H || defined HAVE_LINUX_SOUNDCARD_H || defined HAVE_MACHINE_SOUNDCARD_H #define HAVE_OSS 1 #endif #if defined HAVE_WINDOWS_H && defined HAVE_MMSYSTEM_H #define HAVE_WINSOUND 1 #endif #if defined HAVE_OS2_H && defined HAVE_OS2ME_H #define HAVE_OS2SOUND 1 #endif #undef HAVE_STRTOUL ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/readmult�����������������������������������������������������������������������0000755�0003725�0000144�00000001440�10532031045�015114� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # # Script to read more than 1 song with icedax # Each file gets an individual name from the command line # # based on a perl script from Matthias Schniedermeyer # # usage: readmult <track a> <title a> <track b> <title b> ... # # example: readmult 1 intro 3 lovesong 5 medley # will produce a file named intro.wav for track 1, # a file named lovesong.wav for track 3, and # a file named medley.wav for track 5. # CDDA2WAV=icedax CDDA2WAVOPTS="-P0" if [ $(( $# % 2 )) -eq 0 ]; then while [ $# -ge 2 ]; do $CDDA2WAV $CDDA2WAVOPTS -Owav -t $1 $PREFIX$2".wav" RES=$? if [ $RES -ne 0 ]; then echo "$CDDA2WAV error, return value "$RES". Aborted." >&2 break fi shift 2 done else echo "usage: $0 [<Tracknr> <Filename>] ..." >&2 fi ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/sndconfig.c��������������������������������������������������������������������0000644�0003725�0000144�00000037515�10536265343�015521� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)sndconfig.c 1.17 04/08/03 Copyright 1998-2004 Heiko Eissfeldt */ /* os dependent functions */ #include "config.h" #include <stdio.h> #include <stdxlib.h> #include <strdefs.h> #include <fctldefs.h> #include <unixstd.h> #include <sys/ioctl.h> #if !defined __CYGWIN32__ # include <timedefs.h> #endif #include <schily.h> /* soundcard setup */ #if defined (HAVE_SOUNDCARD_H) || defined (HAVE_LINUX_SOUNDCARD_H) || defined (HAVE_SYS_SOUNDCARD_H) || defined (HAVE_MACHINE_SOUNDCARD_H) # if defined (HAVE_SOUNDCARD_H) # include <soundcard.h> # else # if defined (HAVE_MACHINE_SOUNDCARD_H) # include <machine/soundcard.h> # else # if defined (HAVE_SYS_SOUNDCARD_H) # include <sys/soundcard.h> # else # if defined (HAVE_LINUX_SOUNDCARD_H) # include <linux/soundcard.h> # endif # endif # endif # endif #endif #include "mytype.h" #include "byteorder.h" #include "lowlevel.h" #include "global.h" #include "sndconfig.h" #ifdef ECHO_TO_SOUNDCARD # if defined(__CYGWIN32__) # include <windows.h> # include "mmsystem.h" # endif # if defined(__EMX__) # define INCL_DOS # define INCL_OS2MM # include <os2.h> # define PPFN _PPFN # include <os2me.h> # undef PPFN static unsigned long DeviceID; # define FRAGMENTS 2 /* playlist-structure */ typedef struct { ULONG ulCommand; ULONG ulOperand1, ulOperand2, ulOperand3; } PLAYLISTSTRUCTURE; static PLAYLISTSTRUCTURE PlayList[FRAGMENTS + 1]; static unsigned BufferInd; # endif /* defined __EMX__ */ static char snd_device[200] = SOUND_DEV; int set_snd_device(const char *devicename) { strncpy(snd_device, devicename, sizeof(snd_device)); return 0; } # if defined __CYGWIN32__ static HWAVEOUT DeviceID; # define WAVEHDRS 3 static WAVEHDR wavehdr[WAVEHDRS]; static unsigned lastwav = 0; static int check_winsound_caps(int bits, double rate, int channels); static int check_winsound_caps(int bits, double rate, int channels) { int result = 0; WAVEOUTCAPS caps; /* get caps */ if (waveOutGetDevCaps(0, &caps, sizeof(caps))) { fprintf(stderr, "cannot get soundcard capabilities!\n"); return 1; } /* check caps */ if ((bits == 8 && !(caps.dwFormats & 0x333)) || (bits == 16 && !(caps.dwFormats & 0xccc))) { fprintf(stderr, "%d bits sound are not supported\n", bits); result = 2; } if ((channels == 1 && !(caps.dwFormats & 0x555)) || (channels == 2 && !(caps.dwFormats & 0xaaa))) { fprintf(stderr, "%d sound channels are not supported\n", channels); result = 3; } if ((rate == 44100.0 && !(caps.dwFormats & 0xf00)) || (rate == 22050.0 && !(caps.dwFormats & 0xf0)) || (rate == 11025.0 && !(caps.dwFormats & 0xf))) { fprintf(stderr, "%d sample rate is not supported\n", (int)rate); result = 4; } return result; } # endif /* defined CYGWIN */ #endif /* defined ECHO_TO_SOUNDCARD */ #ifdef HAVE_SUN_AUDIOIO_H # include <sun/audioio.h> #endif #ifdef HAVE_SYS_AUDIOIO_H # include <sys/audioio.h> #endif #ifdef HAVE_SYS_ASOUNDLIB_H # include <sys/asoundlib.h> snd_pcm_t *pcm_handle; #endif #if defined HAVE_OSS && defined SNDCTL_DSP_GETOSPACE audio_buf_info abinfo; #endif int init_soundcard(double rate, int bits) { #ifdef ECHO_TO_SOUNDCARD if (global.echo) { # if defined(HAVE_OSS) && HAVE_OSS == 1 if (open_snd_device() != 0) { errmsg("Cannot open sound device '%s'\n", snd_device); global.echo = 0; } else { /* This the sound device initialisation for 4front Open sound drivers */ int dummy; int garbled_rate = rate; int stereo = (global.channels == 2); int myformat = bits == 8 ? AFMT_U8 : (MY_LITTLE_ENDIAN ? AFMT_S16_LE : AFMT_S16_BE); int mask; if (ioctl(global.soundcard_fd, (int)SNDCTL_DSP_GETBLKSIZE, &dummy) == -1) { fprintf(stderr, "Cannot get blocksize for %s\n", snd_device); global.echo = 0; } if (ioctl(global.soundcard_fd, (int)SNDCTL_DSP_SYNC, NULL) == -1) { fprintf(stderr, "Cannot sync for %s\n", snd_device); global.echo = 0; } #if defined SNDCTL_DSP_GETOSPACE if (ioctl(global.soundcard_fd, SNDCTL_DSP_GETOSPACE, &abinfo) == -1) { fprintf(stderr, "Cannot get input buffersize for %s\n", snd_device); abinfo.fragments = 0; } #endif /* check, if the sound device can do the requested format */ if (ioctl(global.soundcard_fd, (int)SNDCTL_DSP_GETFMTS, &mask) == -1) { perror("fatal error:"); return -1; } if ((mask & myformat) == 0) { fprintf(stderr, "sound format (%d bits signed) is not available\n", bits); if ((mask & AFMT_U8) != 0) { bits = 8; myformat = AFMT_U8; } } if (ioctl(global.soundcard_fd, (int)SNDCTL_DSP_SETFMT, &myformat) == -1) { fprintf(stderr, "Cannot set %d bits/sample for %s\n",bits, snd_device); global.echo = 0; } /* limited sound devices may not support stereo */ if (stereo && ioctl(global.soundcard_fd, (int)SNDCTL_DSP_STEREO, &stereo) == -1) { fprintf(stderr, "Cannot set stereo mode for %s\n", snd_device); stereo = 0; } if (!stereo && ioctl(global.soundcard_fd, (int)SNDCTL_DSP_STEREO, &stereo) == -1) { fprintf(stderr, "Cannot set mono mode for %s\n", snd_device); global.echo = 0; } /* set the sample rate */ if (ioctl(global.soundcard_fd, (int)SNDCTL_DSP_SPEED, &garbled_rate) == -1) { fprintf(stderr, "Cannot set rate %d.%2d Hz for %s\n", (int)rate, (int)(rate*100)%100, snd_device); global.echo = 0; } if ( abs((long)rate - garbled_rate) > rate / 20) { fprintf(stderr, "sound device: next best sample rate is %d\n",garbled_rate); } } # else /* HAVE_OSS */ # if defined HAVE_SYS_AUDIOIO_H || defined HAVE_SUN_AUDIOIO_H /* This is the SunOS / Solaris and compatibles sound initialisation */ if ((global.soundcard_fd = open(snd_device, O_WRONLY, 0)) == EOF) { perror(""); fprintf(stderr, "Cannot open %s\n",snd_device); global.echo = 0; } else { audio_info_t info; # if defined (AUDIO_INITINFO) && defined (AUDIO_ENCODING_LINEAR) AUDIO_INITINFO(&info); info.play.sample_rate = rate; info.play.channels = global.channels; info.play.precision = bits; info.play.encoding = AUDIO_ENCODING_LINEAR; info.play.pause = 0; info.record.pause = 0; info.monitor_gain = 0; if (ioctl(global.soundcard_fd, AUDIO_SETINFO, &info) < 0) { fprintf(stderr, "Cannot init %s (sun)\n", snd_device); global.echo = 0; } # else fprintf(stderr, "Cannot init sound device with 44.1 KHz sample rate on %s (sun compatible)\n", snd_device); global.echo = 0; # endif } # else /* SUN audio */ # if defined(__CYGWIN32__) /* Windows sound info */ MMRESULT mmres; WAVEFORMATEX wavform; if (waveOutGetNumDevs() < 1) { fprintf( stderr, "no sound devices available!\n"); global.echo = 0; return 1; } /* check capabilities */ if (check_winsound_caps(bits, rate, global.channels) != 0) { fprintf( stderr, "soundcard capabilities are not sufficient!\n"); global.echo = 0; return 1; } wavform.wFormatTag = WAVE_FORMAT_PCM; wavform.nChannels = global.channels; wavform.nSamplesPerSec = (int)rate; wavform.wBitsPerSample = bits; wavform.cbSize = sizeof(wavform); wavform.nAvgBytesPerSec = (int)rate * global.channels * (wavform.wBitsPerSample / 8); wavform.nBlockAlign = global.channels * (wavform.wBitsPerSample / 8); DeviceID = 0; mmres = waveOutOpen(&DeviceID, WAVE_MAPPER, &wavform, (unsigned long)WIN_CallBack, 0, CALLBACK_FUNCTION); if (mmres) { char erstr[329]; waveOutGetErrorText(mmres, erstr, sizeof(erstr)); fprintf( stderr, "soundcard open error: %s!\n", erstr); global.echo = 0; return 1; } global.soundcard_fd = 0; /* init all wavehdrs */ { int i; for (i=0; i < WAVEHDRS; i++) { wavehdr[i].dwBufferLength = (global.channels*(bits/ 8)*(int)rate* global.nsectors)/75; wavehdr[i].lpData = malloc(wavehdr[i].dwBufferLength); if (wavehdr[i].lpData == NULL) { fprintf(stderr, "no memory for sound buffers available\n"); waveOutReset(0); waveOutClose(DeviceID); return 1; } mmres = waveOutPrepareHeader(DeviceID, &wavehdr[i], sizeof(WAVEHDR)); if (mmres) { char erstr[129]; waveOutGetErrorText(mmres, erstr, sizeof(erstr)); fprintf( stderr, "soundcard prepare error: %s!\n", erstr); return 1; } wavehdr[i].dwLoops = 0; wavehdr[i].dwFlags = WHDR_DONE; wavehdr[i].dwBufferLength = 0; } } # else # if defined(__EMX__) # if defined (HAVE_MMPM) /* OS/2 MMPM/2 MCI sound info */ MCI_OPEN_PARMS mciOpenParms; int i; /* create playlist */ for (i = 0; i < FRAGMENTS; i++) { PlayList[i].ulCommand = DATA_OPERATION; /* play data */ PlayList[i].ulOperand1 = 0; /* address */ PlayList[i].ulOperand2 = 0; /* size */ PlayList[i].ulOperand3 = 0; /* offset */ } PlayList[FRAGMENTS].ulCommand = BRANCH_OPERATION; /* jump */ PlayList[FRAGMENTS].ulOperand1 = 0; PlayList[FRAGMENTS].ulOperand2 = 0; /* destination */ PlayList[FRAGMENTS].ulOperand3 = 0; memset(&mciOpenParms, 0, sizeof(mciOpenParms)); mciOpenParms.pszDeviceType = (PSZ) (((unsigned long) MCI_DEVTYPE_WAVEFORM_AUDIO << 16) | (unsigned short) DeviceIndex); mciOpenParms.pszElementName = (PSZ) & PlayList; /* try to open the sound device */ if (mciSendCommand(0, MCI_OPEN, MCI_WAIT | MCI_OPEN_SHAREABLE | MCIOPEN_Type_ID, &mciOpenParms, 0) != MCIERR_SUCCESS) { /* no sound */ fprintf( stderr, "no sound devices available!\n"); global.echo = 0; return 1; } /* try to set the parameters */ DeviceID = mciOpenParms.usDeviceID; { MCI_WAVE_SET_PARMS mciWaveSetParms; memset(&mciWaveSetParms, 0, sizeof(mciWaveSetParms)); mciWaveSetParms.ulSamplesPerSec = rate; mciWaveSetParms.usBitsPerSample = bits; mciWaveSetParms.usChannels = global.channels; mciWaveSetParms.ulAudio = MCI_SET_AUDIO_ALL; /* set play-parameters */ if (mciSendCommand(DeviceID, MCI_SET, MCI_WAIT | MCI_WAVE_SET_SAMPLESPERSEC | MCI_WAVE_SET_BITSPERSAMPLE | MCI_WAVE_SET_CHANNELS, (PVOID) & mciWaveSetParms, 0)) { MCI_GENERIC_PARMS mciGenericParms; fprintf( stderr, "soundcard capabilities are not sufficient!\n"); global.echo = 0; /* close */ mciSendCommand(DeviceID, MCI_CLOSE, MCI_WAIT, &mciGenericParms, 0); return 1; } } # endif /* EMX MMPM OS2 sound */ # else # if defined(__QNX__) int card = -1; int dev = 0; int rtn; snd_pcm_channel_info_t pi; snd_pcm_channel_params_t pp; if (card == -1) { rtn = snd_pcm_open_preferred(&pcm_handle, &card, &dev, SND_PCM_OPEN_PLAYBACK); if (rtn < 0) { perror("sound device open"); return 1; } } else { rtn = snd_pcm_open(&pcm_handle, card, dev, SND_PCM_OPEN_PLAYBACK); if (rtn < 0) { perror("sound device open"); return 1; } } memset(&pi, 0, sizeof(pi)); pi.channel = SND_PCM_CHANNEL_PLAYBACK; rtn = snd_pcm_plugin_info(pcm_handle, &pi); if (rtn < 0) { fprintf(stderr, "snd_pcm_plugin_info failed: %s\n", snd_strerror(rtn)); return 1; } memset(&pp, 0, sizeof(pp)); pp.mode = SND_PCM_MODE_BLOCK; pp.channel = SND_PCM_CHANNEL_PLAYBACK; pp.start_mode = SND_PCM_START_FULL; pp.stop_mode = SND_PCM_STOP_STOP; pp.buf.block.frag_size = pi.max_fragment_size; pp.buf.block.frags_max = 1; pp.buf.block.frags_min = 1; pp.format.interleave = 1; pp.format.rate = rate; pp.format.voices = global.channels; if (bits == 8) { pp.format.format = SND_PCM_SFMT_U8; } else { pp.format.format = SND_PCM_SFMT_S16_LE; } rtn = snd_pcm_plugin_params(pcm_handle, &pp); if (rtn < 0) { fprintf(stderr, "snd_pcm_plugin_params failed: %s\n", snd_strerror(rtn)); return 1; } rtn = snd_pcm_plugin_prepare(pcm_handle, SND_PCM_CHANNEL_PLAYBACK); if (rtn < 0) { fprintf(stderr, "snd_pcm_plugin_prepare failed: %s\n", snd_strerror(rtn)); return 1; } global.soundcard_fd = snd_pcm_file_descriptor(pcm_handle, SND_PCM_CHANNEL_PLAYBACK); # endif /* QNX sound */ # endif /* EMX OS2 sound */ # endif /* CYGWIN Windows sound */ # endif /* else SUN audio */ # endif /* else HAVE_OSS */ } #endif /* ifdef ECHO_TO_SOUNDCARD */ return 0; } int open_snd_device() { #if defined(F_GETFL) && defined(F_SETFL) && defined(O_NONBLOCK) int fl; #endif #if defined ECHO_TO_SOUNDCARD && !defined __CYGWIN32__ && !defined __EMX__ global.soundcard_fd = open(snd_device, O_WRONLY #ifdef linux /* Linux BUG: the sound driver open() blocks, if the device is in use. */ | O_NONBLOCK #endif , 0); #if defined(F_GETFL) && defined(F_SETFL) && defined(O_NONBLOCK) fl = fcntl(global.soundcard_fd, F_GETFL, 0); fl &= ~O_NONBLOCK; fcntl(global.soundcard_fd, F_SETFL, fl); #endif return (global.soundcard_fd < 0); #else return 0; #endif } int close_snd_device () { #if !defined ECHO_TO_SOUNDCARD return 0; #else # if defined __CYGWIN32__ waveOutReset(0); return waveOutClose(DeviceID); # else /* !Cygwin32 */ # if defined __EMX__ # if defined HAVE_MMPM /* close the sound device */ MCI_GENERIC_PARMS mciGenericParms; mciSendCommand(DeviceID, MCI_CLOSE, MCI_WAIT, &mciGenericParms, 0); # else /* HAVE_MMPM */ return 0; # endif /* HAVE_MMPM */ # else /* !EMX */ # if defined __QNX__ snd_pcm_plugin_flush(pcm_handle, SND_PCM_CHANNEL_PLAYBACK); return snd_pcm_close(pcm_handle); # else /* !QNX */ return close(global.soundcard_fd); # endif /* !QNX */ # endif /* !EMX */ # endif /* !Cygwin32 */ #endif /* ifdef ECHO_TO_SOUNDCARD */ } int write_snd_device(char *buffer, unsigned todo) { int result = 0; #ifdef ECHO_TO_SOUNDCARD #if defined __CYGWIN32__ MMRESULT mmres; wavehdr[lastwav].dwBufferLength = todo; memcpy(wavehdr[lastwav].lpData, buffer, todo); mmres = waveOutWrite(DeviceID, &wavehdr[lastwav], sizeof(WAVEHDR)); if (mmres) { char erstr[129]; waveOutGetErrorText(mmres, erstr, sizeof(erstr)); fprintf( stderr, "soundcard write error: %s!\n", erstr); return 1; } if (++lastwav >= WAVEHDRS) lastwav -= WAVEHDRS; result = mmres; #else #if defined __EMX__ Playlist[BufferInd].ulOperand1 = buffer; Playlist[BufferInd].ulOperand2 = todo; Playlist[BufferInd].ulOperand3 = 0; if (++BufferInd >= FRAGMENTS) BufferInd -= FRAGMENTS; /* no MCI_WAIT here, because application program has to continue */ memset(&mciPlayParms, 0, sizeof(mciPlayParms)); if (mciSendCommand(DeviceID, MCI_PLAY, MCI_FROM, &mciPlayParms, 0)) { fprintf( stderr, "soundcard write error: %s!\n", erstr); return 1; } result = 0; #else int retval2; int towrite; #if defined HAVE_OSS && defined SNDCTL_DSP_GETOSPACE towrite = abinfo.fragments * abinfo.fragsize; if (towrite == 0) #endif towrite = todo; do { fd_set writefds[1]; struct timeval timeout2; int wrote; timeout2.tv_sec = 0; timeout2.tv_usec = 4*120000; FD_ZERO(writefds); FD_SET(global.soundcard_fd, writefds); retval2 = select(global.soundcard_fd + 1, NULL, writefds, NULL, &timeout2); switch (retval2) { default: case -1: perror ("select failed"); /* fall through */ case 0: /* timeout */ result = 2; goto outside_loop; case 1: break; } if (towrite > todo) { towrite = todo; } #if defined __QNX__ && defined HAVE_SYS_ASOUNDLIB_H wrote = snd_pcm_plugin_write(pcm_handle, buffer, towrite); #else wrote = write(global.soundcard_fd, buffer, towrite); #endif if (wrote <= 0) { perror( "cant write audio"); result = 1; goto outside_loop; } else { todo -= wrote; buffer += wrote; } } while (todo > 0); outside_loop: ; #endif /* !defined __EMX__ */ #endif /* !defined __CYGWIN32__ */ #endif /* ECHO_TO_SOUNDCARD */ return result; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/aiff.c�������������������������������������������������������������������������0000644�0003725�0000144�00000013474�10536265343�014452� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)aiff.c 1.5 01/10/27 Copyright 1998,1999 Heiko Eissfeldt */ /*** * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Heiko Eissfeldt * * * --------------------------------------------------------------------- * definitions for aiff pcm output * --------------------------------------------------------------------- */ #include "config.h" #include <stdio.h> #include <unixstd.h> #include <strdefs.h> #include <standard.h> #include <schily.h> #include "mytype.h" #include "byteorder.h" #include "sndfile.h" typedef UINT4 FOURCC; /* a four character code */ typedef struct CHUNKHDR { FOURCC ckid; /* chunk ID */ UINT4 dwSize; /* chunk size */ } CHUNKHDR; #define mmioFOURCC(ch0, ch1, ch2, ch3) \ ((UINT4)(unsigned char)(ch3) | ((UINT4)(unsigned char)(ch2) << 8) | \ ((UINT4)(unsigned char)(ch1) << 16) | ((UINT4)(unsigned char)(ch0) << 24)) #define FOURCC_FORM mmioFOURCC ('F', 'O', 'R', 'M') #define FOURCC_AIFF mmioFOURCC ('A', 'I', 'F', 'F') #define FOURCC_COMM mmioFOURCC ('C', 'O', 'M', 'M') #define FOURCC_SSND mmioFOURCC ('S', 'S', 'N', 'D') typedef struct AIFFHDR { CHUNKHDR formChk; FOURCC formType; CHUNKHDR commChk; /* Common chunk */ /* from now on, alignment prevents us from using the original types :-(( */ unsigned char numChannels[2]; /* Audio Channels */ unsigned char numSampleFrames[4]; /* # of samples */ unsigned char samplesize[2]; /* bits per sample */ unsigned char sample_rate[10]; /* sample rate in extended float */ unsigned char ssndChkid[4]; /* Sound data chunk */ unsigned char dwSize[4]; /* size of chunk */ unsigned char offset[4]; /* start of 1st sample */ unsigned char blocksize[4]; /* aligned sound data block size */ } AIFFHDR; static AIFFHDR AiffHdr; /* Prototypes */ static int Format_samplerate(unsigned long rate, unsigned char the_rate[10]); static int InitSound(int audio, long channels, unsigned long rate, long nBitsPerSample, unsigned long expected_bytes); static int ExitSound(int audio, unsigned long nBytesDone); static unsigned long GetHdrSize(void); static unsigned long InSizeToOutSize(unsigned long BytesToDo); /* format the sample rate into an bigendian 10-byte IEEE-754 floating point number */ static int Format_samplerate(unsigned long rate, unsigned char the_rate[10]) { int i; /* normalize rate */ for (i = 0; (rate & 0xffff) != 0; rate <<= 1, i++) { if ((rate & 0x8000) != 0) { break; } } /* set exponent and sign */ the_rate[1] = 14-i; the_rate[0] = 0x40; /* LSB = sign */ /* 16-bit part of mantisse for sample rate */ the_rate[3] = rate & 0xff; the_rate[2] = (rate >> 8) & 0xff; /* initialize lower digits of mantisse */ the_rate[4] = the_rate[5] = the_rate[6] = the_rate[7] = the_rate[8] = the_rate[9] = 0; return 0; } static int InitSound(int audio, long channels, unsigned long rate, long nBitsPerSample, unsigned long expected_bytes) { UINT4 tmp; fillbytes(&AiffHdr, sizeof(AiffHdr), '\0'); AiffHdr.formChk.ckid = cpu_to_be32(FOURCC_FORM); AiffHdr.formChk.dwSize= cpu_to_be32(expected_bytes + offset_of(AIFFHDR,blocksize)+sizeof(AiffHdr.blocksize) - offsetof(AIFFHDR,formType)); AiffHdr.formType = cpu_to_be32(FOURCC_AIFF); AiffHdr.commChk.ckid = cpu_to_be32(FOURCC_COMM); AiffHdr.commChk.dwSize= cpu_to_be32(offset_of(AIFFHDR,ssndChkid) - offset_of(AIFFHDR,numChannels)); AiffHdr.numChannels[1]= channels; tmp = cpu_to_be32(expected_bytes/(channels * (nBitsPerSample/8))); AiffHdr.numSampleFrames[0] = tmp >> 24; AiffHdr.numSampleFrames[1] = tmp >> 16; AiffHdr.numSampleFrames[2] = tmp >> 8; AiffHdr.numSampleFrames[3] = tmp >> 0; AiffHdr.samplesize[1] = nBitsPerSample; Format_samplerate(rate, AiffHdr.sample_rate); memcpy(AiffHdr.ssndChkid, "SSND", 4); tmp = cpu_to_be32(expected_bytes + offset_of(AIFFHDR,blocksize)+sizeof(AiffHdr.blocksize) - offset_of(AIFFHDR, offset)); AiffHdr.dwSize[0] = tmp >> 24; AiffHdr.dwSize[1] = tmp >> 16; AiffHdr.dwSize[2] = tmp >> 8; AiffHdr.dwSize[3] = tmp >> 0; return write (audio, &AiffHdr, sizeof (AiffHdr)); } static int ExitSound(int audio, unsigned long nBytesDone ) { UINT4 tmp; AiffHdr.formChk.dwSize= cpu_to_be32(nBytesDone + sizeof(AIFFHDR) - offsetof(AIFFHDR,commChk)); tmp = cpu_to_be32(nBytesDone/( AiffHdr.numChannels[1] * AiffHdr.samplesize[1]/ULONG_C(8))); AiffHdr.numSampleFrames[0] = tmp >> 24; AiffHdr.numSampleFrames[1] = tmp >> 16; AiffHdr.numSampleFrames[2] = tmp >> 8; AiffHdr.numSampleFrames[3] = tmp >> 0; /* If an odd number of bytes has been written, extend the chunk with one dummy byte. This is a requirement for AIFF. */ if ((nBytesDone & 1) && (lseek(audio, 1L, SEEK_CUR) == -1)) { return 0; } /* goto beginning */ if (lseek(audio, 0L, SEEK_SET) == -1) { return 0; } return write (audio, &AiffHdr, sizeof (AiffHdr)); } static unsigned long GetHdrSize() { return sizeof( AiffHdr ); } static unsigned long InSizeToOutSize(unsigned long BytesToDo) { return BytesToDo; } struct soundfile aiffsound = { InitSound, /* init header method */ ExitSound, /* exit header method */ GetHdrSize, /* report header size method */ /* get sound samples out */ (int (*)(int audio, unsigned char *buf, unsigned long BytesToDo))write, InSizeToOutSize, /* compressed? output file size */ 1 /* needs big endian samples */ }; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/semshm.h�����������������������������������������������������������������������0000644�0003725�0000144�00000002206�10513514665�015034� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)semshm.h 1.3 03/08/29 Copyright 1998,1999 Heiko Eissfeldt */ #undef DEBUG_SHM #ifdef DEBUG_SHM extern char *start_of_shm; extern char *end_of_shm; #endif #define FREE_SEM 0 #define DEF_SEM 1 #if defined (HAVE_SEMGET) && defined(USE_SEMAPHORES) extern int sem_id; #else #define sem_id 42 /* nearly any other number would do it too */ void init_pipes(void); void init_parent(void); void init_child(void); #endif #ifdef HAVE_AREAS /* the name of the shared memory mapping for the FIFO under BeOS. */ #define AREA_NAME "shmfifo" #endif void free_sem(void); int semrequest(int semid, int semnum); int semrelease(int semid, int semnum, int amount); int flush_buffers(void); void * request_shm_sem(unsigned amount_of_sh_mem, unsigned char **pointer); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/icedax.c�����������������������������������������������������������������������0000644�0003725�0000144�00000245045�10563167602�015002� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)cdda2wav.c 1.64 06/02/19 Copyright 1998-2004 Heiko Eissfeldt, Copyright 2004-2006 J. Schilling */ #undef DEBUG_BUFFER_ADDRESSES #undef GPROF #undef DEBUG_FORKED #undef DEBUG_CLEANUP #undef DEBUG_DYN_OVERLAP #undef DEBUG_READS #define DEBUG_ILLLEADOUT 0 /* 0 disables, 1 enables */ /* * Copyright: GNU Public License 2 applies * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * parts (C) Peter Widow * parts (C) Thomas Niederreiter * parts (C) RSA Data Security, Inc. * * last changes: * 18.12.93 - first version, OK * 01.01.94 - generalized & clean up HE * 10.06.94 - first linux version HE * 12.06.94 - wav header alignment problem fixed HE * 12.08.94 - open the cdrom device O_RDONLY makes more sense :-) * no more floating point math * change to sector size 2352 which is more common * sub-q-channel information per kernel ioctl requested * doesn't work as well as before * some new options (-max -i) * 01.02.95 - async i/o via semaphores and shared memory * 03.02.95 - overlapped reading on sectors * 03.02.95 - generalized sample rates. all integral divisors are legal * 04.02.95 - sun format added * more divisors: all integral halves >= 1 allowed * floating point math needed again * 06.02.95 - bugfix for last track and not d0 * tested with photo-cd with audio tracks * tested with xa disk * 29.01.96 - new options for bulk transfer * 01.06.96 - tested with enhanced cd * 01.06.96 - tested with cd-plus * 02.06.96 - support pipes * 02.06.96 - support raw format * 04.02.96 - security hole fixed * 22.04.97 - large parts rewritten * 28.04.97 - make file names DOS compatible * 01.09.97 - add speed control * 20.10.97 - add find mono option * Jan/Feb 98 - conversion to use Joerg Schillings SCSI library * see ChangeLog */ #include "config.h" #include <unixstd.h> #include <stdio.h> #include <standard.h> #include <stdxlib.h> #include <strdefs.h> #include <schily.h> #include <signal.h> #include <math.h> #include <fctldefs.h> #include <timedefs.h> #if defined (HAVE_LIMITS_H) #include <limits.h> #endif #if defined (HAVE_SYS_IOCTL_H) #include <sys/ioctl.h> #endif #include <errno.h> #include <statdefs.h> #include <waitdefs.h> #if defined (HAVE_SETPRIORITY) #include <sys/resource.h> #endif #include <vadefs.h> #include <usal/scsitransp.h> #ifdef HAVE_AREAS #include <be/kernel/OS.h> #endif #include "mytype.h" #include "sndconfig.h" #include "semshm.h" /* semaphore functions */ #include "sndfile.h" #include "wav.h" /* wav file header structures */ #include "sun.h" /* sun audio file header structures */ #include "raw.h" /* raw file handling */ #include "aiff.h" /* aiff file handling */ #include "aifc.h" /* aifc file handling */ #ifdef USE_LAME #include "mp3.h" /* mp3 file handling */ #endif #include "interface.h" /* low level cdrom interfacing */ #include "icedax.h" #include "resample.h" #include "toc.h" #include "setuid.h" #include "ringbuff.h" #include "global.h" #include "exitcodes.h" #ifdef USE_PARANOIA #include "cdda_paranoia.h" #endif #include "defaults.h" static void RestrictPlaybackRate(long newrate); static void output_indices(FILE *fp, index_list *p, unsigned trackstart); static int write_info_file(char *fname_baseval, unsigned int track, unsigned long SamplesDone, int numbered); static void CloseAudio(int channels_val, unsigned long nSamples, struct soundfile *audio_out); static void CloseAll(void); static void OpenAudio(char *fname, double rate, long nBitsPerSample, long channels_val, unsigned long expected_bytes, struct soundfile*audio_out); static void set_offset(myringbuff *p, int offset); static int get_offset(myringbuff *p); static void usage(void); static void init_globals(void); static int is_fifo(char *filename); /* Rules: * unique parameterless options first, * unique parametrized option names next, * ambigious parameterless option names next, * ambigious string parametrized option names last */ static const char *opts = "paranoia,paraopts&,version,help,h,\ no-write,N,dump-rates,R,bulk,B,alltracks,verbose-scsi+,V+,\ find-extremes,F,find-mono,G,no-infofile,H,\ deemphasize,T,info-only,J,silent-scsi,Q,\ cddbp-server*,cddbp-port*,\ scanbus,devices,device*,dev*,D*,auxdevice*,A*,interface*,I*,output-format*,O*,\ output-endianess*,E*,cdrom-endianess*,C*,speed#,S#,\ playback-realtime#L,p#L,md5#,M#,set-overlap#,P#,sound-device*,K*,\ cddb#,L#,channels*,c*,bits-per-sample#,b#,rate#,r#,gui,g,\ divider*,a*,track*,t*,index#,i#,duration*,d*,offset#,o#,\ sectors-per-request#,n#,verbose-level&,v&,buffers-in-ring#,l#,\ stereo,s,mono,m,wait,w,echo,e,quiet,q,max,x\ "; #ifdef NEED_O_BINARY #include <io.h> /* for setmode() prototype */ #endif /* global variables */ global_t global; /* static variables */ static unsigned long nSamplesDone = 0; static int child_pid = -2; static unsigned long *nSamplesToDo; static unsigned int current_track; static int bulk = 0; unsigned int get_current_track(void); unsigned int get_current_track() { return current_track; } static void RestrictPlaybackRate(long newrate) { global.playback_rate = newrate; if ( global.playback_rate < 25 ) global.playback_rate = 25; /* filter out insane values */ if ( global.playback_rate > 250 ) global.playback_rate = 250; if ( global.playback_rate < 100 ) global.nsectors = (global.nsectors*global.playback_rate)/100; } long SamplesNeeded(long amount, long undersampling_val) { long retval = ((undersampling_val * 2 + Halved)*amount)/2; if (Halved && (*nSamplesToDo & 1)) retval += 2; return retval; } static int argc2; static int argc3; static char **argv2; static void reset_name_iterator(void); static void reset_name_iterator() { argv2 -= argc3 - argc2; argc2 = argc3; } static char *get_next_name(void); static char *get_next_name() { if (argc2 > 0) { argc2--; return (*argv2++); } else { return NULL; } } static char *cut_extension(char *fname); static char *cut_extension(char *fname) { char *pp; pp = strrchr(fname, '.'); if (pp == NULL) { pp = fname + strlen(fname); } *pp = '\0'; return pp; } #ifdef INFOFILES static void output_indices(FILE *fp, index_list *p, unsigned trackstart) { int ci; fprintf(fp, "Index=\t\t"); if (p == NULL) { fprintf(fp, "0\n"); return; } for (ci = 1; p != NULL; ci++, p = p->next) { int frameoff = p->frameoffset; if (p->next == NULL) fputs("\nIndex0=\t\t", fp); #if 0 else if ( ci > 8 && (ci % 8) == 1) fputs("\nIndex =\t\t", fp); #endif if (frameoff != -1) fprintf(fp, "%d ", frameoff - trackstart); else fprintf(fp, "-1 "); } fputs("\n", fp); } /* * write information before the start of the sampling process * * * uglyfied for Joerg Schillings ultra dumb line parser */ static int write_info_file(char *fname_baseval, unsigned int track, unsigned long int SamplesDone, int numbered) { FILE *info_fp; char fname[200]; char datetime[30]; time_t utc_time; struct tm *tmptr; /* write info file */ if (!strcmp(fname_baseval,"-")) return 0; strncpy(fname, fname_baseval, sizeof(fname) -1); fname[sizeof(fname) -1] = 0; if (numbered) sprintf(cut_extension(fname), "_%02u.inf", track); else strcpy(cut_extension(fname), ".inf"); info_fp = fopen (fname, "w"); if (!info_fp) return -1; #if 0 #ifdef MD5_SIGNATURES if (global.md5blocksize) MD5Final (global.MD5_result, &global.context); #endif #endif utc_time = time(NULL); tmptr = localtime(&utc_time); if (tmptr) { strftime(datetime, sizeof(datetime), "%x %X", tmptr); } else { strncpy(datetime, "unknown", sizeof(datetime)); } fprintf(info_fp, "#created by icedax %s %s\n#\n", VERSION , datetime ); fprintf(info_fp, "CDINDEX_DISCID=\t'%s'\n" , global.cdindex_id); fprintf(info_fp, "CDDB_DISCID=\t0x%08lx\n\ MCN=\t\t%s\n\ ISRC=\t\t%15.15s\n\ #\n\ Albumperformer=\t'%s'\n\ Performer=\t'%s'\n\ Albumtitle=\t'%s'\n" , (unsigned long) global.cddb_id , Get_MCN() , Get_ISRC(track) , global.creator != NULL ? global.creator : (const unsigned char *)"" , global.trackcreator[track] != NULL ? global.trackcreator[track] : (global.creator != NULL ? global.creator : (const unsigned char *)"") , global.disctitle != NULL ? global.disctitle : (const unsigned char *)"" ); fprintf(info_fp, "Tracktitle=\t'%s'\n" , global.tracktitle[track] ? global.tracktitle[track] : (const unsigned char *)"" ); fprintf(info_fp, "Tracknumber=\t%u\n" , track ); fprintf(info_fp, "Trackstart=\t%ld\n" , Get_AudioStartSector(track) ); fprintf(info_fp, "# track length in sectors (1/75 seconds each), rest samples\nTracklength=\t%ld, %d\n" , SamplesDone/588L,(int)(SamplesDone%588)); fprintf(info_fp, "Pre-emphasis=\t%s\n" , Get_Preemphasis(track) && (global.deemphasize == 0) ? "yes" : "no"); fprintf(info_fp, "Channels=\t%d\n" , Get_Channels(track) ? 4 : global.channels == 2 ? 2 : 1); { int cr = Get_Copyright(track); fputs("Copy_permitted=\t", info_fp); switch (cr) { case 0: fputs("once (copyright protected)\n", info_fp); break; case 1: fputs("no (SCMS first copy)\n", info_fp); break; case 2: fputs("yes (not copyright protected)\n", info_fp); break; default: fputs("unknown\n", info_fp); } } fprintf(info_fp, "Endianess=\t%s\n" , global.need_big_endian ? "big" : "little" ); fprintf(info_fp, "# index list\n"); output_indices(info_fp, global.trackindexlist[track], Get_AudioStartSector(track)); #if 0 /* MD5 checksums in info files are currently broken. * for on-the-fly-recording the generation of info files has been shifted * before the recording starts, so there is no checksum at that point. */ #ifdef MD5_SIGNATURES fprintf(info_fp, "#(blocksize) checksum\nMD-5=\t\t(%d) %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n" , global.md5blocksize , global.MD5_result[0] , global.MD5_result[1] , global.MD5_result[2] , global.MD5_result[3] , global.MD5_result[4] , global.MD5_result[5] , global.MD5_result[6] , global.MD5_result[7] , global.MD5_result[8] , global.MD5_result[9] , global.MD5_result[10] , global.MD5_result[11] , global.MD5_result[12] , global.MD5_result[13] , global.MD5_result[14] , global.MD5_result[15]); #endif #endif fclose(info_fp); return 0; } #endif static void CloseAudio(int channels_val, unsigned long nSamples, struct soundfile *audio_out) { /* define length */ audio_out->ExitSound( global.audio, (nSamples-global.SkippedSamples)*global.OutSampleSize*channels_val ); close (global.audio); global.audio = -1; } static unsigned int track = 1; /* On terminating: * define size-related entries in audio file header, update and close file */ static void CloseAll() { WAIT_T chld_return_status; int amiparent; /* terminate child process first */ amiparent = child_pid > 0; if (global.iloop > 0) { /* set to zero */ global.iloop = 0; } #if defined HAVE_FORK_AND_SHAREDMEM # ifdef DEBUG_CLEANUP fprintf(stderr, "%s terminating, \n", amiparent ? "Parent (READER)" : "Child (WRITER)"); #endif #else # ifdef DEBUG_CLEANUP fprintf(stderr, "icedax single process terminating, \n"); # endif #endif if (amiparent || child_pid < 0) { /* switch to original mode and close device */ EnableCdda (get_scsi_p(), 0, 0); } if (!amiparent) { /* do general clean up */ if (global.audio>=0) { if (bulk) { /* finish sample file for this track */ CloseAudio(global.channels, global.nSamplesDoneInTrack, global.audio_out); } else { /* finish sample file for this track */ CloseAudio(global.channels, (unsigned int) *nSamplesToDo, global.audio_out); } } /* tell minimum and maximum amplitudes, if required */ if (global.findminmax) { fprintf(stderr, "Right channel: minimum amplitude :%d/-32768, maximum amplitude :%d/32767\n", global.minamp[0], global.maxamp[0]); fprintf(stderr, "Left channel: minimum amplitude :%d/-32768, maximum amplitude :%d/32767\n", global.minamp[1], global.maxamp[1]); } /* tell mono or stereo recording, if required */ if (global.findmono) { fprintf(stderr, "Audio samples are originally %s.\n", global.ismono ? "mono" : "stereo"); } return; /* end of child or single process */ } if (global.have_forked == 1) { #ifdef DEBUG_CLEANUP fprintf(stderr, "Parent wait for child death, \n"); #endif /* wait for child to terminate */ if (0 > wait(&chld_return_status)) { perror(""); } else { if (WIFEXITED(chld_return_status)) { if (WEXITSTATUS(chld_return_status)) { fprintf(stderr, "\nW Child exited with %d\n", WEXITSTATUS(chld_return_status)); } } if (WIFSIGNALED(chld_return_status)) { fprintf(stderr, "\nW Child exited due to signal %d\n", WTERMSIG(chld_return_status)); } if (WIFSTOPPED(chld_return_status)) { fprintf(stderr, "\nW Child is stopped due to signal %d\n", WSTOPSIG(chld_return_status)); } } #ifdef DEBUG_CLEANUP fprintf(stderr, "\nW Parent child death, state:%d\n", chld_return_status); #endif } #ifdef GPROF rename("gmon.out", "gmon.child"); #endif } /* report a usage error and exit */ #ifdef PROTOTYPES static void usage2 (const char *szMessage, ...) #else static void usage2(const char *szMessage, va_dcl va_alist) #endif { va_list marker; #ifdef PROTOTYPES va_start(marker, szMessage); #else va_start(marker); #endif vfprintf(stderr, szMessage, marker); va_end(marker); fprintf(stderr, "\nPlease use -help or consult the man page for help.\n"); exit (1); } /* report a fatal error, clean up and exit */ #ifdef PROTOTYPES void FatalError (const char *szMessage, ...) #else void FatalError(const char *szMessage, va_dcl va_alist) #endif { va_list marker; #ifdef PROTOTYPES va_start(marker, szMessage); #else va_start(marker); #endif vfprintf(stderr, szMessage, marker); va_end(marker); if (child_pid >= 0) { if (child_pid == 0) { pid_t ppid; /* * Kill the parent too if we are not orphaned. */ ppid = getppid(); if (ppid > 1) kill(ppid, SIGINT); } else { kill(child_pid, SIGINT); } } exit (1); } /* open the audio output file and prepare the header. * the header will be defined on terminating (when the size * is known). So hitting the interrupt key leaves an intact * file. */ static void OpenAudio(char *fname, double rate, long nBitsPerSample, long channels_val, unsigned long expected_bytes, struct soundfile *audio_out) { if (global.audio == -1) { global.audio = open (fname, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY #ifdef SYNCHRONOUS_WRITE | O_SYNC #endif , 0666); if (global.audio == -1) { if (errno == EAGAIN && is_fifo(fname)) { FatalError ("Could not open fifo %s. Probably no fifo reader present.\n", fname); } perror("open audio sample file"); FatalError ("Could not open file %s\n", fname); } } global.SkippedSamples = 0; any_signal = 0; audio_out->InitSound( global.audio, channels_val, (unsigned long)rate, nBitsPerSample, expected_bytes ); #ifdef MD5_SIGNATURES if (global.md5blocksize) MD5Init (&global.context); global.md5count = global.md5blocksize; #endif } #include "scsi_cmds.h" static int RealEnd(SCSI *usalp, UINT4 *buff); static int RealEnd(SCSI *usalp, UINT4 *buff) { if (usal_cmd_err(usalp) != 0) { int c,k,q; k = usal_sense_key(usalp); c = usal_sense_code(usalp); q = usal_sense_qual(usalp); if ((k == 0x05 /* ILLEGAL_REQUEST */ && c == 0x21 /* lba out of range */ && q == 0x00) || (k == 0x05 /* ILLEGAL_REQUEST */ && c == 0x63 /*end of user area encountered on this track*/ && q == 0x00) || (k == 0x08 /* BLANK_CHECK */ && c == 0x64 /* illegal mode for this track */ && q == 0x00)) { return 1; } } if (usal_getresid(usalp) > 16) return 1; { unsigned char *p; /* Look into the subchannel data */ buff += CD_FRAMESAMPLES; p = (unsigned char *)buff; if (p[0] == 0x21 && p[1] == 0xaa) { return 1; } } return 0; } static void set_offset(myringbuff *p, int offset) { #ifdef DEBUG_SHM fprintf(stderr, "Write offset %d at %p\n", offset, &p->offset); #endif p->offset = offset; } static int get_offset(myringbuff *p) { #ifdef DEBUG_SHM fprintf(stderr, "Read offset %d from %p\n", p->offset, &p->offset); #endif return p->offset; } static void usage() { fputs( "usage: icedax [OPTIONS ...] [trackfilenames ...]\n\ OPTIONS:\n\ [-c chans] [-s] [-m] [-b bits] [-r rate] [-a divider] [-S speed] [-x]\n\ [-t track[+endtrack]] [-i index] [-o offset] [-d duration] [-F] [-G]\n\ [-q] [-w] [-v vopts] [-R] [-P overlap] [-B] [-T] [-C input-endianess]\n\ [-e] [-n sectors] [-N] [-J] [-L cddbp-mode] [-H] [-g] [-l buffers] [-D cd-device]\n\ [-I interface] [-K sound-device] [-O audiotype] [-E output-endianess]\n\ [-A auxdevice] [-paranoia] [-cddbp-server=name] [-cddbp-port=port] [-version]\n", stderr); fputs("\ (-D) dev=device set the cdrom or scsi device (as Bus,Id,Lun).\n\ (-A) auxdevice=device set the aux device (typically /dev/cdrom).\n\ (-K) sound-device=device set the sound device to use for -e (typically /dev/dsp).\n\ (-I) interface=interface specify the interface for cdrom access.\n\ (generic_scsi or cooked_ioctl).\n\ (-c) channels=channels set 1 for mono, 2 or s for stereo (s: channels swapped).\n\ (-s) -stereo select stereo recording.\n\ (-m) -mono select mono recording.\n\ (-x) -max select maximum quality (stereo/16-bit/44.1 KHz).\n\ (-b) bits=bits set bits per sample per channel (8, 12 or 16 bits).\n\ (-r) rate=rate set rate in samples per second. -R gives all rates\n\ (-a) divider=divider set rate to 44100Hz / divider. -R gives all rates\n\ (-R) -dump-rates dump a table with all available sample rates\n\ (-S) speed=speedfactor set the cdrom drive to a given speed during reading\n\ (-P) set-overlap=sectors set amount of overlap sampling (default is 0)\n\ (-n) sectors-per-request=secs read 'sectors' sectors per request.\n\ (-l) buffers-in-ring=buffers use a ring buffer with 'buffers' elements.\n\ (-t) track=track[+end track] select start track (option. end track).\n\ (-i) index=index select start index.\n\ (-o) offset=offset start at 'offset' sectors behind start track/index.\n\ one sector equivalents 1/75 second.\n\ (-O) output-format=audiotype set to wav, au (sun), cdr (raw), aiff or aifc format.\n\ (-C) cdrom-endianess=endian set little, big or guess input sample endianess.\n\ (-E) output-endianess=endian set little or big output sample endianess.\n\ (-d) duration=seconds set recording time in seconds or 0 for whole track.\n\ (-w) -wait wait for audio signal, then start recording.\n\ (-F) -find-extremes find extrem amplitudes in samples.\n\ (-G) -find-mono find if input samples are mono.\n\ (-T) -deemphasize undo pre-emphasis in input samples.\n\ (-e) -echo echo audio data to sound device (see -K) SOUND_DEV.\n\ (-v) verbose-level=optlist controls verbosity (for a list use -vhelp).\n\ (-N) -no-write do not create audio sample files.\n\ (-J) -info-only give disc information only.\n\ (-L) cddb=cddbpmode do cddbp title lookups.\n\ resolve multiple entries according to cddbpmode: 0=interactive, 1=first entry\n\ (-H) -no-infofile no info file generation.\n\ (-g) -gui generate special output suitable for gui frontends.\n\ (-Q) -silent-scsi do not print status of erreneous scsi-commands.\n\ -scanbus scan the SCSI bus and exit\n\ --devices scan for system devices and print with native names\n\ (-M) md5=count calculate MD-5 checksum for blocks of 'count' bytes.\n\ (-q) -quiet quiet operation, no screen output.\n\ (-p) playback-realtime=perc play (echo) audio pitched at perc percent (50%-200%).\n\ (-V) -verbose-scsi each option increases verbosity for SCSI commands.\n\ (-h) -help show this help screen.\n\ (-B) -alltracks, -bulk record each track into a seperate file.\n\ -paranoia use the lib paranoia for reading.\n\ -paraopts=opts set options for lib paranoia (see -paraopts=help).\n\ -cddbp-server=servername set the cddbp server to use for title lookups.\n\ -cddbp-port=portnumber set the cddbp port to use for title lookups.\n\ -version print version information.\n\ \n\ Please note: some short options will be phased out soon (disappear)!\n\ \n\ parameters: (optional) one or more file names or - for standard output.\n\ ", stderr); fputs("Version ", stderr); fputs(VERSION, stderr); fprintf(stderr, "\n\ defaults %s, %d bit, %d.%02d Hz, track 1, no offset, one track,\n", CHANNELS-1?"stereo":"mono", BITS_P_S, 44100 / UNDERSAMPLING, (4410000 / UNDERSAMPLING) % 100); fprintf(stderr, "\ type %s '%s', don't wait for signal, not quiet,\n", AUDIOTYPE, FILENAME); fprintf(stderr, "\ use %s, device %s, aux %s\n", DEF_INTERFACE, CD_DEVICE, AUX_DEVICE); exit( SYNTAX_ERROR ); } static void init_globals() { #ifdef HISTORICAL_JUNK global.dev_name = CD_DEVICE; /* device name */ #endif global.aux_name = AUX_DEVICE;/* auxiliary cdrom device */ strncpy(global.fname_base, FILENAME, sizeof(global.fname_base));/* auxiliary cdrom device */ global.have_forked = 0; /* state variable for clean up */ global.parent_died = 0; /* state variable for clean up */ global.audio = -1; /* audio file desc */ global.cooked_fd = -1; /* cdrom file desc */ global.no_file = 0; /* flag no_file */ global.no_infofile = 0; /* flag no_infofile */ global.no_cddbfile = 0; /* flag no_cddbfile */ global.quiet = 0; /* flag quiet */ global.verbose = SHOW_TOC + SHOW_SUMMARY + SHOW_STARTPOSITIONS + SHOW_TITLES; /* verbose level */ global.scsi_silent = 0; global.scsi_verbose = 0; /* SCSI verbose level */ global.scanbus = 0; global.scandevs = 0; global.multiname = 0; /* multiple file names given */ global.sh_bits = 0; /* sh_bits: sample bit shift */ global.Remainder= 0; /* remainder */ global.iloop = 0; /* todo counter */ global.SkippedSamples = 0; /* skipped samples */ global.OutSampleSize = 0; /* output sample size */ global.channels = CHANNELS; /* output sound channels */ global.nSamplesDoneInTrack = 0; /* written samples in current track */ global.buffers = 4; /* buffers to use */ global.nsectors = NSECTORS; /* sectors to read in one request */ global.overlap = 1; /* amount of overlapping sectors */ global.useroverlap = -1; /* amount of overlapping sectors user override */ global.need_hostorder = 0; /* processing needs samples in host endianess */ global.in_lendian = -1; /* input endianess from SetupSCSI() */ global.outputendianess = NONE; /* user specified output endianess */ global.findminmax = 0; /* flag find extrem amplitudes */ #ifdef HAVE_LIMITS_H global.maxamp[0] = INT_MIN; /* maximum amplitude */ global.maxamp[1] = INT_MIN; /* maximum amplitude */ global.minamp[0] = INT_MAX; /* minimum amplitude */ global.minamp[1] = INT_MAX; /* minimum amplitude */ #else global.maxamp[0] = -32768; /* maximum amplitude */ global.maxamp[1] = -32768; /* maximum amplitude */ global.minamp[0] = 32767; /* minimum amplitude */ global.minamp[1] = 32767; /* minimum amplitude */ #endif global.speed = DEFAULT_SPEED; /* use default */ global.userspeed = -1; /* speed user override */ global.findmono = 0; /* flag find if samples are mono */ global.ismono = 1; /* flag if samples are mono */ global.swapchannels = 0; /* flag if channels shall be swapped */ global.deemphasize = 0; /* flag undo pre-emphasis in samples */ global.playback_rate = 100; /* new fancy selectable sound output rate */ global.gui = 0; /* flag plain formatting for guis */ global.cddb_id = 0; /* disc identifying id for CDDB database */ global.cddb_revision = 0; /* entry revision for CDDB database */ global.cddb_year = 0; /* disc identifying year for CDDB database */ global.cddb_genre[0] = '\0'; /* disc identifying genre for CDDB database */ global.cddbp = 0; /* flag if titles shall be looked up from CDDBP */ global.cddbp_server = 0; /* user supplied CDDBP server */ global.cddbp_port = 0; /* user supplied CDDBP port */ global.illleadout_cd = 0; /* flag if illegal leadout is present */ global.reads_illleadout = 0; /* flag if cdrom drive reads cds with illegal leadouts */ global.disctitle = NULL; global.creator = NULL; global.copyright_message = NULL; memset(global.tracktitle, 0, sizeof(global.tracktitle)); memset(global.trackindexlist, 0, sizeof(global.trackindexlist)); global.just_the_toc = 0; #ifdef USE_PARANOIA global.paranoia_parms.disable_paranoia = global.paranoia_parms.disable_extra_paranoia = global.paranoia_parms.disable_scratch_detect = global.paranoia_parms.disable_scratch_repair = 0; global.paranoia_parms.retries = 20; global.paranoia_parms.overlap = -1; global.paranoia_parms.mindynoverlap = -1; global.paranoia_parms.maxdynoverlap = -1; #endif } #if !defined (HAVE_STRCASECMP) || (HAVE_STRCASECMP != 1) #include <ctype.h> static int strcasecmp(const char *s1, const char *s2); static int strcasecmp(const char *s1, const char *s2) { if (s1 && s2) { while (*s1 && *s2 && (tolower(*s1) - tolower(*s2) == 0)) { s1++; s2++; } if (*s1 == '\0' && *s2 == '\0') return 0; if (*s1 == '\0') return -1; if (*s2 == '\0') return +1; return tolower(*s1) - tolower(*s2); } return -1; } #endif static int is_fifo(char *filename) { #if defined S_ISFIFO struct stat statstruct; if (stat(filename, &statstruct)) { /* maybe the output file does not exist. */ if (errno == ENOENT) return 0; else comerr("Error during stat for output file\n"); } else { if (S_ISFIFO(statstruct.st_mode)) { return 1; } } return 0; #else return 0; #endif } #if !defined (HAVE_STRTOUL) || (HAVE_STRTOUL != 1) static unsigned int strtoul(const char *s1, char **s2, int base); static unsigned int strtoul(const char *s1, char **s2, int base) { long retval; if (base == 10) { /* strip zeros in front */ while (*s1 == '0') s1++; } if (s2 != NULL) { *s2 = astol(s1, &retval); } else { (void) astol(s1, &retval); } return (unsigned long) retval; } #endif static unsigned long SectorBurst; #if (SENTINEL > CD_FRAMESIZE_RAW) error block size for overlap check has to be < sector size #endif static void switch_to_realtime_priority(void); #ifdef HAVE_SYS_PRIOCNTL_H #include <sys/priocntl.h> #include <sys/rtpriocntl.h> static void switch_to_realtime_priority() { pcinfo_t info; pcparms_t param; rtinfo_t rtinfo; rtparms_t rtparam; int pid; pid = getpid(); /* get info */ strcpy(info.pc_clname, "RT"); if (-1 == priocntl(P_PID, pid, PC_GETCID, (void *)&info)) { errmsg("Cannot get priority class id priocntl(PC_GETCID)\n"); goto prio_done; } memmove(&rtinfo, info.pc_clinfo, sizeof(rtinfo_t)); /* set priority not to the max */ rtparam.rt_pri = rtinfo.rt_maxpri - 2; rtparam.rt_tqsecs = 0; rtparam.rt_tqnsecs = RT_TQDEF; param.pc_cid = info.pc_cid; memmove(param.pc_clparms, &rtparam, sizeof(rtparms_t)); priv_on(); needroot(0); if (-1 == priocntl(P_PID, pid, PC_SETPARMS, (void *)¶m)) errmsg("Cannot set priority class parameters priocntl(PC_SETPARMS)\n"); prio_done: priv_off(); dontneedroot(); } #else #if defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING -0 >= 0 #define USE_POSIX_PRIORITY_SCHEDULING #endif #ifdef USE_POSIX_PRIORITY_SCHEDULING #include <sched.h> static void switch_to_realtime_priority() { #ifdef _SC_PRIORITY_SCHEDULING if (sysconf(_SC_PRIORITY_SCHEDULING) == -1) { errmsg("WARNING: RR-scheduler not available, disabling.\n"); } else #endif { int sched_fifo_min, sched_fifo_max; struct sched_param sched_parms; sched_fifo_min = sched_get_priority_min(SCHED_FIFO); sched_fifo_max = sched_get_priority_max(SCHED_FIFO); sched_parms.sched_priority = sched_fifo_max - 1; priv_on(); needroot(0); if (-1 == sched_setscheduler(getpid(), SCHED_FIFO, &sched_parms) && global.quiet != 1) errmsg("cannot set posix realtime scheduling policy\n"); priv_off(); dontneedroot(); } } #else #if defined(__CYGWIN32__) /* * NOTE: Base.h from Cygwin-B20 has a second typedef for BOOL. * We define BOOL to make all local code use BOOL * from Windows.h and use the hidden __SBOOL for * our global interfaces. * * NOTE: windows.h from Cygwin-1.x includes a structure field named sample, * so me may not define our own 'sample' or need to #undef it now. * With a few nasty exceptions, Microsoft assumes that any global * defines or identifiers will begin with an Uppercase letter, so * there may be more of these problems in the future. * * NOTE: windows.h defines interface as an alias for struct, this * is used by COM/OLE2, I guess it is class on C++ * We man need to #undef 'interface' */ #define BOOL WBOOL /* This is the Win BOOL */ #define format __format /* Avoid format parameter hides global ... */ #include <windows.h> #undef format #undef interface static void switch_to_realtime_priority() { /* set priority class */ if (FALSE == SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS)) { fprintf(stderr, "No realtime priority possible.\n"); return; } /* set thread priority */ if (FALSE == SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST)) { fprintf(stderr, "Could not set realtime priority.\n"); } } #else static void switch_to_realtime_priority() { } #endif #endif #endif /* SCSI cleanup */ int on_exitscsi(void *status); int on_exitscsi(void *status) { exit((intptr_t)status); return 0; } /* wrapper for signal handler exit needed for Mac-OS-X */ static void exit_wrapper(int status); static void exit_wrapper(int status) { #if defined DEBUG_CLEANUP fprintf( stderr, "Exit(%d) for %s\n", status, child_pid == 0 ? "Child" : "Parent"); fflush(stderr); #endif if (child_pid != 0) { SCSI *usalp = get_scsi_p(); if (usalp->running) { usalp->cb_fun = on_exitscsi; usalp->cb_arg = (void *) (uintptr_t) status; } else { on_exitscsi((void *) (intptr_t) status); } } else { exit(status); } } /* signal handler for process communication */ static void set_nonforked(int status); /* ARGSUSED */ static void set_nonforked(int status) { global.parent_died = 1; #if defined DEBUG_CLEANUP fprintf( stderr, "SIGPIPE received from %s\n.", child_pid == 0 ? "Child" : "Parent"); #endif if (child_pid == 0) { pid_t ppid; /* * Kill the parent too if we are not orphaned. */ ppid = getppid(); if (ppid > 1) kill(ppid, SIGINT); } else { kill(child_pid, SIGINT); } exit(SIGPIPE_ERROR); } #ifdef USE_PARANOIA static struct paranoia_statistics { long c_sector; long v_sector; int last_heartbeatstate; long lasttime; char heartbeat; int minoverlap; int curoverlap; int maxoverlap; int slevel; int slastlevel; int stimeout; int rip_smile_level; unsigned verifies; unsigned reads; unsigned fixup_edges; unsigned fixup_atoms; unsigned readerrs; unsigned skips; unsigned overlaps; unsigned scratchs; unsigned drifts; unsigned fixup_droppeds; unsigned fixup_dupeds; } *para_stat; static void paranoia_reset(void); static void paranoia_reset() { para_stat->c_sector = 0; para_stat->v_sector = 0; para_stat->last_heartbeatstate = 0; para_stat->lasttime = 0; para_stat->heartbeat = ' '; para_stat->minoverlap = 0x7FFFFFFF; para_stat->curoverlap = 0; para_stat->maxoverlap = 0; para_stat->slevel = 0; para_stat->slastlevel = 0; para_stat->stimeout = 0; para_stat->rip_smile_level = 0; para_stat->verifies = 0; para_stat->reads = 0; para_stat->readerrs = 0; para_stat->fixup_edges = 0; para_stat->fixup_atoms = 0; para_stat->fixup_droppeds = 0; para_stat->fixup_dupeds = 0; para_stat->drifts = 0; para_stat->scratchs = 0; para_stat->overlaps = 0; para_stat->skips = 0; } static void paranoia_callback(long inpos, int function); static void paranoia_callback(long inpos, int function) { struct timeval thistime; long test; switch (function) { case -2: para_stat->v_sector = inpos / CD_FRAMEWORDS; return; case -1: para_stat->last_heartbeatstate = 8; para_stat->heartbeat = '*'; para_stat->slevel = 0; para_stat->v_sector = inpos / CD_FRAMEWORDS; break; case PARANOIA_CB_VERIFY: if (para_stat->stimeout >= 30) { if (para_stat->curoverlap > CD_FRAMEWORDS) { para_stat->slevel = 2; } else { para_stat->slevel = 1; } } para_stat->verifies++; break; case PARANOIA_CB_READ: if (inpos / CD_FRAMEWORDS > para_stat->c_sector) { para_stat->c_sector = inpos / CD_FRAMEWORDS; } para_stat->reads++; break; case PARANOIA_CB_FIXUP_EDGE: if (para_stat->stimeout >= 5) { if (para_stat->curoverlap > CD_FRAMEWORDS) { para_stat->slevel = 2; } else { para_stat->slevel = 1; } } para_stat->fixup_edges++; break; case PARANOIA_CB_FIXUP_ATOM: if (para_stat->slevel < 3 || para_stat->stimeout > 5) { para_stat->slevel = 3; } para_stat->fixup_atoms++; break; case PARANOIA_CB_READERR: para_stat->slevel = 6; para_stat->readerrs++; break; case PARANOIA_CB_SKIP: para_stat->slevel = 8; para_stat->skips++; break; case PARANOIA_CB_OVERLAP: para_stat->curoverlap = inpos; if (inpos > para_stat->maxoverlap) para_stat->maxoverlap = inpos; if (inpos < para_stat->minoverlap) para_stat->minoverlap = inpos; para_stat->overlaps++; break; case PARANOIA_CB_SCRATCH: para_stat->slevel = 7; para_stat->scratchs++; break; case PARANOIA_CB_DRIFT: if (para_stat->slevel < 4 || para_stat->stimeout > 5) { para_stat->slevel = 4; } para_stat->drifts++; break; case PARANOIA_CB_FIXUP_DROPPED: para_stat->slevel = 5; para_stat->fixup_droppeds++; break; case PARANOIA_CB_FIXUP_DUPED: para_stat->slevel = 5; para_stat->fixup_dupeds++; break; } gettimeofday(&thistime, NULL); /* now in tenth of seconds. */ test = thistime.tv_sec * 10 + thistime.tv_usec / 100000; if (para_stat->lasttime != test || function == -1 || para_stat->slastlevel != para_stat->slevel) { if (function == -1 || para_stat->slastlevel != para_stat->slevel) { static const char hstates[] = " .o0O0o."; para_stat->lasttime = test; para_stat->stimeout++; para_stat->last_heartbeatstate++; if (para_stat->last_heartbeatstate > 7) { para_stat->last_heartbeatstate = 0; } para_stat->heartbeat = hstates[para_stat->last_heartbeatstate]; if (function == -1) { para_stat->heartbeat = '*'; } } if (para_stat->slastlevel != para_stat->slevel) { para_stat->stimeout = 0; } para_stat->slastlevel = para_stat->slevel; } if (para_stat->slevel < 8) { para_stat->rip_smile_level = para_stat->slevel; } else { para_stat->rip_smile_level = 0; } } #endif static long lSector; static long lSector_p2; static double rate = 44100.0 / UNDERSAMPLING; static int bits = BITS_P_S; static char fname[200]; static const char *audio_type; static long BeginAtSample; static unsigned long SamplesToWrite; static unsigned minover; static unsigned maxover; static unsigned long calc_SectorBurst(void); static unsigned long calc_SectorBurst() { unsigned long SectorBurstVal; SectorBurstVal = min(global.nsectors, (global.iloop + CD_FRAMESAMPLES-1) / CD_FRAMESAMPLES); if ( lSector+(int)SectorBurst-1 >= lSector_p2 ) SectorBurstVal = lSector_p2 - lSector; return SectorBurstVal; } /* if PERCENTAGE_PER_TRACK is defined, the percentage message will reach * 100% every time a track end is reached or the time limit is reached. * * Otherwise if PERCENTAGE_PER_TRACK is not defined, the percentage message * will reach 100% once at the very end of the last track. */ #define PERCENTAGE_PER_TRACK static int do_read(myringbuff *p, unsigned *total_unsuccessful_retries); static int do_read(myringbuff *p, unsigned *total_unsuccessful_retries) { unsigned char *newbuf; int offset; unsigned int added_size; /* how many sectors should be read */ SectorBurst = calc_SectorBurst(); #ifdef USE_PARANOIA if (global.paranoia_selected) { int i; for (i = 0; i < SectorBurst; i++) { void *dp; dp = paranoia_read_limited(global.cdp, paranoia_callback, global.paranoia_parms.retries); /* { char *err; char *msg; err = cdda_errors(global.cdp); msg = cdda_messages(global.cdp); if (err) { fputs(err, stderr); free(err); } if (msg) { fputs(msg, stderr); free(msg); } } */ if (dp != NULL) { memcpy(p->data + i*CD_FRAMESAMPLES, dp, CD_FRAMESIZE_RAW); } else { fputs("E unrecoverable error!", stderr); exit(READ_ERROR); } } newbuf = (unsigned char *)p->data; offset = 0; set_offset(p,offset); added_size = SectorBurst * CD_FRAMESAMPLES; global.overlap = 0; handle_inputendianess(p->data, added_size); } else #endif { unsigned int retry_count; #define MAX_READRETRY 12 retry_count = 0; do { SCSI *usalp = get_scsi_p(); int retval; #ifdef DEBUG_READS fprintf(stderr, "reading from %lu to %lu, overlap %u\n", lSector, lSector + SectorBurst -1, global.overlap); #endif #ifdef DEBUG_BUFFER_ADDRESSES fprintf(stderr, "%p %l\n", p->data, global.pagesize); if (((unsigned)p->data) & (global.pagesize -1) != 0) { fprintf(stderr, "Address %p is NOT page aligned!!\n", p->data); } #endif if (global.reads_illleadout != 0 && lSector > Get_StartSector(LastTrack())) { int singles = 0; UINT4 bufferSub[CD_FRAMESAMPLES + 24]; /* we switch to single sector reads, * in order to handle the remaining sectors. */ usalp->silent++; do { ReadCdRomSub( usalp, bufferSub, lSector+singles, 1 ); *eorecording = RealEnd( usalp, bufferSub ); if (*eorecording) { break; } memcpy(p->data+singles*CD_FRAMESAMPLES, bufferSub, CD_FRAMESIZE_RAW); singles++; } while (singles < SectorBurst); usalp->silent--; if ( *eorecording ) { patch_real_end(lSector+singles); SectorBurst = singles; #if DEBUG_ILLLEADOUT fprintf(stderr, "iloop=%11lu, nSamplesToDo=%11lu, end=%lu -->\n", global.iloop, *nSamplesToDo, lSector+singles); #endif *nSamplesToDo -= global.iloop - SectorBurst*CD_FRAMESAMPLES; global.iloop = SectorBurst*CD_FRAMESAMPLES; #if DEBUG_ILLLEADOUT fprintf(stderr, "iloop=%11lu, nSamplesToDo=%11lu\n\n", global.iloop, *nSamplesToDo); #endif } } else { retval = ReadCdRom( usalp, p->data, lSector, SectorBurst ); } handle_inputendianess(p->data, SectorBurst * CD_FRAMESAMPLES); if (NULL == (newbuf = synchronize( p->data, SectorBurst*CD_FRAMESAMPLES, *nSamplesToDo-global.iloop ))) { /* could not synchronize! * Try to invalidate the cdrom cache. * Increase overlap setting, if possible. */ /*trash_cache(p->data, lSector, SectorBurst);*/ if (global.overlap < global.nsectors - 1) { global.overlap++; lSector--; SectorBurst = calc_SectorBurst(); #ifdef DEBUG_DYN_OVERLAP fprintf(stderr, "using increased overlap of %u\n", global.overlap); #endif } else { lSector += global.overlap - 1; global.overlap = 1; SectorBurst = calc_SectorBurst(); } } else break; } while (++retry_count < MAX_READRETRY); if (retry_count == MAX_READRETRY && newbuf == NULL && global.verbose != 0) { (*total_unsuccessful_retries)++; } if (newbuf) { offset = newbuf - ((unsigned char *)p->data); } else { offset = global.overlap * CD_FRAMESIZE_RAW; } set_offset(p,offset); /* how much has been added? */ added_size = SectorBurst * CD_FRAMESAMPLES - offset/4; if (newbuf && *nSamplesToDo != global.iloop) { minover = min(global.overlap, minover); maxover = max(global.overlap, maxover); /* should we reduce the overlap setting ? */ if (offset > CD_FRAMESIZE_RAW && global.overlap > 1) { #ifdef DEBUG_DYN_OVERLAP fprintf(stderr, "decreasing overlap from %u to %u (jitter %d)\n", global.overlap, global.overlap-1, offset - (global.overlap)*CD_FRAMESIZE_RAW); #endif global.overlap--; SectorBurst = calc_SectorBurst(); } } } if (global.iloop >= added_size) { global.iloop -= added_size; } else { global.iloop = 0; } lSector += SectorBurst - global.overlap; #if defined PERCENTAGE_PER_TRACK && defined HAVE_FORK_AND_SHAREDMEM { int as; while ((as = Get_StartSector(current_track+1)) != -1 && lSector >= as) { current_track++; } } #endif return offset; } static void print_percentage(unsigned *poper, int c_offset); static void print_percentage(unsigned *poper, int c_offset) { unsigned per; #ifdef PERCENTAGE_PER_TRACK /* Thomas Niederreiter wants percentage per track */ unsigned start_in_track = max(BeginAtSample, Get_AudioStartSector(current_track)*CD_FRAMESAMPLES); per = min(BeginAtSample + (long)*nSamplesToDo, Get_StartSector(current_track+1)*CD_FRAMESAMPLES) - (long)start_in_track; per = (BeginAtSample+nSamplesDone - start_in_track )/(per/100); #else per = global.iloop ? (nSamplesDone)/(*nSamplesToDo/100) : 100; #endif if (global.overlap > 0) { fprintf(stderr, "\r%2d/%2d/%2d/%7d %3d%%", minover, maxover, global.overlap, c_offset - global.overlap*CD_FRAMESIZE_RAW, per); } else if (*poper != per) { fprintf(stderr, "\r%3d%%", per); } *poper = per; fflush(stderr); } static unsigned long do_write(myringbuff *p); static unsigned long do_write(myringbuff *p) { int current_offset; unsigned int InSamples; static unsigned oper = 200; current_offset = get_offset(p); /* how many bytes are available? */ InSamples = global.nsectors*CD_FRAMESAMPLES - current_offset/4; /* how many samples are wanted? */ InSamples = min((*nSamplesToDo-nSamplesDone),InSamples); /* when track end is reached, close current file and start a new one */ while ((nSamplesDone < *nSamplesToDo) && (InSamples != 0)) { long unsigned int how_much = InSamples; long int left_in_track; left_in_track = Get_StartSector(current_track+1)*CD_FRAMESAMPLES - (int)(BeginAtSample+nSamplesDone); if (*eorecording != 0 && current_track == cdtracks+1 && (*total_segments_read) == (*total_segments_written)+1) { /* limit, if the actual end of the last track is * not known from the toc. */ left_in_track = InSamples; } if (left_in_track < 0) { fprintf(stderr, "internal error: negative left_in_track:%ld, current_track=%d\n",left_in_track, current_track); } if (bulk) { how_much = min(how_much, (unsigned long) left_in_track); } #ifdef MD5_SIGNATURES if (global.md5count) { MD5Update (&global.context, ((unsigned char *)p->data) +current_offset, min(global.md5count,how_much)); global.md5count -= min(global.md5count,how_much); } #endif if ( SaveBuffer ( p->data + current_offset/4, how_much, &nSamplesDone) ) { if (global.have_forked == 1) { pid_t ppid; /* * Kill the parent too if we are not orphaned. */ ppid = getppid(); if (ppid > 1) kill(ppid, SIGINT); } exit(WRITE_ERROR); } global.nSamplesDoneInTrack += how_much; SamplesToWrite -= how_much; /* move residual samples upto buffer start */ if (how_much < InSamples) { memmove( (char *)(p->data) + current_offset, (char *)(p->data) + current_offset + how_much*4, (InSamples - how_much) * 4); } if ((unsigned long) left_in_track <= InSamples || SamplesToWrite == 0) { /* the current portion to be handled is the end of a track */ if (bulk) { /* finish sample file for this track */ CloseAudio(global.channels, global.nSamplesDoneInTrack, global.audio_out); } else if (SamplesToWrite == 0) { /* finish sample file for this track */ CloseAudio(global.channels, (unsigned int) *nSamplesToDo, global.audio_out); } if (global.verbose) { #ifdef USE_PARANOIA double f; #endif print_percentage(&oper, current_offset); fputc(' ', stderr); #ifndef THOMAS_SCHAU_MAL if ((unsigned long)left_in_track > InSamples) { fputs(" incomplete", stderr); } #endif if (global.tracktitle[current_track] != NULL) { fprintf( stderr, " track %2u '%s' recorded", current_track, global.tracktitle[current_track]); } else { fprintf( stderr, " track %2u recorded", current_track); } #ifdef USE_PARANOIA oper = para_stat->readerrs + para_stat->skips + para_stat->fixup_edges + para_stat->fixup_atoms + para_stat->fixup_droppeds + para_stat->fixup_dupeds + para_stat->drifts; f = (100.0 * oper) / (((double)global.nSamplesDoneInTrack)/588.0); if (para_stat->readerrs) { fprintf(stderr, " with audible hard errors"); } else if ((para_stat->skips) > 0) { fprintf(stderr, " with %sretry/skip errors", f < 2.0 ? "":"audible "); } else if (oper > 0) { oper = f; fprintf(stderr, " with "); if (oper < 2) fprintf(stderr, "minor"); else if (oper < 10) fprintf(stderr, "medium"); else if (oper < 67) fprintf(stderr, "noticable audible"); else if (oper < 100) fprintf(stderr, "major audible"); else fprintf(stderr, "extreme audible"); fprintf(stderr, " problems"); } else { fprintf(stderr, " successfully"); } if (f >= 0.1) fprintf(stderr, " (%.1f%% problem sectors)", f); #else fprintf(stderr, " successfully"); #endif if (waitforsignal == 1) { fprintf(stderr, ". %d silent samples omitted", global.SkippedSamples); } fputs("\n", stderr); if (global.reads_illleadout && *eorecording == 1) { fprintf(stderr, "Real lead out at: %ld sectors\n", (*nSamplesToDo+BeginAtSample)/CD_FRAMESAMPLES); } #ifdef USE_PARANOIA if (global.paranoia_selected) { oper = 200; /* force new output */ print_percentage(&oper, current_offset); if (para_stat->minoverlap == 0x7FFFFFFF) para_stat->minoverlap = 0; fprintf(stderr, " %u rderr, %u skip, %u atom, %u edge, %u drop, %u dup, %u drift\n" ,para_stat->readerrs ,para_stat->skips ,para_stat->fixup_atoms ,para_stat->fixup_edges ,para_stat->fixup_droppeds ,para_stat->fixup_dupeds ,para_stat->drifts); oper = 200; /* force new output */ print_percentage(&oper, current_offset); fprintf(stderr, " %u overlap(%.4g .. %.4g)\n", para_stat->overlaps, (float)para_stat->minoverlap / (2352.0/2.0), (float)para_stat->maxoverlap / (2352.0/2.0)); paranoia_reset(); } #endif } global.nSamplesDoneInTrack = 0; if ( bulk && SamplesToWrite > 0 ) { if ( !global.no_file ) { char *tmp_fname; /* build next filename */ tmp_fname = get_next_name(); if (tmp_fname != NULL) { strncpy(global.fname_base, tmp_fname, sizeof global.fname_base); global.fname_base[ sizeof(global.fname_base)-1] = '\0'; } tmp_fname = cut_extension(global.fname_base); tmp_fname[0] = '\0'; if (global.multiname == 0) { sprintf(fname, "%s_%02u.%s", global.fname_base, current_track+1, audio_type); } else { sprintf(fname, "%s.%s", global.fname_base, audio_type); } OpenAudio( fname, rate, bits, global.channels, (Get_AudioStartSector(current_track+1) - Get_AudioStartSector(current_track)) *CD_FRAMESIZE_RAW, global.audio_out); } /* global.nofile */ } /* if ( bulk && SamplesToWrite > 0 ) */ current_track++; } /* left_in_track <= InSamples */ InSamples -= how_much; } /* end while */ if (!global.quiet && *nSamplesToDo != nSamplesDone) { print_percentage(&oper, current_offset); } return nSamplesDone; } #define PRINT_OVERLAP_INIT \ if (global.verbose) { \ if (global.overlap > 0) \ fprintf(stderr, "overlap:min/max/cur, jitter, percent_done:\n / / / 0%%"); \ else \ fputs("percent_done:\n 0%", stderr); \ } #if defined HAVE_FORK_AND_SHAREDMEM static void forked_read(void); /* This function does all audio cdrom reads * until there is nothing more to do */ static void forked_read() { unsigned total_unsuccessful_retries = 0; #if !defined(HAVE_SEMGET) || !defined(USE_SEMAPHORES) init_child(); #endif minover = global.nsectors; PRINT_OVERLAP_INIT while (global.iloop) { do_read(get_next_buffer(), &total_unsuccessful_retries); define_buffer(); } /* while (global.iloop) */ if (total_unsuccessful_retries) { fprintf(stderr,"%u unsuccessful matches while reading\n",total_unsuccessful_retries); } } static void forked_write(void); static void forked_write() { /* don't need these anymore. Good security policy says we get rid of them ASAP */ priv_off(); neverneedroot(); neverneedgroup(); #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) #else init_parent(); #endif for (;nSamplesDone < *nSamplesToDo;) { if (*eorecording == 1 && (*total_segments_read) == (*total_segments_written)) break; /* get oldest buffers */ nSamplesDone = do_write(get_oldest_buffer()); drop_buffer(); } /* end for */ } #endif /* This function implements the read and write calls in one loop (in case * there is no fork/thread_create system call). * This means reads and writes have to wait for each other to complete. */ static void nonforked_loop(void); static void nonforked_loop() { unsigned total_unsuccessful_retries = 0; minover = global.nsectors; PRINT_OVERLAP_INIT while (global.iloop) { do_read(get_next_buffer(), &total_unsuccessful_retries); do_write(get_oldest_buffer()); } if (total_unsuccessful_retries) { fprintf(stderr,"%u unsuccessful matches while reading\n",total_unsuccessful_retries); } } void verbose_usage(void); void verbose_usage() { fputs("\ help lists all verbose options.\n\ disable disables verbose mode.\n\ all enables all verbose options.\n\ toc display the table of contents.\n\ summary display a summary of track parameters.\n\ indices retrieve/display index positions.\n\ catalog retrieve/display media catalog number.\n\ trackid retrieve/display international standard recording code.\n\ sectors display the start sectors of each track.\n\ titles display any known track titles.\n\ ", stderr); } #ifdef USE_PARANOIA void paranoia_usage(void); void paranoia_usage() { fputs("\ help lists all paranoia options.\n\ disable disables paranoia mode. Paranoia is still being used.\n\ no-verify switches verify off, and overlap on.\n\ retries=amount set the number of maximum retries per sector.\n\ overlap=amount set the number of sectors used for statical paranoia overlap.\n\ minoverlap=amt set the min. number of sectors used for dynamic paranoia overlap.\n\ maxoverlap=amt set the max. number of sectors used for dynamic paranoia overlap.\n\ ", stderr); } #endif int handle_verbose_opts(char *optstr, long *flagp); int handle_verbose_opts(char *optstr, long *flagp) { char *ep; char *np; int optlen; *flagp = 0; while (*optstr) { if ((ep = strchr(optstr, ',')) != NULL) { optlen = ep - optstr; np = ep + 1; } else { optlen = strlen(optstr); np = optstr + optlen; } if (strncmp(optstr, "toc", optlen) == 0) { *flagp |= SHOW_TOC; } else if (strncmp(optstr, "summary", optlen) == 0) { *flagp |= SHOW_SUMMARY; } else if (strncmp(optstr, "indices", optlen) == 0) { *flagp |= SHOW_INDICES; } else if (strncmp(optstr, "catalog", optlen) == 0) { *flagp |= SHOW_MCN; } else if (strncmp(optstr, "trackid", optlen) == 0) { *flagp |= SHOW_ISRC; } else if (strncmp(optstr, "sectors", optlen) == 0) { *flagp |= SHOW_STARTPOSITIONS; } else if (strncmp(optstr, "titles", optlen) == 0) { *flagp |= SHOW_TITLES; } else if (strncmp(optstr, "all", optlen) == 0) { *flagp |= SHOW_MAX; } else if (strncmp(optstr, "disable", optlen) == 0) { *flagp = 0; } else if (strncmp(optstr, "help", optlen) == 0) { verbose_usage(); exit(NO_ERROR); } else { char *endptr; unsigned arg = strtoul(optstr, &endptr, 10); if (optstr != endptr && arg <= SHOW_MAX) { *flagp |= arg; fprintf(stderr, "Warning: numerical parameters for -v are no more supported in the next releases!\n"); } else { fprintf(stderr, "unknown option %s\n", optstr); verbose_usage(); exit(SYNTAX_ERROR); } } optstr = np; } return 1; } int handle_paranoia_opts(char *optstr, long *flagp); int handle_paranoia_opts(char *optstr, long *flagp) { #ifdef USE_PARANOIA char *ep; char *np; int optlen; while (*optstr) { if ((ep = strchr(optstr, ',')) != NULL) { optlen = ep - optstr; np = ep + 1; } else { optlen = strlen(optstr); np = optstr + optlen; } if (strncmp(optstr, "retries=", min(8,optlen)) == 0) { char *eqp = strchr(optstr, '='); int rets; astoi(eqp+1, &rets); if (rets >= 0) { global.paranoia_parms.retries = rets; } } else if (strncmp(optstr, "overlap=", min(8, optlen)) == 0) { char *eqp = strchr(optstr, '='); int rets; astoi(eqp+1, &rets); if (rets >= 0) { global.paranoia_parms.overlap = rets; } } else if (strncmp(optstr, "minoverlap=", min(11, optlen)) == 0) { char *eqp = strchr(optstr, '='); int rets; astoi(eqp+1, &rets); if (rets >= 0) { global.paranoia_parms.mindynoverlap = rets; } } else if (strncmp(optstr, "maxoverlap=", min(11, optlen)) == 0) { char *eqp = strchr(optstr, '='); int rets; astoi(eqp+1, &rets); if (rets >= 0) { global.paranoia_parms.maxdynoverlap = rets; } } else if (strncmp(optstr, "no-verify", optlen) == 0) { global.paranoia_parms.disable_extra_paranoia = 1; } else if (strncmp(optstr, "disable", optlen) == 0) { global.paranoia_parms.disable_paranoia = 1; } else if (strncmp(optstr, "help", optlen) == 0) { paranoia_usage(); exit(NO_ERROR); } else { fprintf(stderr, "unknown option %s\n", optstr); paranoia_usage(); exit(SYNTAX_ERROR); } optstr = np; } return 1; #else fputs("lib paranoia support is not configured!\n", stderr); return 0; #endif } /* and finally: the MAIN program */ int main(int argc, char *argv[]) { long lSector_p1; long sector_offset = 0; unsigned long endtrack = 1; double rectime = DURATION; int cd_index = -1; double int_part; int littleendian = -1; char *int_name; static char *user_sound_device = ""; char * env_p; int tracks_included; int moreargs; int_name = DEF_INTERFACE; audio_type = AUDIOTYPE; save_args(argc, argv); /* init global variables */ init_globals(); { int am_i_cdda2wav; /* When being invoked as list_audio_tracks, just dump a list of audio tracks. */ am_i_cdda2wav = !(strlen(argv[0]) >= sizeof("list_audio_tracks")-1 && !strcmp(argv[0]+strlen(argv[0])+1-sizeof("list_audio_tracks"),"list_audio_tracks")); if (!am_i_cdda2wav) global.verbose = SHOW_JUSTAUDIOTRACKS; } /* Control those set-id privileges... */ initsecurity(); env_p = getenv("CDDA_DEVICE"); if (env_p != NULL) { global.dev_name = env_p; } env_p = getenv("CDDBP_SERVER"); if (env_p != NULL) { global.cddbp_server = env_p; } env_p = getenv("CDDBP_PORT"); if (env_p != NULL) { global.cddbp_port = env_p; } { int cac; char *const*cav; BOOL version = FALSE; BOOL help = FALSE; char *channels = NULL; int irate = -1; char *divider = NULL; char *trackspec = NULL; char *duration = NULL; char *oendianess = NULL; char *cendianess = NULL; int cddbp = -1; BOOL stereo = FALSE; BOOL mono = FALSE; BOOL domax = FALSE; BOOL dump_rates = FALSE; int userverbose = -1; long paraopts = 0; cac = argc; cav = argv; cac--; cav++; if (getargs(&cac, &cav, opts , &global.paranoia_selected , handle_paranoia_opts, ¶opts , &version , &help, &help , &global.no_file, &global.no_file , &dump_rates, &dump_rates , &bulk, &bulk, &bulk , &global.scsi_verbose, &global.scsi_verbose , &global.findminmax, &global.findminmax , &global.findmono, &global.findmono , &global.no_infofile, &global.no_infofile , &global.deemphasize, &global.deemphasize , &global.just_the_toc, &global.just_the_toc , &global.scsi_silent, &global.scsi_silent , &global.cddbp_server, &global.cddbp_port , &global.scanbus , &global.scandevs , &global.dev_name, &global.dev_name, &global.dev_name , &global.aux_name, &global.aux_name , &int_name, &int_name , &audio_type, &audio_type , &oendianess, &oendianess , &cendianess, &cendianess , &global.userspeed, &global.userspeed , &global.playback_rate, &global.playback_rate , &global.md5blocksize, &global.md5blocksize , &global.useroverlap, &global.useroverlap , &user_sound_device, &user_sound_device , &cddbp, &cddbp , &channels, &channels , &bits, &bits , &irate, &irate , &global.gui, &global.gui , ÷r, ÷r , &trackspec, &trackspec , &cd_index, &cd_index , &duration, &duration , §or_offset, §or_offset , &global.nsectors, &global.nsectors , handle_verbose_opts, &userverbose , handle_verbose_opts, &userverbose , &global.buffers, &global.buffers , &stereo, &stereo , &mono, &mono , &waitforsignal, &waitforsignal , &global.echo, &global.echo , &global.quiet, &global.quiet , &domax, &domax ) < 0) { errmsgno(EX_BAD, "Bad Option: %s.\n", cav[0]); fputs ("use 'icedax -help' to get more information.\n", stderr); exit (SYNTAX_ERROR); } if (getfiles(&cac, &cav, opts) == 0) /* No more file type arguments */; moreargs = cav - argv; if (version) { fprintf(stderr, "icedax " CDRKIT_VERSION "\n"); exit(EXIT_SUCCESS); } if (help) { usage(); } if (!global.scanbus) cdr_defaults(&global.dev_name, NULL, NULL, NULL); if (dump_rates) { /* list available rates */ int ii; fputs("\ Available rates are:\n\ Rate Divider Rate Divider Rate Divider Rate Divider\n\ " , stderr ); for (ii = 1; ii <= 44100 / 880 / 2; ii++) { long i2 = ii; fprintf(stderr, "%7.1f %2ld %7.1f %2ld.5 ", 44100.0/i2, i2, 44100.0/(i2+0.5), i2); i2 += 25; fprintf(stderr, "%7.1f %2ld %7.1f %2ld.5\n", 44100.0/i2, i2, 44100.0/(i2+0.5), i2); i2 -= 25; } exit(NO_ERROR); } if (channels) { if (*channels == 's') { global.channels = 2; global.swapchannels = 1; } else { global.channels = strtol(channels, NULL, 10); } } if (irate >= 0) { rate = irate; } if (divider) { double divider_d; divider_d = strtod(divider , NULL); if (divider_d > 0.0) { rate = 44100.0 / divider_d; } else { fputs("E option -divider requires a nonzero, positive argument.\nSee -dump-rates.", stderr); exit(SYNTAX_ERROR); } } if (trackspec) { char * endptr; char * endptr2; track = strtoul(trackspec, &endptr, 10 ); endtrack = strtoul(endptr, &endptr2, 10 ); if (endptr2 == endptr) { endtrack = track; } else if (track == endtrack) { bulk = -1; } } if (duration) { char *end_ptr = NULL; rectime = strtod(duration, &end_ptr ); if (*end_ptr == 'f') { rectime = rectime / 75.0; /* TODO: add an absolute end of recording. */ #if 0 } else if (*end_ptr == 'F') { rectime = rectime / 75.0; #endif } else if (*end_ptr != '\0') { rectime = -1.0; } } if (oendianess) { if (strcasecmp(oendianess, "little") == 0) { global.outputendianess = LITTLE; } else if (strcasecmp(oendianess, "big") == 0) { global.outputendianess = BIG; } else { usage2("wrong parameter '%s' for option -E", oendianess); } } if (cendianess) { if (strcasecmp(cendianess, "little") == 0) { littleendian = 1; } else if (strcasecmp(cendianess, "big") == 0) { littleendian = 0; } else if (strcasecmp(cendianess, "guess") == 0) { littleendian = -2; } else { usage2("wrong parameter '%s' for option -C", cendianess); } } if (cddbp >= 0) { global.cddbp = 1 + cddbp; } if (stereo) { global.channels = 2; } if (mono) { global.channels = 1; global.need_hostorder = 1; } if (global.echo) { #ifdef ECHO_TO_SOUNDCARD if (global.playback_rate != 100) { RestrictPlaybackRate( global.playback_rate ); } global.need_hostorder = 1; #else fprintf(stderr, "There is no sound support compiled into %s.\n",argv[0]); global.echo = 0; #endif } if (global.quiet) { global.verbose = 0; } if (domax) { global.channels = 2; bits = 16; rate = 44100; } if (global.findminmax) { global.need_hostorder = 1; } if (global.deemphasize) { global.need_hostorder = 1; } if (global.just_the_toc) { global.verbose = SHOW_MAX; bulk = 1; } if (global.gui) { #ifdef Thomas_will_es global.no_file = 1; global.no_infofile = 1; global.verbose = SHOW_MAX; #endif global.no_cddbfile = 1; } if (global.no_file) { global.no_infofile = 1; global.no_cddbfile = 1; } if (global.no_infofile) { global.no_cddbfile = 1; } if (global.md5blocksize) { #ifdef MD5_SIGNATURES fputs("MD5 signatures are currently broken! Sorry\n", stderr); #else fputs("MD5 signatures are currently broken! Sorry\n", stderr); #endif } if (user_sound_device) { #ifndef ECHO_TO_SOUNDCARD fputs("There is no sound support configured!\n", stderr); #endif } if (global.paranoia_selected) { global.useroverlap = 0; } if (userverbose >= 0) { global.verbose = userverbose; } } /* check all parameters */ if (global.buffers < 1) { usage2("Incorrect buffer setting: %d", global.buffers); } if (global.nsectors < 1) { usage2("Incorrect nsectors setting: %d", global.nsectors); } if (global.verbose < 0 || global.verbose > SHOW_MAX) { usage2("Incorrect verbose level setting: %d",global.verbose); } if (global.verbose == 0) global.quiet = 1; if ( rectime < 0.0 ) { usage2("Incorrect recording time setting: %d.%02d", (int)rectime, (int)(rectime*100+0.5) % 100); } if ( global.channels != 1 && global.channels != 2 ) { usage2("Incorrect channel setting: %d",global.channels); } if ( bits != 8 && bits != 12 && bits != 16 ) { usage2("Incorrect bits_per_sample setting: %d",bits); } if ( rate < 827.0 || rate > 44100.0 ) { usage2("Incorrect sample rate setting: %d.%02d", (int)rate, ((int)rate*100) % 100); } int_part = (double)(long) (2*44100.0 / rate); if (2*44100.0 / rate - int_part >= 0.5 ) { int_part += 1.0; fprintf( stderr, "Nearest available sample rate is %d.%02d Hertz\n", 2*44100 / (int)int_part, (2*4410000 / (int)int_part) % 100); } Halved = ((int) int_part) & 1; rate = 2*44100.0 / int_part; undersampling = (int) int_part / 2.0; samples_to_do = undersampling; if (!strcmp((char *)int_name,"generic_scsi")) interface = GENERIC_SCSI; else if (!strcmp((char *)int_name,"cooked_ioctl")) interface = COOKED_IOCTL; else { usage2("Incorrect interface setting: %s",int_name); } /* check * init audio file */ if (!strncmp(audio_type,"wav",3)) { global.audio_out = &wavsound; } else if (!strncmp(audio_type, "sun", 3) || !strncmp(audio_type, "au", 2)) { /* Enhanced compatibility */ audio_type = "au"; global.audio_out = &sunsound; } else if (!strncmp(audio_type, "cdr", 3) || !strncmp(audio_type, "raw", 3)) { global.audio_out = &rawsound; } else if (!strncmp(audio_type, "aiff", 4)) { global.audio_out = &aiffsound; } else if (!strncmp(audio_type, "aifc", 4)) { global.audio_out = &aifcsound; #ifdef USE_LAME } else if (!strncmp(audio_type, "mp3", 3)) { global.audio_out = &mp3sound; if (!global.quiet) { unsigned char Lame_version[20]; fetch_lame_version(Lame_version); fprintf(stderr, "Using LAME version %s.\n", Lame_version); } if (bits < 9) { bits = 16; fprintf(stderr, "Warning: sample size forced to 16 bit for MP3 format.\n"); } #endif /* USE_LAME */ } else { usage2("Incorrect audio type setting: %3s", audio_type); } if (bulk == -1) bulk = 0; global.need_big_endian = global.audio_out->need_big_endian; if (global.outputendianess != NONE) global.need_big_endian = global.outputendianess == BIG; if (global.no_file) global.fname_base[0] = '\0'; if (!bulk) { strcat(global.fname_base, "."); strcat(global.fname_base, audio_type); } /* If we need to calculate with samples or write them to a soundcard, * we need a conversion to host byte order. */ if (global.channels != 2 || bits != 16 || rate != 44100) global.need_hostorder = 1; /* Bad hack!! * Remove for release 2.0 * this is a bug compatibility feature. */ if (global.gui && global.verbose == SHOW_TOC) global.verbose |= SHOW_STARTPOSITIONS | SHOW_SUMMARY | SHOW_TITLES; /* * all options processed. * Now a file name per track may follow */ argc2 = argc3 = argc - moreargs; argv2 = argv + moreargs; if ( moreargs < argc ) { if (!strcmp(argv[moreargs],"-")) { #ifdef NEED_O_BINARY setmode(fileno(stdout), O_BINARY); #endif global.audio = dup (fileno(stdout)); strncpy( global.fname_base, "standard_output", sizeof(global.fname_base) ); global.fname_base[sizeof(global.fname_base)-1]=0; } else if (!is_fifo(argv[moreargs])) { /* we do have at least one argument */ global.multiname = 1; } } #define SETSIGHAND(PROC, SIG, SIGNAME) if (signal(SIG, PROC) == SIG_ERR) \ { fprintf(stderr, "cannot set signal %s handler\n", SIGNAME); exit(SETSIG_ERROR); } SETSIGHAND(exit_wrapper, SIGINT, "SIGINT") SETSIGHAND(exit_wrapper, SIGQUIT, "SIGQUIT") SETSIGHAND(exit_wrapper, SIGTERM, "SIGTERM") SETSIGHAND(exit_wrapper, SIGHUP, "SIGHUP") SETSIGHAND(set_nonforked, SIGPIPE, "SIGPIPE") /* setup interface and open cdrom device */ /* request sychronization facilities and shared memory */ SetupInterface( ); /* use global.useroverlap to set our overlap */ if (global.useroverlap != -1) global.overlap = global.useroverlap; /* check for more valid option combinations */ if (global.nsectors < 1+global.overlap) { fprintf( stderr, "Warning: Setting #nsectors to minimum of %d, due to jitter correction!\n", global.overlap+1); global.nsectors = global.overlap+1; } if (global.overlap > 0 && global.buffers < 2) { fprintf( stderr, "Warning: Setting #buffers to minimum of 2, due to jitter correction!\n"); global.buffers = 2; } /* Value of 'nsectors' must be defined here */ global.shmsize = 0; #ifdef USE_PARANOIA while (global.shmsize < sizeof (struct paranoia_statistics)) global.shmsize += global.pagesize; #endif global.shmsize += 10*global.pagesize; /* XXX Der Speicherfehler ist nicht in libparanoia sondern in cdda2wav :-( */ global.shmsize += HEADER_SIZE + ENTRY_SIZE_PAGE_AL * global.buffers; #if defined (HAVE_FORK_AND_SHAREDMEM) /* * The (void *) cast is to avoid a GCC warning like: * warning: dereferencing type-punned pointer will break strict-aliasing rules * which does not apply to this code. (void *) introduces a compatible * intermediate type in the cast list. */ he_fill_buffer = request_shm_sem(global.shmsize, (unsigned char **)(void *)&he_fill_buffer); if (he_fill_buffer == NULL) { fprintf( stderr, "no shared memory available!\n"); exit(SHMMEM_ERROR); } #else /* do not have fork() and shared memory */ he_fill_buffer = malloc(global.shmsize); if (he_fill_buffer == NULL) { fprintf( stderr, "no buffer memory available!\n"); exit(NOMEM_ERROR); } #endif #ifdef USE_PARANOIA { int i = 0; para_stat = (struct paranoia_statistics *)he_fill_buffer; while (i < sizeof (struct paranoia_statistics)) { i += global.pagesize; he_fill_buffer += global.pagesize; global.shmsize -= global.pagesize; } } #endif if (global.verbose != 0) fprintf(stderr, "%u bytes buffer memory requested, %d buffers, %d sectors\n", global.shmsize, global.buffers, global.nsectors); /* initialize pointers into shared memory segment */ last_buffer = he_fill_buffer + 1; total_segments_read = (unsigned long *) (last_buffer + 1); total_segments_written = total_segments_read + 1; child_waits = (int *) (total_segments_written + 1); parent_waits = child_waits + 1; in_lendian = parent_waits + 1; eorecording = in_lendian + 1; *total_segments_read = *total_segments_written = 0; nSamplesToDo = (unsigned long *)(eorecording + 1); *eorecording = 0; *in_lendian = global.in_lendian; set_total_buffers(global.buffers, sem_id); #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) atexit ( free_sem ); #endif /* * set input endian default */ if (littleendian != -1) *in_lendian = littleendian; /* get table of contents */ cdtracks = ReadToc(); if (cdtracks == 0) { fprintf(stderr, "No track in table of contents! Aborting...\n"); exit(MEDIA_ERROR); } calc_cddb_id(); calc_cdindex_id(); #if 1 Check_Toc(); #endif if (ReadTocText != NULL && FirstAudioTrack () != -1) { ReadTocText(get_scsi_p()); handle_cdtext(); } if ( global.verbose == SHOW_JUSTAUDIOTRACKS ) { unsigned int z; for (z = 0; z < cdtracks; z++) if (Get_Datatrack(z) == 0) printf("%02d\t%06ld\n", Get_Tracknumber(z), Get_AudioStartSector(z)); exit(NO_ERROR); } if ( global.verbose != 0 ) { fputs( "#icedax version ", stderr ); fputs( VERSION, stderr ); #if defined USE_POSIX_PRIORITY_SCHEDULING || defined HAVE_SYS_PRIOCNTL_H fputs( ", real time sched.", stderr ); #endif #if defined ECHO_TO_SOUNDCARD fputs( ", soundcard", stderr ); #endif #if defined USE_PARANOIA fputs( ", libparanoia", stderr ); #endif fputs( " support\n", stderr ); } FixupTOC(cdtracks + 1); #if 0 if (!global.paranoia_selected) { fprintf(stderr, "NICE\n"); /* try to get some extra kicks */ priv_on(); needroot(0); #if defined HAVE_SETPRIORITY setpriority(PRIO_PROCESS, 0, -20); #else # if defined(HAVE_NICE) && (HAVE_NICE == 1) nice(-20); # endif #endif priv_off(); dontneedroot(); } #endif /* switch cdrom to audio mode */ EnableCdda (get_scsi_p(), 1, CD_FRAMESIZE_RAW); atexit ( CloseAll ); DisplayToc(); if ( FirstAudioTrack () == -1 ) { if (no_disguised_audiotracks()) { FatalError ( "This disk has no audio tracks\n" ); } } Read_MCN_ISRC(); /* check if start track is in range */ if ( track < 1 || track > cdtracks ) { usage2("Incorrect start track setting: %d",track); } /* check if end track is in range */ if ( endtrack < track || endtrack > cdtracks ) { usage2("Incorrect end track setting: %ld",endtrack); } do { lSector = Get_AudioStartSector ( track ); lSector_p1 = Get_EndSector ( track ) + 1; if ( lSector < 0 ) { if ( bulk == 0 ) { FatalError ( "Track %d not found\n", track ); } else { fprintf(stderr, "Skipping data track %d...\n", track); if (endtrack == track) endtrack++; track++; } } } while (bulk != 0 && track <= cdtracks && lSector < 0); if ((global.illleadout_cd == 0 || global.reads_illleadout != 0) && cd_index != -1) { if (global.verbose && !global.quiet) { global.verbose |= SHOW_INDICES; } sector_offset += ScanIndices( track, cd_index, bulk ); } else { cd_index = 1; if (global.deemphasize || (global.verbose & SHOW_INDICES)) { ScanIndices( track, cd_index, bulk ); } } lSector += sector_offset; /* check against end sector of track */ if ( lSector >= lSector_p1 ) { fprintf(stderr, "W Sector offset %lu exceeds track size (ignored)\n", sector_offset ); lSector -= sector_offset; } if ( lSector < 0L ) { fputs( "Negative start sector! Set to zero.\n", stderr ); lSector = 0L; } lSector_p2 = Get_LastSectorOnCd( track ); if (bulk == 1 && track == endtrack && rectime == 0.0) rectime = 99999.0; if ( rectime == 0.0 ) { /* set time to track time */ *nSamplesToDo = (lSector_p1 - lSector) * CD_FRAMESAMPLES; rectime = (lSector_p1 - lSector) / 75.0; if (CheckTrackrange( track, endtrack) == 1) { lSector_p2 = Get_EndSector ( endtrack ) + 1; if (lSector_p2 >= 0) { rectime = (lSector_p2 - lSector) / 75.0; *nSamplesToDo = (long)(rectime*44100.0 + 0.5); } else { fputs( "End track is no valid audio track (ignored)\n", stderr ); } } else { fputs( "Track range does not consist of audio tracks only (ignored)\n", stderr ); } } else { /* Prepare the maximum recording duration. * It is defined as the biggest amount of * adjacent audio sectors beginning with the * specified track/index/offset. */ if ( rectime > (lSector_p2 - lSector) / 75.0 ) { rectime = (lSector_p2 - lSector) / 75.0; lSector_p1 = lSector_p2; } /* calculate # of samples to read */ *nSamplesToDo = (long)(rectime*44100.0 + 0.5); } global.OutSampleSize = (1+bits/12); if (*nSamplesToDo/undersampling == 0L) { usage2("Time interval is too short. Choose a duration greater than %d.%02d secs!", undersampling/44100, (int)(undersampling/44100) % 100); } if ( moreargs < argc ) { if (!strcmp(argv[moreargs],"-") || is_fifo(argv[moreargs])) { /* * pipe mode */ if (bulk == 1) { fprintf(stderr, "W Bulk mode is disabled while outputting to a %spipe\n", is_fifo(argv[moreargs]) ? "named " : ""); bulk = 0; } global.no_cddbfile = 1; } } if (global.no_infofile == 0) { global.no_infofile = 1; if (global.channels == 1 || bits != 16 || rate != 44100) { fprintf(stderr, "W Sample conversions disable generation of info files!\n"); } else if (waitforsignal == 1) { fprintf(stderr, "W Option -w 'wait for signal' disables generation of info files!\n"); } else if (sector_offset != 0) { fprintf(stderr, "W Using an start offset (option -o) disables generation of info files!\n"); } else if (!bulk && !((lSector == Get_AudioStartSector(track)) && ((long)(lSector + rectime*75.0 + 0.5) == Get_EndSector(track) + 1))) { fprintf(stderr, "W Duration is not set for complete tracks (option -d), this disables generation\n of info files!\n"); } else { global.no_infofile = 0; } } SamplesToWrite = *nSamplesToDo*2/(int)int_part; { int first = FirstAudioTrack(); tracks_included = Get_Track( (unsigned) (lSector + *nSamplesToDo/CD_FRAMESAMPLES -1)) - max((int)track,first) +1; } if (global.multiname != 0 && moreargs + tracks_included > argc) { global.multiname = 0; } if ( !waitforsignal ) { #ifdef INFOFILES if (!global.no_infofile) { int i; for (i = track; i < (int)track + tracks_included; i++) { unsigned minsec, maxsec; char *tmp_fname; /* build next filename */ tmp_fname = get_next_name(); if (tmp_fname != NULL) strncpy( global.fname_base, tmp_fname, sizeof(global.fname_base)-8 ); global.fname_base[sizeof(global.fname_base)-1]=0; minsec = max(lSector, Get_AudioStartSector(i)); maxsec = min(lSector + rectime*75.0 + 0.5, 1+Get_EndSector(i)); if ((int)minsec == Get_AudioStartSector(i) && (int)maxsec == 1+Get_EndSector(i)) { write_info_file(global.fname_base,i,(maxsec-minsec)*CD_FRAMESAMPLES, bulk && global.multiname == 0); } else { fprintf(stderr, "Partial length copy for track %d, no info file will be generated for this track!\n", i); } if (!bulk) break; } reset_name_iterator(); } #endif } if (global.just_the_toc) exit(NO_ERROR); #ifdef ECHO_TO_SOUNDCARD if (user_sound_device[0] != '\0') { set_snd_device(user_sound_device); } init_soundcard(rate, bits); #endif /* ECHO_TO_SOUNDCARD */ if (global.userspeed > -1) global.speed = global.userspeed; if (global.speed != 0 && SelectSpeed != NULL) { SelectSpeed(get_scsi_p(), global.speed); } current_track = track; if ( !global.no_file ) { { char *myfname; myfname = get_next_name(); if (myfname != NULL) { strncpy( global.fname_base, myfname, sizeof(global.fname_base)-8 ); global.fname_base[sizeof(global.fname_base)-1]=0; } } /* strip audio_type extension */ { char *cp = global.fname_base; cp = strrchr(cp, '.'); if (cp == NULL) { cp = global.fname_base + strlen(global.fname_base); } *cp = '\0'; } if (bulk && global.multiname == 0) { sprintf(fname, "%s_%02u.%s",global.fname_base,current_track,audio_type); } else { sprintf(fname, "%s.%s",global.fname_base,audio_type); } OpenAudio( fname, rate, bits, global.channels, (unsigned)(SamplesToWrite*global.OutSampleSize*global.channels), global.audio_out); } global.Remainder = (75 % global.nsectors)+1; global.sh_bits = 16 - bits; /* shift counter */ global.iloop = *nSamplesToDo; if (Halved && (global.iloop&1)) global.iloop += 2; BeginAtSample = lSector * CD_FRAMESAMPLES; #if 1 if ( (global.verbose & SHOW_SUMMARY) && !global.just_the_toc && (global.reads_illleadout == 0 || lSector+*nSamplesToDo/CD_FRAMESAMPLES <= (unsigned) Get_AudioStartSector(cdtracks-1))) { fprintf(stderr, "samplefile size will be %lu bytes.\n", global.audio_out->GetHdrSize() + global.audio_out->InSizeToOutSize(SamplesToWrite*global.OutSampleSize*global.channels) ); fprintf (stderr, "recording %d.%04d seconds %s with %d bits @ %5d.%01d Hz" ,(int)rectime , (int)(rectime * 10000) % 10000, global.channels == 1 ? "mono":"stereo", bits, (int)rate, (int)(rate*10)%10); if (!global.no_file && *global.fname_base) fprintf(stderr, " ->'%s'...", global.fname_base ); fputs("\n", stderr); } #endif #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) #else init_pipes(); #endif #ifdef USE_PARANOIA if (global.paranoia_selected) { long paranoia_mode; global.cdp = paranoia_init(get_scsi_p(), global.nsectors); if (global.paranoia_parms.overlap >= 0) { int overlap = global.paranoia_parms.overlap; if (overlap > global.nsectors - 1) overlap = global.nsectors - 1; paranoia_overlapset(global.cdp, overlap); } /* * Default to a minimum of dynamic overlapping == 0.5 sectors. * If we don't do this, we get the default from libparanoia * which is approx. 0.1. */ if (global.paranoia_parms.mindynoverlap < 0) paranoia_dynoverlapset(global.cdp, CD_FRAMEWORDS/2, -1); paranoia_dynoverlapset(global.cdp, global.paranoia_parms.mindynoverlap * CD_FRAMEWORDS, global.paranoia_parms.maxdynoverlap * CD_FRAMEWORDS); paranoia_mode = PARANOIA_MODE_FULL ^ PARANOIA_MODE_NEVERSKIP; if (global.paranoia_parms.disable_paranoia) { paranoia_mode = PARANOIA_MODE_DISABLE; } if (global.paranoia_parms.disable_extra_paranoia) { paranoia_mode |= PARANOIA_MODE_OVERLAP; paranoia_mode &= ~PARANOIA_MODE_VERIFY; } /* not yet implemented */ if (global.paranoia_parms.disable_scratch_detect) { paranoia_mode &= ~(PARANOIA_MODE_SCRATCH|PARANOIA_MODE_REPAIR); } /* not yet implemented */ if (global.paranoia_parms.disable_scratch_repair) { paranoia_mode &= ~PARANOIA_MODE_REPAIR; } paranoia_modeset(global.cdp, paranoia_mode); if (global.verbose) fprintf(stderr, "using lib paranoia for reading.\n"); paranoia_seek(global.cdp, lSector, SEEK_SET); paranoia_reset(); } #endif #if defined(HAVE_FORK_AND_SHAREDMEM) /* Everything is set up. Now fork and let one process read cdda sectors and let the other one store them in a wav file */ /* forking */ child_pid = fork(); if (child_pid > 0 && global.gui > 0 && global.verbose > 0) fprintf( stderr, "child pid is %d\n", child_pid); /*********************** fork **************************************/ if (child_pid == 0) { /* child WRITER section */ #ifdef HAVE_AREAS /* Under BeOS a fork() with shared memory does not work as * it does under System V Rel. 4. The mapping of the child * works with copy on write semantics, so changes do not propagate * back and forth. The existing mapping has to be deleted * and replaced by an clone without copy on write semantics. * This is done with clone_area(...,B_CLONE_ADDRESS,...). * Thanks to file support.c from the postgreSQL project. */ area_info inf; int32 cook = 0; /* iterate over all mappings to find our shared memory mapping. */ while (get_next_area_info(0, &cook, &inf) == B_OK) { /* check the name of the mapping. */ if (!strcmp(inf.name, AREA_NAME)) { void *area_address; area_id area_parent; /* kill the cow mapping. */ area_address = inf.address; if (B_OK != delete_area(inf.area)) { fprintf(stderr, "delete_area: no valid area.\n"); exit(SHMMEM_ERROR); } /* get the parent mapping. */ area_parent = find_area(inf.name); if (area_parent == B_NAME_NOT_FOUND) { fprintf(stderr, "find_area: no such area name.\n"); exit(SHMMEM_ERROR); } /* clone the parent mapping without cow. */ if (B_OK > clone_area("shm_child", &area_address, B_CLONE_ADDRESS, B_READ_AREA | B_WRITE_AREA, area_parent)) { fprintf(stderr,"clone_area failed\n"); exit(SHMMEM_ERROR); } } } #endif #ifdef __EMX__ if (DosGetSharedMem(he_fill_buffer, 3)) { comerr("DosGetSharedMem() failed.\n"); } #endif global.have_forked = 1; forked_write(); #ifdef __EMX__ DosFreeMem(he_fill_buffer); _exit(NO_ERROR); /* NOTREACHED */ #endif exit_wrapper(NO_ERROR); /* NOTREACHED */ } else if (child_pid > 0) { /* parent READER section */ global.have_forked = 1; switch_to_realtime_priority(); forked_read(); #ifdef HAVE_AREAS { area_id aid; aid = find_area(AREA_NAME); if (aid < B_OK) { comerrno(aid, "find_area() failed.\n"); } delete_area(aid); } #endif #ifdef __EMX__ DosFreeMem(he_fill_buffer); #endif exit_wrapper(NO_ERROR); /* NOTREACHED */ } else perror("fork error."); #endif /* version without fork */ { global.have_forked = 0; #if 0 if (!global.paranoia_selected) { fprintf(stderr, "REAL\n"); switch_to_realtime_priority(); } #endif fprintf(stderr, "a nonforking version is running...\n"); nonforked_loop(); exit_wrapper(NO_ERROR); /* NOTREACHED */ } #ifdef USE_PARANOIA if (global.paranoia_selected) paranoia_free(global.cdp); #endif return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/inf2cdtext.pl������������������������������������������������������������������0000755�0003725�0000144�00000015631�10471375025�016005� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl -w # Copyright 2002 by Heiko Eißfeldt (Eissfeldt) use strict; use integer; # read all .inf files and generate the binary cdtext block # for cdrecord. my @results; sub fill_packet { my $ID = shift; my $track = shift; my $seq_nr = shift; my $charpos = shift; my $text = shift; my $todo = shift; return if (!defined($$text)); my @packet = (); push @packet, chr($ID); # track title, performer, ... push @packet, chr($$track); push @packet, chr($$seq_nr); $$charpos = 15 if ($$charpos > 15); push @packet, chr($$charpos); my $cp = 0; my $tracks_inp = 0; while (length($$text) + 1 < 12 - $cp) { push @packet, split(//, $$text); push @packet, chr(0); $cp += length($$text) + 1; $$charpos = 0; $tracks_inp++; $$text = shift @$todo; if ($#$todo < 1 && (!defined($$text) || $$text eq "") ) { push @packet, (chr(0)) x (12 - $cp); $$seq_nr++; print_packet(@packet); return; } $$text = "" if (!defined($$text)); $$track++; } # packet gets full my $left = 12 - $cp; if ($left > length($$text)) { # title fits into packet push @packet, split(//, $$text); push @packet, chr(0); $tracks_inp++; print_packet(@packet); $$charpos = 0; $$text = shift @$todo; unless ((!defined($$text) || $$text eq "") && $#$todo < 1) { $$track++; } $$seq_nr++; } else { # print current packet and more if more entries are present push @packet, split(//, substr($$text, 0, $left)); print_packet(@packet); $$text = substr($$text, $left); $$charpos += $left; $$seq_nr++; } } my @crctab =( 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, ); sub add_crc { # crc with polynomial: x^16 + x^12 + x^5 + 1 # 1,0001,0000,0010,0001 my $packref = shift; my $crc = 0; foreach (@$packref) { $crc = ($crc << 8) ^ $crctab[ ( ($crc >> (16-8)) ^ ord($_) ) & 0xff ]; $crc &= 0xffff; } $$packref[16] = chr((($crc >> 8) & 0xff) ^ 0xff); $$packref[17] = chr(($crc & 0xff) ^ 0xff); } sub print_packet { return if ($#_ < 1); my @packet = (@_); add_crc(\@packet); if ($packet[0] ne chr(0x8f)) { printf STDERR ("%02x "x4 ." "."%c "x12 ." "."%02x "x2), map( defined($_) ? ord($_) : "___undef", @packet ); } else { printf STDERR ("%02x "x4 ." "."%02x "x12 ." "."%02x "x2), map( defined($_) ? ord($_) : "___undef", @packet ); } printf STDERR "\n"; push @results, @packet; } my $defaultperformer = $ARGV[0] || die "usage: ", $^X, " defaultperformer_name\n"; my $prefix = $ARGV[1] || "audio"; @ARGV = glob("${prefix}_??.inf"); my @albumtitles; my @tracktitles; my @performers; my $ISRC; my @ISRCs; my $MCN; my $performer; while (<>) { if (/^Performer=\s+'(.*?)'$/) { $performer = $1; } if (/^Albumtitle=\s+'(.*?)'$/) { push @albumtitles, $1; } if (/^Tracktitle=\s+'(.*?)'$/) { push @tracktitles, $1; } if (/^ISRC=\s+(\S+?)$/) { $ISRC = $1; } if (/^MCN=\s+(\S+?)$/) { $MCN = $1; } if (eof) { close ARGV; $performer = $defaultperformer if (!defined($performer)); push @performers, $performer; $performer = undef; push @ISRCs, $ISRC; $ISRC = undef; } } # my $seq_nr = 0; my @todo; my $text; my $track; my $charpos; # build cdtext packets # build track titles @todo = ($albumtitles[0], @tracktitles); $text = shift @todo; $track = 0; $charpos = 0; while ($#todo > 1 || defined($text)) { fill_packet(0x80, \$track, \$seq_nr, \$charpos, \$text, \@todo); } my $trackpacks = $seq_nr; # store for later reference my $last_track = $track; # build performer entries #@todo = ($performer) x (1 + scalar(@tracktitles)); @todo = ($defaultperformer, @performers); $text = shift @todo; $track = 0; $charpos = 0; while ($#todo > 1 || defined($text)) { fill_packet(0x81, \$track, \$seq_nr, \$charpos, \$text, \@todo); } my $perfpacks = $seq_nr - $trackpacks; # store for later reference # build ISRC entries @todo = ($MCN, @ISRCs); $text = shift @todo; $track = 0; $charpos = 0; while ($#todo > 1 || defined($text)) { $text = "" if (!defined($text)); fill_packet(0x8e, \$track, \$seq_nr, \$charpos, \$text, \@todo); } my $isrcpacks = $seq_nr - $trackpacks - $perfpacks; # store for later reference # build size information blocks my $size1 = chr(0) . chr(1) . chr($last_track) . chr(0) . chr($trackpacks) . chr($perfpacks) . chr(0) x 5; my $size2 = chr(0) x 6 . chr($isrcpacks) . chr(3) . chr($seq_nr+2) . chr(0) x 2; my $size3 = chr(0) x 4 . chr(9); # hard coded language 09 = english @todo = ($size1, $size2, $size3); $text = shift @todo; $track = 0; $charpos = 0; while ((defined($text) && $text ne "") ) { fill_packet(0x8f, \$track, \$seq_nr, \$charpos, \$text, \@todo); } # write out the results my $size = @results + 2; print chr($size >> 8), chr($size & 0xff), chr(0), chr(0), @results; �������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/cdda2ogg.mk1�������������������������������������������������������������������0000644�0003725�0000144�00000001251�10471375025�015450� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ident @(#)Makefile.man 1.1 00/03/21 ########################################################################### # Sample makefile for installing manual pages ########################################################################### SRCROOT= .. RULESDIR= RULES include $(SRCROOT)/$(RULESDIR)/rules.top ########################################################################### MANDIR= man TARGETMAN= cdda2ogg MANSECT= $(MANSECT_CMD) MANSUFFIX= $(MANSUFF_CMD) MANFILE= cdda2ogg.1 ########################################################################### include $(SRCROOT)/$(RULESDIR)/rules.man ########################################################################### �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/config.h�����������������������������������������������������������������������0000644�0003725�0000144�00000003710�10477233650�015007� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)config.h 1.7 03/10/06 Copyright 1998-2003 Heiko Eissfeldt */ /* * a central configuration file */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <mconfig.h> #if __STDC__-0 != 0 || (defined PROTOTYPES && defined STDC_HEADERS) #define UINT_C(a) (a##u) #define ULONG_C(a) (a##ul) #define USHORT_C(a) (a##uh) #define CONCAT(a,b) a##b #else #define UINT_C(a) ((unsigned) a) #define ULONG_C(a) ((unsigned long) a) #define USHORT_C(a) ((unsigned short) a) #define CONCAT(a,b) a/**/b #endif #include "lconfig.h" /* temporary until a autoconf check is present */ #ifdef __BEOS__ #define HAVE_AREAS 1 #endif #if defined HAVE_FORK && (defined (HAVE_SMMAP) || defined(HAVE_USGSHM) || defined(HAVE_DOSALLOCSHAREDMEM) || defined (HAVE_AREAS)) #define HAVE_FORK_AND_SHAREDMEM #undef FIFO #define FIFO #else #undef FIFO #endif #if !defined HAVE_MEMMOVE #define memmove(dst, src, size) movebytes((src), (dst), (size)) #endif ��������������������������������������������������������cdrkit-1.1.11/icedax/configure����������������������������������������������������������������������0000755�0003725�0000144�00000126152�10471375025�015303� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -cc=* | --cc=* ) CC="$ac_optarg" ; echo using $CC as compiler ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=cdda2wav.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 echo "configure:556: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 CDRTOOLS_VERSION=`sed -n -f ../../version.sed <../../../cdrecord/cdrecord.c` case "$host_os" in solaris*|sunos*) echo $ac_n "checking for sched_get_priority_max in -lposix4""... $ac_c" 1>&6 echo "configure:584: checking for sched_get_priority_max in -lposix4" >&5 ac_lib_var=`echo posix4'_'sched_get_priority_max | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lposix4 $LIBS" cat > conftest.$ac_ext <<EOF #line 592 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sched_get_priority_max(); int main() { sched_get_priority_max() ; return 0; } EOF if { (eval echo configure:603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo posix4 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF LIBS="-lposix4 $LIBS" else echo "$ac_t""no" 1>&6 fi ;; esac echo $ac_n "checking for _oss_ioctl in -lossaudio""... $ac_c" 1>&6 echo "configure:633: checking for _oss_ioctl in -lossaudio" >&5 ac_lib_var=`echo ossaudio'_'_oss_ioctl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lossaudio $LIBS" cat > conftest.$ac_ext <<EOF #line 641 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _oss_ioctl(); int main() { _oss_ioctl() ; return 0; } EOF if { (eval echo configure:652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo ossaudio | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF LIBS="-lossaudio $LIBS" else echo "$ac_t""no" 1>&6 fi EXTRALIBS="$LIBS" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:685: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF #line 700 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF #line 717 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF #line 734 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 for ac_hdr in sys/cdio.h sys/cdrio.h sundev/srreg.h sys/audioio.h sun/audioio.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:768: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF #line 773 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF else echo "$ac_t""no" 1>&6 fi done for ac_hdr in soundcard.h sys/soundcard.h linux/soundcard.h machine/soundcard.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:808: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF #line 813 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF else echo "$ac_t""no" 1>&6 fi done for ac_hdr in sys/asoundlib.h windows.h mmsystem.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:848: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF #line 853 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF else echo "$ac_t""no" 1>&6 fi done for ac_hdr in os2.h os2me.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:888: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF #line 893 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF else echo "$ac_t""no" 1>&6 fi done case "${ac_cv_header_sys_cdio_h}""${ac_cv_header_sundev_srreg_h}" in *yes*) HAVE_SUN_IOCTL=1 ;; *) HAVE_SUN_IOCTL= ;; esac case "${ac_cv_header_sys_audioio_h}""${ac_cv_header_sun_audioio_h}" in *yes*) HAVE_SUNSOUND=1 ;; *) HAVE_SUNSOUND= ;; esac case "${ac_cv_header_machine_soundcard_h}""${ac_cv_header_sys_soundcard_h}""${ac_cv_header_linux_soundcard_h}" in *yes*) HAVE_OSS=1 ;; *) HAVE_OSS= ;; esac case "${ac_cv_header_windows_h}""${ac_cv_header_mmsystem_h}" in *yesyes*) HAVE_WINSOUND=1 ;; *) HAVE_WINSOUND= ;; esac case "${ac_cv_header_os2_h}""${ac_cv_header_os2me_h}" in *yesyes*) HAVE_OS2SOUND=1 ;; *) HAVE_OS2SOUND= ;; esac for ac_func in strtoul do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:980: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF #line 985 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:1008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <<EOF #define $ac_tr_func 1 EOF else echo "$ac_t""no" 1>&6 fi done trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS <<EOF #! /bin/sh # Generated automatically by configure. # Run this file to recreate the current configuration. # This directory was configured as follows, # on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir trap 'rm -fr `echo "local.cnf lconfig.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <<EOF # Protect against being on the right side of a sed subst in config.status. sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g s%@host_vendor@%$host_vendor%g s%@host_os@%$host_os%g s%@CDRTOOLS_VERSION@%$CDRTOOLS_VERSION%g s%@EXTRALIBS@%$EXTRALIBS%g s%@CPP@%$CPP%g s%@HAVE_SUN_IOCTL@%$HAVE_SUN_IOCTL%g s%@HAVE_SUNSOUND@%$HAVE_SUNSOUND%g s%@HAVE_OSS@%$HAVE_OSS%g s%@HAVE_SYS_ASOUNDLIB_H@%$HAVE_SYS_ASOUNDLIB_H%g s%@HAVE_WINSOUND@%$HAVE_WINSOUND%g s%@HAVE_OS2SOUND@%$HAVE_OS2SOUND%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <<EOF CONFIG_FILES=\${CONFIG_FILES-"local.cnf"} EOF cat >> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <<EOF CONFIG_HEADERS="lconfig.h" EOF cat >> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <<EOF EOF cat >> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/exitcodes.h��������������������������������������������������������������������0000644�0003725�0000144�00000001752�10477233650�015535� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)exitcodes.h 1.1 02/11/21 Copyright 2002 Heiko Eissfeldt */ /* header file for system wide exit codes. */ #ifndef exitcodes_h #define exitcodes_h #define NO_ERROR 0 #define SYNTAX_ERROR 1 #define PERM_ERROR 2 #define READ_ERROR 3 #define WRITE_ERROR 4 #define SOUND_ERROR 5 #define STAT_ERROR 6 #define SIGPIPE_ERROR 7 #define SETSIG_ERROR 8 #define SHMMEM_ERROR 9 #define NOMEM_ERROR 10 #define MEDIA_ERROR 11 #define DEVICEOPEN_ERROR 12 #define RACE_ERROR 13 #define DEVICE_ERROR 14 #define INTERNAL_ERROR 15 #define SEMAPHORE_ERROR 16 #define SETUPSCSI_ERROR 17 #define PIPE_ERROR 18 #endif ����������������������cdrkit-1.1.11/icedax/setuid.h�����������������������������������������������������������������������0000644�0003725�0000144�00000001531�10513514665�015035� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)setuid.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ /* Security functions */ void initsecurity(void); void needroot(int necessary); void dontneedroot(void); void neverneedroot(void); void needgroup(int necessary); void dontneedgroup(void); void neverneedgroup(void); #if defined (HPUX) #define HAVE_SETREUID #define HAVE_SETREGID int seteuid(uid_t uid); int setreuid(uid_t uid1, uid_t uid2); int setregid(gid_t gid1, gid_t gid2); #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/scsi_cmds.c��������������������������������������������������������������������0000644�0003725�0000144�00000144346�10536265343�015517� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)scsi_cmds.c 1.29 03/03/31 Copyright 1998-2002 Heiko Eissfeldt */ /* file for all SCSI commands * FUA (Force Unit Access) bit handling copied from Monty's cdparanoia. */ #undef DEBUG_FULLTOC #undef WARN_FULLTOC #define TESTSUBQFALLBACK 0 #include "config.h" #include <stdio.h> #include <standard.h> #include <stdxlib.h> #include <strdefs.h> #include <schily.h> #include <btorder.h> #define g5x_cdblen(cdb, len) ((cdb)->count[0] = ((len) >> 16L)& 0xFF,\ (cdb)->count[1] = ((len) >> 8L) & 0xFF,\ (cdb)->count[2] = (len) & 0xFF) #include <usal/usalcmd.h> #include <usal/scsidefs.h> #include <usal/scsireg.h> #include <usal/scsitransp.h> #include "mytype.h" #include "icedax.h" #include "interface.h" #include "byteorder.h" #include "global.h" #include "wodim.h" #include "toc.h" #include "scsi_cmds.h" #include "exitcodes.h" unsigned char *bufferTOC; subq_chnl *SubQbuffer; unsigned char *cmd; static unsigned ReadFullTOCSony(SCSI *usalp); static unsigned ReadFullTOCMMC(SCSI *usalp); int SCSI_emulated_ATAPI_on(SCSI *usalp) { /* return is_atapi;*/ if (usal_isatapi(usalp) > 0) return (TRUE); (void) allow_atapi(usalp, TRUE); return (allow_atapi(usalp, TRUE)); } int heiko_mmc(SCSI *usalp) { unsigned char mode[0x100]; int was_atapi; struct cd_mode_page_2A *mp; int retval; fillbytes((caddr_t)mode, sizeof(mode), '\0'); was_atapi = allow_atapi(usalp, 1); usalp->silent++; mp = mmc_cap(usalp, mode); usalp->silent--; allow_atapi(usalp, was_atapi); if (mp == NULL) return (0); /* have a look at the capabilities */ if (mp->cd_da_supported == 0) { retval = -1; } else { retval = 1 + mp->cd_da_accurate; } return retval; } int accepts_fua_bit; unsigned char density = 0; unsigned char orgmode4 = 0; unsigned char orgmode10, orgmode11; /* get current sector size from SCSI cdrom drive */ unsigned int get_orig_sectorsize(SCSI *usalp, unsigned char *m4, unsigned char *m10, unsigned char *m11) { /* first get current values for density, etc. */ static unsigned char *modesense = NULL; if (modesense == NULL) { modesense = malloc(12); if (modesense == NULL) { fprintf(stderr, "Cannot allocate memory for mode sense command in line %d\n", __LINE__); return 0; } } /* do the scsi cmd */ if (usalp->verbose) fprintf(stderr, "\nget density and sector size..."); if (mode_sense(usalp, modesense, 12, 0x01, 0) < 0) fprintf(stderr, "get_orig_sectorsize mode sense failed\n"); /* FIXME: some drives dont deliver block descriptors !!! */ if (modesense[3] == 0) return 0; #if 0 modesense[4] = 0x81; modesense[10] = 0x08; modesense[11] = 0x00; #endif if (m4 != NULL) /* density */ *m4 = modesense[4]; if (m10 != NULL) /* MSB sector size */ *m10 = modesense[10]; if (m11 != NULL) /* LSB sector size */ *m11 = modesense[11]; return (modesense[10] << 8) + modesense[11]; } /* switch CDROM scsi drives to given sector size */ int set_sectorsize(SCSI *usalp, unsigned int secsize) { static unsigned char mode [4 + 8]; int retval; if (orgmode4 == 0xff) { get_orig_sectorsize(usalp, &orgmode4, &orgmode10, &orgmode11); } if (orgmode4 == 0x82 && secsize == 2048) orgmode4 = 0x81; /* prepare to read cds in the previous mode */ fillbytes((caddr_t)mode, sizeof(mode), '\0'); mode[ 3] = 8; /* Block Descriptor Length */ mode[ 4] = orgmode4; /* normal density */ mode[10] = secsize >> 8; /* block length "msb" */ mode[11] = secsize & 0xFF; /* block length lsb */ if (usalp->verbose) fprintf(stderr, "\nset density and sector size..."); /* do the scsi cmd */ if ((retval = mode_select(usalp, mode, 12, 0, usalp->inq->data_format >= 2)) < 0) fprintf (stderr, "setting sector size failed\n"); return retval; } /* switch Toshiba/DEC and HP drives from/to cdda density */ void EnableCddaModeSelect(SCSI *usalp, int fAudioMode, unsigned uSectorsize) { /* reserved, Medium type=0, Dev spec Parm = 0, block descriptor len 0 oder 8, Density (cd format) (0=YellowBook, XA Mode 2=81h, XA Mode1=83h and raw audio via SCSI=82h), # blks msb, #blks, #blks lsb, reserved, blocksize, blocklen msb, blocklen lsb, */ /* MODE_SELECT, page = SCSI-2 save page disabled, reserved, reserved, parm list len, flags */ static unsigned char mode [4 + 8] = { /* mode section */ 0, 0, 0, 8, /* Block Descriptor Length */ /* block descriptor */ 0, /* Density Code */ 0, 0, 0, /* # of Blocks */ 0, /* reserved */ 0, 0, 0};/* Blocklen */ if (orgmode4 == 0 && fAudioMode) { if (0 == get_orig_sectorsize(usalp, &orgmode4, &orgmode10, &orgmode11)) { /* cannot retrieve density, sectorsize */ orgmode10 = (CD_FRAMESIZE >> 8L); orgmode11 = (CD_FRAMESIZE & 0xFF); } } if (fAudioMode) { /* prepare to read audio cdda */ mode [4] = density; /* cdda density */ mode [10] = (uSectorsize >> 8L); /* block length "msb" */ mode [11] = (uSectorsize & 0xFF); /* block length "lsb" */ } else { /* prepare to read cds in the previous mode */ mode [4] = orgmode4; /* 0x00; \* normal density */ mode [10] = orgmode10; /* (CD_FRAMESIZE >> 8L); \* block length "msb" */ mode [11] = orgmode11; /* (CD_FRAMESIZE & 0xFF); \* block length lsb */ } if (usalp->verbose) fprintf(stderr, "\nset density/sector size (EnableCddaModeSelect)...\n"); /* do the scsi cmd */ if (mode_select(usalp, mode, 12, 0, usalp->inq->data_format >= 2) < 0) fprintf (stderr, "Audio mode switch failed\n"); } /* read CD Text information from the table of contents */ void ReadTocTextSCSIMMC(SCSI *usalp) { short datalength; #if 1 /* READTOC, MSF, format, res, res, res, Start track/session, len msb, len lsb, control */ unsigned char *p = bufferTOC; register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)bufferTOC; scmd->size = 4; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x43; /* Read TOC command */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.addr[0] = 5; /* format field */ scmd->cdb.g1_cdb.res6 = 0; /* track/session is reserved */ g1_cdblen(&scmd->cdb.g1_cdb, 4); usalp->silent++; if (usalp->verbose) fprintf(stderr, "\nRead TOC CD Text size ..."); usalp->cmdname = "read toc size (text)"; if (usal_cmd(usalp) < 0) { usalp->silent--; if (global.quiet != 1) fprintf (stderr, "Read TOC CD Text failed (probably not supported).\n"); p[0] = p[1] = '\0'; return ; } usalp->silent--; datalength = (p[0] << 8) | (p[1]); if (datalength <= 2) return; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)bufferTOC; scmd->size = 2+datalength; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x43; /* Read TOC command */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.addr[0] = 5; /* format field */ scmd->cdb.g1_cdb.res6 = 0; /* track/session is reserved */ g1_cdblen(&scmd->cdb.g1_cdb, 2+datalength); usalp->silent++; if (usalp->verbose) fprintf(stderr, "\nRead TOC CD Text data (length %hd)...", 2+datalength); usalp->cmdname = "read toc data (text)"; if (usal_cmd(usalp) < 0) { usalp->silent--; if (global.quiet != 1) fprintf (stderr, "Read TOC CD Text data failed (probably not supported).\n"); p[0] = p[1] = '\0'; return ; } usalp->silent--; #else { FILE *fp; int read_; /*fp = fopen("PearlJam.cdtext", "rb");*/ /*fp = fopen("celine.cdtext", "rb");*/ fp = fopen("japan.cdtext", "rb"); if (fp == NULL) { perror(""); return; } fillbytes(bufferTOC, CD_FRAMESIZE, '\0'); read_ = fread(bufferTOC, 1, CD_FRAMESIZE, fp ); fprintf(stderr, "read %d bytes. sizeof(bufferTOC)=%u\n", read_, CD_FRAMESIZE); datalength = (bufferTOC[0] << 8) | (bufferTOC[1]); fclose(fp); } #endif } /* read the full TOC */ static unsigned ReadFullTOCSony(SCSI *usalp) { /* READTOC, MSF, format, res, res, res, Start track/session, len msb, len lsb, control */ register struct usal_cmd *scmd = usalp->scmd; unsigned tracks = 99; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)bufferTOC; scmd->size = 4 + (3 + tracks + 6) * 11; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x43; /* Read TOC command */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.res6 = 1; /* session */ g1_cdblen(&scmd->cdb.g1_cdb, 4 + (3 + tracks + 6) * 11); scmd->cdb.g1_cdb.vu_97 = 1; /* format */ usalp->silent++; if (usalp->verbose) fprintf(stderr, "\nRead Full TOC Sony ..."); usalp->cmdname = "read full toc sony"; if (usal_cmd(usalp) < 0) { usalp->silent--; if (global.quiet != 1) fprintf (stderr, "Read Full TOC Sony failed (probably not supported).\n"); return 0; } usalp->silent--; return (unsigned)((bufferTOC[0] << 8) | bufferTOC[1]); } struct msf_address { unsigned char mins; unsigned char secs; unsigned char frame; }; struct zmsf_address { unsigned char zero; unsigned char mins; unsigned char secs; unsigned char frame; }; #ifdef WARN_FULLTOC static unsigned lba(struct msf_address *ad); static unsigned lba(struct msf_address *ad) { return ad->mins*60*75 + ad->secs*75 + ad->frame; } #endif static unsigned dvd_lba(struct zmsf_address *ad); static unsigned dvd_lba(struct zmsf_address *ad) { return ad->zero*1053696 + ad->mins*60*75 + ad->secs*75 + ad->frame; } struct tocdesc { unsigned char session; unsigned char adrctl; unsigned char tno; unsigned char point; struct msf_address adr1; struct zmsf_address padr2; }; struct outer { unsigned char len_msb; unsigned char len_lsb; unsigned char first_track; unsigned char last_track; struct tocdesc ent[1]; }; static unsigned long first_session_leadout = 0; static unsigned collect_tracks(struct outer *po, unsigned entries, BOOL bcd_flag); static unsigned collect_tracks(struct outer *po, unsigned entries, BOOL bcd_flag) { unsigned tracks = 0; int i; unsigned session; unsigned last_start; unsigned leadout_start_orig; unsigned leadout_start; unsigned max_leadout = 0; #ifdef DEBUG_FULLTOC for (i = 0; i < entries; i++) { fprintf(stderr, "%3d: %d %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n" ,i ,bufferTOC[4+0 + (i * 11)] ,bufferTOC[4+1 + (i * 11)] ,bufferTOC[4+2 + (i * 11)] ,bufferTOC[4+3 + (i * 11)] ,bufferTOC[4+4 + (i * 11)] ,bufferTOC[4+5 + (i * 11)] ,bufferTOC[4+6 + (i * 11)] ,bufferTOC[4+7 + (i * 11)] ,bufferTOC[4+8 + (i * 11)] ,bufferTOC[4+9 + (i * 11)] ,bufferTOC[4+10 + (i * 11)] ); } #endif /* reformat to standard toc format */ bufferTOC[2] = 0; bufferTOC[3] = 0; session = 0; last_start = 0; leadout_start_orig = 0; leadout_start = 0; for (i = 0; i < entries; i++) { #ifdef WARN_FULLTOC if (po->ent[i].tno != 0) { fprintf(stderr, "entry %d, tno is not 0: %d!\n", i, po->ent[i].tno); } #endif if (bcd_flag) { po->ent[i].session = from_bcd(po->ent[i].session); po->ent[i].adr1.mins = from_bcd(po->ent[i].adr1.mins); po->ent[i].adr1.secs = from_bcd(po->ent[i].adr1.secs); po->ent[i].adr1.frame = from_bcd(po->ent[i].adr1.frame); po->ent[i].padr2.mins = from_bcd(po->ent[i].padr2.mins); po->ent[i].padr2.secs = from_bcd(po->ent[i].padr2.secs); po->ent[i].padr2.frame = from_bcd(po->ent[i].padr2.frame); } switch (po->ent[i].point) { case 0xa0: /* check if session is monotonous increasing */ if (session+1 == po->ent[i].session) { session = po->ent[i].session; } #ifdef WARN_FULLTOC else fprintf(stderr, "entry %d, session anomaly %d != %d!\n", i, session+1, po->ent[i].session); /* check the adrctl field */ if (0x10 != (po->ent[i].adrctl & 0x10)) { fprintf(stderr, "entry %d, incorrect adrctl field %x!\n", i, po->ent[i].adrctl); } #endif /* first track number */ if (bufferTOC[2] < po->ent[i].padr2.mins && bufferTOC[3] < po->ent[i].padr2.mins) { bufferTOC[2] = po->ent[i].padr2.mins; } #ifdef WARN_FULLTOC else fprintf(stderr, "entry %d, session %d: start tracknumber anomaly: %d <= %d,%d(last)!\n", i, session, po->ent[i].padr2.mins, bufferTOC[2], bufferTOC[3]); #endif break; case 0xa1: #ifdef WARN_FULLTOC /* check if session is constant */ if (session != po->ent[i].session) { fprintf(stderr, "entry %d, session anomaly %d != %d!\n", i, session, po->ent[i].session); } /* check the adrctl field */ if (0x10 != (po->ent[i].adrctl & 0x10)) { fprintf(stderr, "entry %d, incorrect adrctl field %x!\n", i, po->ent[i].adrctl); } #endif /* last track number */ if (bufferTOC[2] <= po->ent[i].padr2.mins && bufferTOC[3] < po->ent[i].padr2.mins) { bufferTOC[3] = po->ent[i].padr2.mins; } #ifdef WARN_FULLTOC else fprintf(stderr, "entry %d, session %d: end tracknumber anomaly: %d <= %d,%d(last)!\n", i, session, po->ent[i].padr2.mins, bufferTOC[2], bufferTOC[3]); #endif break; case 0xa2: #ifdef WARN_FULLTOC /* check if session is constant */ if (session != po->ent[i].session) { fprintf(stderr, "entry %d, session anomaly %d != %d!\n", i, session, po->ent[i].session); } /* check the adrctl field */ if (0x10 != (po->ent[i].adrctl & 0x10)) { fprintf(stderr, "entry %d, incorrect adrctl field %x!\n", i, po->ent[i].adrctl); } #endif /* register leadout position */ { unsigned leadout_start_tmp = dvd_lba(&po->ent[i].padr2); if (first_session_leadout == 0) first_session_leadout = leadout_start_tmp - 150; if (leadout_start_tmp > leadout_start) { leadout_start_orig = leadout_start_tmp; leadout_start = leadout_start_tmp; } #ifdef WARN_FULLTOC else fprintf(stderr, "entry %d, leadout position anomaly %u!\n", i, leadout_start_tmp); #endif } break; case 0xb0: #ifdef WARN_FULLTOC /* check if session is constant */ if (session != po->ent[i].session) { fprintf(stderr, "entry %d, session anomaly %d != %d!\n", i, session, po->ent[i].session); } /* check the adrctl field */ if (0x50 != (po->ent[i].adrctl & 0x50)) { fprintf(stderr, "entry %d, incorrect adrctl field %x!\n", i, po->ent[i].adrctl); } /* check the next program area */ if (lba(&po->ent[i].adr1) < 6750 + leadout_start) { fprintf(stderr, "entry %d, next program area %u < leadout_start + 6750 = %u!\n", i, lba(&po->ent[i].adr1), 6750 + leadout_start); } /* check the maximum leadout_start */ if (max_leadout != 0 && dvd_lba(&po->ent[i].padr2) != max_leadout) { fprintf(stderr, "entry %d, max leadout_start %u != last max_leadout_start %u!\n", i, dvd_lba(&po->ent[i].padr2), max_leadout); } #endif if (max_leadout == 0) max_leadout = dvd_lba(&po->ent[i].padr2); break; case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: break; case 0xc0: case 0xc1: break; default: /* check if session is constant */ if (session != po->ent[i].session) { #ifdef WARN_FULLTOC fprintf(stderr, "entry %d, session anomaly %d != %d!\n", i, session, po->ent[i].session); #endif continue; } /* check tno */ if (bcd_flag) po->ent[i].point = from_bcd(po->ent[i].point); if (po->ent[i].point < bufferTOC[2] || po->ent[i].point > bufferTOC[3]) { #ifdef WARN_FULLTOC fprintf(stderr, "entry %d, track number anomaly %d - %d - %d!\n", i, bufferTOC[2], po->ent[i].point, bufferTOC[3]); #endif } else { /* check start position */ unsigned trackstart = dvd_lba(&po->ent[i].padr2); /* correct illegal leadouts */ if (leadout_start < trackstart) { leadout_start = trackstart+1; } if (trackstart < last_start || trackstart >= leadout_start) { #ifdef WARN_FULLTOC fprintf(stderr, "entry %d, track %d start position anomaly %d - %d - %d!\n", i, po->ent[i].point, last_start, trackstart, leadout_start); #endif } else { last_start = trackstart; memcpy(&po->ent[tracks], &po->ent[i], sizeof(struct tocdesc)); tracks++; } } } /* switch */ } /* for */ /* patch leadout track */ po->ent[tracks].session = session; po->ent[tracks].adrctl = 0x10; po->ent[tracks].tno = 0; po->ent[tracks].point = 0xAA; po->ent[tracks].adr1.mins = 0; po->ent[tracks].adr1.secs = 0; po->ent[tracks].adr1.frame = 0; po->ent[tracks].padr2.zero = leadout_start_orig / (1053696); po->ent[tracks].padr2.mins = (leadout_start_orig / (60*75)) % 100; po->ent[tracks].padr2.secs = (leadout_start_orig / 75) % 60; po->ent[tracks].padr2.frame = leadout_start_orig % 75; tracks++; /* length */ bufferTOC[0] = ((tracks * 8) + 2) >> 8; bufferTOC[1] = ((tracks * 8) + 2) & 0xff; /* reformat 11 byte blocks to 8 byte entries */ /* 1: Session \ / reserved 2: adr ctrl | | adr ctrl 3: TNO | | track number 4: Point | | reserved 5: Min +-->----+ 0 6: Sec | | Min 7: Frame | | Sec 8: Zero | \ Frame 9: PMin | 10: PSec | 11: PFrame / */ for (i = 0; i < tracks; i++) { bufferTOC[4+0 + (i << 3)] = 0; bufferTOC[4+1 + (i << 3)] = bufferTOC[4+1 + (i*11)]; bufferTOC[4+1 + (i << 3)] = (bufferTOC[4+1 + (i << 3)] >> 4) | (bufferTOC[4+1 + (i << 3)] << 4); bufferTOC[4+2 + (i << 3)] = bufferTOC[4+3 + (i*11)]; bufferTOC[4+3 + (i << 3)] = 0; bufferTOC[4+4 + (i << 3)] = bufferTOC[4+7 + (i*11)]; bufferTOC[4+5 + (i << 3)] = bufferTOC[4+8 + (i*11)]; bufferTOC[4+6 + (i << 3)] = bufferTOC[4+9 + (i*11)]; bufferTOC[4+7 + (i << 3)] = bufferTOC[4+10 + (i*11)]; #ifdef DEBUG_FULLTOC fprintf(stderr, "%02x %02x %02x %02x %02x %02x\n" ,bufferTOC[4+ 1 + i*8] ,bufferTOC[4+ 2 + i*8] ,bufferTOC[4+ 4 + i*8] ,bufferTOC[4+ 5 + i*8] ,bufferTOC[4+ 6 + i*8] ,bufferTOC[4+ 7 + i*8] ); #endif } TOC_entries(tracks, NULL, bufferTOC+4, 0); return tracks; } /* read the table of contents from the cd and fill the TOC array */ unsigned ReadTocSony(SCSI *usalp) { unsigned tracks = 0; unsigned return_length; struct outer *po = (struct outer *)bufferTOC; return_length = ReadFullTOCSony(usalp); /* Check if the format was understood */ if ((return_length & 7) == 2 && (bufferTOC[3] - bufferTOC[2]) == (return_length >> 3)) { /* The extended format seems not be understood, fallback to * the classical format. */ return ReadTocSCSI( usalp ); } tracks = collect_tracks(po, ((return_length - 2) / 11), TRUE); return --tracks; /* without lead-out */ } /* read the start of the lead-out from the first session TOC */ unsigned ReadFirstSessionTOCSony(SCSI *usalp) { unsigned return_length; if (first_session_leadout != 0) return first_session_leadout; return_length = ReadFullTOCSony(usalp); if (return_length >= 4 + (3 * 11) -2) { unsigned off; /* We want the entry with POINT = 0xA2, which has the start position of the first session lead out */ off = 4 + 2 * 11 + 3; if (bufferTOC[off-3] == 1 && bufferTOC[off] == 0xA2) { unsigned retval; off = 4 + 2 * 11 + 8; retval = bufferTOC[off] >> 4; retval *= 10; retval += bufferTOC[off] & 0xf; retval *= 60; off++; retval += 10 * (bufferTOC[off] >> 4) + (bufferTOC[off] & 0xf); retval *= 75; off++; retval += 10 * (bufferTOC[off] >> 4) + (bufferTOC[off] & 0xf); retval -= 150; return retval; } } return 0; } /* read the full TOC */ static unsigned ReadFullTOCMMC(SCSI *usalp) { /* READTOC, MSF, format, res, res, res, Start track/session, len msb, len lsb, control */ register struct usal_cmd *scmd = usalp->scmd; unsigned tracks = 99; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)bufferTOC; scmd->size = 4 + (tracks + 8) * 11; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x43; /* Read TOC command */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.addr[0] = 2; /* format */ scmd->cdb.g1_cdb.res6 = 1; /* session */ g1_cdblen(&scmd->cdb.g1_cdb, 4 + (tracks + 8) * 11); usalp->silent++; if (usalp->verbose) fprintf(stderr, "\nRead Full TOC MMC..."); usalp->cmdname = "read full toc mmc"; if (usal_cmd(usalp) < 0) { if (global.quiet != 1) fprintf (stderr, "Read Full TOC MMC failed (probably not supported).\n"); #ifdef B_BEOS_VERSION #else usalp->silent--; return 0; #endif } usalp->silent--; return (unsigned)((bufferTOC[0] << 8) | bufferTOC[1]); } /* read the start of the lead-out from the first session TOC */ unsigned ReadFirstSessionTOCMMC(SCSI *usalp) { unsigned off; unsigned return_length; if (first_session_leadout != 0) return first_session_leadout; return_length = ReadFullTOCMMC(usalp); /* We want the entry with POINT = 0xA2, which has the start position of the first session lead out */ off = 4 + 3; while (off < return_length && bufferTOC[off] != 0xA2) { off += 11; } if (off < return_length) { off += 5; return (bufferTOC[off]*60 + bufferTOC[off+1])*75 + bufferTOC[off+2] - 150; } return 0; } /* read the table of contents from the cd and fill the TOC array */ unsigned ReadTocMMC(SCSI *usalp) { unsigned tracks = 0; unsigned return_length; struct outer *po = (struct outer *)bufferTOC; return_length = ReadFullTOCMMC(usalp); if (return_length - 2 < 4*11 || ((return_length - 2) % 11) != 0) return ReadTocSCSI(usalp); tracks = collect_tracks(po, ((return_length - 2) / 11), FALSE); return --tracks; /* without lead-out */ } /* read the table of contents from the cd and fill the TOC array */ unsigned ReadTocSCSI(SCSI *usalp) { unsigned tracks; int result; unsigned char bufferTOCMSF[CD_FRAMESIZE]; /* first read the first and last track number */ /* READTOC, MSF format flag, res, res, res, res, Start track, len msb, len lsb, flags */ register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)bufferTOC; scmd->size = 4; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x43; /* read TOC command */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.res6 = 1; /* start track */ g1_cdblen(&scmd->cdb.g1_cdb, 4); if (usalp->verbose) fprintf(stderr, "\nRead TOC size (standard)..."); /* do the scsi cmd (read table of contents) */ usalp->cmdname = "read toc size"; if (usal_cmd(usalp) < 0) FatalError ("Read TOC size failed.\n"); tracks = ((bufferTOC [3] ) - bufferTOC [2] + 2) ; if (tracks > MAXTRK) return 0; if (tracks == 0) return 0; memset(bufferTOCMSF, 0, sizeof(bufferTOCMSF)); fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)bufferTOCMSF; scmd->size = 4 + tracks * 8; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x43; /* read TOC command */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.res = 1; /* MSF format */ scmd->cdb.g1_cdb.res6 = 1; /* start track */ g1_cdblen(&scmd->cdb.g1_cdb, 4 + tracks * 8); if (usalp->verbose) fprintf(stderr, "\nRead TOC tracks (standard MSF)..."); /* do the scsi cmd (read table of contents) */ usalp->cmdname = "read toc tracks "; result = usal_cmd(usalp); if (result < 0) { /* MSF format did not succeeded */ memset(bufferTOCMSF, 0, sizeof(bufferTOCMSF)); } else { int i; for (i = 0; i < tracks; i++) { bufferTOCMSF[4+1 + (i << 3)] = (bufferTOCMSF[4+1 + (i << 3)] >> 4) | (bufferTOCMSF[4+1 + (i << 3)] << 4); #if 0 fprintf(stderr, "MSF %d %02x %02x %02x %02x %02x %02x %02x %02x\n" ,i ,bufferTOCMSF[4+0 + (i * 8)] ,bufferTOCMSF[4+1 + (i * 8)] ,bufferTOCMSF[4+2 + (i * 8)] ,bufferTOCMSF[4+3 + (i * 8)] ,bufferTOCMSF[4+4 + (i * 8)] ,bufferTOCMSF[4+5 + (i * 8)] ,bufferTOCMSF[4+6 + (i * 8)] ,bufferTOCMSF[4+7 + (i * 8)] ); #endif } } /* LBA format for cd burners like Philips CD-522 */ fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)bufferTOC; scmd->size = 4 + tracks * 8; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x43; /* read TOC command */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.res = 0; /* LBA format */ scmd->cdb.g1_cdb.res6 = 1; /* start track */ g1_cdblen(&scmd->cdb.g1_cdb, 4 + tracks * 8); if (usalp->verbose) fprintf(stderr, "\nRead TOC tracks (standard LBA)..."); /* do the scsi cmd (read table of contents) */ usalp->cmdname = "read toc tracks "; if (usal_cmd(usalp) < 0) { FatalError ("Read TOC tracks (lba) failed.\n"); } { int i; for (i = 0; i < tracks; i++) { bufferTOC[4+1 + (i << 3)] = (bufferTOC[4+1 + (i << 3)] >> 4) | (bufferTOC[4+1 + (i << 3)] << 4); #if 0 fprintf(stderr, "LBA %d %02x %02x %02x %02x %02x %02x %02x %02x\n" ,i ,bufferTOC[4+0 + (i * 8)] ,bufferTOC[4+1 + (i * 8)] ,bufferTOC[4+2 + (i * 8)] ,bufferTOC[4+3 + (i * 8)] ,bufferTOC[4+4 + (i * 8)] ,bufferTOC[4+5 + (i * 8)] ,bufferTOC[4+6 + (i * 8)] ,bufferTOC[4+7 + (i * 8)] ); #endif } } TOC_entries(tracks, bufferTOC+4, bufferTOCMSF+4, result); return --tracks; /* without lead-out */ } /* ---------------- Read methods ------------------------------ */ /* Read max. SectorBurst of cdda sectors to buffer via standard SCSI-2 Read(10) command */ static int ReadStandardLowlevel(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal, unsigned secsize); static int ReadStandardLowlevel(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal, unsigned secsize) { /* READ10, flags, block1 msb, block2, block3, block4 lsb, reserved, transfer len msb, transfer len lsb, block addressing mode */ register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)p; scmd->size = SectorBurstVal * secsize; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x28; /* read 10 command */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.res |= (accepts_fua_bit == 1 ? 1 << 2 : 0); g1_cdbaddr(&scmd->cdb.g1_cdb, lSector); g1_cdblen(&scmd->cdb.g1_cdb, SectorBurstVal); if (usalp->verbose) fprintf(stderr, "\nReadStandard10 %s (%u)...", secsize > 2048 ? "CDDA" : "CD_DATA", secsize); usalp->cmdname = "ReadStandard10"; if (usal_cmd(usalp)) return 0; /* has all or something been read? */ return SectorBurstVal - usal_getresid(usalp)/secsize; } int ReadStandard(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { return ReadStandardLowlevel(usalp, p, lSector, SectorBurstVal, CD_FRAMESIZE_RAW); } int ReadStandardData(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { return ReadStandardLowlevel(usalp, p, lSector, SectorBurstVal, CD_FRAMESIZE); } /* Read max. SectorBurst of cdda sectors to buffer via vendor-specific ReadCdda(10) command */ int ReadCdda10(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { /* READ10, flags, block1 msb, block2, block3, block4 lsb, reserved, transfer len msb, transfer len lsb, block addressing mode */ register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)p; scmd->size = SectorBurstVal*CD_FRAMESIZE_RAW; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0xd4; /* Read audio command */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.res |= (accepts_fua_bit == 1 ? 1 << 2 : 0); g1_cdbaddr(&scmd->cdb.g1_cdb, lSector); g1_cdblen(&scmd->cdb.g1_cdb, SectorBurstVal); if (usalp->verbose) fprintf(stderr, "\nReadNEC10 CDDA..."); usalp->cmdname = "Read10 NEC"; if (usal_cmd(usalp)) return 0; /* has all or something been read? */ return SectorBurstVal - usal_getresid(usalp)/CD_FRAMESIZE_RAW; } /* Read max. SectorBurst of cdda sectors to buffer via vendor-specific ReadCdda(12) command */ int ReadCdda12(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)p; scmd->size = SectorBurstVal*CD_FRAMESIZE_RAW; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G5_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g5_cdb.cmd = 0xd8; /* read audio command */ scmd->cdb.g5_cdb.lun = usal_lun(usalp); scmd->cdb.g5_cdb.res |= (accepts_fua_bit == 1 ? 1 << 2 : 0); g5_cdbaddr(&scmd->cdb.g5_cdb, lSector); g5_cdblen(&scmd->cdb.g5_cdb, SectorBurstVal); if (usalp->verbose) fprintf(stderr, "\nReadSony12 CDDA..."); usalp->cmdname = "Read12"; if (usal_cmd(usalp)) return 0; /* has all or something been read? */ return SectorBurstVal - usal_getresid(usalp)/CD_FRAMESIZE_RAW; } /* Read max. SectorBurst of cdda sectors to buffer via vendor-specific ReadCdda(12) command */ /* > It uses a 12 Byte CDB with 0xd4 as opcode, the start sector is coded as > normal and the number of sectors is coded in Byte 8 and 9 (begining with 0). */ int ReadCdda12Matsushita(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)p; scmd->size = SectorBurstVal*CD_FRAMESIZE_RAW; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G5_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g5_cdb.cmd = 0xd4; /* read audio command */ scmd->cdb.g5_cdb.lun = usal_lun(usalp); scmd->cdb.g5_cdb.res |= (accepts_fua_bit == 1 ? 1 << 2 : 0); g5_cdbaddr(&scmd->cdb.g5_cdb, lSector); g5_cdblen(&scmd->cdb.g5_cdb, SectorBurstVal); if (usalp->verbose) fprintf(stderr, "\nReadMatsushita12 CDDA..."); usalp->cmdname = "Read12Matsushita"; if (usal_cmd(usalp)) return 0; /* has all or something been read? */ return SectorBurstVal - usal_getresid(usalp)/CD_FRAMESIZE_RAW; } /* Read max. SectorBurst of cdda sectors to buffer via MMC standard READ CD command */ int ReadCddaMMC12(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { register struct usal_cmd *scmd; scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)p; scmd->size = SectorBurstVal*CD_FRAMESIZE_RAW; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G5_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g5_cdb.cmd = 0xbe; /* read cd command */ scmd->cdb.g5_cdb.lun = usal_lun(usalp); scmd->cdb.g5_cdb.res = 1 << 1; /* expected sector type field CDDA */ g5_cdbaddr(&scmd->cdb.g5_cdb, lSector); g5x_cdblen(&scmd->cdb.g5_cdb, SectorBurstVal); scmd->cdb.g5_cdb.count[3] = 1 << 4; /* User data */ if (usalp->verbose) fprintf(stderr, "\nReadMMC12 CDDA..."); usalp->cmdname = "ReadCD MMC 12"; if (usal_cmd(usalp)) return 0; /* has all or something been read? */ return SectorBurstVal - usal_getresid(usalp)/CD_FRAMESIZE_RAW; } int ReadCddaFallbackMMC(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { static int ReadCdda12_unknown = 0; int retval = -999; usalp->silent++; if (ReadCdda12_unknown || ((retval = ReadCdda12(usalp, p, lSector, SectorBurstVal)) <= 0)) { /* if the command is not available, use the regular * MMC ReadCd */ if (retval <= 0 && usal_sense_key(usalp) == 0x05) { ReadCdda12_unknown = 1; } usalp->silent--; ReadCdRom = ReadCddaMMC12; ReadCdRomSub = ReadCddaSubMMC12; return ReadCddaMMC12(usalp, p, lSector, SectorBurstVal); } usalp->silent--; return retval; } /* Read the Sub-Q-Channel to SubQbuffer. This is the method for * drives that do not support subchannel parameters. */ #ifdef PROTOTYPES static subq_chnl *ReadSubQFallback (SCSI *usalp, unsigned char sq_format, unsigned char track) #else static subq_chnl * ReadSubQFallback(SCSI *usalp, unsigned char sq_format, unsigned char track) #endif { register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)SubQbuffer; scmd->size = 24; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x42; /* Read SubQChannel */ /* use LBA */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.addr[0] = 0x40; /* SubQ info */ scmd->cdb.g1_cdb.addr[1] = 0; /* parameter list: all */ scmd->cdb.g1_cdb.res6 = track; /* track number */ g1_cdblen(&scmd->cdb.g1_cdb, 24); if (usalp->verbose) fprintf(stderr, "\nRead Subchannel_dumb..."); usalp->cmdname = "Read Subchannel_dumb"; if (usal_cmd(usalp) < 0) { fprintf( stderr, "Read SubQ failed\n"); } /* check, if the requested format is delivered */ { unsigned char *p = (unsigned char *) SubQbuffer; if ((((unsigned)p[2] << 8) | p[3]) /* LENGTH */ > ULONG_C(11) && (p[5] >> 4) /* ADR */ == sq_format) { if (sq_format == GET_POSITIONDATA) p[5] = (p[5] << 4) | (p[5] >> 4); return SubQbuffer; } } /* FIXME: we might actively search for the requested info ... */ return NULL; } /* Read the Sub-Q-Channel to SubQbuffer */ #ifdef PROTOTYPES subq_chnl *ReadSubQSCSI (SCSI *usalp, unsigned char sq_format, unsigned char track) #else subq_chnl * ReadSubQSCSI(SCSI *usalp, unsigned char sq_format, unsigned char track) #endif { int resp_size; register struct usal_cmd *scmd = usalp->scmd; switch (sq_format) { case GET_POSITIONDATA: resp_size = 16; track = 0; break; case GET_CATALOGNUMBER: resp_size = 24; track = 0; break; case GET_TRACK_ISRC: resp_size = 24; break; default: fprintf(stderr, "ReadSubQSCSI: unknown format %d\n", sq_format); return NULL; } fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)SubQbuffer; scmd->size = resp_size; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x42; /* use LBA */ scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.addr[0] = 0x40; /* SubQ info */ scmd->cdb.g1_cdb.addr[1] = sq_format; /* parameter list: all */ scmd->cdb.g1_cdb.res6 = track; /* track number */ g1_cdblen(&scmd->cdb.g1_cdb, resp_size); if (usalp->verbose) fprintf(stderr, "\nRead Subchannel..."); usalp->cmdname = "Read Subchannel"; if (usal_cmd(usalp) < 0) { /* in case of error do a fallback for dumb firmwares */ return ReadSubQFallback(usalp, sq_format, track); } if (sq_format == GET_POSITIONDATA) SubQbuffer->control_adr = (SubQbuffer->control_adr << 4) | (SubQbuffer->control_adr >> 4); return SubQbuffer; } static subq_chnl sc; static subq_chnl* fill_subchannel(unsigned char bufferwithQ[]); static subq_chnl* fill_subchannel(unsigned char bufferwithQ[]) { sc.subq_length = 0; sc.control_adr = bufferwithQ[CD_FRAMESIZE_RAW + 0]; sc.track = bufferwithQ[CD_FRAMESIZE_RAW + 1]; sc.index = bufferwithQ[CD_FRAMESIZE_RAW + 2]; return ≻ } int ReadCddaSubSony(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)p; scmd->size = SectorBurstVal*(CD_FRAMESIZE_RAW + 16); scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G5_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g5_cdb.cmd = 0xd8; /* read audio command */ scmd->cdb.g5_cdb.lun = usal_lun(usalp); scmd->cdb.g5_cdb.res |= (accepts_fua_bit == 1 ? 1 << 2 : 0); scmd->cdb.g5_cdb.res10 = 0x01; /* subcode 1 -> cdda + 16 * q sub */ g5_cdbaddr(&scmd->cdb.g5_cdb, lSector); g5_cdblen(&scmd->cdb.g5_cdb, SectorBurstVal); if (usalp->verbose) fprintf(stderr, "\nReadSony12 CDDA + SubChannels..."); usalp->cmdname = "Read12SubChannelsSony"; if (usal_cmd(usalp)) return -1; /* has all or something been read? */ return usal_getresid(usalp) != 0; } int ReadCddaSub96Sony(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); int ReadCddaSub96Sony(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)p; scmd->size = SectorBurstVal*(CD_FRAMESIZE_RAW + 96); scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G5_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g5_cdb.cmd = 0xd8; /* read audio command */ scmd->cdb.g5_cdb.lun = usal_lun(usalp); scmd->cdb.g5_cdb.res |= (accepts_fua_bit == 1 ? 1 << 2 : 0); scmd->cdb.g5_cdb.res10 = 0x02; /* subcode 2 -> cdda + 96 * q sub */ g5_cdbaddr(&scmd->cdb.g5_cdb, lSector); g5_cdblen(&scmd->cdb.g5_cdb, SectorBurstVal); if (usalp->verbose) fprintf(stderr, "\nReadSony12 CDDA + 96 byte SubChannels..."); usalp->cmdname = "Read12SubChannelsSony"; if (usal_cmd(usalp)) return -1; /* has all or something been read? */ return usal_getresid(usalp) != 0; } subq_chnl *ReadSubChannelsSony(SCSI *usalp, unsigned lSector) { /*int retval = ReadCddaSub96Sony(usalp, (UINT4 *)bufferTOC, lSector, 1);*/ int retval = ReadCddaSubSony(usalp, (UINT4 *)bufferTOC, lSector, 1); if (retval != 0) return NULL; return fill_subchannel(bufferTOC); } /* Read max. SectorBurst of cdda sectors to buffer via MMC standard READ CD command */ int ReadCddaSubMMC12(SCSI *usalp, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { register struct usal_cmd *scmd; scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)p; scmd->size = SectorBurstVal*(CD_FRAMESIZE_RAW + 16); scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G5_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g5_cdb.cmd = 0xbe; /* read cd command */ scmd->cdb.g5_cdb.lun = usal_lun(usalp); scmd->cdb.g5_cdb.res = 1 << 1; /* expected sector type field CDDA */ g5_cdbaddr(&scmd->cdb.g5_cdb, lSector); g5x_cdblen(&scmd->cdb.g5_cdb, SectorBurstVal); scmd->cdb.g5_cdb.count[3] = 1 << 4; /* User data */ scmd->cdb.g5_cdb.res10 = 0x02; /* subcode 2 -> cdda + 16 * q sub */ if (usalp->verbose) fprintf(stderr, "\nReadMMC12 CDDA + SUB..."); usalp->cmdname = "ReadCD Sub MMC 12"; if (usal_cmd(usalp)) return -1; /* has all or something been read? */ return usal_getresid(usalp) != 0; } static subq_chnl *ReadSubChannelsMMC(SCSI *usalp, unsigned lSector); static subq_chnl *ReadSubChannelsMMC(SCSI *usalp, unsigned lSector) { int retval = ReadCddaSubMMC12(usalp, (UINT4 *)bufferTOC, lSector, 1); if (retval != 0) return NULL; return fill_subchannel(bufferTOC); } subq_chnl *ReadSubChannelsFallbackMMC(SCSI *usalp, unsigned lSector) { static int ReadSubSony_unknown = 0; subq_chnl *retval = NULL; usalp->silent++; if (ReadSubSony_unknown || ((retval = ReadSubChannelsSony(usalp, lSector)) == NULL)) { /* if the command is not available, use the regular * MMC ReadCd */ if (retval == NULL && usal_sense_key(usalp) == 0x05) { ReadSubSony_unknown = 1; } usalp->silent--; return ReadSubChannelsMMC(usalp, lSector); } usalp->silent--; return retval; } subq_chnl *ReadStandardSub(usalp, lSector) SCSI *usalp; unsigned lSector; { if (0 == ReadStandardLowlevel (usalp, (UINT4 *)bufferTOC, lSector, 1, CD_FRAMESIZE_RAW + 16 )) { return NULL; } #if 0 fprintf(stderr, "Subchannel Sec %x: %02x %02x %02x %02x\n" ,lSector ,bufferTOC[CD_FRAMESIZE_RAW + 0] ,bufferTOC[CD_FRAMESIZE_RAW + 1] ,bufferTOC[CD_FRAMESIZE_RAW + 2] ,bufferTOC[CD_FRAMESIZE_RAW + 3] ); #endif sc.control_adr = (bufferTOC[CD_FRAMESIZE_RAW + 0] << 4) | bufferTOC[CD_FRAMESIZE_RAW + 1]; sc.track = from_bcd(bufferTOC[CD_FRAMESIZE_RAW + 2]); sc.index = from_bcd(bufferTOC[CD_FRAMESIZE_RAW + 3]); return ≻ } /********* non standardized speed selects ***********************/ void SpeedSelectSCSIToshiba(SCSI *usalp, unsigned speed) { static unsigned char mode [4 + 3]; unsigned char *page = mode + 4; int retval; fillbytes((caddr_t)mode, sizeof(mode), '\0'); /* the first 4 mode bytes are zero. */ page[0] = 0x20; page[1] = 1; page[2] = speed; /* 0 for single speed, 1 for double speed (3401) */ if (usalp->verbose) fprintf(stderr, "\nspeed select Toshiba..."); usalp->silent++; /* do the scsi cmd */ if ((retval = mode_select(usalp, mode, 7, 0, usalp->inq->data_format >= 2)) < 0) fprintf (stderr, "speed select Toshiba failed\n"); usalp->silent--; } void SpeedSelectSCSINEC(SCSI *usalp, unsigned speed) { static unsigned char mode [4 + 8]; unsigned char *page = mode + 4; int retval; register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)mode, sizeof(mode), '\0'); /* the first 4 mode bytes are zero. */ page [0] = 0x0f; /* page code */ page [1] = 6; /* parameter length */ /* bit 5 == 1 for single speed, otherwise double speed */ page [2] = speed == 1 ? 1 << 5 : 0; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)mode; scmd->size = 12; scmd->flags = SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0xC5; scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.addr[0] = 0 ? 1 : 0 | 1 ? 0x10 : 0; g1_cdblen(&scmd->cdb.g1_cdb, 12); if (usalp->verbose) fprintf(stderr, "\nspeed select NEC..."); /* do the scsi cmd */ usalp->cmdname = "speed select NEC"; if ((retval = usal_cmd(usalp)) < 0) fprintf(stderr ,"speed select NEC failed\n"); } void SpeedSelectSCSIPhilipsCDD2600(SCSI *usalp, unsigned speed) { /* MODE_SELECT, page = SCSI-2 save page disabled, reserved, reserved, parm list len, flags */ static unsigned char mode [4 + 8]; unsigned char *page = mode + 4; int retval; fillbytes((caddr_t)mode, sizeof(mode), '\0'); /* the first 4 mode bytes are zero. */ page[0] = 0x23; page[1] = 6; page[2] = page [4] = speed; page[3] = 1; if (usalp->verbose) fprintf(stderr, "\nspeed select Philips..."); /* do the scsi cmd */ if ((retval = mode_select(usalp, mode, 12, 0, usalp->inq->data_format >= 2)) < 0) fprintf (stderr, "speed select PhilipsCDD2600 failed\n"); } void SpeedSelectSCSISony(SCSI *usalp, unsigned speed) { static unsigned char mode [4 + 4]; unsigned char *page = mode + 4; int retval; fillbytes((caddr_t)mode, sizeof(mode), '\0'); /* the first 4 mode bytes are zero. */ page[0] = 0x31; page[1] = 2; page[2] = speed; if (usalp->verbose) fprintf(stderr, "\nspeed select Sony..."); /* do the scsi cmd */ usalp->silent++; if ((retval = mode_select(usalp, mode, 8, 0, usalp->inq->data_format >= 2)) < 0) fprintf (stderr, "speed select Sony failed\n"); usalp->silent--; } void SpeedSelectSCSIYamaha (usalp, speed) SCSI *usalp; unsigned speed; { static unsigned char mode [4 + 4]; unsigned char *page = mode + 4; int retval; fillbytes((caddr_t)mode, sizeof(mode), '\0'); /* the first 4 mode bytes are zero. */ page[0] = 0x31; page[1] = 2; page[2] = speed; if (usalp->verbose) fprintf(stderr, "\nspeed select Yamaha..."); /* do the scsi cmd */ if ((retval = mode_select(usalp, mode, 8, 0, usalp->inq->data_format >= 2)) < 0) fprintf (stderr, "speed select Yamaha failed\n"); } void SpeedSelectSCSIMMC(SCSI *usalp, unsigned speed) { int spd; register struct usal_cmd *scmd = usalp->scmd; if (speed == 0 || speed == 0xFFFF) { spd = 0xFFFF; } else { spd = (1764 * speed) / 10; } fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->flags = SCG_DISRE_ENA; scmd->cdb_len = SC_G5_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g5_cdb.cmd = 0xBB; scmd->cdb.g5_cdb.lun = usal_lun(usalp); i_to_2_byte(&scmd->cdb.g5_cdb.addr[0], spd); i_to_2_byte(&scmd->cdb.g5_cdb.addr[2], 0xffff); if (usalp->verbose) fprintf(stderr, "\nspeed select MMC..."); usalp->cmdname = "set cd speed"; usalp->silent++; if (usal_cmd(usalp) < 0) { if (usal_sense_key(usalp) == 0x05 && usal_sense_code(usalp) == 0x20 && usal_sense_qual(usalp) == 0x00) { /* this optional command is not implemented */ } else { usal_printerr(usalp); fprintf (stderr, "speed select MMC failed\n"); } } usalp->silent--; } /* request vendor brand and model */ unsigned char *Inquiry(SCSI *usalp) { static unsigned char *Inqbuffer = NULL; register struct usal_cmd *scmd = usalp->scmd; if (Inqbuffer == NULL) { Inqbuffer = malloc(36); if (Inqbuffer == NULL) { fprintf(stderr, "Cannot allocate memory for inquiry command in line %d\n", __LINE__); return NULL; } } fillbytes(Inqbuffer, 36, '\0'); fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)Inqbuffer; scmd->size = 36; scmd->flags = SCG_RECV_DATA|SCG_DISRE_ENA; scmd->cdb_len = SC_G0_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g0_cdb.cmd = SC_INQUIRY; scmd->cdb.g0_cdb.lun = usal_lun(usalp); scmd->cdb.g0_cdb.count = 36; usalp->cmdname = "inquiry"; if (usal_cmd(usalp) < 0) return (NULL); /* define structure with inquiry data */ memcpy(usalp->inq, Inqbuffer, sizeof(*usalp->inq)); if (usalp->verbose) usal_prbytes("Inquiry Data :", (Uchar *)Inqbuffer, 22 - scmd->resid); return (Inqbuffer); } #define SC_CLASS_EXTENDED_SENSE 0x07 #define TESTUNITREADY_CMD 0 #define TESTUNITREADY_CMDLEN 6 #define ADD_SENSECODE 12 #define ADD_SC_QUALIFIER 13 #define NO_MEDIA_SC 0x3a #define NO_MEDIA_SCQ 0x00 int TestForMedium(SCSI *usalp) { register struct usal_cmd *scmd = usalp->scmd; if (interface != GENERIC_SCSI) { return 1; } /* request READY status */ fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = (caddr_t)0; scmd->size = 0; scmd->flags = SCG_DISRE_ENA | (1 ? SCG_SILENT:0); scmd->cdb_len = SC_G0_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g0_cdb.cmd = SC_TEST_UNIT_READY; scmd->cdb.g0_cdb.lun = usal_lun(usalp); if (usalp->verbose) fprintf(stderr, "\ntest unit ready..."); usalp->silent++; usalp->cmdname = "test unit ready"; if (usal_cmd(usalp) >= 0) { usalp->silent--; return 1; } usalp->silent--; if (scmd->sense.code >= SC_CLASS_EXTENDED_SENSE) { return scmd->u_sense.cmd_sense[ADD_SENSECODE] != NO_MEDIA_SC || scmd->u_sense.cmd_sense[ADD_SC_QUALIFIER] != NO_MEDIA_SCQ; } else { /* analyse status. */ /* 'check condition' is interpreted as not ready. */ return (scmd->u_scb.cmd_scb[0] & 0x1e) != 0x02; } } int StopPlaySCSI(SCSI *usalp) { register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = NULL; scmd->size = 0; scmd->flags = SCG_DISRE_ENA; scmd->cdb_len = SC_G0_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g0_cdb.cmd = 0x1b; scmd->cdb.g0_cdb.lun = usal_lun(usalp); if (usalp->verbose) fprintf(stderr, "\nstop audio play"); /* do the scsi cmd */ usalp->cmdname = "stop audio play"; return usal_cmd(usalp) >= 0 ? 0 : -1; } int Play_atSCSI(SCSI *usalp, unsigned int from_sector, unsigned int sectors) { register struct usal_cmd *scmd = usalp->scmd; fillbytes((caddr_t)scmd, sizeof(*scmd), '\0'); scmd->addr = NULL; scmd->size = 0; scmd->flags = SCG_DISRE_ENA; scmd->cdb_len = SC_G1_CDBLEN; scmd->sense_len = CCS_SENSE_LEN; scmd->cdb.g1_cdb.cmd = 0x47; scmd->cdb.g1_cdb.lun = usal_lun(usalp); scmd->cdb.g1_cdb.addr[1] = (from_sector + 150) / (60*75); scmd->cdb.g1_cdb.addr[2] = ((from_sector + 150) / 75) % 60; scmd->cdb.g1_cdb.addr[3] = (from_sector + 150) % 75; scmd->cdb.g1_cdb.res6 = (from_sector + 150 + sectors) / (60*75); scmd->cdb.g1_cdb.count[0] = ((from_sector + 150 + sectors) / 75) % 60; scmd->cdb.g1_cdb.count[1] = (from_sector + 150 + sectors) % 75; if (usalp->verbose) fprintf(stderr, "\nplay sectors..."); /* do the scsi cmd */ usalp->cmdname = "play sectors"; return usal_cmd(usalp) >= 0 ? 0 : -1; } static caddr_t scsibuffer; /* page aligned scsi transfer buffer */ void init_scsibuf(SCSI *scsp, unsigned amt); void init_scsibuf(SCSI *usalp, unsigned amt) { if (scsibuffer != NULL) { fprintf(stderr, "the SCSI transfer buffer has already been allocated!\n"); exit(SETUPSCSI_ERROR); } scsibuffer = usal_getbuf(usalp, amt); if (scsibuffer == NULL) { fprintf(stderr, "could not get SCSI transfer buffer!\n"); exit(SETUPSCSI_ERROR); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/toc.h��������������������������������������������������������������������������0000644�0003725�0000144�00000004700�10513514665�014326� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)toc.h 1.9 06/02/19 Copyright 1998,1999 Heiko Eissfeldt, Copyright 2006 J. Schilling */ #define MAXTRK 100 /* maximum of audio tracks (without a hidden track) */ extern unsigned cdtracks; extern int have_multisession; extern int have_CD_extra; extern int have_CD_text; extern int have_CDDB; #if !defined(HAVE_NETDB_H) #undef USE_REMOTE #else #define USE_REMOTE 1 extern int request_titles(void); #endif extern int ReadToc(void); extern void Check_Toc(void); extern int TOC_entries(unsigned tracks, unsigned char *a, unsigned char *b, int bvalid); extern void toc_entry(unsigned nr, unsigned flag, unsigned tr, unsigned char *ISRC, unsigned long lba, int m, int s, int f); extern int patch_real_end(unsigned long sector); extern int no_disguised_audiotracks(void); extern int Get_Track(unsigned long sector); extern long FirstTrack(void); extern long LastTrack(void); extern long FirstAudioTrack(void); extern long FirstDataTrack(void); extern long LastAudioTrack(void); extern long Get_EndSector(unsigned long p_track); extern long Get_StartSector(unsigned long p_track); extern long Get_AudioStartSector(unsigned long p_track); extern long Get_LastSectorOnCd(unsigned long p_track); extern int CheckTrackrange(unsigned long from, unsigned long upto); extern int Get_Preemphasis(unsigned long p_track); extern int Get_Channels(unsigned long p_track); extern int Get_Copyright(unsigned long p_track); extern int Get_Datatrack(unsigned long p_track); extern int Get_Tracknumber(unsigned long p_track); extern unsigned char *Get_MCN(void); extern unsigned char *Get_ISRC(unsigned long p_track); extern unsigned find_an_off_sector(unsigned lSector, unsigned SectorBurstVal); extern void DisplayToc(void); extern unsigned FixupTOC(unsigned no_tracks); extern void calc_cddb_id(void); extern void calc_cdindex_id(void); extern void Read_MCN_ISRC(void); extern unsigned ScanIndices(unsigned trackval, unsigned indexval, int bulk); extern int handle_cdtext(void); extern int lba_2_msf(long lba, int *m, int *s, int *f); ����������������������������������������������������������������cdrkit-1.1.11/icedax/CMakeLists.txt�����������������������������������������������������������������0000644�0003725�0000144�00000002465�11304054475�016133� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������PROJECT (icedax C) INCLUDE_DIRECTORIES(../include ../wodim ../libparanoia ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include) include(../include/AddScgBits.cmake) include(../include/AddSchilyBits.cmake) include(../include/AddNetworkBits.cmake) FIND_FILE (HAVE_SYS_SOUNDCARD_H sys/soundcard.h) IF(HAVE_SYS_SOUNDCARD_H) ADD_DEFINITIONS(-DHAVE_SYS_SOUNDCARD_H) ENDIF(HAVE_SYS_SOUNDCARD_H) FIND_FILE (HAVE_LINUX_SOUNDCARD_H linux/soundcard.h) IF(HAVE_LINUX_SOUNDCARD_H) ADD_DEFINITIONS(-DHAVE_LINUX_SOUNDCARD_H) ENDIF(HAVE_LINUX_SOUNDCARD_H) FIND_LIBRARY(HAVE_LIBOSSAUDIO "ossaudio") IF(HAVE_LIBOSSAUDIO) LIST(APPEND EXTRA_LIBS "ossaudio") ENDIF(HAVE_LIBOSSAUDIO) LIST(APPEND EXTRA_LIBS paranoia) IF (WIN32) LIST(APPEND EXTRA_LIBS winmm) ENDIF (WIN32) LINK_DIRECTORIES(../librols ../libusal ../libparanoia) ADD_EXECUTABLE (icedax aifc.c aiff.c base64.c icedax.c interface.c ioctl.c raw.c resample.c ringbuff.c scsi_cmds.c semshm.c setuid.c sha_func.c sndconfig.c sun.c toc.c wav.c) TARGET_LINK_LIBRARIES(icedax wodimstuff ${EXTRA_LIBS}) SET_TARGET_PROPERTIES(icedax PROPERTIES SKIP_BUILD_RPATH TRUE) INSTALL(TARGETS icedax DESTINATION bin) INSTALL(PROGRAMS pitchplay readmult cdda2mp3 cdda2ogg DESTINATION bin) INSTALL(FILES cdda2ogg.1 icedax.1 pitchplay.1 readmult.1 list_audio_tracks.1 DESTINATION ${MANSUBDIR}/man1) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/ioctl.c������������������������������������������������������������������������0000644�0003725�0000144�00000042013�10536265343�014646� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)ioctl.c 1.22 06/02/19 Copyright 1998,1999,2000 Heiko Eissfeldt, Copyright 2006 J. Schilling */ /*** * CopyPolicy: GNU Public License 2 applies * Copyright (C) 1999 Heiko Eissfeldt heiko@colossus.escape.de * * Ioctl interface module for cdrom drive access * * Solaris ATAPI cdrom drives are untested! * */ #include "config.h" #include <stdio.h> #include <standard.h> #include <stdxlib.h> #include <unixstd.h> #include <strdefs.h> #include <errno.h> #include <signal.h> #include <fctldefs.h> #include <assert.h> #include <sys/ioctl.h> #include <statdefs.h> #include <schily.h> #include <device.h> #include <usal/scsitransp.h> #include "mycdrom.h" #include "lowlevel.h" /* some include file locations have changed with newer kernels */ #if defined (__linux__) # if LINUX_VERSION_CODE > 0x10300 + 97 # if LINUX_VERSION_CODE < 0x200ff # include <linux/sbpcd.h> # include <linux/ucdrom.h> # endif # if !defined(CDROM_SELECT_SPEED) # include <linux/ucdrom.h> # endif # endif #endif #include "mytype.h" #include "byteorder.h" #include "interface.h" #include "toc.h" #include "icedax.h" #include "ioctl.h" #include "global.h" #include "exitcodes.h" #include <utypes.h> #include <wodim.h> #if defined (HAVE_IOCTL_INTERFACE) #if !defined(sun) && !defined(__sun) && !(defined(__FreeBSD__) && (__FreeBSD_version >= 501112)) static struct cdrom_read_audio arg; #endif #if (defined(__FreeBSD__) && __FreeBSD_version >= 400014) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) static unsigned sector_size; #endif static int err; static void EnableCdda_cooked(SCSI *usalp, int fAudioMode, unsigned uSectorsize); /* ARGSUSED */ static void EnableCdda_cooked(SCSI *usalp, int fAudioMode, unsigned uSectorsize) { #if (defined(__FreeBSD__) && __FreeBSD_version >= 400014) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) if (usalp && usalp->verbose) fprintf(stderr, "EnableCdda_cooked (CDRIOCSETBLOCKSIZE)...\n"); if (fAudioMode) { if (ioctl(global.cooked_fd, CDRIOCGETBLOCKSIZE, §or_size) ==-1) sector_size = CD_FRAMESIZE; ioctl(global.cooked_fd, CDRIOCSETBLOCKSIZE, &uSectorsize); } else ioctl(global.cooked_fd, CDRIOCSETBLOCKSIZE, §or_size); #else #if defined CDIOCSETCDDA if (usalp && usalp->verbose) { fprintf(stderr, "EnableCdda_cooked (CDIOCSETCDDA)...\n"); if (uSectorsize != CD_FRAMESIZE_RAW) fprintf(stderr, "non audio sector size is ignored.\n"); } ioctl(global.cooked_fd, CDIOCSETCDDA, &fAudioMode); #else fprintf(stderr, "EnableCdda_cooked (CDIOCSETCDDA) is not available...\n"); #endif #endif } static unsigned ReadToc_cooked(SCSI *x); /* read the table of contents (toc) via the ioctl interface */ static unsigned ReadToc_cooked(SCSI *x) { unsigned i; unsigned tracks; struct cdrom_tochdr hdr; struct cdrom_tocentry entry[100]; struct cdrom_tocentry entryMSF[100]; if (x && x->verbose) { fprintf(stderr, "ReadToc_cooked (CDROMREADTOCHDR)...\n"); } /* get TocHeader to find out how many entries there are */ err = ioctl( global.cooked_fd, CDROMREADTOCHDR, &hdr ); if ( err != 0 ) { /* error handling */ if (err == -1) { if (errno == EPERM) fprintf( stderr, "Please run this program setuid root.\n"); perror("cooked: Read TOC "); exit( DEVICE_ERROR ); } else { fprintf( stderr, "can't get TocHeader (error %d).\n", err ); exit( MEDIA_ERROR ); } } /* get all TocEntries */ for ( i = 0; i < hdr.cdth_trk1; i++ ) { entryMSF[i].cdte_track = 1+i; entryMSF[i].cdte_format = CDROM_MSF; err = ioctl( global.cooked_fd, CDROMREADTOCENTRY, &entryMSF[i] ); if ( err != 0 ) { /* error handling */ fprintf( stderr, "can't get TocEntry #%d msf (error %d).\n", i+1, err ); exit( MEDIA_ERROR ); } } entryMSF[i].cdte_track = CDROM_LEADOUT; entryMSF[i].cdte_format = CDROM_MSF; err = ioctl( global.cooked_fd, CDROMREADTOCENTRY, &entryMSF[i] ); if ( err != 0 ) { /* error handling */ fprintf( stderr, "can't get TocEntry LEADOUT msf (error %d).\n", err ); exit( MEDIA_ERROR ); } tracks = hdr.cdth_trk1+1; /* for (i = 0; i < tracks; i++) { toc[i].bFlags = (entry[i].cdte_adr << 4) | (entry[i].cdte_ctrl & 0x0f); toc[i].bTrack = entry[i].cdte_track; toc[i].mins = entry[i].cdte_addr.msf.minute; toc[i].secs = entry[i].cdte_addr.msf.second; toc[i].frms = entry[i].cdte_addr.msf.frame; } */ /* get all TocEntries now in lba format */ for ( i = 0; i < hdr.cdth_trk1; i++ ) { entry[i].cdte_track = 1+i; entry[i].cdte_format = CDROM_LBA; err = ioctl( global.cooked_fd, CDROMREADTOCENTRY, &entry[i] ); if ( err != 0 ) { /* error handling */ fprintf( stderr, "can't get TocEntry #%d lba (error %d).\n", i+1, err ); exit( MEDIA_ERROR ); } #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) entry[i].cdte_addr.lba = be32_to_cpu(entry[i].cdte_addr.lba); #endif } entry[i].cdte_track = CDROM_LEADOUT; entry[i].cdte_format = CDROM_LBA; err = ioctl( global.cooked_fd, CDROMREADTOCENTRY, &entry[i] ); if ( err != 0 ) { /* error handling */ fprintf( stderr, "can't get TocEntry LEADOUT lba (error %d).\n", err ); exit( MEDIA_ERROR ); } #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) entry[i].cdte_addr.lba = be32_to_cpu(entry[i].cdte_addr.lba); #endif for (i = 0; i < tracks; i++) { toc_entry(i+1, (entry[i].cdte_adr << 4) | (entry[i].cdte_ctrl & 0x0f), entry[i].cdte_track, NULL /* ISRC */, entry[i].cdte_addr.lba, entryMSF[i].cdte_addr.msf.minute, entryMSF[i].cdte_addr.msf.second, entryMSF[i].cdte_addr.msf.frame); } bufferTOC[0] = '\0'; bufferTOC[1] = '\0'; return --tracks; /* without lead-out */ } static void trash_cache_cooked(UINT4 *p, unsigned lSector, unsigned SectorBurstVal); static void trash_cache_cooked(UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { /* trash the cache */ #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) #if defined(__FreeBSD__) && __FreeBSD_version >= 501112 pread(global.cooked_fd, (void *) &p[0], 3*CD_FRAMESIZE_RAW, find_an_off_sector(lSector, SectorBurstVal)*CD_FRAMESIZE_RAW); #else static struct cdrom_read_audio arg2; arg2.address.lba = find_an_off_sector(lSector, SectorBurstVal); arg2.addr_format = CDROM_LBA; arg2.nframes = 3; arg2.buffer = (unsigned char *) &p[0]; ioctl(global.cooked_fd, CDROMREADAUDIO, &arg2); #endif #endif #if defined __linux__ static struct cdrom_read_audio arg2; arg2.addr.lba = find_an_off_sector(lSector, SectorBurstVal); arg2.addr_format = CDROM_LBA; arg2.nframes = 3; arg2.buf = (unsigned char *) &p[0]; ioctl(global.cooked_fd, CDROMREADAUDIO, &arg2); #endif #if defined __sun || (defined HAVE_SYS_CDIO_H && defined CDROM_DA_NO_SUBCODE) struct cdrom_cdda suncdda; suncdda.cdda_addr = lSector; suncdda.cdda_length = SectorBurstVal*CD_FRAMESIZE_RAW; suncdda.cdda_data = (char *) &p[0]; suncdda.cdda_subcode = CDROM_DA_NO_SUBCODE; ioctl(global.cooked_fd, CDROMCDDA, &suncdda); #endif } static void ReadCdRomData_cooked(SCSI *x, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); /* read 'SectorBurst' adjacent sectors of data sectors * to Buffer '*p' beginning at sector 'lSector' */ static void ReadCdRomData_cooked(SCSI *x, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { int retval; if (x && x->verbose) { fprintf(stderr, "ReadCdRomData_cooked (lseek & read)...\n"); } if ((retval = lseek(global.cooked_fd, lSector*CD_FRAMESIZE, SEEK_SET)) != (int)lSector*CD_FRAMESIZE) { perror("cannot seek sector"); } if ((retval = read(global.cooked_fd, p, SectorBurstVal*CD_FRAMESIZE)) != (int)SectorBurstVal*CD_FRAMESIZE) { perror("cannot read sector"); } return; } static int ReadCdRom_cooked(SCSI *x, UINT4 *p, unsigned lSector, unsigned SectorBurstVal); /* read 'SectorBurst' adjacent sectors of audio sectors * to Buffer '*p' beginning at sector 'lSector' */ static int ReadCdRom_cooked(SCSI *x, UINT4 *p, unsigned lSector, unsigned SectorBurstVal) { int retry_count=0; static int nothing_read = 1; /* read 2352 bytes audio data */ #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) #if defined(__FreeBSD__) && __FreeBSD_version >= 501112 if (x && x->verbose) { fprintf(stderr, "ReadCdRom_cooked (pread)...\n"); } do { err = 0; if (pread(global.cooked_fd, (void *) &p[0], SectorBurstVal*CD_FRAMESIZE_RAW, lSector*CD_FRAMESIZE_RAW) == -1) err = -1; #else arg.address.lba = lSector; arg.addr_format = CDROM_LBA; arg.nframes = SectorBurstVal; arg.buffer = (unsigned char *) &p[0]; if (x && x->verbose) { fprintf(stderr, "ReadCdRom_cooked (CDROMREADAUDIO)...\n"); } do { err = ioctl(global.cooked_fd, CDROMREADAUDIO, &arg); #endif #endif #if defined __linux__ arg.addr.lba = lSector; arg.addr_format = CDROM_LBA; arg.nframes = SectorBurstVal; arg.buf = (unsigned char *) &p[0]; if (x && x->verbose) { fprintf(stderr, "ReadCdRom_cooked (CDROMREADAUDIO)...\n"); } do { err = ioctl(global.cooked_fd, CDROMREADAUDIO, &arg); #endif #if defined __sun || (defined HAVE_SYS_CDIO_H && defined CDROM_DA_NO_SUBCODE) struct cdrom_cdda suncdda; suncdda.cdda_addr = lSector; suncdda.cdda_length = SectorBurstVal*CD_FRAMESIZE_RAW; suncdda.cdda_data = (char *) &p[0]; suncdda.cdda_subcode = CDROM_DA_NO_SUBCODE; if (x && x->verbose) { fprintf(stderr, "ReadCdRom_cooked (CDROMCDDA)...\n"); } do { err = ioctl(global.cooked_fd, CDROMCDDA, &suncdda); #endif retry_count++; if (err) { trash_cache_cooked(p, lSector, SectorBurstVal); } } while ((err) && (retry_count < 30)); if (err != 0) { if (x->silent == 0) { /* error handling */ if (err == -1) { if (nothing_read && (errno == EINVAL || errno == EIO)) fprintf( stderr, "Sorry, this driver and/or drive does not support cdda reading.\n"); perror("cooked: Read cdda "); fprintf(stderr, " sector %u + %u, buffer %p + %x\n", lSector, SectorBurstVal, p, global.shmsize); } else { fprintf(stderr, "can't read frame #%u (error %d).\n", lSector, err); } } return SectorBurstVal - 1; } else { nothing_read = 0; } return SectorBurstVal; } static int StopPlay_cooked(SCSI *x); static int StopPlay_cooked(SCSI *x) { if (x && x->verbose) { fprintf(stderr, "StopPlay_cooked (CDROMSTOP)...\n"); } return ioctl( global.cooked_fd, CDROMSTOP, 0 ) ? 0 : -1; } static int Play_at_cooked(SCSI *x, unsigned int from_sector, unsigned int sectors); static int Play_at_cooked(SCSI *x, unsigned int from_sector, unsigned int sectors) { struct cdrom_msf cmsf; int retval; if (x && x->verbose) { fprintf(stderr, "Play_at_cooked (CDROMSTART & CDROMPLAYMSF)... (%u-%u)", from_sector, from_sector+sectors-1); fprintf(stderr, "\n"); } cmsf.cdmsf_min0 = (from_sector + 150) / (60*75); cmsf.cdmsf_sec0 = ((from_sector + 150) / 75) % 60; cmsf.cdmsf_frame0 = (from_sector + 150) % 75; cmsf.cdmsf_min1 = (from_sector + 150 + sectors) / (60*75); cmsf.cdmsf_sec1 = ((from_sector + 150 + sectors) / 75) % 60; cmsf.cdmsf_frame1 = (from_sector + 150 + sectors) % 75; #if 0 /* makes index scanning under FreeBSD too slow */ if (( retval = ioctl( global.cooked_fd, CDROMSTART, 0 )) != 0){ perror(""); } #endif if (( retval = ioctl( global.cooked_fd, CDROMPLAYMSF, &cmsf )) != 0){ perror(""); } return retval; } /* request sub-q-channel information. This function may cause confusion * for a drive, when called in the sampling process. */ static subq_chnl *ReadSubQ_cooked(SCSI *x, unsigned char sq_format, unsigned char track) { struct cdrom_subchnl sub_ch; #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) struct cd_sub_channel_info sub_ch_info; if (x && x->verbose) { fprintf(stderr, "ReadSubQ_cooked (CDROM_GET_MCN or CDROMSUBCHNL)...\n"); } sub_ch.address_format = CD_MSF_FORMAT; sub_ch.track = track; sub_ch.data_len = sizeof(struct cd_sub_channel_info); sub_ch.data = &sub_ch_info; switch (sq_format) { case GET_CATALOGNUMBER: sub_ch.data_format = CD_MEDIA_CATALOG; #else if (x && x->verbose) { fprintf(stderr, "ReadSubQ_cooked (CDROM_GET_MCN or CDROMSUBCHNL)...\n"); } switch (sq_format) { case GET_CATALOGNUMBER: #endif #if defined CDROM_GET_MCN if (!(err = ioctl(global.cooked_fd, CDROM_GET_MCN, (struct cdrom_mcn *) SubQbuffer))) { subq_chnl *SQp = (subq_chnl *) SubQbuffer; subq_catalog *SQPp = (subq_catalog *) &SQp->data; memmove(SQPp->media_catalog_number, SQp, sizeof (SQPp->media_catalog_number)); SQPp->zero = 0; SQPp->mc_valid = 0x80; break; } else #endif { return NULL; } case GET_POSITIONDATA: #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) sub_ch.data_format = CD_CURRENT_POSITION; #endif #if defined (__linux__) sub_ch.cdsc_format = CDROM_MSF; #endif if (!(err = ioctl(global.cooked_fd, CDROMSUBCHNL, &sub_ch))) { /* copy to SubQbuffer */ subq_chnl *SQp = (subq_chnl *) (SubQbuffer); subq_position *SQPp = (subq_position *) SQp->data; SQp->audio_status = sub_ch.cdsc_audiostatus; SQp->format = sub_ch.cdsc_format; SQp->control_adr = (sub_ch.cdsc_adr << 4) | (sub_ch.cdsc_ctrl & 0x0f); SQp->track = sub_ch.cdsc_trk; SQp->index = sub_ch.cdsc_ind; SQPp->abs_min = sub_ch.cdsc_absaddr.msf.minute; SQPp->abs_sec = sub_ch.cdsc_absaddr.msf.second; SQPp->abs_frame = sub_ch.cdsc_absaddr.msf.frame; SQPp->trel_min = sub_ch.cdsc_reladdr.msf.minute; SQPp->trel_sec = sub_ch.cdsc_reladdr.msf.second; SQPp->trel_frame = sub_ch.cdsc_reladdr.msf.frame; } else { if (err == -1) { if (errno == EPERM) fprintf( stderr, "Please run this program setuid root.\n"); perror("cooked: Read subq "); exit( DEVICE_ERROR ); } else { fprintf(stderr, "can't read sub q channel (error %d).\n", err); exit( DEVICE_ERROR ); } } break; default: return NULL; } /* switch */ return (subq_chnl *)(SubQbuffer); } /* Speed control */ static void SpeedSelect_cooked(SCSI *x, unsigned speed); /* ARGSUSED */ static void SpeedSelect_cooked(SCSI *x, unsigned speed) { if (x && x->verbose) { fprintf(stderr, "SpeedSelect_cooked (CDROM_SELECT_SPEED)...\n"); } #ifdef CDROM_SELECT_SPEED /* CAUTION!!!!! Non standard ioctl parameter types here!!!! */ if ((err = ioctl(global.cooked_fd, CDROM_SELECT_SPEED, speed))) { if (err == -1) { if (errno == EPERM) fprintf( stderr, "Please run this program setuid root.\n"); perror("cooked: Speed select "); /*exit( err ); */ } else { fprintf(stderr, "can't set speed %d (error %d).\n", speed, err); exit( DEVICE_ERROR ); } } #endif } /* set function pointers to use the ioctl routines */ void SetupCookedIoctl(char *pdev_name) { #if (HAVE_ST_RDEV == 1) struct stat statstruct; if (fstat(global.cooked_fd, &statstruct)) { fprintf(stderr, "cannot stat cd %d (%s)\n",global.cooked_fd, pdev_name); exit(STAT_ERROR); } #if defined __linux__ switch (major(statstruct.st_rdev)) { case CDU31A_CDROM_MAJOR: /* sony cdu-31a/33a */ global.nsectors = 13; if (global.nsectors >= 14) { global.overlap = 10; } break; case MATSUSHITA_CDROM_MAJOR: /* sbpcd 1 */ case MATSUSHITA_CDROM2_MAJOR: /* sbpcd 2 */ case MATSUSHITA_CDROM3_MAJOR: /* sbpcd 3 */ case MATSUSHITA_CDROM4_MAJOR: /* sbpcd 4 */ /* some are more compatible than others */ global.nsectors = 13; break; default: global.nsectors = 8; break; } err = ioctl(global.cooked_fd, CDROMAUDIOBUFSIZ, global.nsectors); switch (major(statstruct.st_rdev)) { case MATSUSHITA_CDROM_MAJOR: /* sbpcd 1 */ case MATSUSHITA_CDROM2_MAJOR: /* sbpcd 2 */ case MATSUSHITA_CDROM3_MAJOR: /* sbpcd 3 */ case MATSUSHITA_CDROM4_MAJOR: /* sbpcd 4 */ if (err == -1) { perror("ioctl(CDROMAUDIOBUFSIZ)"); } } #endif #endif EnableCdda = EnableCdda_cooked; ReadCdRom = ReadCdRom_cooked; ReadCdRomData = (int (*)(SCSI *, unsigned char *, unsigned, unsigned)) ReadCdRomData_cooked; doReadToc = ReadToc_cooked; ReadTocText = NULL; ReadSubQ = ReadSubQ_cooked; ReadSubChannels = NULL; SelectSpeed = SpeedSelect_cooked; Play_at = Play_at_cooked; StopPlay = StopPlay_cooked; trash_cache = trash_cache_cooked; ReadLastAudio = NULL; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/mytype.h�����������������������������������������������������������������������0000644�0003725�0000144�00000001765�10477233650�015101� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)mytype.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ #if 4 == SIZEOF_LONG_INT #define UINT4 long unsigned int #define UINT4_C ULONG_C #else #if 4 == SIZEOF_INT #define UINT4 unsigned int #define UINT4_C UINT_C #else #if 4 == SIZEOF_SHORT_INT #define UINT4 short unsigned int #define UINT4_C USHORT_C #else error need an integer type with 32 bits, but do not know one! #endif #endif #endif #define TRUE 1 #define FALSE 0 #ifndef offset_of #define offset_of(TYPE, MEMBER) ((size_t) ((TYPE *)0)->MEMBER) #endif #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif �����������cdrkit-1.1.11/icedax/lconfig.h����������������������������������������������������������������������0000644�0003725�0000144�00000004603�10563167602�015164� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* lconfig.h. Generated automatically by configure. */ #if 0 /* @(#)lconfig.h.in 1.5 03/09/04 Copyright 1998-2003 Heiko Eissfeldt */ #endif /* #undef HAVE_SYS_CDIO_H */ /* if we should use sys/cdio.h */ /* #undef HAVE_SUNDEV_SRREG_H */ /* if we should use sundev/srreg.h */ /* #undef HAVE_SYS_AUDIOIO_H */ /* if we should use sys/audioio.h */ /* #undef HAVE_SUN_AUDIOIO_H */ /* if we should use sun/audioio.h */ /* #undef HAVE_SOUNDCARD_H */ /* if we should use soundcard.h */ /* TESTED BY CMAKE */ /*#define HAVE_SYS_SOUNDCARD_H 1 if we should use sys/soundcard.h */ /*define HAVE_LINUX_SOUNDCARD_H 1 if we should use linux/soundcard.h */ /* #undef HAVE_MACHINE_SOUNDCARD_H */ /* if we should use machine/soundcard.h */ /* #undef HAVE_SYS_ASOUNDLIB_H */ /* if we should use sys/asoundlib.h */ /* #undef HAVE_WINDOWS_H */ /* if we should use windows.h */ /* #undef HAVE_MMSYSTEM_H */ /* if we should use mmsystem.h */ /* #undef HAVE_OS2_H */ /* if we should use os2.h */ /* #undef HAVE_OS2ME_H */ /* if we should use os2me.h */ #if defined HAVE_SOUNDCARD_H || defined HAVE_SYS_SOUNDCARD_H || defined HAVE_LINUX_SOUNDCARD_H || defined HAVE_MACHINE_SOUNDCARD_H #define HAVE_OSS 1 #endif /* #if defined HAVE_WINDOWS_H && defined HAVE_MMSYSTEM_H #define HAVE_WINSOUND 1 #endif #if defined HAVE_OS2_H && defined HAVE_OS2ME_H #define HAVE_OS2SOUND 1 #endif */ #define HAVE_STRTOUL 1 /* EB, some defaults, fixme */ #define CD_DEVICE "/dev/cdrom" #define FILENAME "audio" #define UNDERSAMPLING 1 #define VERSION CDRKIT_VERSION #define BITS_P_S 16 #define CHANNELS 2 #define AUDIOTYPE "wav" #define DURATION 0 #define DEF_INTERFACE "generic_scsi" #define USE_PARANOIA 1 #define DEFAULT_SPEED 0 #define CDINDEX_SUPPORT #define CDDB_SUPPORT #define CDDBHOST "freedb.freedb.org" #define CDDBPORT 8880 #define HAVE_IOCTL_INTERFACE #define ECHO_TO_SOUNDCARD #define SOUND_DEV "/dev/dsp" #define NSECTORS 75 #define INFOFILES /* #undef MD5_SIGNATURES */ /* not implemented */ #define AUX_DEVICE "/dev/cdrom" �����������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/cdda2ogg�����������������������������������������������������������������������0000755�0003725�0000144�00000004356�10532031045�014762� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Script for processing all audio tracks with an ogg or mp3 decoder # based on a news article by Tom Kludy # This variant uses named pipes in order to save space. # usage: cdda2ogg <name prefix for all ogg/mp3 files> # specify the sampling program and its options # do not specify the track option here! CDDA2WAV=${CDDA2WAV:-icedax} CDDA2WAV_OPTS=${CDDA2WAV_OPTS:-'-H -P0 -q'} # for normal use, comment out the next line #DEBUG='-d1' # the post processor is fed through a pipe to avoid space waste # specify the post processing program and its options case $0 in *ogg|*OGG|*Ogg) # ensure the right suffix for suffixes later suffix=ogg missmsg="Encoder not found. Install one first! (eg. vorbis-tools)" MP_CODER=${MP_CODER:-oggenc} outopt="-o" ;; *mp3|*MP3|*mpeg3|*MPEG3|*Mp3) suffix=mp3 missmsg="Encoder not found. Install one first! (eg. lame)" MP_CODER=${MP_CODER:-lame} outopt="" ;; *) echo Unknown target file type: $suffix. Valid names for this application are: cdda2mp3, cdda2ogg. exit 1 ;; esac MP_OPTIONS=${MP_OPTIONS:-''} MP_CODER=$(which $MP_CODER 2>/dev/null) if [ ! -x "$MP_CODER" ] ; then echo $missmsg exit 1 fi CDDA_DEVICE=${CDDA_DEVICE:-/dev/cdrw} export CDDA_DEVICE FILEPREFIX=${1:-audiotrack} if [ -e /etc/default/cdda2$suffix ]; then . /etc/default/cdda2$suffix fi if [ -z "$LIST" ] ; then echo Looking for available tracks... # could use list_audio_tracks instead but that would need an extra filter as # well, and this way we do not depend on that symlink LIST="$( $CDDA2WAV -J -vtoc -H 2>&1 | sed -e 's/^[^\ ].*//; s/\.([^)]*)/ /g;s/,//g;')" if [ -z "$LIST" ] ; then echo "ERROR: No valid audio tracks detected" exit 1 fi fi echo Fetching `echo $LIST | wc -w` tracks from $CDDA_DEVICE, encoding with $MP_CODER. echo Cancel with Ctrl-C, watch out for error messages. for TRACK in $LIST ; do NAME="`printf "%02d" $TRACK`-$FILEPREFIX.$suffix" echo echo "############ Starting with Track Nr. $TRACK -> $NAME ############" $CDDA2WAV $CDDA2WAV_OPTS -t$TRACK $DEBUG - | \ $MP_CODER $MP_OPTIONS - $outopt "$NAME" # check result code RES=$? if [ $RES != 0 ] ; then echo File $NAME failed \(result $RES\). Aborted. >&2 break fi done ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/base64.c�����������������������������������������������������������������������0000644�0003725�0000144�00000011637�10536265343�014630� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)base64.c 1.4 02/04/06 Copyright 1998,1999 Heiko Eissfeldt */ /*____________________________________________________________________________ // // CD Index - The Internet CD Index // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // $Id: base64.c,v 1.1.1.3 1999/04/29 00:57:14 marc Exp $ //____________________________________________________________________________ */ /* * Program: RFC-822 routines (originally from SMTP) * * Author: Mark Crispin * Networks and Distributed Computing * Computing & Communications * University of Washington * Administration Building, AG-44 * Seattle, WA 98195 * Internet: MRC@CAC.Washington.EDU * * Date: 27 July 1988 * Last Edited: 10 September 1998 * * Sponsorship: The original version of this work was developed in the * Symbolic Systems Resources Group of the Knowledge Systems * Laboratory at Stanford University in 1987-88, and was funded * by the Biomedical Research Technology Program of the National * Institutes of Health under grant number RR-00785. * * Original version Copyright 1988 by The Leland Stanford Junior University * Copyright 1998 by the University of Washington * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notices appear in all copies and that both the * above copyright notices and this permission notice appear in supporting * documentation, and that the name of the University of Washington or The * Leland Stanford Junior University not be used in advertising or publicity * pertaining to distribution of the software without specific, written prior * permission. This software is made available "as is", and * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE, * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #include "config.h" #include <stdio.h> #include <stdxlib.h> #include "base64.h" /* NOTE: This is not true RFC822 anymore. The use of the characters // '/', '+', and '=' is no bueno when the ID will be used as part of a URL. // '_', '.', and '-' have been used instead */ /* Convert binary contents to BASE64 * Accepts: source * length of source * pointer to return destination length * Returns: destination as BASE64 */ unsigned char *rfc822_binary(char *src, unsigned long srcl, unsigned long *len) { unsigned char *ret,*d; unsigned char *s = (unsigned char *) src; char *v = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._"; unsigned long i = ((srcl + 2) / 3) * 4; *len = i += 2 * ((i / 60) + 1); d = ret = malloc ((size_t) ++i); for (i = 0; srcl; s += 3) { /* process tuplets */ *d++ = v[s[0] >> 2]; /* byte 1: high 6 bits (1) */ /* byte 2: low 2 bits (1), high 4 bits (2) */ *d++ = v[((s[0] << 4) + (--srcl ? (s[1] >> 4) : 0)) & 0x3f]; /* byte 3: low 4 bits (2), high 2 bits (3) */ *d++ = srcl ? v[((s[1] << 2) + (--srcl ? (s[2] >> 6) : 0)) & 0x3f] : '-'; /* byte 4: low 6 bits (3) */ *d++ = srcl ? v[s[2] & 0x3f] : '-'; if (srcl) srcl--; /* count third character if processed */ if ((++i) == 15) { /* output 60 characters? */ i = 0; /* restart line break count, insert CRLF */ *d++ = '\015'; *d++ = '\012'; } } *d = '\0'; /* tie off string */ return ret; /* return the resulting string */ } �������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/raw.c��������������������������������������������������������������������������0000644�0003725�0000144�00000002542�10536265343�014330� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)raw.c 1.4 01/10/27 Copyright 1998,1999 Heiko Eissfeldt */ #include "config.h" #include <unixstd.h> #include "sndfile.h" static int InitSound(void); static int InitSound() { return 0; } static int ExitSound(void); static int ExitSound() { return 0; } static unsigned long GetHdrSize(void); static unsigned long GetHdrSize() { return 0L; } static unsigned long InSizeToOutSize(unsigned long BytesToDo); static unsigned long InSizeToOutSize(unsigned long BytesToDo) { return BytesToDo; } struct soundfile rawsound = { (int (*)(int audio, long channels, unsigned long myrate, long nBitsPerSample, unsigned long expected_bytes)) InitSound, (int (*)(int audio, unsigned long nBytesDone)) ExitSound, GetHdrSize, (int (*)(int audio, unsigned char *buf, unsigned long BytesToDo)) write, /* get sound samples out */ InSizeToOutSize, /* compressed? output file size */ 1 /* needs big endian samples */ }; ��������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/wav.c��������������������������������������������������������������������������0000644�0003725�0000144�00000012015�10546232127�014323� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)wav.c 1.4 01/10/27 Copyright 1998,1999 Heiko Eissfeldt */ /*** * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Heiko Eissfeldt * * */ #include "config.h" #include <stdio.h> #include <unixstd.h> #include "byteorder.h" #include "sndfile.h" /*** * --------------------------------------------------------------------- * definitions for RIFF-output (from windows MMSYSTEM) * --------------------------------------------------------------------- */ typedef unsigned int FOURCC; /* a four character code */ typedef struct CHUNKHDR { FOURCC ckid; /* chunk ID */ unsigned int dwSize; /* chunk size */ } CHUNKHDR; /* flags for 'wFormatTag' field of WAVEFORMAT */ #define WAVE_FORMAT_PCM 1 /* specific waveform format structure for PCM data */ typedef struct pcmwaveformat_tag { unsigned short wFormatTag; /* format type */ unsigned short nChannels; /* number of channels (i.e. mono, stereo, etc.) */ unsigned int nSamplesPerSec; /* sample rate */ unsigned int nAvgBytesPerSec;/* for buffer size estimate */ unsigned short nBlockAlign; /* block size of data */ unsigned short wBitsPerSample; } PCMWAVEFORMAT; typedef PCMWAVEFORMAT *PPCMWAVEFORMAT; /* MMIO macros */ #define mmioFOURCC(ch0, ch1, ch2, ch3) \ ((unsigned int)(unsigned char)(ch0) | ((unsigned int)(unsigned char)(ch1) << 8) | \ ((unsigned int)(unsigned char)(ch2) << 16) | ((unsigned int)(unsigned char)(ch3) << 24)) #define FOURCC_RIFF mmioFOURCC ('R', 'I', 'F', 'F') #define FOURCC_LIST mmioFOURCC ('L', 'I', 'S', 'T') #define FOURCC_WAVE mmioFOURCC ('W', 'A', 'V', 'E') #define FOURCC_FMT mmioFOURCC ('f', 'm', 't', ' ') #define FOURCC_DATA mmioFOURCC ('d', 'a', 't', 'a') /* simplified Header for standard WAV files */ typedef struct WAVEHDR { CHUNKHDR chkRiff; FOURCC fccWave; CHUNKHDR chkFmt; unsigned short wFormatTag; /* format type */ unsigned short nChannels; /* number of channels (i.e. mono, stereo, etc.) */ unsigned int nSamplesPerSec; /* sample rate */ unsigned int nAvgBytesPerSec;/* for buffer estimation */ unsigned short nBlockAlign; /* block size of data */ unsigned short wBitsPerSample; CHUNKHDR chkData; } WAVEHDR; #define IS_STD_WAV_HEADER(waveHdr) ( \ waveHdr.chkRiff.ckid == FOURCC_RIFF && \ waveHdr.fccWave == FOURCC_WAVE && \ waveHdr.chkFmt.ckid == FOURCC_FMT && \ waveHdr.chkData.ckid == FOURCC_DATA && \ waveHdr.wFormatTag == WAVE_FORMAT_PCM) static WAVEHDR waveHdr; static int _InitSound(int audio, long channels, unsigned long rate, long nBitsPerSample, unsigned long expected_bytes); static int _InitSound(int audio, long channels, unsigned long rate, long nBitsPerSample, unsigned long expected_bytes) { unsigned long nBlockAlign = channels * ((nBitsPerSample + 7) / 8); unsigned long nAvgBytesPerSec = nBlockAlign * rate; unsigned long temp = expected_bytes + sizeof(WAVEHDR) - sizeof(CHUNKHDR); waveHdr.chkRiff.ckid = cpu_to_le32(FOURCC_RIFF); waveHdr.fccWave = cpu_to_le32(FOURCC_WAVE); waveHdr.chkFmt.ckid = cpu_to_le32(FOURCC_FMT); waveHdr.chkFmt.dwSize = cpu_to_le32(sizeof (PCMWAVEFORMAT)); waveHdr.wFormatTag = cpu_to_le16(WAVE_FORMAT_PCM); waveHdr.nChannels = cpu_to_le16(channels); waveHdr.nSamplesPerSec = cpu_to_le32(rate); waveHdr.nBlockAlign = cpu_to_le16(nBlockAlign); waveHdr.nAvgBytesPerSec = cpu_to_le32(nAvgBytesPerSec); waveHdr.wBitsPerSample = cpu_to_le16(nBitsPerSample); waveHdr.chkData.ckid = cpu_to_le32(FOURCC_DATA); waveHdr.chkRiff.dwSize = cpu_to_le32(temp); waveHdr.chkData.dwSize = cpu_to_le32(expected_bytes); return write (audio, &waveHdr, sizeof (waveHdr)); } static int _ExitSound(int audio, unsigned long nBytesDone); static int _ExitSound(int audio, unsigned long nBytesDone) { unsigned long temp = nBytesDone + sizeof(WAVEHDR) - sizeof(CHUNKHDR); waveHdr.chkRiff.dwSize = cpu_to_le32(temp); waveHdr.chkData.dwSize = cpu_to_le32(nBytesDone); /* goto beginning */ if (lseek(audio, 0L, SEEK_SET) == -1) { return 0; } return write (audio, &waveHdr, sizeof (waveHdr)); } static unsigned long _GetHdrSize(void); static unsigned long _GetHdrSize(void) { return sizeof( waveHdr ); } static unsigned long InSizeToOutSize(unsigned long BytesToDo); static unsigned long InSizeToOutSize(unsigned long BytesToDo) { return BytesToDo; } struct soundfile wavsound = { _InitSound, /* init header method */ _ExitSound, /* exit header method */ _GetHdrSize, /* report header size method */ /* get sound samples out */ (int (*)(int audio, unsigned char *buf, unsigned long BytesToDo)) write, InSizeToOutSize, /* compressed? output file size */ 0 /* needs big endian samples */ }; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/cd_extra.c���������������������������������������������������������������������0000644�0003725�0000144�00000025020�10513514665�015323� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)cd_extra.c 1.8 02/11/21 Copyright 2000-2001 Heiko Eissfeldt */ /* This is an include file! */ /**************** CD-Extra special treatment *********************************/ #include <ctype.h> static unsigned long Read_CD_Extra_File(unsigned char *Extra_buf, unsigned long sector); static unsigned long Read_CD_Extra_File(unsigned char *Extra_buf, unsigned long sector) { unsigned long mysec; /* read PVD */ ReadCdRomData(get_scsi_p(), Extra_buf, sector+16, 1); /* check ISO signature */ if (memcmp(Extra_buf, "\001CD001", 6) != 0) return 0; /* get path_table */ mysec = Extra_buf[148] << 24; mysec |= Extra_buf[149] << 16; mysec |= Extra_buf[150] << 8; mysec |= Extra_buf[151]; if (mysec <= sector) return 0; /* read path table */ ReadCdRomData(get_scsi_p(), Extra_buf, mysec, 1); /* find cdplus subdirectory */ { unsigned char * p = Extra_buf; while (p+8 < Extra_buf + CD_FRAMESIZE_RAW) { int namelength; namelength = p[0] | (p[1] << 8); if (namelength == 6 && !memcmp(p+8, "CDPLUS", 6)) break; p += 8 + namelength + (namelength & 1); } if (p+8 >= Extra_buf + CD_FRAMESIZE_RAW) return 0; /* get extent */ mysec = p[2] << 24; mysec |= p[3] << 16; mysec |= p[4] << 8; mysec |= p[5]; } if (mysec <= sector) return 0; ReadCdRomData(get_scsi_p(), Extra_buf, mysec, 1); /* find file info.cdp */ { unsigned char * p = Extra_buf; while (p+33 < Extra_buf + CD_FRAMESIZE_RAW) { int namelength; namelength = p[32]; if (namelength == 10 && !memcmp(p+33, "INFO.CDP;1", 10)) break; p += p[0]; } if (p+33 >= Extra_buf + CD_FRAMESIZE_RAW) return 0; /* get extent */ mysec = p[6] << 24; mysec |= p[7] << 16; mysec |= p[8] << 8; mysec |= p[9]; } if (mysec <= sector) return 0; /* read file info.cdp */ ReadCdRomData(get_scsi_p(), Extra_buf, mysec, 1); return mysec - sector; } static unsigned char Extra_buffer[CD_FRAMESIZE_RAW]; /* * Read the file cdplus/info.cdp from the cd extra disc. * This file has to reside at exactly 75 sectors after start of * the last session (according to Blue Book). * Of course, there are a lot dubious cd extras, which don't care :-((( * As an alternative method, we try reading through the iso9660 file system... */ static int Read_CD_Extra_Info(unsigned long sector); static int Read_CD_Extra_Info(unsigned long sector) { unsigned i; static int offsets[] = { 75 /* this is what blue book says */ }; for (i = 0; i < sizeof(offsets)/sizeof(int); i++) { #ifdef DEBUG_XTRA fprintf(stderr, "debug: Read_CD_Extra_Info at sector %lu\n", sector+offsets[i]); #endif ReadCdRomData(get_scsi_p(), Extra_buffer, sector+offsets[i], 1); /* If we are unlucky the drive cannot handle XA sectors by default. We try to compensate by ignoring the first eight bytes. Of course then we lack the last 8 bytes of the sector... */ if (Extra_buffer[0] == 0) memmove(Extra_buffer, Extra_buffer +8, CD_FRAMESIZE - 8); /* check for cd extra */ if (Extra_buffer[0] == 'C' && Extra_buffer[1] == 'D') return sector+offsets[i]; /* * CD is not conforming to BlueBook! * Read the file through ISO9660 file system. */ { unsigned long offset = Read_CD_Extra_File(Extra_buffer, sector); if (offset == 0) return 0; if (Extra_buffer[0] == 0) memmove(Extra_buffer, Extra_buffer +8, CD_FRAMESIZE - 8); /* check for cd extra */ if (Extra_buffer[0] == 'C' && Extra_buffer[1] == 'D') return sector+offset; } } return 0; } static void Read_Subinfo(unsigned pos, unsigned length); static void Read_Subinfo(unsigned pos, unsigned length) { unsigned num_infos, num; unsigned char *Subp, *orgSubp; unsigned this_track = 0xff; #ifdef DEBUG_XTRA unsigned char *up; unsigned char *sp; unsigned u; unsigned short s; #endif length += 8; length = (length + CD_FRAMESIZE_RAW-1) / CD_FRAMESIZE_RAW; length *= CD_FRAMESIZE_RAW; orgSubp = Subp = malloc(length); if (Subp == NULL) { fprintf(stderr, "Read_Subinfo no memory(%d)\n",length); goto errorout; } ReadCdRomData(get_scsi_p(), Subp, pos, 1); num_infos = Subp[45]+(Subp[44] << 8); #ifdef DEBUG_XTRA fprintf(stderr, "subinfo version %c%c.%c%c, %d info packets\n", Subp[8], Subp[9], Subp[10], Subp[11], num_infos); #endif length -= 46; Subp += 46; for (num = 0; num < num_infos && length > 0; num++) { unsigned id = *Subp; unsigned len = *(Subp +1); #define INFOPACKETTYPES 0x44 #ifdef INFOPACKETSTRINGS static const char *infopacketID[INFOPACKETTYPES] = { "0", "track identifier", "album title", "universal product code", "international standard book number", "copyright", "track title", "notes", "main interpret", "secondary interpret", "composer", "original composer", "creation date", "release date", "publisher", "0f", "isrc audio track", "isrc lyrics", "isrc pictures", "isrc MIDI data", "14", "15", "16", "17", "18", "19", "copyright state SUB_INFO", "copyright state intro lyrics", "copyright state lyrics", "copyright state MIDI data", "1e", "1f", "intro lyrics", "pointer to lyrics text file and length", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "still picture descriptor", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "MIDI file descriptor", "genre code", "tempo", "key" }; #endif if (id >= INFOPACKETTYPES) { fprintf(stderr, "Off=%4d, ind=%2d/%2d, unknown Id=%2u, len=%2u ", /* this pointer difference is assumed to be small enough for an int. */ (int)(Subp - orgSubp) , num, num_infos, id, len); Subp += 2 + 1; length -= 2 + 1; break; } #ifdef DEBUG_XTRA fprintf(stderr, "info packet %d\n", id); #endif switch (id) { case 1: /* track nummer or 0 */ this_track = 10 * (*(Subp + 2) - '0') + (*(Subp + 3) - '0'); break; case 0x02: /* album title */ if (global.disctitle == NULL) { global.disctitle = malloc(len + 1); if (global.disctitle != NULL) { memcpy(global.disctitle, Subp + 2, len); global.disctitle[len] = '\0'; } } break; case 0x03: /* media catalog number */ if (Get_MCN()[0] == '\0' && Subp[2] != '\0' && len >= 13) { Set_MCN( Subp + 2); } break; case 0x06: /* track title */ if (this_track > 0 && this_track < 100 && global.tracktitle[this_track] == NULL) { global.tracktitle[this_track] = malloc(len + 1); if (global.tracktitle[this_track] != NULL) { memcpy(global.tracktitle[this_track], Subp + 2, len); global.tracktitle[this_track][len] = '\0'; } } break; case 0x05: /* copyright message */ if (global.copyright_message == NULL) { global.copyright_message = malloc(len + 1); if (global.copyright_message != NULL) { memcpy(global.copyright_message, Subp + 2, len); global.copyright_message[len] = '\0'; } } break; case 0x08: /* creator */ if (global.creator == NULL) { global.creator = malloc(len + 1); if (global.creator != NULL) { memcpy(global.creator, Subp + 2, len); global.creator[len] = '\0'; } } break; case 0x10: /* isrc */ if (this_track > 0 && this_track < 100 && Get_ISRC(this_track)[0] == '\0' && Subp[2] != '\0' && len >= 15) { Set_ISRC(this_track, Subp + 2); } break; #if 0 case 0x04: case 0x07: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: #ifdef INFOPACKETSTRINGS fprintf(stderr, "%s: %*.*s\n",infopacketID[id], (int) len, (int) len, (Subp +2)); #endif break; #ifdef DEBUG_XTRA case 0x1a: case 0x1b: case 0x1c: case 0x1d: #ifdef INFOPACKETSTRINGS fprintf(stderr, "%s %scopyrighted\n", infopacketID[id], *(Subp + 2) == 0 ? "not " : ""); #endif break; case 0x21: fprintf(stderr, "lyrics file beginning at sector %u", (unsigned) GET_BE_UINT_FROM_CHARP(Subp + 2)); if (len == 8) fprintf(stderr, ", having length: %u\n", (unsigned) GET_BE_UINT_FROM_CHARP(Subp + 6)); else fputs("\n", stderr); break; case 0x30: sp = Subp + 2; while (sp < Subp + 2 + len) { /*while (len >= 10) {*/ s = be16_to_cpu((*(sp)) | (*(sp) << 8)); fprintf(stderr, "%04x, ", s); sp += 2; up = sp; switch (s) { case 0: break; case 4: break; case 5: break; case 6: break; } u = GET_BE_UINT_FROM_CHARP(up); fprintf(stderr, "%04lx, ", (long) u); up += 4; u = GET_BE_UINT_FROM_CHARP(up); fprintf(stderr, "%04lx, ", (long) u); up += 4; sp += 8; } fputs("\n", stderr); break; case 0x40: fprintf(stderr, "MIDI file beginning at sector %u", (unsigned) GET_BE_UINT_FROM_CHARP(Subp + 2)); if (len == 8) fprintf(stderr, ", having length: %u\n", (unsigned) GET_BE_UINT_FROM_CHARP(Subp + 6)); else fputs("\n", stderr); break; #ifdef INFOPACKETSTRINGS case 0x42: fprintf(stderr, "%s: %d beats per minute\n",infopacketID[id], *(Subp + 2)); break; case 0x41: if (len == 8) fprintf(stderr, "%s: %x, %x, %x, %x, %x, %x, %x, %x\n", infopacketID[id], *(Subp + 2), *(Subp + 3), *(Subp + 4), *(Subp + 5), *(Subp + 6), *(Subp + 7), *(Subp + 8), *(Subp + 9) ); else fprintf(stderr, "%s:\n",infopacketID[id]); break; case 0x43: fprintf(stderr, "%s: %x\n",infopacketID[id], *(Subp + 2)); break; default: fprintf(stderr, "%s: %*.*s\n",infopacketID[id], (int) len, (int) len, (Subp +2)); #endif #endif #endif } if (len & 1) len++; Subp += 2 + len; length -= 2 + len; } /* cleanup */ free(orgSubp); errorout: return; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/global.h�����������������������������������������������������������������������0000644�0003725�0000144�00000005311�10536314200�014764� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)global.h 1.11 04/07/29 Copyright 1998-2004 Heiko Eissfeldt */ /* Global Variables */ #ifdef MD5_SIGNATURES #include "md5.h" #endif #ifdef USE_PARANOIA #include "cdda_paranoia.h" #endif typedef struct index_list { struct index_list *next; int frameoffset; } index_list; typedef struct global { char *dev_name; /* device name */ char *aux_name; /* device name */ char fname_base[200]; int have_forked; int parent_died; int audio; struct soundfile *audio_out; int cooked_fd; int no_file; int no_infofile; int no_cddbfile; int quiet; int verbose; int scsi_silent; int scsi_verbose; int scanbus; int scandevs; int multiname; int sh_bits; int Remainder; int SkippedSamples; int OutSampleSize; int need_big_endian; int need_hostorder; int channels; unsigned long iloop; unsigned long nSamplesDoneInTrack; unsigned overlap; int useroverlap; unsigned nsectors; unsigned buffers; unsigned shmsize; long pagesize; int in_lendian; int outputendianess; int findminmax; int maxamp[2]; int minamp[2]; unsigned speed; int userspeed; int ismono; int findmono; int swapchannels; int deemphasize; int gui; long playback_rate; int target; /* SCSI Id to be used */ int lun; /* SCSI Lun to be used */ UINT4 cddb_id; int cddbp; char * cddbp_server; char * cddbp_port; unsigned cddb_revision; int cddb_year; char cddb_genre[60]; int illleadout_cd; int reads_illleadout; unsigned char *cdindex_id; unsigned char *creator; unsigned char *copyright_message; unsigned char *disctitle; unsigned char *tracktitle[100]; unsigned char *trackcreator[100]; index_list *trackindexlist[100]; int paranoia_selected; #ifdef USE_PARANOIA cdrom_paranoia *cdp; struct paranoia_parms_t { Ucbit disable_paranoia:1; Ucbit disable_extra_paranoia:1; Ucbit disable_scratch_detect:1; Ucbit disable_scratch_repair:1; int retries; int overlap; int mindynoverlap; int maxdynoverlap; } paranoia_parms; #endif unsigned md5blocksize; #ifdef MD5_SIGNATURES int md5count; MD5_CTX context; unsigned char MD5_result[16]; #endif #ifdef ECHO_TO_SOUNDCARD int soundcard_fd; #endif int echo; int just_the_toc; } global_t; extern global_t global; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/icedax.h�����������������������������������������������������������������������0000644�0003725�0000144�00000011541�10531372767�015004� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)icedax.h 1.4 00/02/13 Copyright 1998,1999,2000 Heiko Eissfeldt */ /*** * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Heiko Eissfeldt * * prototypes from cdda2wav.c */ #ifdef max #undef max #endif #ifdef min #undef min #endif #define max(a,b) ((a) > (b) ? (a) : (b)) #define min(a,b) ((a) < (b) ? (a) : (b)) /* verbose levels */ #define SHOW_TOC 1 #define SHOW_SUMMARY 2 #define SHOW_INDICES 4 #define SHOW_MCN 8 #define SHOW_ISRC 16 #define SHOW_STARTPOSITIONS 32 #define SHOW_TITLES 64 #define SHOW_JUSTAUDIOTRACKS 128 #define SHOW_MAX 255 /* Endianess */ #define GUESS (-2) #define NONE (-1) #define LITTLE 0 #define BIG 1 void FatalError(const char *szMessage, ...); void AnalyzeQchannel(unsigned frame); long SamplesNeeded(long amount, long undersampling); unsigned int get_current_track(void); #if defined (sun) && !defined(SVR4) #define atexit(f) on_exit(f, 0) #endif #ifndef _LINUX_CDROM_H #define _LINUX_CDROM_H /* * some fix numbers */ #define CD_MINS 74 /* max. minutes per CD, not really a limit */ #define CD_SECS 60 /* seconds per minute */ #define CD_FRAMES 75 /* frames per second */ #define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame, not transfered by the drive */ #define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */ #define CD_SUBHEAD_SIZE 8 /* subheader bytes per raw XA data frame */ #define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */ #define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD)/* sync bytes + header of XA frame */ #define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */ #define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */ /* most drives don't deliver everything: */ #define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /* 2340 */ #define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /* 2336 */ /* Optics drive also has a 'read all' mode: */ #define CD_FRAMESIZE_RAWER 2646 /* bytes per frame */ #define CD_EDC_SIZE 4 /* bytes EDC per most raw data frame types */ #define CD_ZERO_SIZE 8 /* bytes zero per yellow book mode 1 frame */ #define CD_ECC_SIZE 276 /* bytes ECC per most raw data frame types */ #define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */ #define CD_FRAMESIZE_SUB 96 /* subchannel data "frame" size */ #define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */ #define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */ #define CD_NUM_OF_CHUNKS 98 /* chunks per frame */ #define CD_FRAMESIZE_XA CD_FRAMESIZE_RAW1 /* obsolete name */ #define CD_BLOCK_OFFSET CD_MSF_OFFSET /* obsolete name */ /* * the raw frame layout: * * - audio (red): | audio_sample_bytes | * | 2352 | * * - data (yellow, mode1): | sync - head - data - EDC - zero - ECC | * | 12 - 4 - 2048 - 4 - 8 - 276 | * * - data (yellow, mode2): | sync - head - data | * | 12 - 4 - 2336 | * * - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC | * | 12 - 4 - 8 - 2048 - 4 - 276 | * * - XA data (green, mode2 form2): | sync - head - sub - data - EDC | * | 12 - 4 - 8 - 2324 - 4 | */ /* * CD-ROM address types (cdrom_tocentry.cdte_format) */ #if !defined CDROM_LBA #define CDROM_LBA 0x01 /* "logical block": first frame is #0 */ #define CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */ #endif /* * bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */ #define CDROM_DATA_TRACK 0x04 /* * The leadout track is always 0xAA, regardless of # of tracks on disc */ #define CDROM_LEADOUT 0xAA /* * audio states (from SCSI-2, but seen with other drives, too) */ #define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */ #define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */ #define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */ #define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */ #define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */ #define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */ #ifdef FIVETWELVE #define CDROM_MODE1_SIZE 512 #else #define CDROM_MODE1_SIZE 2048 #endif /*FIVETWELVE*/ #define CDROM_MODE2_SIZE 2336 #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/ioctl.h������������������������������������������������������������������������0000644�0003725�0000144�00000000774�10513514665�014662� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)ioctl.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ void SetupCookedIoctl(char *pdev_name); ����cdrkit-1.1.11/icedax/byteorder.h��������������������������������������������������������������������0000644�0003725�0000144�00000004316�10477233650�015544� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)byteorder.h 1.3 03/07/20 Copyright 1998,1999 Heiko Eissfeldt */ #ifndef MYBYTE_ORDER #define MYBYTE_ORDER 1 /* supply the byte order macros */ #if defined (WORDS_BIGENDIAN) # define MY_BIG_ENDIAN 1 # define MY_LITTLE_ENDIAN 0 #else # define MY_BIG_ENDIAN 0 # define MY_LITTLE_ENDIAN 1 #endif # undef cpu_to_le32 # undef cpu_to_le16 # undef cpu_to_be32 # undef cpu_to_be16 # undef le32_to_cpu # undef le16_to_cpu # undef be32_to_cpu # undef be16_to_cpu # define revert4bytes(x) \ ((unsigned long int)((((unsigned long int)(x) & ULONG_C(0x000000ff)) << 24) | \ (((unsigned long int)(x) & ULONG_C(0x0000ff00)) << 8) | \ (((unsigned long int)(x) & ULONG_C(0x00ff0000)) >> 8) | \ (((unsigned long int)(x) & ULONG_C(0xff000000)) >> 24))) # define revert2bytes(x) \ ((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \ (((unsigned short int)(x) & 0xff00) >> 8))) #if MY_BIG_ENDIAN == 1 # define cpu_to_le32(x) revert4bytes(x) # define cpu_to_le16(x) revert2bytes(x) # define le32_to_cpu(x) cpu_to_le32(x) # define le16_to_cpu(x) cpu_to_le16(x) # define cpu_to_be32(x) (x) # define cpu_to_be16(x) (x) # define be32_to_cpu(x) (x) # define be16_to_cpu(x) (x) #else # define cpu_to_be32(x) revert4bytes(x) # define cpu_to_be16(x) revert2bytes(x) # define be32_to_cpu(x) cpu_to_be32(x) # define be16_to_cpu(x) cpu_to_be16(x) # define cpu_to_le32(x) (x) # define cpu_to_le16(x) (x) # define le32_to_cpu(x) (x) # define le16_to_cpu(x) (x) #endif #define GET_LE_UINT_FROM_CHARP(p) ((unsigned int)((*(p+3))<<24)|((*(p+2))<<16)|((*(p+1))<<8)|(*(p))) #define GET_BE_UINT_FROM_CHARP(p) ((unsigned int)((*(p))<<24)|((*(p+1))<<16)|((*(p+2))<<8)|(*(p+3))) #endif /* ifndef MYBYTE_ORDER */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/resample.c���������������������������������������������������������������������0000644�0003725�0000144�00000070515�10536265343�015354� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)resample.c 1.15 02/11/21 Copyright 1998,1999,2000 Heiko Eissfeldt */ /* resampling module * * The audio data has been read. Here are the * functions to ensure a correct continuation * of the output stream and to convert to a * lower sample rate. * */ #undef DEBUG_VOTE_ENDIANESS #undef DEBUG_SHIFTS /* simulate bad cdrom drives */ #undef DEBUG_MATCHING #undef SHOW_JITTER #undef CHECK_MEM #include "config.h" #include <timedefs.h> #include <stdio.h> #include <stdxlib.h> #include <utypes.h> #include <unixstd.h> #include <standard.h> #include <strdefs.h> #include <limits.h> #include <assert.h> #include <math.h> #include <usal/scsitransp.h> #include "mytype.h" #include "icedax.h" #include "interface.h" #include "byteorder.h" #include "ringbuff.h" #include "resample.h" #include "toc.h" #include "sndfile.h" #include "sndconfig.h" #include "global.h" #include "exitcodes.h" int waitforsignal = 0; /* flag: wait for any audio response */ int any_signal = 0; short undersampling; /* conversion factor */ short samples_to_do; /* loop variable for conversion */ int Halved; /* interpolate due to non integral divider */ static long lsum = 0, rsum = 0; /* accumulator for left/right channel */ static long ls2 = 0, rs2 = 0, ls3 = 0, rs3 = 0, auxl = 0, auxr = 0; static const unsigned char *my_symmemmem(const unsigned char *HAYSTACK, const size_t HAYSTACK_LEN, const unsigned char *const NEEDLE, const size_t NEEDLE_LEN); static const unsigned char *my_memmem(const unsigned char *HAYSTACK, const size_t HAYSTACK_LEN, const unsigned char *const NEEDLE, const size_t NEEDLE_LEN); static const unsigned char *my_memrmem(const unsigned char *HAYSTACK, const size_t HAYSTACK_LEN, const unsigned char *const NEEDLE, const size_t NEEDLE_LEN); static const unsigned char *sync_buffers(const unsigned char *const newbuf); static long interpolate(long p1, long p2, long p3); static void emit_sample(long lsumval, long rsumval, long channels); static void change_endianness(UINT4 *pSam, unsigned int Samples); static void swap_channels(UINT4 *pSam, unsigned int Samples); static int guess_endianess(UINT4 *p, Int16_t *p2, unsigned int SamplesToDo); #ifdef CHECK_MEM static void check_mem(const unsigned char *p, unsigned long amount, const unsigned char *q, unsigned line, char *file); static void check_mem(const unsigned char *p, unsigned long amount, const unsigned char *q, unsigned line, char *file) { if (p < q || p+amount > q + ENTRY_SIZE) { fprintf(stderr, "file %s, line %u: invalid buffer range (%p - %p), allowed is (%p - %p)\n", file,line,p, p+amount-1, q, q + ENTRY_SIZE-1); exit(INTERNAL_ERROR); } } #endif #ifdef DEBUG_MATCHING int memcmp(const void * a, const void * b, size_t c) { return 1; } #endif static const unsigned char * my_symmemmem(const unsigned char *HAYSTACK, const size_t HAYSTACK_LEN, const unsigned char * const NEEDLE, const size_t NEEDLE_LEN) { const unsigned char * const UPPER_LIMIT = HAYSTACK + HAYSTACK_LEN - NEEDLE_LEN - 1; const unsigned char * HAYSTACK2 = HAYSTACK-1; while (HAYSTACK <= UPPER_LIMIT) { if (memcmp(NEEDLE, HAYSTACK, NEEDLE_LEN) == 0) { return HAYSTACK; } else { if (memcmp(NEEDLE, HAYSTACK2, NEEDLE_LEN) == 0) { return HAYSTACK2; } HAYSTACK2--; HAYSTACK++; } } #ifdef DEBUG_MATCHING HAYSTACK2++; HAYSTACK--; fprintf(stderr, "scompared %p-%p with %p-%p (%p)\n", NEEDLE, NEEDLE + NEEDLE_LEN-1, HAYSTACK2, HAYSTACK + NEEDLE_LEN-1, HAYSTACK); #endif return NULL; } static const unsigned char * my_memmem(const unsigned char *HAYSTACK, const size_t HAYSTACK_LEN, const unsigned char * const NEEDLE, const size_t NEEDLE_LEN) { const unsigned char * const UPPER_LIMIT = HAYSTACK + HAYSTACK_LEN - NEEDLE_LEN; while (HAYSTACK <= UPPER_LIMIT) { if (memcmp(NEEDLE, HAYSTACK, NEEDLE_LEN) == 0) { return HAYSTACK; } else { HAYSTACK++; } } #ifdef DEBUG_MATCHING HAYSTACK--; fprintf(stderr, "fcompared %p-%p with %p-%p (%p)\n", NEEDLE, NEEDLE + NEEDLE_LEN-1, HAYSTACK - HAYSTACK_LEN + NEEDLE_LEN, HAYSTACK + NEEDLE_LEN-1, HAYSTACK); #endif return NULL; } static const unsigned char * my_memrmem(const unsigned char *HAYSTACK, const size_t HAYSTACK_LEN, const unsigned char * const NEEDLE, const size_t NEEDLE_LEN) { const unsigned char * const LOWER_LIMIT = HAYSTACK - (HAYSTACK_LEN - 1); while (HAYSTACK >= LOWER_LIMIT) { if (memcmp(NEEDLE, HAYSTACK, NEEDLE_LEN) == 0) { return HAYSTACK; } else { HAYSTACK--; } } #ifdef DEBUG_MATCHING HAYSTACK++; fprintf(stderr, "bcompared %p-%p with %p-%p (%p)\n", NEEDLE, NEEDLE + NEEDLE_LEN-1, HAYSTACK, HAYSTACK + (HAYSTACK_LEN - 1), HAYSTACK + (HAYSTACK_LEN - 1) - NEEDLE_LEN - 1); #endif return NULL; } /* find continuation in new buffer */ static const unsigned char * sync_buffers(const unsigned char * const newbuf) { const unsigned char *retval = newbuf; if (global.overlap != 0) { /* find position of SYNC_SIZE bytes of the old buffer in the new buffer */ size_t haystack_len; const size_t needle_len = SYNC_SIZE; const unsigned char * const oldbuf = (const unsigned char *) (get_previous_read_buffer()->data); const unsigned char * haystack; const unsigned char * needle; /* compare the previous buffer with the new one * * 1. symmetrical search: * look for the last SYNC_SIZE bytes of the previous buffer * in the new buffer (from the optimum to the outer positions). * * 2. if the first approach did not find anything do forward search * look for the last SYNC_SIZE bytes of the previous buffer * in the new buffer (from behind the overlap to the end). * */ haystack_len = min((global.nsectors - global.overlap)*CD_FRAMESIZE_RAW +SYNC_SIZE+1, global.overlap*CD_FRAMESIZE_RAW); /* expected here */ haystack = newbuf + CD_FRAMESIZE_RAW*global.overlap - SYNC_SIZE; needle = oldbuf + CD_FRAMESIZE_RAW*global.nsectors - SYNC_SIZE; #ifdef DEBUG_MATCHING fprintf(stderr, "oldbuf %p-%p new %p-%p %u %u %u\n", oldbuf, oldbuf + CD_FRAMESIZE_RAW*global.nsectors - 1, newbuf, newbuf + CD_FRAMESIZE_RAW*global.nsectors - 1, CD_FRAMESIZE_RAW*global.nsectors, global.nsectors, global.overlap); #endif retval = my_symmemmem(haystack, haystack_len, needle, needle_len); if (retval != NULL) { retval += SYNC_SIZE; } else { /* fallback to asymmetrical search */ /* if there is no asymmetrical part left, return with 'not found' */ if (2*global.overlap == global.nsectors) { retval = NULL; } else if (2*global.overlap > global.nsectors) { /* the asymmetrical part is in front, search backwards */ haystack_len = (2*global.overlap-global.nsectors)*CD_FRAMESIZE_RAW; haystack = newbuf + haystack_len - 1; retval = my_memrmem(haystack, haystack_len, needle, needle_len); } else { /* the asymmetrical part is at the end, search forward */ haystack = newbuf + 2*(global.overlap*CD_FRAMESIZE_RAW - SYNC_SIZE); haystack_len = (global.nsectors-2*global.overlap)*CD_FRAMESIZE_RAW + 2*SYNC_SIZE; retval = my_memmem(haystack, haystack_len, needle, needle_len); } if (retval != NULL) retval += SYNC_SIZE; } #ifdef SHOW_JITTER if (retval) { fprintf(stderr,"%d\n", retval-(newbuf+global.overlap*CD_FRAMESIZE_RAW)); } else { fprintf(stderr,"no match\n"); } #endif } return retval; } /* quadratic interpolation * p1, p3 span the interval 0 - 2. give interpolated value for 1/2 */ static long int interpolate(long int p1, long int p2, long int p3) { return (3L*p1 + 6L*p2 - p3)/8L; } static unsigned char *pStart; /* running ptr defining end of output buffer */ static unsigned char *pDst; /* start of output buffer */ /* * Write the filtered sample into the output buffer. */ static void emit_sample(long lsumval, long rsumval, long channels) { if (global.findminmax) { if (rsumval > global.maxamp[0]) global.maxamp[0] = rsumval; if (rsumval < global.minamp[0]) global.minamp[0] = rsumval; if (lsumval < global.minamp[1]) global.minamp[1] = lsumval; if (lsumval > global.maxamp[1]) global.maxamp[1] = lsumval; } /* convert to output format */ if ( channels == 1 ) { Int16_t sum; /* mono section */ sum = ( lsumval + rsumval ) >> (global.sh_bits + 1); if ( global.sh_bits == 8 ) { if ( waitforsignal == 1 ) { if ( any_signal == 0 ) { if ( ( (char) sum) != '\0' ) { pStart = (unsigned char *) pDst; any_signal = 1; *pDst++ = ( unsigned char ) sum + ( 1 << 7 ); } else global.SkippedSamples++; } else *pDst++ = ( unsigned char ) sum + ( 1 << 7 ); } else *pDst++ = ( unsigned char ) sum + ( 1 << 7 ); } else { Int16_t * myptr = (Int16_t *) pDst; if ( waitforsignal == 1 ) { if ( any_signal == 0 ) { if ( sum != 0 ) { pStart = (unsigned char *) pDst; any_signal = 1; *myptr = sum; pDst += sizeof( Int16_t ); } else global.SkippedSamples++; } else { *myptr = sum; pDst += sizeof( Int16_t ); } } else { *myptr = sum; pDst += sizeof( Int16_t ); } } } else { /* stereo section */ lsumval >>= global.sh_bits; rsumval >>= global.sh_bits; if ( global.sh_bits == 8 ) { if ( waitforsignal == 1 ) { if ( any_signal == 0 ) { if ( ((( char ) lsumval != '\0') || (( char ) rsumval != '\0'))) { pStart = (unsigned char *) pDst; any_signal = 1; *pDst++ = ( unsigned char )( short ) lsumval + ( 1 << 7 ); *pDst++ = ( unsigned char )( short ) rsumval + ( 1 << 7 ); } else global.SkippedSamples++; } else { *pDst++ = ( unsigned char )( short ) lsumval + ( 1 << 7 ); *pDst++ = ( unsigned char )( short ) rsumval + ( 1 << 7 ); } } else { *pDst++ = ( unsigned char )( short ) lsumval + ( 1 << 7 ); *pDst++ = ( unsigned char )( short ) rsumval + ( 1 << 7 ); } } else { Int16_t * myptr = (Int16_t *) pDst; if ( waitforsignal == 1 ) { if ( any_signal == 0 ) { if ( ((( Int16_t ) lsumval != 0) || (( Int16_t ) rsumval != 0))) { pStart = (unsigned char *) pDst; any_signal = 1; *myptr++ = ( Int16_t ) lsumval; *myptr = ( Int16_t ) rsumval; pDst += 2*sizeof( Int16_t ); } else global.SkippedSamples++; } else { *myptr++ = ( Int16_t ) lsumval; *myptr = ( Int16_t ) rsumval; pDst += 2*sizeof( Int16_t ); } } else { *myptr++ = ( Int16_t ) lsumval; *myptr = ( Int16_t ) rsumval; pDst += 2*sizeof( Int16_t ); } } } } static void change_endianness(UINT4 *pSam, unsigned int Samples) { UINT4 *pend = (pSam + Samples); /* type UINT4 may not be greater than the assumed biggest type */ #if (SIZEOF_LONG_INT < 4) error type unsigned long is too small #endif #if (SIZEOF_LONG_INT == 4) unsigned long *plong = (unsigned long *)pSam; for (; plong < pend;) { *plong = ((*plong >> 8L) & UINT_C(0x00ff00ff)) | ((*plong << 8L) & UINT_C(0xff00ff00)); plong++; } #else /* sizeof long unsigned > 4 bytes */ #if (SIZEOF_LONG_INT == 8) #define INTEGRAL_LONGS (SIZEOF_LONG_INT-1UL) register unsigned long *plong; unsigned long *pend0 = (unsigned long *) (((unsigned long) pend) & ~ INTEGRAL_LONGS); if (((unsigned long) pSam) & INTEGRAL_LONGS) { *pSam = ((*pSam >> 8L) & UINT_C(0x00ff00ff)) | ((*pSam << 8L) & UINT_C(0xff00ff00)); pSam++; } plong = (unsigned long *)pSam; for (; plong < pend0;) { *plong = ((*plong >> 8L) & ULONG_C(0x00ff00ff00ff00ff)) | ((*plong << 8L) & ULONG_C(0xff00ff00ff00ff00)); plong++; } if (((unsigned long *) pend) != pend0) { UINT4 *pint = (UINT4 *) pend0; for (;pint < pend;) { *pint = ((*pint >> 8) & UINT_C(0x00ff00ff)) | ((*pint << 8) & UINT_C(0xff00ff00)); pint++; } } #else /* sizeof long unsigned > 4 bytes but not 8 */ { UINT4 *pint = pSam; for (;pint < pend;) { *pint = ((*pint >> 8) & UINT_C(0x00ff00ff)) | ((*pint << 8) & UINT_C(0xff00ff00)); pint++; } } #endif #endif } static void swap_channels(UINT4 *pSam, unsigned int Samples) { UINT4 *pend = (pSam + Samples); /* type UINT4 may not be greater than the assumed biggest type */ #if (SIZEOF_LONG_INT < 4) error type unsigned long is too small #endif #if (SIZEOF_LONG_INT == 4) unsigned long *plong = (unsigned long *)pSam; for (; plong < pend;) { *plong = ((*plong >> 16L) & UINT_C(0x0000ffff)) | ((*plong << 16L) & UINT_C(0xffff0000)); plong++; } #else /* sizeof long unsigned > 4 bytes */ #if (SIZEOF_LONG_INT == 8) #define INTEGRAL_LONGS (SIZEOF_LONG_INT-1UL) register unsigned long *plong; unsigned long *pend0 = (unsigned long *) (((unsigned long) pend) & ~ INTEGRAL_LONGS); if (((unsigned long) pSam) & INTEGRAL_LONGS) { *pSam = ((*pSam >> 16L) & UINT_C(0x0000ffff)) | ((*pSam << 16L) & UINT_C(0xffff0000)); pSam++; } plong = (unsigned long *)pSam; for (; plong < pend0;) { *plong = ((*plong >> 16L) & ULONG_C(0x0000ffff0000ffff)) | ((*plong << 16L) & ULONG_C(0xffff0000ffff0000)); plong++; } if (((unsigned long *) pend) != pend0) { UINT4 *pint = (UINT4 *) pend0; for (;pint < pend;) { *pint = ((*pint >> 16L) & UINT_C(0x0000ffff)) | ((*pint << 16L) & UINT_C(0xffff0000)); pint++; } } #else /* sizeof long unsigned > 4 bytes but not 8 */ { UINT4 *pint = pSam; for (;pint < pend;) { *pint = ((*pint >> 16L) & UINT_C(0x0000ffff)) | ((*pint << 16L) & UINT_C(0xffff0000)); pint++; } } #endif #endif } #ifdef ECHO_TO_SOUNDCARD static long ReSampleBuffer(unsigned char *p, unsigned char *newp, long samples, int samplesize); static long ReSampleBuffer(unsigned char *p, unsigned char *newp, long samples, int samplesize) { double idx=0.0; UINT4 di=0,si=0; if (global.playback_rate == 100.0) { memcpy(newp, p, samplesize* samples); di = samples; } else while( si < (UINT4)samples ){ memcpy( newp+(di*samplesize), p+(si*samplesize), samplesize ); idx += (double)(global.playback_rate/100.0); si = (UINT4)idx; di++; } return di*samplesize; } #endif static int guess_endianess(UINT4 *p, Int16_t *p2, unsigned SamplesToDo) { /* analyse samples */ int vote_for_little = 0; int vote_for_big = 0; int total_votes; while (((UINT4 *)p2 - p) + (unsigned) 1 < SamplesToDo) { unsigned char *p3 = (unsigned char *)p2; #if MY_LITTLE_ENDIAN == 1 int diff_lowl = *(p2+0) - *(p2+2); int diff_lowr = *(p2+1) - *(p2+3); int diff_bigl = ((*(p3 ) << 8) + *(p3+1)) - ((*(p3+4) << 8) + *(p3+5)); int diff_bigr = ((*(p3+2) << 8) + *(p3+3)) - ((*(p3+6) << 8) + *(p3+7)); #else int diff_lowl = ((*(p3+1) << 8) + *(p3 )) - ((*(p3+5) << 8) + *(p3+4)); int diff_lowr = ((*(p3+3) << 8) + *(p3+2)) - ((*(p3+7) << 8) + *(p3+6)); int diff_bigl = *(p2+0) - *(p2+2); int diff_bigr = *(p2+1) - *(p2+3); #endif if ((abs(diff_lowl) + abs(diff_lowr)) < (abs(diff_bigl) + abs(diff_bigr))) { vote_for_little++; } else { if ((abs(diff_lowl) + abs(diff_lowr)) > (abs(diff_bigl) + abs(diff_bigr))) { vote_for_big++; } } p2 += 2; } #ifdef DEBUG_VOTE_ENDIANESS if (global.quiet != 1) fprintf(stderr, "votes for little: %4d, votes for big: %4d\n", vote_for_little, vote_for_big); #endif total_votes = vote_for_big + vote_for_little; if (total_votes < 3 || abs(vote_for_big - vote_for_little) < total_votes/3) { return -1; } else { if (vote_for_big > vote_for_little) return 1; else return 0; } } int jitterShift = 0; void handle_inputendianess(UINT4 *p, unsigned SamplesToDo) { /* if endianess is unknown, guess endianess based on differences between succesive samples. If endianess is correct, the differences are smaller than with the opposite byte order. */ if ((*in_lendian) < 0) { Int16_t *p2 = (Int16_t *)p; /* skip constant samples */ while ((((UINT4 *)p2 - p) + (unsigned) 1 < SamplesToDo) && *p2 == *(p2+2)) p2++; if (((UINT4 *)p2 - p) + (unsigned) 1 < SamplesToDo) { switch (guess_endianess(p, p2, SamplesToDo)) { case -1: break; case 1: (*in_lendian) = 0; #if 0 if (global.quiet != 1) fprintf(stderr, "big endian detected\n"); #endif break; case 0: (*in_lendian) = 1; #if 0 if (global.quiet != 1) fprintf(stderr, "little endian detected\n"); #endif break; } } } /* ENDIAN ISSUES: * the individual endianess of cdrom/cd-writer, cpu, * sound card and audio output format need a careful treatment. * * For possible sample processing (rate conversion) we need * the samples in cpu byte order. This is the first conversion. * * After processing it depends on the endianness of the output * format, whether a second conversion is needed. * */ if (global.need_hostorder && (*in_lendian) != MY_LITTLE_ENDIAN) { /* change endianess of delivered samples to native cpu order */ change_endianness(p, SamplesToDo); } } unsigned char * synchronize(UINT4 *p, unsigned SamplesToDo, unsigned TotSamplesDone) { static int jitter = 0; char *pSrc; /* start of cdrom buffer */ /* synchronisation code */ if (TotSamplesDone != 0 && global.overlap != 0 && SamplesToDo > CD_FRAMESAMPLES) { pSrc = (char *) sync_buffers((unsigned char *)p); if (!pSrc ) { return NULL; } if (pSrc) { jitter = ((unsigned char *)pSrc - (((unsigned char *)p) + global.overlap*CD_FRAMESIZE_RAW))/4; jitterShift += jitter; SamplesToDo -= jitter + global.overlap*CD_FRAMESAMPLES; #if 0 fprintf(stderr, "Length: pre %d, diff1 %ld, diff2 %ld, min %ld\n", SamplesToDo, (TotSamplesWanted - TotSamplesDone), SamplesNeeded((TotSamplesWanted - TotSamplesDone), undersampling), min(SamplesToDo, SamplesNeeded((TotSamplesWanted - TotSamplesDone), undersampling))); #endif } } else { pSrc = ( char * ) p; } return (unsigned char *) pSrc; } /* convert cdda data to required output format * sync code for unreliable cdroms included * */ long SaveBuffer(UINT4 *p, unsigned long SamplesToDo, unsigned long *TotSamplesDone) { UINT4 *pSrc; /* start of cdrom buffer */ UINT4 *pSrcStop; /* end of cdrom buffer */ /* in case of different endianness between host and output format, or channel swaps, or deemphasizing copy in a seperate buffer and modify the local copy */ if ( ((((!global.need_hostorder && global.need_big_endian == (*in_lendian)) || (global.need_hostorder && global.need_big_endian != MY_BIG_ENDIAN) ) || (global.deemphasize != 0) ) && (global.OutSampleSize > 1) ) || global.swapchannels != 0) { static UINT4 *localoutputbuffer; if (localoutputbuffer == NULL) { localoutputbuffer = malloc(global.nsectors*CD_FRAMESIZE_RAW); if (localoutputbuffer == NULL) { perror("cannot allocate local buffer"); return 1; } } memcpy(localoutputbuffer, p, SamplesToDo*4); p = localoutputbuffer; } pSrc = p; pDst = (unsigned char *) p; pStart = ( unsigned char * ) pSrc; pSrcStop = pSrc + SamplesToDo; /* code for subsampling and output stage */ if (global.ismono && global.findmono) { Int16_t *pmm; for (pmm = (Int16_t *)pStart; (UINT4 *) pmm < pSrcStop; pmm += 2) { if (*pmm != *(pmm+1)) { global.ismono = 0; break; } } } /* optimize the case of no conversion */ if (1 && undersampling == 1 && samples_to_do == 1 && global.channels == 2 && global.OutSampleSize == 2 && Halved == 0) { /* output format is the original cdda format -> * just forward the buffer */ if ( waitforsignal != 0 && any_signal == 0) { UINT4 *myptr = (UINT4 *)pStart; while (myptr < pSrcStop && *myptr == 0) myptr++; pStart = (unsigned char *) myptr; /* scan for first signal */ if ( (UINT4 *)pStart != pSrcStop ) { /* first non null amplitude is found in buffer */ any_signal = 1; global.SkippedSamples += ((UINT4 *)pStart - p); } else { global.SkippedSamples += (pSrcStop - p); } } pDst = (unsigned char *) pSrcStop; /* set pDst to end */ if (global.deemphasize && (Get_Preemphasis(get_current_track())) ) { /* this implements an attenuation treble shelving filter to undo the effect of pre-emphasis. The filter is of a recursive first order */ static Int16_t lastin[2] = { 0, 0 }; static double lastout[2] = { 0.0, 0.0 }; Int16_t *pmm; /* Here is the gnuplot file for the frequency response of the deemphasis. The error is below +-0.1dB # first define the ideal filter. We use the tenfold sampling frequency. T=1./441000. OmegaU=1./15E-6 OmegaL=15./50.*OmegaU V0=OmegaL/OmegaU H0=V0-1. B=V0*tan(OmegaU*T/2.) # the coefficients follow a1=(B - 1.)/(B + 1.) b0=(1.0 + (1.0 - a1) * H0/2.) b1=(a1 + (a1 - 1.0) * H0/2.) # helper variables D=b1/b0 o=2*pi*T H2(f)=b0*sqrt((1+2*cos(f*o)*D+D*D)/(1+2*cos(f*o)*a1+a1*a1)) # now approximate the ideal curve with a fitted one for sampling frequency # of 44100 Hz. T2=1./44100. V02=0.3365 OmegaU2=1./19E-6 B2=V02*tan(OmegaU2*T2/2.) # the coefficients follow a12=(B2 - 1.)/(B2 + 1.) b02=(1.0 + (1.0 - a12) * (V02-1.)/2.) b12=(a12 + (a12 - 1.0) * (V02-1.)/2.) # helper variables D2=b12/b02 o2=2*pi*T2 H(f)=b02*sqrt((1+2*cos(f*o2)*D2+D2*D2)/(1+2*cos(f*o2)*a12+a12*a12)) # plot best, real, ideal, level with halved attenuation, # level at full attentuation, 10fold magnified error set logscale x set grid xtics ytics mxtics mytics plot [f=1000:20000] [-12:2] 20*log10(H(f)),20*log10(H2(f)), 20*log10(OmegaL/(2*pi*f)), 0.5*20*log10(V0), 20*log10(V0), 200*log10(H(f)/H2(f)) pause -1 "Hit return to continue" */ #ifdef TEST #define V0 0.3365 #define OMEGAG (1./19e-6) #define T (1./44100.) #define H0 (V0-1.) #define B (V0*tan((OMEGAG * T)/2.0)) #define a1 ((B - 1.)/(B + 1.)) #define b0 (1.0 + (1.0 - a1) * H0/2.0) #define b1 (a1 + (a1 - 1.0) * H0/2.0) #undef V0 #undef OMEGAG #undef T #undef H0 #undef B #else #define a1 -0.62786881719628784282 #define b0 0.45995451989513153057 #define b1 -0.08782333709141937339 #endif for (pmm = (Int16_t *)pStart; pmm < (Int16_t *)pDst;) { lastout[0] = *pmm * b0 + lastin[0] * b1 - lastout[0] * a1; lastin[0] = *pmm; *pmm++ = lastout[0] > 0.0 ? lastout[0] + 0.5 : lastout[0] - 0.5; lastout[1] = *pmm * b0 + lastin[1] * b1 - lastout[1] * a1; lastin[1] = *pmm; *pmm++ = lastout[1] > 0.0 ? lastout[1] + 0.5 : lastout[1] - 0.5; } #undef a1 #undef b0 #undef b1 } if (global.swapchannels == 1) { swap_channels((UINT4 *)pStart, SamplesToDo); } if (global.findminmax) { Int16_t *pmm; for (pmm = (Int16_t *)pStart; pmm < (Int16_t *)pDst; pmm++) { if (*pmm < global.minamp[1]) global.minamp[1] = *pmm; if (*pmm > global.maxamp[1]) global.maxamp[1] = *pmm; pmm++; if (*pmm < global.minamp[0]) global.minamp[0] = *pmm; if (*pmm > global.maxamp[0]) global.maxamp[0] = *pmm; } } } else { #define none_missing 0 #define one_missing 1 #define two_missing 2 #define collecting 3 static int sample_state = collecting; static int Toggle_on = 0; if (global.channels == 2 && global.swapchannels == 1) { swap_channels((UINT4 *)pStart, SamplesToDo); } /* conversion required */ while ( pSrc < pSrcStop ) { long l,r; long iSamples_left = (pSrcStop - pSrc) / sizeof(Int16_t) / 2; Int16_t *myptr = (Int16_t *) pSrc; /* LSB l, MSB l */ l = *myptr++; /* left channel */ r = *myptr++; /* right channel */ pSrc = (UINT4 *) myptr; switch (sample_state) { case two_missing: two__missing: ls2 += l; rs2 += r; if (undersampling > 1) { ls3 += l; rs3 += r; } sample_state = one_missing; break; case one_missing: auxl = l; auxr = r; ls3 += l; rs3 += r; sample_state = none_missing; /* FALLTHROUGH */ none__missing: case none_missing: /* Filtered samples are complete. Now interpolate and scale. */ if (Halved != 0 && Toggle_on == 0) { lsum = interpolate(lsum, ls2, ls3)/(int) undersampling; rsum = interpolate(rsum, rs2, rs3)/(int) undersampling; } else { lsum /= (int) undersampling; rsum /= (int) undersampling; } emit_sample(lsum, rsum, global.channels); /* reload counter */ samples_to_do = undersampling - 1; lsum = auxl; rsum = auxr; /* reset sample register */ auxl = ls2 = ls3 = 0; auxr = rs2 = rs3 = 0; Toggle_on ^= 1; sample_state = collecting; break; case collecting: if ( samples_to_do > 0) { samples_to_do--; if (Halved != 0 && Toggle_on == 0) { /* Divider x.5 : we need data for quadratic interpolation */ iSamples_left--; lsum += l; rsum += r; if ( samples_to_do < undersampling - 1) { ls2 += l; rs2 += r; } if ( samples_to_do < undersampling - 2) { ls3 += l; rs3 += r; } } else { /* integral divider */ lsum += l; rsum += r; iSamples_left--; } } else { if (Halved != 0 && Toggle_on == 0) { sample_state = two_missing; goto two__missing; } else { auxl = l; auxr = r; sample_state = none_missing; goto none__missing; } } break; } /* switch state */ } /* while */ /* flush_buffer */ if ((samples_to_do == 0 && Halved == 0)) { if (Halved != 0 && Toggle_on == 0) { lsum = interpolate(lsum, ls2, ls3)/(int) undersampling; rsum = interpolate(rsum, rs2, rs3)/(int) undersampling; } else { lsum /= (int) undersampling; rsum /= (int) undersampling; } emit_sample(lsum, rsum, global.channels); /* reload counter */ samples_to_do = undersampling; /* reset sample register */ lsum = auxl = ls2 = ls3 = 0; rsum = auxr = rs2 = rs3 = 0; Toggle_on ^= 1; sample_state = collecting; } } /* if optimize else */ if ( waitforsignal == 0 ) pStart = (unsigned char *)p; if ( waitforsignal == 0 || any_signal != 0) { int retval = 0; unsigned outlen; unsigned todo; assert(pDst >= pStart); outlen = (size_t) (pDst - pStart); if (outlen <= 0) return 0; #ifdef ECHO_TO_SOUNDCARD /* this assumes the soundcard needs samples in native cpu byte order */ if (global.echo != 0) { static unsigned char *newp; unsigned newlen; newlen = (100*(outlen/4))/global.playback_rate; newlen = (newlen*4); if ( (newp != NULL) || (newp = malloc( 2*global.nsectors*CD_FRAMESIZE_RAW+32 )) ) { newlen = ReSampleBuffer( pStart, newp, outlen/4, global.OutSampleSize*global.channels ); write_snd_device((char *)newp, newlen); } } #endif if ( global.no_file != 0 ) { *TotSamplesDone += SamplesToDo; return 0; } if ( (!global.need_hostorder && global.need_big_endian == (*in_lendian)) || (global.need_hostorder && global.need_big_endian != MY_BIG_ENDIAN)) { if ( global.OutSampleSize > 1) { /* change endianness from input sample or native cpu order to required output endianness */ change_endianness((UINT4 *)pStart, outlen/4); } } { unsigned char * p2 = pStart; todo = outlen; while (todo != 0) { int retval_; retval_ = global.audio_out->WriteSound ( global.audio, p2, todo ); if (retval_ < 0) break; p2 += retval_; todo -= retval_; } } if (todo == 0) { *TotSamplesDone += SamplesToDo; return 0; } else { fprintf(stderr, "write(audio, 0x%p, %u) = %d\n",pStart,outlen,retval); perror("Probably disk space exhausted"); return 1; } } else { *TotSamplesDone += SamplesToDo; return 0; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/lowlevel.h���������������������������������������������������������������������0000644�0003725�0000144�00000001252�10477233650�015372� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)lowlevel.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ /* os dependent functions */ #ifndef LOWLEVEL # define LOWLEVEL 1 # if defined(__linux__) # include <linux/version.h> # include <linux/major.h> # endif /* defined __linux__ */ #endif /* ifndef LOWLEVEL */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/icedax.1�����������������������������������������������������������������������0000644�0003725�0000144�00000076377�10545046762�014735� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������'\" t .\" @(#)icedax.1 1.14 02/12/09 Copyright 1998,1999,2000 Heiko Eissfeldt .if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a .if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o .if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u .if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A .if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O .if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U .if t .ds s \\(*b .if t .ds S SS .if n .ds a ae .if n .ds o oe .if n .ds u ue .if n .ds s sz .if t .ds m \\(*m .if n .ds m micro .TH ICEDAX 1 .SH NAME icedax \- a sampling utility that dumps CD audio data into wav sound files .SH SYNOPSIS .B icedax .RB [ -c .IR chans ] .RB [ -s ] .RB [ -m ] .RB [ -b .IR bits ] .RB [ -r .IR rate ] .RB [ -a .IR divider ] .RB [ -t .IR track [ +endtrack ]] .RB [ -i .IR index ] .RB [ -o .IR offset ] .RB [ -d .IR duration ] .RB [ -x ] .RB [ -q ] .RB [ -w ] .RB [ -v .IR optlist ] .RB [ -V ] .RB [ -Q ] .RB [ -J ] .RB [ -L .IR cddbmode ] .RB [ -R ] .RB [ -P .IR sectors ] .RB [ -F ] .RB [ -G ] .RB [ -T ] .RB [ -e ] .RB [ -p .IR percentage ] .RB [ -n .IR sectors ] .RB [ -l .IR buffers ] .RB [ -N ] .RB [ -J ] .RB [ -H ] .RB [ -g ] .RB [ -B ] .RB [ -D .IR device ] .RB [ -A .IR auxdevice ] .RB [ -I .IR interface ] .RB [ -O .IR audiotype ] .RB [ -C .IR input-endianess ] .RB [ -E .IR output-endianess ] .RB [ -M .IR count ] .RB [ -S .IR speed ] .RB [ -paranoia ] .RB [ cddbp-server=servername ] .RB [ cddbp-port=portnumber ] .RI [ filename(s) or .IR directories ] .SH DESCRIPTION .B icedax stands for InCrEdible Digital Audio eXtractor. It can retrieve audio tracks .RB ( CDDA ) from CDROM drives that are capable of reading audio data digitally to the host (see README for a list of drives). .SH OPTIONS .TP .BI dev= device .TP .BI \-D " device .TP .BI \-device " device uses .B device as the source for CDDA reading. For example .B /dev/cdrom or .B Bus,ID,Lun. The device specification can also have influence on the selection of the driver interface (eg. on Linux). See the .B \-I option for details. .sp The setting of the environment variable .B CDDA_DEVICE is overridden by this option. .TP .BI \-A " auxdevice .TP .BI \-auxdevice " auxdevice uses .B auxdevice as CDROM drive for ioctl usage. .TP .BI \-I " interface .TP .BI \-interface " interface specifies the interface for CDROM access: .B generic_scsi or (on Linux, and FreeBSD systems) .BR cooked_ioctl . .sp Using the .B cooked_ioctl is not recommended as this makes .B icedax mainly depend on the audio extraction quality of the operating system which is usually extremely bad. .TP .BI \-c " channels --channels" uses .B 1 for mono, or .B 2 for stereo recording, or .B s for stereo recording with both channels swapped. .TP .B \-s " --stereo" sets to stereo recording. .TP .B \-m " --mono" sets to mono recording. .TP .B \-x " --max" sets maximum (CD) quality. .TP .BI \-b " bits --bits-per-sample" sets bits per sample per channel: .BR 8 , .B 12 or .BR 16 . .TP .BI \-r " rate --rate" sets rate in samples per second. Possible values are listed with the .B \-R option. .TP .BI \-a " divider --divider" sets rate to 44100Hz / divider. Possible values are listed with the .B \-R option. .TP .B \-R " --dump-rates" shows a list of all sample rates and their dividers. .TP .B \-P " sectors --set-overlap" sets the initial number of overlap .I sectors for jitter correction. .TP .BI \-n " sectors --sectors-per-request" reads .I sectors per request. .TP .BI \-l " buffers --buffers-in-ring" uses a ring buffer with .I buffers total. .TP .BI \-t " track+endtrack --track" selects the start track and optionally the end track. .TP .BI \-i " index --index" selects the start index. .TP .BI \-o " offset --offset" starts .I offset sectors behind start track (one sector equivalents 1/75 seconds). .TP .B \-O " audiotype --output-format" can be .I wav (for wav files) or .I aiff (for apple/sgi aiff files) or .I aifc (for apple/sgi aifc files) or .I au or .I sun (for sun .au PCM files) or .I cdr or .I raw (for headerless files to be used for cd writers). .TP .BI \-C " endianess --cdrom-endianess" sets endianess of the input samples to 'little', 'big' or 'guess' to override defaults. .TP .BI \-E " endianess --output-endianess" sets endianess of the output samples to 'little' or 'big' to override defaults. .TP .BI \-d " duration --duration" sets recording time in seconds or frames. Frames (sectors) are indicated by a 'f' suffix (like 75f for 75 sectors). .B 0 sets the time for whole track. .TP .B \-B " --bulk --alltracks" copies each track into a separate file. .TP .B \-w " --wait" waits for signal, then start recording. .TP .B \-F " --find-extremes" finds extreme amplitudes in samples. .TP .B \-G " --find-mono" finds if input samples are in mono. .TP .B \-T " --deemphasize" undo the effect of pre-emphasis in the input samples. .TP .B \-e " --echo" copies audio data to sound device e.g. .BR /dev/dsp . .TP .B \-p " percentage --set-pitch" changes pitch of audio data copied to sound device. .TP .B \-v " itemlist --verbose-level" prints verbose information about the CD. .B Level is a list of comma separated suboptions. Each suboption controls the type of information to be reported. .TS H allbox; c cw(1i) r l. Suboption Description disable no information is given, warnings appear however all all information is given toc show table of contents summary show a summary of the recording parameters indices determine and display index offsets catalog retrieve and display the media catalog number MCN trackid T{ .na retrieve and display all International Standard Recording Codes ISRC T} sectors T{ .na show the table of contents in start sector notation T} titles T{ .na show the table of contents with track titles (when available) T} .TE .TP .B \-N " --no-write" does not write to a file, it just reads (for debugging purposes). .TP .B \-J " --info-only" does not write to a file, it just gives information about the disc. .TP .B \-L " cddb mode --cddb" does a cddbp album- and track title lookup based on the cddb id. The parameter cddb mode defines how multiple entries shall be handled. .TS H allbox; c cw(4i) r l. Parameter Description 0 T{ .na interactive mode. The user selects the entry to use. T} 1 T{ .na first fit mode. The first entry is taken unconditionally. T} .TE .TP .B " cddbp-server=servername" sets the server to be contacted for title lookups. .TP .B " cddbp-port=portnumber" sets the port number to be used for title lookups. .TP .B \-H " --no-infofile" does not write an info file and a cddb file. .TP .B \-g " --gui" formats the output to be better parsable by gui frontends. .TP .B \-M " count --md5" enables calculation of MD-5 checksum for 'count' bytes from a beginning of a track. .TP .B \-S " speed --speed" sets the cdrom device to one of the selectable speeds for reading. .TP .B \-q " --quiet" quiet operation, no screen output. .TP .B \-V " --verbose-SCSI" enable SCSI command logging to the console. This is mainly used for debugging. .TP .B \-Q " --silent-SCSI" suppress SCSI command error reports to the console. This is mainly used for guis. .TP .B \-scanbus Scan all SCSI devices on all SCSI busses and print the inquiry strings. This option may be used to find SCSI address of the CD/DVD-Recorder on a system. The numbers printed out as labels are computed by: .B "bus * 100 + target .TP .B \-\-devices Like \-scanbus but works in a more native way, respecting the device name specification on the current operating system. See .B wodim(1) for details. .TP .B \-paranoia use the paranoia library instead of icedax's routines for reading. .TP .B \-h " --help" display version of icedax on standard output. .TP Defaults depend on the .B Makefile and .B environment variable settings (currently .B CDDA_DEVICE ). .SH "ENVIRONMENT VARIABLES" .B CDDA_DEVICE is used to set the device name. The device naming is compatible with the one used by the wodim tool. .TP .B CDDBP_SERVER is used for cddbp title lookups when supplied. .TP .B CDDBP_PORT is used for cddbp title lookups when supplied. .TP .B RSH If the .B RSH environment variable is present, the remote connection will not be created via .BR rcmd (3) but by calling the program pointed to by .BR RSH . Use e.g. .BR RSH= /usr/bin/ssh to create a secure shell connection. .sp Note that this forces .B icedax to create a pipe to the .B rsh(1) program and disallows .B icedax to directly access the network socket to the remote server. This makes it impossible to set up performance parameters and slows down the connection compared to a .B root initiated .B rcmd(3) connection. .TP .B RSCSI If the .B RSCSI environment variable is present, the remote SCSI server will not be the program .B /opt/schily/sbin/rscsi but the program pointed to by .BR RSCSI . Note that the remote SCSI server program name will be ignored if you log in using an account that has been created with a remote SCSI server program as login shell. .SH "RETURN VALUES" .B icedax uses the following exit codes to indicate various degrees of success: .TS H allbox; c cw(1i) r l. Exitcode Description 0 no errors encountered, successful operation. 1 usage or syntax error. icedax got inconsistent arguments. 2 permission (un)set errors. permission changes failed. 3 read errors on the cdrom/burner device encountered. 4 T{ .na write errors while writing one of the output files encountered. T} 5 errors with soundcard handling (initialization/write). 6 T{ .na errors with stat() system call on the read device (cooked ioctl). T} 7 pipe communication errors encountered (in forked mode). 8 signal handler installation errors encountered. 9 allocation of shared memory failed (in forked mode). 10 dynamic heap memory allocation failed. 11 errors on the audio cd medium encountered. 12 device open error in ioctl handling detected. 13 race condition in ioctl interface handling detected. 14 error in ioctl() operation encountered. 15 internal error encountered. Please report back!!! 16 T{ .na error in semaphore operation encountered (install / request). T} 17 could not get the scsi transfer buffer. 18 T{ .na could not create pipes for process communication (in forked mode). T} .TE .SH "DISCUSSION" .B icedax is able to read parts of an .B audio CD or .B multimedia CDROM (containing audio parts) directly digitally. These parts can be written to a file, a pipe, or to a sound device. .PP .B icedax stands for .B CDDA to .B WAV (where .B CDDA stands for compact disc digital audio and .B WAV is a sound sample format introduced by MS Windows). It allows copying .B CDDA audio data from the CDROM drive into a file in .B WAV or other formats. .PP The latest versions try to get higher real-time scheduling priorities to ensure smooth (uninterrupted) operation. These priorities are available for super users and are higher than those of 'normal' processes. Thus delays are minimized. .PP If your CDROM is on device .B DEV and it is loaded with an audio CD, you may simply invoke .B icedax dev=DEV and it will create the sound file .B audio.wav recording the whole track beginning with track 1 in stereo at 16 bit at 44100 Hz sample rate, if your file system has enough space free. Otherwise recording time will be limited. For details see files .B README and .B README.INSTALL . .SH "HINTS ON OPTIONS" .IP "Options" Most of the options are used to control the format of the WAV file. In the following text all of them are described. .IP "Select Device" .BI \-D " device" selects the CDROM drive device to be used. The specifier given should correspond to the selected interface (see below). .B CHANGE! For the cooked_ioctl interface this is the cdrom device descriptor as before. .B The SCSI devices used with the generic SCSI interface however are now .B addressed with their SCSI-Bus, SCSI-Id, and SCSI-Lun instead of the generic .B SCSI device descriptor!!! One example for a SCSI CDROM drive on bus 0 with SCSI ID 3 and lun 0 is -D0,3,0. .IP "Select Auxiliary device" .BI \-A " auxdevice" is necessary for CD-Extra handling. For Non-SCSI-CDROM drives this is the same device as given by -D (see above). For SCSI-CDROM drives it is the CDROM drive (SCSI) device (i.e. .B /dev/sr0 ) corresponding to the SCSI device (i.e. .B 0,3,0 ). It has to match the device used for sampling. .IP "Select Interface" .BI \-I " interface" selects the CDROM drive interface. For SCSI drives use generic_scsi (cooked_ioctl may not yet be available for all devices): .B generic_scsi and .BR cooked_ioctl . The first uses the generic SCSI interface, the latter uses the ioctl of the CDROM driver. The latter variant works only when the kernel driver supports .B CDDA reading. This entry has to match the selected CDROM device (see above). .IP "Enable echo to soundcard" .B \-e copies audio data to the sound card while recording, so you hear it nearly simultaneously. The soundcard gets the same data that is recorded. This is time critical, so it works best with the .B \-q option. To use .B icedax as a pseudo CD player without recording in a file you could use .B "icedax \-q \-e \-t2 \-d0 \-N" to play the whole second track. This feature reduces the recording speed to at most onefold speed. You cannot make better recordings than your sound card can play (since the same data is used). .IP "Change pitch of echoed audio" .B "\-p percentage" changes the pitch of all audio echoed to a sound card. Only the copy to the soundcard is affected, the recorded audio samples in a file remain the same. Normal pitch, which is the default, is given by 100%. Lower percentages correspond to lower pitches, i.e. -p 50 transposes the audio output one octave lower. See also the script .B pitchplay as an example. This option was contributed by Raul Sobon. .IP "Select mono or stereo recording" .B \-m or .B "\-c 1" selects mono recording (both stereo channels are mixed), .B \-s or .B "\-c 2" or .B "\-c s" selects stereo recording. Parameter s will swap both sound channels. .IP "Select maximum quality" .B \-x will set stereo, 16 bits per sample at 44.1 KHz (full CD quality). Note that other format options given later can change this setting. .IP "Select sample quality" .B "\-b 8" specifies 8 bit (1 Byte) for each sample in each channel; .B "\-b 12" specifies 12 bit (2 Byte) for each sample in each channel; .B "\-b 16" specifies 16 bit (2 Byte) for each sample in each channel (Ensure that your sample player or sound card is capable of playing 12-bit or 16-bit samples). Selecting 12 or 16 bits doubles file size. 12-bit samples are aligned to 16-bit samples, so they waste some disk space. .IP "Select sample rate" .BI \-r " samplerate" selects a sample rate. .I samplerate can be in a range between 44100 and 900. Option .B \-R lists all available rates. .IP "Select sample rate divider" .BI \-a " divider" selects a sample rate divider. .I divider can be minimally 1 and maximally 50.5 and everything between in steps of 0.5. Option .B \-R lists all available rates. .IP To make the sound smoother at lower sampling rates, .B icedax sums over .I n samples (where .I n is the specific dividend). So for 22050 Hertz output we have to sum over 2 samples, for 900 Hertz we have to sum over 49 samples. This cancels higher frequencies. Standard sector size of an audio CD (ignoring additional information) is 2352 Bytes. In order to finish summing for an output sample at sector boundaries the rates above have to be chosen. Arbitrary sampling rates in high quality would require some interpolation scheme, which needs much more sophisticated programming. .IP "List a table of all sampling rates" .BI \-R shows a list of all sample rates and their dividers. Dividers can range from 1 to 50.5 in steps of 0.5. .IP "Select start track and optionally end track" .BI \-t " n+m" selects .B n as the start track and optionally .B m as the last track of a range to be recorded. These tracks must be from the table of contents. This sets the track where recording begins. Recording can advance through the following tracks as well (limited by the optional end track or otherwise depending on recording time). Whether one file or different files are then created depends on the .B \-B option (see below). .IP "Select start index" .BI \-i " n" selects the index to start recording with. Indices other than 1 will invoke the index scanner, which will take some time to find the correct start position. An offset may be given additionally (see below). .IP "Set recording time" .B \-d " n" sets recording time to .I n seconds or set recording time for whole track if .I n is zero. In order to specify the duration in frames (sectors) also, the argument can have an appended 'f'. Then the numerical argument is to be taken as frames (sectors) rather than seconds. Please note that if track ranges are being used they define the recording time as well thus overriding any .BR \-d " option" specified times. .IP Recording time is defined as the time the generated sample will play (at the defined sample rate). Since it's related to the amount of generated samples, it's not the time of the sampling process itself (which can be less or more). It's neither strictly coupled with the time information on the audio CD (shown by your hifi CD player). Differences can occur by the usage of the .B \-o option (see below). Notice that recording time will be shortened, unless enough disk space exists. Recording can be aborted at anytime by pressing the break character (signal SIGQUIT). .IP "Record all tracks of a complete audio CD in separate files" .B \-B copies each track into a separate file. A base name can be given. File names have an appended track number and an extension corresponding to the audio format. To record all audio tracks of a CD, use a sufficient high duration (i.e. -d99999). .IP "Set start sector offset" .BI \-o " sectors" increments start sector of the track by .IR sectors . By this option you are able to skip a certain amount at the beginning of a track so you can pick exactly the part you want. Each sector runs for 1/75 seconds, so you have very fine control. If your offset is so high that it would not fit into the current track, a warning message is issued and the offset is ignored. Recording time is not reduced. (To skip introductory quiet passages automagically, use the .B \-w option see below.) .IP "Wait for signal option" .B \-w Turning on this option will suppress all silent output at startup, reducing possibly file size. .B icedax will watch for any signal in the output signal and switches on writing to file. .IP "Find extreme samples" .B \-F Turning on this option will display the most negative and the most positive sample value found during recording for both channels. This can be useful for readjusting the volume. The values shown are not reset at track boundaries, they cover the complete sampling process. They are taken from the original samples and have the same format (i.e. they are independent of the selected output format). .IP "Find if input samples are in mono" .B \-G If this option is given, input samples for both channels will be compared. At the end of the program the result is printed. Differences in the channels indicate stereo, otherwise when both channels are equal it will indicate mono. .IP "Undo the pre-emphasis in the input samples" .B \-T Some older audio CDs are recorded with a modified frequency response called pre-emphasis. This is found mostly in classical recordings. The correction can be seen in the flags of the Table Of Contents often. But there are recordings, that show this setting only in the subchannels. If this option is given, the index scanner will be started, which reads the q-subchannel of each track. If pre-emphasis is indicated in the q-subchannel of a track, but not in the TOC, pre-emphasis will be assumed to be present, and subsequently a reverse filtering is done for this track before the samples are written into the audio file. .IP "Set audio format" .B \-O " audiotype" can be .I wav (for wav files) or .I au or .I sun (for sun PCM files) or .I cdr or .I raw (for headerless files to be used for cd writers). All file samples are coded in linear pulse code modulation (as done in the audio compact disc format). This holds for all audio formats. Wav files are compatible to Wind*ws sound files, they have lsb,msb byte order as being used on the audio cd. The default filename extension is '.wav'. Sun type files are not like the older common logarithmically coded .au files, but instead as mentioned above linear PCM is used. The byte order is msb,lsb to be compatible. The default filename extension is '.au'. The AIFF and the newer variant AIFC from the Apple/SGI world store their samples in bigendian format (msb,lsb). In AIFC no compression is used. Finally the easiest 'format', the cdr aka raw format. It is done per default in msb,lsb byte order to satisfy the order wanted by most cd writers. Since there is no header information in this format, the sample parameters can only be identified by playing the samples on a soundcard or similar. The default filename extension is '.cdr' or '.raw'. .IP "Select cdrom drive reading speed" .B \-S " speed" allows to switch the cdrom drive to a certain level of speed in order to reduce read errors. The argument is transfered verbatim to the drive. Details depend very much on the cdrom drives. An argument of 0 for example is often the default speed of the drive, a value of 1 often selects single speed. .IP "Enable MD5 checksums" .B \-M " count" enables calculation of MD-5 checksum for 'count' bytes from the beginning of a track. This was introduced for quick comparisons of tracks. .IP "Use Monty's libparanoia for reading of sectors" .B \-paranoia selects an alternate way of extracting audio sectors. Monty's library is used with the following default options: .sp PARANOIA_MODE_FULL, but without PARANOIA_MODE_NEVERSKIP .sp for details see Monty's libparanoia documentation. In this case the option .B \-P has no effect. .IP "Do linear or overlapping reading of sectors" (This applies unless option .B \-paranoia is used.) .B \-P " sectors" sets the given number of sectors for initial overlap sampling for jitter correction. Two cases are to be distinguished. For nonzero values, some sectors are read twice to enable icedax's jitter correction. If an argument of zero is given, no overlap sampling will be used. For nonzero overlap sectors icedax dynamically adjusts the setting during sampling (like cdparanoia does). If no match can be found, icedax retries the read with an increased overlap. If the amount of jitter is lower than the current overlapped samples, icedax reduces the overlap setting, resulting in a higher reading speed. The argument given has to be lower than the total number of sectors per request (see option .I -n below). Icedax will check this setting and issues a error message otherwise. The case of zero sectors is nice on low load situations or errorfree (perfect) cdrom drives and perfect (not scratched) audio cds. .IP "Set the transfer size" .B \-n " sectors" will set the transfer size to the specified sectors per request. .IP "Set number of ring buffer elements" .B \-l " buffers" will allocate the specified number of ring buffer elements. .IP "Set endianess of input samples" .B \-C " endianess" will override the default settings of the input format. Endianess can be set explicitly to "little" or "big" or to the automatic endianess detection based on voting with "guess". .IP "Set endianess of output samples" .B \-E " endianess" (endianess can be "little" or "big") will override the default settings of the output format. .IP "Verbose option" .B \-v " itemlist" prints more information. A list allows selection of different information items. .sp .B "disable" keeps quiet .sp .B "toc" displays the table of contents .sp .B "summary" displays a summary of recording parameters .sp .B "indices" invokes the index scanner and displays start positions of indices .sp .B "catalog" retrieves and displays a media catalog number .sp .B "trackid" retrieves and displays international standard recording codes .sp .B "sectors" displays track start positions in absolute sector notation .sp To combine several requests just list the suboptions separated with commas. .IP "The table of contents" The display will show the table of contents with number of tracks and total time (displayed in .IR mm : ss . hh format, .IR mm =minutes, .IR ss =seconds, .IR hh "=rounded 1/100 seconds)." The following list displays track number and track time for each entry. The summary gives a line per track describing the type of the track. .sp .ce 1 .B "track preemphasis copypermitted tracktype chans" .sp The .B track column holds the track number. .B preemphasis shows if that track has been given a non linear frequency response. NOTE: You can undo this effect with the .B \-T option. .B "copy-permitted" indicates if this track is allowed to copy. .B "tracktype" can be data or audio. On multimedia CDs (except hidden track CDs) both of them should be present. .B "channels" is defined for audio tracks only. There can be two or four channels. .IP "No file output" .B \-N this debugging option switches off writing to a file. .IP "No infofile generation" .B \-H this option switches off creation of an info file and a cddb file. .IP "Generation of simple output for gui frontends" .B \-g this option switches on simple line formatting, which is needed to support gui frontends (like xcd-roast). .IP "Verbose SCSI logging" .B \-V this option switches on logging of SCSI commands. This will produce a lot of output (when SCSI devices are being used). This is needed for debugging purposes. The format is the same as being used with the cdrecord program from J\*org Schilling or the wodim tool. See there for details. .IP "Quiet option" .B \-q suppresses all screen output except error messages. That reduces cpu time resources. .IP "Just show information option" .B \-J does not write a file, it only prints information about the disc (depending on the .B \-v option). This is just for information purposes. .SH "CDDBP support" .IP "Lookup album and track titles option" .B \-L " cddbp mode" Icedax tries to retrieve performer, album-, and track titles from a cddbp server. The default server right now is 'freedb.freedb.org'. It is planned to have more control over the server handling later. The parameter defines how multiple entries are handled: .PP 0 interactive mode, the user chooses one of the entries. .PP 1 take the first entry without asking. .IP "Set server for title lookups" .B cddbp-server " servername" When using \-L or --cddb, the server being contacted can be set with this option. .IP "Set portnumber for title lookups" .B cddbp-port " portnumber" When using \-L or --cddb, the server port being contacted can be set with this option. .SH "HINTS ON USAGE" Don't create samples you cannot read. First check your sample player software and sound card hardware. I experienced problems with very low sample rates (stereo <= 1575 Hz, mono <= 3675 Hz) when trying to play them with standard WAV players for sound blaster (maybe they are not legal in .B WAV format). Most CD-Writers insist on audio samples in a bigendian format. Now icedax supports the .B \-E " endianess" option to control the endianess of the written samples. .PP If your hardware is fast enough to run icedax uninterrupted and your CD drive is one of the 'perfect' ones, you will gain speed when switching all overlap sampling off with the .B \-P " 0" option. Further fine tuning can be done with the .B \-n " sectors" option. You can specify how much sectors should be requested in one go. .PP Icedax supports .B pipes now. Use a filename of .B \- to let icedax output its samples to standard output. .PP Conversion to other sound formats can be done using the .B sox program package (although the use of .B sox -x to change the byte order of samples should be no more necessary; see option .B \-E to change the output byteorder). .PP If you want to sample more than one track into different files in one run, this is currently possible with the .B \-B option. When recording time exceeds the track limit a new file will be opened for the next track. .SH FILES Icedax can generate a lot of files for various purposes. .sp Audio files: .sp There are audio files containing samples with default extensions .wav, .au, .aifc, .aiff, and .cdr according to the selected sound format. These files are not generated when option (-N) is given. Multiple files may be written when the bulk copy option (-B) is used. Individual file names can be given as arguments. If the number of file names given is sufficient to cover all included audio tracks, the file names will be used verbatim. Otherwise, if there are less file names than files needed to write the included tracks, the part of the file name before the extension is extended with '_dd' where dd represents the current track number. .sp Cddb and Cdindex files: .sp If icedax detects cd-extra or cd-text (album/track) title information, then .cddb and .cdindex files are generated unless suppressed by the option -H. They contain suitable formatted entries for submission to audio cd track title databases in the internet. The CDINDEX and CDDB(tm) systems are currently supported. For more information please visit www.musicbrainz.org and www.freedb.com. .sp Inf files: .sp The inf files are describing the sample files and the part from the audio cd, it was taken from. They are a means to transfer information to a cd burning program like wodim. For example, if the original audio cd had pre-emphasis enabled, and icedax -T did remove the pre-emphasis, then the inf file has pre-emphasis not set (since the audio file does not have it anymore), while the .cddb and the .cdindex have pre-emphasis set as the original does. .SH WARNING .B IMPORTANT: it is prohibited to sell copies of copyrighted material by noncopyright holders. This program may not be used to circumvent copyrights. The user acknowledges this constraint when using the software. .SH BUGS Generation of md5 checksums is currently broken. .sp Performance may not be optimal on slower systems. .sp The index scanner may give timeouts. .sp The resampling (rate conversion code) uses polynomial interpolation, which is not optimal. .sp Icedax should use threads. .sp Icedax currently cannot sample hidden audio tracks (track 1 index 0). .SH ACKNOWLEDGEMENTS Thanks goto Project MODE (http://www.mode.net/) and Fraunhofer Institut f\*ur integrierte Schaltungen (FhG-IIS) (http://www.iis.fhg.de/) for financial support. Plextor Europe and Ricoh Japan provided cdrom disk drives and cd burners which helped a lot to develop this software. Rammi has helped a lot with the debugging and showed a lot of stamina when hearing 100 times the first 16 seconds of the first track of the Krupps CD. Libparanoia contributed by Monty (Christopher Montgomery) xiphmont@mit.edu. .SH AUTHOR Heiko Eissfeldt heiko@colossus.escape.de .PP This manpage describes the program implementation of .B icedax as shipped by the cdrkit distribution. See .B http://alioth.debian.org/projects/debburn/ for details. It is a spinoff from the original program cdda2wav as distributed in the cdrtools package [1]. However, the cdrtools developers are not involved in the development of this spinoff and therefore shall not be made responsible for any problem caused by it. Do not try to get support for this program by contacting the original authors. .PP If you have support questions, send them to .PP .B debburn-devel@lists.alioth.debian.org .br .PP If you have definitely found a bug, send a mail to this list or to .PP .B submit@bugs.debian.org .br .PP writing at least a short description into the Subject and "Package: cdrkit" into the first line of the mail body. .SH DATE 26 Sep 2006 .SH SOURCES .PP .br [1] Cdrtools 2.01.01a08 from May 2006, http://cdrecord.berlios.de �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cdrkit-1.1.11/icedax/aifc.h�������������������������������������������������������������������������0000644�0003725�0000144�00000000766�10477233650�014454� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)aifc.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ extern struct soundfile aifcsound; ����������cdrkit-1.1.11/icedax/sun.h��������������������������������������������������������������������������0000644�0003725�0000144�00000000764�10477233650�014355� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)sun.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ extern struct soundfile sunsound; ������������cdrkit-1.1.11/icedax/toc.c��������������������������������������������������������������������������0000644�0003725�0000144�00000266620�10760743311�014330� 0����������������������������������������������������������������������������������������������������ustar �steve���������������������������users������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)toc.c 1.57 06/02/19 Copyright 1998-2003 Heiko Eissfeldt */ /* * Copyright: GNU Public License 2 applies * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * CDDA2WAV (C) Heiko Eissfeldt heiko@hexco.de * CDDB routines (C) Ti Kan and Steve Scherf */ #include "config.h" #include <stdio.h> #include <standard.h> #include <stdxlib.h> #include <strdefs.h> #include <utypes.h> #include <intcvt.h> #include <unixstd.h> /* sleep */ #include <ctype.h> #include <errno.h> #include <fctldefs.h> #include <vadefs.h> #include <schily.h> #include <libport.h> #include <sys/ioctl.h> #define CD_TEXT #define CD_EXTRA #undef DEBUG_XTRA #undef DEBUG_CDTEXT #undef DEBUG_CDDBP #include <usal/scsitransp.h> #include "mytype.h" #include "byteorder.h" #include "interface.h" #include "icedax.h" #include "global.h" #include "sha.h" #include "base64.h" #include "toc.h" #include "exitcodes.h" #include "ringbuff.h" int Get_Mins(unsigned long p_track); int Get_Secs(unsigned long p_track); int Get_Frames(unsigned long p_track); int Get_Flags(unsigned long p_track); int Get_SCMS(unsigned long p_track); #if defined USE_REMOTE /* tcp stuff */ /* fix OS/2 compilation */ #ifdef __EMX__ #define gethostid nogethostid #endif #include <sys/socket.h> #undef gethostid #include <netinet/in.h> #if defined(HAVE_NETDB_H) && !defined(HOST_NOT_FOUND) && \ !defined(_INCL_NETDB_H) #include <netdb.h> #define _INCL_NETDB_H #endif #endif int have_CD_text; int have_multisession; int have_CD_extra; int have_CDDB; struct iterator; static void UpdateTrackData(int p_num); static void UpdateIndexData(int p_num); static void UpdateTimeData(int p_min, int p_sec, int p_frm); static unsigned int is_multisession(void); static unsigned int get_end_of_last_audio_track(unsigned mult_off); static int cddb_sum(int n); static void dump_extra_info(unsigned from); static int GetIndexOfSector(unsigned sec, unsigned track); static int patch_cd_extra(unsigned track, unsigned long sector); static void patch_to_audio(unsigned long p_track); static int restrict_tracks_illleadout(void); static void Set_MCN(unsigned char *MCN_arg); static void Set_ISRC(int track, const unsigned char *ISRC_arg); static void InitIterator(struct iterator *iter, unsigned long p_track); static unsigned char g_track=0xff, g_index=0xff; /* current track, index */ /* Conversion function: from logical block adresses to minute,second,frame */ int lba_2_msf(long lba, int *m, int *s, int *f) { #ifdef __follow_redbook__ if (lba >= -150 && lba < 405000) { /* lba <= 404849 */ #else if (lba >= -150) { #endif lba += 150; } else if (lba >= -45150 && lba <= -151) { lba += 450150; } else return 1; *m = lba / 60 / 75; lba -= (*m)*60*75; *s = lba / 75; lba -= (*s)*75; *f = lba; return 0; } /* print the track currently read */ static void UpdateTrackData(int p_num) { if (global.quiet == 0) { fprintf (stderr, "\ntrack: %.2d, ", p_num); fflush(stderr); } g_track = (unsigned char) p_num; } /* print the index currently read */ static void UpdateIndexData(int p_num) { if (global.quiet == 0) { fprintf (stderr, "index: %.2d\n", p_num); fflush(stderr); } g_index = (unsigned char) p_num; } /* print the time of track currently read */ static void UpdateTimeData(int p_min, int p_sec, int p_frm) { if (global.quiet == 0) { fprintf (stderr, "time: %.2d:%.2d.%.2d\r", p_min, p_sec, p_frm); fflush(stderr); } } void AnalyzeQchannel(unsigned frame) { subq_chnl *sub_ch; if (trackindex_disp != 0) { sub_ch = ReadSubQ(get_scsi_p(), GET_POSITIONDATA,0); /* analyze sub Q-channel data */ if (sub_ch->track != g_track || sub_ch->index != g_index) { UpdateTrackData (sub_ch->track); UpdateIndexData (sub_ch->index); } } frame += 150; UpdateTimeData ((unsigned char) (frame / (60*75)), (unsigned char) ((frame % (60*75)) / 75), (unsigned char) (frame % 75)); } unsigned cdtracks = 0; int no_disguised_audiotracks(void) { /* we can assume no audio tracks according to toc here. */ /* read a data sector from the first data track */ unsigned char p[3000]; int retval; get_scsi_p()->silent++; retval = 1 == ReadCdRomData(get_scsi_p(), p, Get_StartSector(1), 1); get_scsi_p()->silent--; if (retval == 0) { int i; fprintf(stderr, "Warning: wrong track types found: patching to audio...\n"); for (i = 0; i < cdtracks; i++) patch_to_audio(i); } return retval; } #undef SIM_ILLLEADOUT int ReadToc(void) { int retval = (*doReadToc)( get_scsi_p() ); #if defined SIM_ILLLEADOUT g_toc[cdtracks+1] = 20*75; #endif return retval; } static int can_read_illleadout(void); static int can_read_illleadout(void) { SCSI *usalp = get_scsi_p(); UINT4 buffer [CD_FRAMESIZE_RAW/4]; if (global.illleadout_cd == 0) return 0; usalp->silent++; global.reads_illleadout = ReadCdRom(usalp, buffer, Get_AudioStartSector(CDROM_LEADOUT), 1); usalp->silent--; return global.reads_illleadout; } unsigned find_an_off_sector(unsigned lSector, unsigned SectorBurstVal); unsigned find_an_off_sector(unsigned lSector, unsigned SectorBurstVal) { long track_of_start = Get_Track(lSector); long track_of_end = Get_Track(lSector + SectorBurstVal -1); long start = Get_AudioStartSector(track_of_start); long end = Get_EndSector(track_of_end); if (lSector - start > end - lSector + SectorBurstVal -1) return start; else return end; } #ifdef CD_TEXT #include "scsi_cmds.h" #endif int handle_cdtext(void) { #ifdef CD_TEXT if (bufferTOC[0] == 0 && bufferTOC[1] == 0) { have_CD_text = 0; return have_CD_text; } /* do a quick scan over all pack type indicators */ { int i; int count_fails = 0; int len = (bufferTOC[0] << 8) | bufferTOC[1]; len = min(len, 2048); for (i = 0; i < len-4; i += 18) { if (bufferTOC[4+i] < 0x80 || bufferTOC[4+i] > 0x8f) { count_fails++; } } have_CD_text = len > 4 && count_fails < 3; } #else have_CD_text = 0; #endif return have_CD_text; } #ifdef CD_TEXT #include "cd_text.c" #endif #if defined CDROMMULTISESSION static int tmp_fd; #endif #ifdef CD_EXTRA #include "cd_extra.c" #endif static unsigned session_start; /* A Cd-Extra is detected, if it is a multisession CD with only audio tracks in the first session and a data track in the last session. */ static unsigned is_multisession(void) { unsigned mult_off; #if defined CDROMMULTISESSION /* * FIXME: we would have to do a ioctl (CDROMMULTISESSION) * for the cdrom device associated with the generic device * not just AUX_DEVICE */ struct cdrom_multisession ms_str; if (interface == GENERIC_SCSI) tmp_fd = open (global.aux_name, O_RDONLY); else tmp_fd = global.cooked_fd; if (tmp_fd != -1) { int result; ms_str.addr_format = CDROM_LBA; result = ioctl(tmp_fd, CDROMMULTISESSION, &ms_str); if (result == -1) { if (global.verbose != 0) perror("multi session ioctl not supported: "); } else { #ifdef DEBUG_XTRA fprintf(stderr, "current ioctl multisession_offset = %u\n", ms_str.addr.lba); #endif if (interface == GENERIC_SCSI) close (tmp_fd); if (ms_str.addr.lba > 0) return ms_str.addr.lba; } } #endif mult_off = 0; if (LastAudioTrack() + 1 == FirstDataTrack()) { mult_off = Get_StartSector(FirstDataTrack()); } #ifdef DEBUG_XTRA fprintf(stderr, "current guessed multisession_offset = %u\n", mult_off); #endif return mult_off; } #define SESSIONSECTORS (152*75) /* The solution is to read the Table of Contents of the first session only (if the drive permits that) and directly use the start of the leadout. If this is not supported, we subtract a constant of SESSIONSECTORS sectors (found heuristically). */ static unsigned get_end_of_last_audio_track(unsigned mult_off) { unsigned retval; /* Try to read the first session table of contents. This works for Sony and mmc type drives. */ if (ReadLastAudio && (retval = ReadLastAudio(get_scsi_p())) != 0) { return retval; } else { return mult_off - SESSIONSECTORS; } } static void dump_cdtext_info(void); #if defined CDDB_SUPPORT static void emit_cddb_form(char *fname_baseval); #endif #if defined CDINDEX_SUPPORT static void emit_cdindex_form(char *fname_baseval); #endif typedef struct TOC { /* structure of table of contents (cdrom) */ unsigned char reserved1; unsigned char bFlags; unsigned char bTrack; unsigned char reserved2; unsigned int dwStartSector; int mins; int secs; int frms; unsigned char ISRC[16]; int SCMS; } TOC; /* Flags contains two fields: bits 7-4 (ADR) : 0 no sub-q-channel information : 1 sub-q-channel contains current position : 2 sub-q-channel contains media catalog number : 3 sub-q-channel contains International Standard Recording Code ISRC : other values reserved bits 3-0 (Control) : bit 3 : when set indicates there are 4 audio channels else 2 channels bit 2 : when set indicates this is a data track else an audio track bit 1 : when set indicates digital copy is permitted else prohibited bit 0 : when set indicates pre-emphasis is present else not present */ #define GETFLAGS(x) ((x)->bFlags) #define GETTRACK(x) ((x)->bTrack) #define GETSTART(x) ((x)->dwStartSector) #define GETMINS(x) ((x)->mins) #define GETSECS(x) ((x)->secs) #define GETFRAMES(x) ((x)->frms) #define GETISRC(x) ((x)->ISRC) #define IS__PREEMPHASIZED(p) ( (GETFLAGS(p) & 0x10) != 0) #define IS__INCREMENTAL(p) ( (GETFLAGS(p) & 0x10) != 0) #define IS__COPYRESTRICTED(p) (!(GETFLAGS(p) & 0x20) != 0) #define IS__COPYRIGHTED(p) (!(GETFLAGS(p) & 0x20) != 0) #define IS__DATA(p) ( (GETFLAGS(p) & 0x40) != 0) #define IS__AUDIO(p) (!(GETFLAGS(p) & 0x40) != 0) #define IS__QUADRO(p) ( (GETFLAGS(p) & 0x80) != 0) /* * Iterator interface inspired from Java */ struct iterator { int index; int startindex; void (*reset)(struct iterator *this); struct TOC *(*getNextTrack)(struct iterator *this); int (*hasNextTrack)(struct iterator *this); }; /* The Table of Contents needs to be corrected if we have a CD-Extra. In this case all audio tracks are followed by a data track (in the second session). Unlike for single session CDs the end of the last audio track cannot be set to the start of the following track, since the lead-out and lead-in would then errenously be part of the audio track. This would lead to read errors when trying to read into the lead-out area. So the length of the last track in case of Cd-Extra has to be fixed. */ unsigned FixupTOC(unsigned no_tracks) { unsigned mult_off; unsigned offset = 0; int j = -1; unsigned real_end = 2000000; /* get the multisession offset in sectors */ mult_off = is_multisession(); /* if the first track address had been the victim of an underflow, * set it to zero. */ if (Get_StartSector(1) > Get_StartSector(LastTrack())) { fprintf(stderr, "Warning: first track has negative start sector! Setting to zero.\n"); toc_entry( 1, Get_Flags(1), Get_Tracknumber(1), Get_ISRC(1), 0, 0, 2, 0 ); } #ifdef DEBUG_XTRA fprintf(stderr, "current multisession_offset = %u\n", mult_off); #endif dump_cdtext_info(); if (mult_off > 100) { /* the offset has to have a minimum size */ /* believe the multisession offset :-) */ /* adjust end of last audio track to be in the first session */ real_end = get_end_of_last_audio_track(mult_off); #ifdef DEBUG_XTRA fprintf(stderr, "current end = %u\n", real_end); #endif j = FirstDataTrack(); if (LastAudioTrack() + 1 == j) { long sj = Get_StartSector(j); if (sj > (long)real_end) { session_start = mult_off; have_multisession = sj; #ifdef CD_EXTRA offset = Read_CD_Extra_Info(sj); if (offset != 0) { have_CD_extra = sj; dump_extra_info(offset); } #endif } } } if (global.cddbp) { #if defined USE_REMOTE if (global.disctitle == NULL) { have_CDDB = !request_titles(); } #else fprintf(stderr, "Cannot lookup titles: no cddbp support included!\n"); #endif } #if defined CDINDEX_SUPPORT || defined CDDB_SUPPORT if (have_CD_text || have_CD_extra || have_CDDB) { unsigned long count_audio_tracks = 0; static struct iterator i; if (i.reset == NULL) InitIterator(&i, 1); while (i.hasNextTrack(&i)) { struct TOC *p = i.getNextTrack(&i); if (IS__AUDIO(p)) count_audio_tracks++; } if (count_audio_tracks > 0 && global.no_cddbfile == 0) { #if defined CDINDEX_SUPPORT emit_cdindex_form(global.fname_base); #endif #if defined CDDB_SUPPORT emit_cddb_form(global.fname_base); #endif } } #endif if (have_multisession) { /* set start of track to beginning of lead-out */ patch_cd_extra(j, real_end); #if defined CD_EXTRA && defined DEBUG_XTRA fprintf(stderr, "setting end of session (track %d) to %u\n", j, real_end); #endif } return offset; } static int cddb_sum(int n) { int ret; for (ret = 0; n > 0; n /= 10) { ret += (n % 10); } return ret; } void calc_cddb_id(void) { UINT4 i; UINT4 t = 0; UINT4 n = 0; for (i = 1; i <= cdtracks; i++) { n += cddb_sum(Get_StartSector(i)/75 + 2); } t = Get_StartSector(i)/75 - Get_StartSector(1)/75; global.cddb_id = (n % 0xff) << 24 | (t << 8) | cdtracks; } #undef TESTCDINDEX #ifdef TESTCDINDEX void TestGenerateId(void) { SHA_INFO sha; unsigned char digest[20], *base64; unsigned long size; sha_init(&sha); sha_update(&sha, (unsigned char *)"0123456789", 10); sha_final(digest, &sha); base64 = rfc822_binary((char *)digest, 20, &size); if (strncmp((char*) base64, "h6zsF82dzSCnFsws9nQXtxyKcBY-", size)) { free(base64); fprintf(stderr, "The SHA-1 hash function failed to properly generate the\n"); fprintf(stderr, "test key.\n"); exit(INTERNAL_ERROR); } free(base64); } #endif void calc_cdindex_id() { SHA_INFO sha; unsigned char digest[20], *base64; unsigned long size; unsigned i; char temp[9]; #ifdef TESTCDINDEX TestGenerateId(); g_toc[1].bTrack = 1; cdtracks = 15; g_toc[cdtracks].bTrack = 15; i = 1; g_toc[i++].dwStartSector = 0U; g_toc[i++].dwStartSector = 18641U; g_toc[i++].dwStartSector = 34667U; g_toc[i++].dwStartSector = 56350U; g_toc[i++].dwStartSector = 77006U; g_toc[i++].dwStartSector = 106094U; g_toc[i++].dwStartSector = 125729U; g_toc[i++].dwStartSector = 149785U; g_toc[i++].dwStartSector = 168885U; g_toc[i++].dwStartSector = 185910U; g_toc[i++].dwStartSector = 205829U; g_toc[i++].dwStartSector = 230142U; g_toc[i++].dwStartSector = 246659U; g_toc[i++].dwStartSector = 265614U; g_toc[i++].dwStartSector = 289479U; g_toc[i++].dwStartSector = 325732U; #endif sha_init(&sha); sprintf(temp, "%02X", Get_Tracknumber(1)); sha_update(&sha, (unsigned char *)temp, 2); sprintf(temp, "%02X", Get_Tracknumber(cdtracks)); sha_update(&sha, (unsigned char *)temp, 2); /* the position of the leadout comes first. */ sprintf(temp, "%08lX", 150 + Get_StartSector(CDROM_LEADOUT)); sha_update(&sha, (unsigned char *)temp, 8); /* now 99 tracks follow with their positions. */ for (i = 1; i <= cdtracks; i++) { sprintf(temp, "%08lX", 150+Get_StartSector(i)); sha_update(&sha, (unsigned char *)temp, 8); } for (i++ ; i <= 100; i++) { sha_update(&sha, (unsigned char *)"00000000", 8); } sha_final(digest, &sha); base64 = rfc822_binary((char *)digest, 20, &size); global.cdindex_id = base64; } #if defined CDDB_SUPPORT #ifdef PROTOTYPES static void escape_and_split(FILE *channel, const char *args, ...) #else /*VARARGS3*/ static void escape_and_split(FILE *channel, const char *args, va_dcl va_alist) #endif { va_list marker; int prefixlen; int len; char *q; #ifdef PROTOTYPES va_start(marker, args); #else va_start(marker); #endif prefixlen = strlen(args); len = prefixlen; fputs(args, channel); q = va_arg(marker, char *); while (*q != '\0') { while (*q != '\0') { len += 2; if (*q == '\\') fputs("\\\\", channel); else if (*q == '\t') fputs("\\t", channel); else if (*q == '\n') fputs("\\n", channel); else { fputc(*q, channel); len--; } if (len > 78) { fputc('\n', channel); fputs(args, channel); len = prefixlen; } q++; } q = va_arg(marker, char *); } fputc('\n', channel); va_end(marker); } static void emit_cddb_form(char *fname_baseval) { static struct iterator i; unsigned first_audio; FILE *cddb_form; char fname[200]; char *pp; if (fname_baseval == NULL || fname_baseval[0] == 0) return; if (!strcmp(fname_baseval,"standard_output")) return; InitIterator(&i, 1); strncpy(fname, fname_baseval, sizeof(fname) -1); fname[sizeof(fname) -1] = 0; pp = strrchr(fname, '.'); if (pp == NULL) { pp = fname + strlen(fname); } strncpy(pp, ".cddb", sizeof(fname) - 1 - (pp - fname)); cddb_form = fopen(fname, "w"); if (cddb_form == NULL) return; first_audio = FirstAudioTrack(); fprintf( cddb_form, "# xmcd\n#\n"); fprintf( cddb_form, "# Track frame offsets:\n#\n"); while (i.hasNextTrack(&i)) { struct TOC *p = i.getNextTrack(&i); if (GETTRACK(p) == CDROM_LEADOUT) break; fprintf( cddb_form, "# %lu\n", 150 + Get_AudioStartSector(GETTRACK(p))); } fprintf( cddb_form, "#\n# Disc length: %lu seconds\n#\n", (150 + Get_StartSector(CDROM_LEADOUT)) / 75); fprintf( cddb_form, "# Revision: %u\n", global.cddb_revision ); fprintf( cddb_form, "# Submitted via: icedax " VERSION "\n" ); fprintf( cddb_form, "DISCID=%08lx\n", (unsigned long)global.cddb_id); if (global.disctitle == NULL && global.creator == NULL) { fprintf( cddb_form, "DTITLE=\n"); } else { if (global.creator == NULL) { escape_and_split( cddb_form, "DTITLE=", global.disctitle, ""); } else if (global.disctitle == NULL) { escape_and_split( cddb_form, "DTITLE=", global.creator, ""); } else { escape_and_split( cddb_form, "DTITLE=", global.creator, " / ", global.disctitle, ""); } } if (global.cddb_year != 0) fprintf( cddb_form, "DYEAR=%4u\n", global.cddb_year); else fprintf( cddb_form, "DYEAR=\n"); fprintf( cddb_form, "DGENRE=%s\n", global.cddb_genre); i.reset(&i); while (i.hasNextTrack(&i)) { struct TOC *p = i.getNextTrack(&i); int ii; ii = GETTRACK(p); if (ii == CDROM_LEADOUT) break; if (global.tracktitle[ii] != NULL) { char prefix[10]; sprintf(prefix, "TTITLE%d=", ii-1); escape_and_split( cddb_form, prefix, global.tracktitle[ii], ""); } else { fprintf( cddb_form, "TTITLE%d=\n", ii-1); } } if (global.copyright_message == NULL) { fprintf( cddb_form, "EXTD=\n"); } else { escape_and_split( cddb_form, "EXTD=", "Copyright ", global.copyright_message, ""); } i.reset(&i); while (i.hasNextTrack(&i)) { struct TOC *p = i.getNextTrack(&i); int ii; ii = GETTRACK(p); if (ii == CDROM_LEADOUT) break; fprintf( cddb_form, "EXTT%d=\n", ii-1); } fprintf( cddb_form, "PLAYORDER=\n"); fclose( cddb_form ); } #if defined USE_REMOTE #include <pwd.h> static int readn(register int fd, register char *ptr, register int nbytes) { int nread; nread = read(fd, ptr, nbytes); #ifdef DEBUG_CDDBP if (nread > 0) { fprintf(stderr, "READ :(%d)", nread); write(2, ptr, nread); } #endif if (nread < 0) { perror("socket read error: "); fprintf(stderr, "fd=%d, ptr=%p, nbytes=%d\n", fd, ptr, nbytes); } return nread; } static ssize_t writez(int fd, const char *ptr) { size_t nleft, nbytes; nleft = nbytes = strlen(ptr); while (nleft > 0) { ssize_t nwritten = write(fd, ptr, nleft); if (nwritten <= 0) { return nwritten; /* return error */ } #ifdef DEBUG_CDDBP fprintf(stderr, "WRITE:%s\n", ptr); #endif nleft -= nwritten; ptr += nwritten; } return nbytes - nleft; } #define SOCKBUFF 2048 static void filter_nonprintable(char *c, size_t l) { size_t i; for(i = 0; i < l; ++i) { if(!isprint(c[i]) && !isspace(c[i])) { c[i] = '_'; } } } int process_cddb_titles(int sock_fd, char *inbuff, int readbytes); int process_cddb_titles(int sock_fd, char *inbuff, int readbytes) { int finished = 0; char *p = inbuff; int ind = 0; unsigned char ** target = &global.creator; do { while (readbytes > 0) { /* do we have a complete line in the buffer? */ p = (char *)memchr(inbuff+ind, '\n', readbytes); if (p == NULL) break; /* look for the terminator first */ if (!strncmp(".\r\n", inbuff+ind, 3)) { finished = 1; break; } /* kill carriage return */ if (p > inbuff+ind && *(p-1) == '\r') { *(p-1) = '\0'; } /* kill line feed */ *p = '\0'; /* handle escaped characters */ { char *q = inbuff+ind; while (*q) { if (*q++ == '\\' && *q != '\0') { if (*q == '\\') { readbytes--; p--; memmove(q, q+1, readbytes - (q-inbuff-ind)); } else if (*q == 'n') { *(q-1) = '\n'; readbytes--; p--; memmove(q, q+1, readbytes - (q-inbuff-ind)); } else if (*q == 't') { *(q-1) = '\t'; readbytes--; p--; memmove(q, q+1, readbytes - (q-inbuff-ind)); } } } } /* handle multi line entries concatenate fields */ /* TODO if the delimiter is split into two lines, it is not recognized. */ if (!strncmp(inbuff+ind, "DTITLE=", 7)) { char *res = strstr(inbuff+ind+7, " / "); int clen; char *q; if (res == NULL) { /* no limiter found yet */ /* copy until the end */ q = p; } else { /* limiter found */ /* copy until the limiter */ q = res; *q = '\0'; } clen = q - (inbuff+ind+7); if (*target == NULL) { *target = malloc(clen+1); if (*target != NULL) **target = '\0'; } else { *target = realloc(*target, strlen((char *)*target) + clen - 1); } if (*target != NULL) { strcat((char *)*target, inbuff+ind+7); } /* handle part after the delimiter, if present */ if (res != NULL) { target = (unsigned char **)&global.disctitle; /* skip the delimiter */ q += 3; clen = p - q; if (*target == NULL) { *target = malloc(clen+1); if (*target != NULL) **target = '\0'; } if (*target != NULL) { strcat((char *)*target, q); } } } else if (!strncmp(inbuff+ind, "TTITLE", 6)) { char *q = (char *)memchr(inbuff+ind, '=', readbytes); unsigned tno; if (q != NULL) { *q = '\0'; tno = (unsigned)atoi(inbuff+ind+6); tno++; if (tno < 100) { if (global.tracktitle[tno] == NULL) { global.tracktitle[tno] = malloc( p - q + 1 ); if (global.tracktitle[tno] != NULL) *(global.tracktitle[tno]) = '\0'; } else { global.tracktitle[tno] = realloc(global.tracktitle[tno], strlen((char *)global.tracktitle[tno]) + p - q + 1 ); } if (global.tracktitle[tno] != NULL) { strcat((char *)global.tracktitle[tno], q+1); } } } } else if (!strncmp(inbuff+ind, "DYEAR", 5)) { char *q = (char *)memchr(inbuff+ind, '=', readbytes); if (q++ != NULL) { sscanf(q, "%d", &global.cddb_year); } } else if (!strncmp(inbuff+ind, "DGENRE", 6)) { char *q = (char *)memchr(inbuff+ind, '=', readbytes); if (q++ != NULL) { /* patch from Joe Nuzman, thanks */ /* might have significant whitespace */ strncpy(global.cddb_genre, q, sizeof(global.cddb_genre)-1); /* always have a terminator */ global.cddb_genre[sizeof(global.cddb_genre)-1] = '\0'; } } else if (!strncmp(inbuff+ind, "# Revision: ", 12)) { char *q = inbuff+ind+11; sscanf(q, "%d", &global.cddb_revision); global.cddb_revision++; } readbytes -= (p - inbuff -ind) + 1; ind = (p - inbuff) + 1; } if (!finished) { int newbytes; memmove(inbuff, inbuff+ind, readbytes); newbytes = readn(sock_fd, inbuff+readbytes, SOCKBUFF-readbytes); if (newbytes < 0) { fprintf(stderr, "Could not read from socket.\n"); return 0; /* Caller checks for != 1 */ } filter_nonprintable(inbuff+readbytes, newbytes); if (newbytes <= 0) break; readbytes += newbytes; ind = 0; } } while (!(finished || readbytes == 0)); return finished; } static int handle_userchoice(char *p, unsigned size); static int handle_userchoice(char *p, unsigned size) { unsigned nr = 0; unsigned user_choice; int i; char *q; char *o; /* count lines. */ q = p; while ((q = (char *)memchr(q, '\n', size - (q-p))) != NULL) { nr++; q++; } if (nr > 1) nr--; /* handle escaped characters */ { char *r = p; while (*r) { if (*r++ == '\\' && *r != '\0') { if (*r == '\\') { size--; memmove(r, r+1, size - (r-p)); } else if (*r == 'n') { *(r-1) = '\n'; size--; memmove(r, r+1, size - (r-p)); } else if (*r == 't') { *(r-1) = '\t'; size--; memmove(r, r+1, size - (r-p)); } } } } /* list entries. */ q = p; fprintf(stderr, "%u entries found:\n", nr); for (q = (char *)memchr(q, '\n', size - (q-p)), o = p, i = 0; i < nr; i++) { *q = '\0'; fprintf(stderr, "%02u: %s\n", i, o); o = q+1; q = (char *)memchr(q, '\n', size - (q-p)); } fprintf(stderr, "%02u: ignore\n", i); /* get user response. */ do { fprintf(stderr, "please choose one (0-%u): ", nr); scanf("%u", &user_choice); /* FIXME: check return value */ } while (user_choice > nr); if (user_choice == nr) return -1; /* skip to choice. */ q = p; for (i = 0; i <= (int)user_choice - 1; i++) { q = (char *)memchr(q, '\0', size - (q-p)) + 1; } return q-p; } /* request disc and track titles from a cddbp server. * * return values: * 0 titles have been found exactly (success) * -1 some communication error happened. * 1 titles have not been found. * 2 multiple fuzzy matches have been found. */ int request_titles(void) { int retval = 0; int sock_fd; struct sockaddr_in sa; struct hostent *he; struct servent *se; struct passwd *pw = getpwuid(getuid()); char hostname[HOST_NAME_MAX]; char inbuff[SOCKBUFF]; char outbuff[SOCKBUFF]; int i; char category[64]; unsigned cat_offset; unsigned disc_id; ssize_t readbytes; sock_fd = socket(AF_INET, SOCK_STREAM, 0); if (sock_fd < 0) { perror("cddb socket failed: "); retval = -1; goto errout; } /* TODO fallbacks * freedb.freedb.org * de.freedb.org * at.freedb.org */ if (global.cddbp_server != NULL) he = gethostbyname(global.cddbp_server); else he = gethostbyname(CDDBHOST /*"freedb.freedb.org"*/); if (he == NULL) { perror("cddb cannot resolve freedb host: "); he = malloc(sizeof(struct hostent)); memset(he, 0 , sizeof(struct hostent)); he->h_length = 4; he->h_addrtype = AF_INET; he->h_addr_list = malloc(4); he->h_addr_list[0] = malloc(4); ((struct in_addr *)(he->h_addr_list[0]))->s_addr = /* kingfisher.berlios.de freedb.freedb.de */ htonl(UINT_C(0xc3254d85)); /*0xc2610412*/ he->h_name = "freedb.freedb.org"; #if 0 retval = -1; goto errout; #endif } /* save result data IMMEDIATELY!! */ memset(&sa, 0 , sizeof(struct sockaddr_in)); sa.sin_family = he->h_addrtype; /* AF_INET; */ sa.sin_addr.s_addr = ((struct in_addr *)((he->h_addr_list)[0]))->s_addr; se = NULL; if (global.cddbp_port == NULL) se = getservbyname("cddbp-alt", "tcp"); if (se == NULL) { if (global.cddbp_port == NULL) { se = getservbyname("cddbp", "tcp"); } if (se == NULL) { se = malloc(sizeof(struct servent)); memset(se, 0 , sizeof(struct servent)); se->s_port = htons(CDDBPORT /*8880*/); #if 0 perror("cddb cannot resolve cddbp or cddbp-alt port:\n "); retval = -1; goto errout; #endif } } if (global.cddbp_port != NULL) { se->s_port = htons(atoi(global.cddbp_port)); } sa.sin_port = se->s_port; /* TODO timeout */ if (0 > connect(sock_fd, (struct sockaddr *)&sa, sizeof(struct sockaddr_in))) { perror("cddb connect failed: "); retval = -1; goto errout; } /* read banner */ readbytes = readn(sock_fd, inbuff, sizeof(inbuff)); if (readbytes < 0) { fprintf(stderr, "Could not read from socket\n"); retval = -1; goto errout; } if (strncmp(inbuff, "200 ", 4) && strncmp(inbuff, "201 ", 4)) { if(readbytes == sizeof(inbuff)) --readbytes; inbuff[readbytes] = '\0'; filter_nonprintable(inbuff, readbytes); fprintf(stderr, "bad status from freedb server during sign-on banner: %s\n", inbuff); retval = -1; goto errout; } /* say hello */ hostname[0] = '\0'; if (0 > gethostname(hostname, sizeof(hostname))) strcpy(hostname, "unknown_host"); hostname[sizeof(hostname)-1] = '\0'; writez(sock_fd, "cddb hello "); if (pw != NULL) { BOOL space_err = FALSE; BOOL ascii_err = FALSE; /* change spaces to underscores */ char *q = pw->pw_name; while (*q != '\0') { if (*q == ' ') { if (!space_err) { space_err = TRUE; errmsgno(EX_BAD, "Warning: Space in user name '%s'.\n", pw->pw_name); } *q = '_'; } if (*q < ' ' || *q > '~') { if (!ascii_err) { ascii_err = TRUE; errmsgno(EX_BAD, "Warning: Nonascii character in user name '%s'.\n", pw->pw_name); } *q = '_'; } q++; } writez(sock_fd, pw->pw_name); writez(sock_fd, " "); } else { writez(sock_fd, "unknown "); } /* change spaces to underscores */ { char *q = hostname; BOOL space_err = FALSE; BOOL ascii_err = FALSE; while (*q != '\0') { if (*q == ' ') { if (!space_err) { space_err = TRUE; errmsgno(EX_BAD, "Warning: Space in hostname '%s'.\n", hostname); } *q = '_'; } if (*q < ' ' || *q > '~') { if (!ascii_err) { ascii_err = TRUE; errmsgno(EX_BAD, "Warning: Nonascii character in hostname '%s'.\n", hostname); } *q = '_'; } q++; } } writez(sock_fd, hostname); writez(sock_fd, " icedax " VERSION "\n"); readbytes = readn(sock_fd, inbuff, sizeof(inbuff)); if (readbytes < 0) { fprintf(stderr, "Could not read from socket\n"); retval = -1; goto errout; } if (strncmp(inbuff, "200 ", 4)) { if(readbytes == sizeof(inbuff)) --readbytes; inbuff[readbytes] = '\0'; filter_nonprintable(inbuff, readbytes); fprintf(stderr, "bad status from freedb server during hello: %s\n", inbuff); retval = -1; goto signoff; } /* enable new protocol variant. Weird command here, no cddb prefix ?!?! */ writez(sock_fd, "proto\n"); readbytes = readn(sock_fd, inbuff, sizeof(inbuff)); if (readbytes < 0) { fprintf(stderr, "Could not read from socket\n"); retval = -1; goto errout; } /* check for errors and maximum supported protocol level */ if (strncmp(inbuff, "201 ", 4) > 0) { if(readbytes == sizeof(inbuff)) --readbytes; inbuff[readbytes] = '\0'; filter_nonprintable(inbuff, readbytes); fprintf(stderr, "bad status from freedb server during proto command: %s\n", inbuff); retval = -1; goto signoff; } /* check the supported protocol level */ if (!memcmp(inbuff, "200 CDDB protocol level: current 1, supported ", 46)) { char *q = strstr(inbuff, " supported "); unsigned pr_level; if (q != NULL) { q += 11; sscanf(q, "%u\n", &pr_level); if (pr_level > 1) { if (pr_level > 5) pr_level = 5; sprintf(inbuff, "proto %1u\n", pr_level); writez(sock_fd, inbuff); readbytes = readn(sock_fd, inbuff, sizeof(inbuff)); if (readbytes < 0) { fprintf(stderr, "Could not read from socket\n"); retval = -1; goto errout; } /* check for errors and maximum supported protocol level */ if (strncmp(inbuff, "201 ", 4) > 0) { if(readbytes == sizeof(inbuff)) --readbytes; inbuff[readbytes] = '\0'; filter_nonprintable(inbuff, readbytes); fprintf(stderr, "bad status from freedb server during proto x: %s\n", inbuff); retval = -1; goto signoff; } } } } /* format query string */ /* query */ #define CDDPB_INCLUDING_DATATRACKS #ifdef CDDPB_INCLUDING_DATATRACKS sprintf(outbuff, "cddb query %08lx %ld ", (unsigned long)global.cddb_id, LastTrack() - FirstTrack() + 1); /* first all leading datatracks */ { int j = FirstAudioTrack(); if (j < 0) j = LastTrack() +1; for (i = FirstTrack(); i < j; i++) { sprintf(outbuff + strlen(outbuff), "%ld ", 150 + Get_StartSector(i)); } } #else sprintf(outbuff, "cddb query %08lx %ld ", global.cddb_id, LastAudioTrack() - FirstAudioTrack() + 1); #endif /* all audio tracks */ for (i = FirstAudioTrack(); i != -1 && i <= LastAudioTrack(); i++) { sprintf(outbuff + strlen(outbuff), "%ld ", 150 + Get_AudioStartSector(i)); } #ifdef CDDPB_INCLUDING_DATATRACKS /* now all trailing datatracks */ for (; i != -1 && i <= LastTrack(); i++) { sprintf(outbuff + strlen(outbuff), "%ld ", 150 + Get_StartSector(i)); } sprintf(outbuff + strlen(outbuff), "%lu\n", (150 + Get_StartSector(CDROM_LEADOUT)) / 75); #else sprintf(outbuff + strlen(outbuff), "%lu\n", (150 + Get_LastSectorOnCd(FirstAudioTrack())) / 75); #endif /* strcpy(outbuff, "cddb query 9709210c 12 150 12010 33557 50765 65380 81467 93235 109115 124135 137732 152575 166742 2339\n"); */ /* strcpy(outbuff, "cddb query 03015501 1 296 344\n"); */ writez(sock_fd, outbuff); readbytes = readn(sock_fd, inbuff, sizeof(inbuff) - 1); if (readbytes < 0) { fprintf(stderr, "Could not read from socket\n"); retval = -1; goto errout; } inbuff[readbytes] = '\0'; filter_nonprintable(inbuff, readbytes); cat_offset = 4; if (!strncmp(inbuff, "210 ", 4) || !strncmp(inbuff, "211 ", 4)) { /* Check if there are really multiple entries. */ char *p = (char *)memchr(inbuff, '\n', readbytes-1); if (p != NULL) cat_offset = p+1 - inbuff; /* first entry */ if (p) p = (char *)memchr(p+1, '\n', inbuff+readbytes - p); /* second entry */ if (p) p = (char *)memchr(p+1, '\n', inbuff+readbytes - p); /* . */ if (p) p = (char *)memchr(p+1, '\n', inbuff+readbytes - p); if (p) { /* multiple entries */ switch (global.cddbp) { case 2: /* take the first entry */ break; case 1: /* ask user */ if (!global.gui) { int userret = handle_userchoice(inbuff+cat_offset, readbytes - cat_offset); if (userret == -1) { /* ignore any selection */ retval = -1; goto signoff; } cat_offset += userret; } break; default: fprintf(stderr, "multiple entries found: %s\n", inbuff); retval = 2; goto signoff; } } } else if (strncmp(inbuff, "200 ", 4)) { if (!strncmp(inbuff, "202 ", 4)) { fprintf(stderr, "no cddb entry found: %s\n", inbuff); retval = 1; } else { fprintf(stderr, "bad status from freedb server during query: %s\n%s", inbuff, outbuff); retval = -1; } goto signoff; } sscanf(inbuff + cat_offset, "%s %x", category, &disc_id ); /* read */ sprintf(inbuff, "cddb read %s %08x\n", category, disc_id); writez(sock_fd, inbuff); /* read status and first buffer size. */ readbytes = readn(sock_fd, inbuff, sizeof(inbuff)); if (readbytes < 0) { fprintf(stderr, "Could not read from socket\n"); retval = -1; goto errout; } filter_nonprintable(inbuff, readbytes); if (strncmp(inbuff, "210 ", 4)) { if(readbytes == sizeof(inbuff)) --readbytes; inbuff[readbytes] = '\0'; fprintf(stderr, "bad status from freedb server during read: %s\n", inbuff); retval = -1; goto signoff; } if (1 != process_cddb_titles(sock_fd, inbuff, readbytes)) { fprintf(stderr, "cddb read finished not correctly!\n"); } signoff: /* sign-off */ writez(sock_fd, "quit\n"); readbytes = readn(sock_fd, inbuff, sizeof(inbuff)); if (readbytes < 0) { fprintf(stderr, "Could not read from socket\n"); retval = -1; goto errout; } if (strncmp(inbuff, "230 ", 4)) { if(readbytes == sizeof(inbuff)) --readbytes; inbuff[readbytes] = '\0'; filter_nonprintable(inbuff, readbytes); fprintf(stderr, "bad status from freedb server during quit: %s\n", inbuff); goto errout; } errout: close(sock_fd); return retval; } #endif #endif #if defined CDINDEX_SUPPORT static int IsSingleArtist(void); /* check, if there are more than one track creators */ static int IsSingleArtist(void) { static struct iterator i; InitIterator(&i, 1); while (i.hasNextTrack(&i)) { struct TOC *p = i.getNextTrack(&i); int ii; if (IS__DATA(p) || GETTRACK(p) == CDROM_LEADOUT) continue; ii = GETTRACK(p); if (global.creator && global.trackcreator[ii] && strcmp((char *) global.creator, (char *) global.trackcreator[ii]) != 0) return 0; } return 1; } static const char *a2h[255-191] = { "À", "Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ò", "Ó", "Ô", "Õ", "Ö", "×", "Ø", "Ù", "Ú", "Û", "Ü", "Ý", "Þ", "ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "÷", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ", }; static char *ascii2html(unsigned char *inp) { static size_t buflen = 256; static char *outline = 0; size_t pos = 0; size_t l=0; /* init */ if(!outline) { outline = malloc(buflen); if(outline == 0) { fprintf(stderr, "error: memory exhausted\n"); _exit(EXIT_FAILURE); } } outline[pos] = '\0'; while (*inp != '\0') { /* Pick the sequence to insert */ const char *insert; char b[2]; const int c = (unsigned char)*inp; switch(c) { case '"': insert = """; break; case '&': insert = "&"; break; case '<': insert = "<"; break; case '>': insert = ">"; break; case 160: insert = " "; break; default: { if(c < 192) { b[0] = c; b[1] = '\0'; insert = b; } else { insert = a2h[c - 192]; } } }; /* Resize buffer */ l = strlen(insert); while(pos + l + 1 >= buflen) { outline = realloc(outline, buflen *= 2); if(outline == 0) { fprintf(stderr, "error: memory exhausted\n"); _exit(EXIT_FAILURE); } } /* Copy in */ strcpy(&outline[pos], insert); pos += l; ++inp; } return outline; } static void emit_cdindex_form(char *fname_baseval) { FILE *cdindex_form; char fname[200]; char *pp; if (fname_baseval == NULL || fname_baseval[0] == 0) return; strncpy(fname, fname_baseval, sizeof(fname) -1); fname[sizeof(fname) -1] = 0; pp = strrchr(fname, '.'); if (pp == NULL) { pp = fname + strlen(fname); } strncpy(pp, ".cdindex", sizeof(fname) - 1 - (pp - fname)); cdindex_form = fopen(fname, "w"); if (cdindex_form == NULL) return; #define CDINDEX_URL "http://www.musicbrainz.org/dtd/CDInfo.dtd" /* format XML page according to cdindex DTD (see www.musicbrainz.org) */ fprintf( cdindex_form, "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<!DOCTYPE CDInfo SYSTEM \"%s\">\n\n<CDInfo>\n", CDINDEX_URL); fprintf( cdindex_form, " <Title>%s\n", global.disctitle ? ascii2html(global.disctitle) : ""); /* * In case of mixed mode and Extra-CD, nonaudio tracks are included! */ fprintf( cdindex_form, " %d\n\n", cdtracks); fprintf( cdindex_form, " \n \n %s\n \n", global.cdindex_id); fprintf( cdindex_form, " \n\n"); if (IsSingleArtist()) { static struct iterator i; InitIterator(&i, 1); fprintf( cdindex_form, " \n %s\n", global.creator ? ascii2html(global.creator) : ""); while (i.hasNextTrack(&i)) { struct TOC *p = i.getNextTrack(&i); int ii = GETTRACK(p); if (ii == CDROM_LEADOUT) break; if (IS__AUDIO(p)) { fprintf( cdindex_form, " \n %s\n \n", ii, global.tracktitle[ii] ? ascii2html(global.tracktitle[ii]) : ""); } else { fprintf( cdindex_form, " \n data track\n \n", ii ); } } fprintf( cdindex_form, " \n"); } else { static struct iterator i; InitIterator(&i, 1); fprintf( cdindex_form, " \n"); while (i.hasNextTrack(&i)) { struct TOC *p = i.getNextTrack(&i); int ii = GETTRACK(p); if (ii == CDROM_LEADOUT) break; if (IS__AUDIO(p)) { fprintf( cdindex_form, " %s\n", global.trackcreator[ii] ? ascii2html(global.trackcreator[ii]) : ""); fprintf( cdindex_form, " %s\n \n", global.tracktitle[ii] ? ascii2html(global.tracktitle[ii]) : ""); } else { fprintf( cdindex_form, " data track\n data track\n \n"); } } fprintf( cdindex_form, " \n"); } fprintf( cdindex_form, "\n"); fclose( cdindex_form ); } #endif static void dump_cdtext_info(void) { #ifdef CD_TEXT /* interpret the contents of CD Text information based on an early draft of SCSI-3 mmc version 2 from jan 2, 1998 CD Text information consists of a text group containing up to 8 language blocks containing up to 255 Pack data chunks of 18 bytes each. So we have at most 36720 bytes to cope with. */ { short int datalength; unsigned char *p = bufferTOC; unsigned char lastline[255*12]; int lastitem = -1; int itemcount = 0; int inlinecount = 0; int outlinecount = 0; lastline[0] = '\0'; datalength = ((p[0] << 8) + p[1]) - 2; datalength = min(datalength, 2048-4); p += 4; for (;datalength > 0; datalength -= sizeof (cdtextpackdata), p += sizeof (cdtextpackdata)) { unsigned char *zeroposition; /* handle one packet of CD Text Information Descriptor Pack Data */ /* this is raw R-W subchannel data converted to 8 bit values. */ cdtextpackdata *c = (cdtextpackdata *)p; int dbcc; int crc_error; unsigned tracknr; #ifdef DEBUG_CDTEXT fprintf(stderr, "datalength =%d\n", datalength); #endif crc_error = !cdtext_crc_ok(c); if (lastitem != c->headerfield[0]) { itemcount = 0; lastitem = c->headerfield[0]; } tracknr = c->headerfield[1] & 0x7f; dbcc = ((unsigned)(c->headerfield[3] & 0x80)) >> 7; /* double byte character code */ #if defined DEBUG_CDTEXT { int extension_flag; int sequence_number; int block_number; int character_position; extension_flag = ((unsigned)(c->headerfield[1] & 0x80)) >> 7; sequence_number = c->headerfield[2]; block_number = ((unsigned)(c->headerfield[3] & 0x30)) >> 4; /* language */ character_position = c->headerfield[3] & 0x0f; fprintf(stderr, "CDText: ext_fl=%d, trnr=%u, seq_nr=%d, dbcc=%d, block_nr=%d, char_pos=%d\n", extension_flag, tracknr, sequence_number, dbcc, block_number, character_position); } #endif /* print ASCII information */ memcpy(lastline+inlinecount, c->textdatafield, 12); inlinecount += 12; zeroposition = (unsigned char *)memchr(lastline+outlinecount, '\0', inlinecount-outlinecount); while (zeroposition != NULL) { process_header(c, tracknr, dbcc, lastline+outlinecount); outlinecount += zeroposition - (lastline+outlinecount) + 1; #if defined DEBUG_CDTEXT fprintf(stderr, "\tin=%d, out=%d, items=%d, trcknum=%u\n", inlinecount, outlinecount, itemcount, tracknr); { int q; for (q= outlinecount; q < inlinecount; q++) fprintf (stderr, "%c", lastline[q] ? lastline[q] : 'ß'); fputs("\n", stderr); } #else if (DETAILED) { if (crc_error) fputs(" ! uncorr. CRC-Error", stderr); fputs("\n", stderr); } #endif itemcount++; if (itemcount > (int)cdtracks || (c->headerfield[0] == 0x8f || (c->headerfield[0] <= 0x8d && c->headerfield[0] >= 0x86))) { outlinecount = inlinecount; break; } tracknr++; zeroposition = (unsigned char *)memchr(lastline+outlinecount, '\0', inlinecount-outlinecount); } } } #endif } static void dump_extra_info(unsigned int from) { #ifdef CD_EXTRA unsigned char *p; unsigned pos, length; if (from == 0) return; p = Extra_buffer + 48; while (*p != '\0') { pos = GET_BE_UINT_FROM_CHARP(p+2); length = GET_BE_UINT_FROM_CHARP(p+6); if (pos == (unsigned)-1) { pos = from+1; } else { pos += session_start; } #ifdef DEBUG_XTRA if (global.gui == 0 && global.verbose != 0) { fprintf(stderr, "Language: %c%c (as defined by ISO 639)", *p, *(p+1)); fprintf(stderr, " at sector %u, len=%u (sessionstart=%u)", pos, length, session_start); fputs("\n", stderr); } #endif /* dump this entry */ Read_Subinfo(pos, length); p += 10; if (p + 9 > (Extra_buffer + CD_FRAMESIZE)) break; } #endif } static char *quote(unsigned char *string); static char *quote(unsigned char *string) { static char result[200]; unsigned char *p = (unsigned char *)result; while (*string) { if (*string == '\'' || *string == '\\') { *p++ = '\\'; } *p++ = *string++; } *p = '\0'; return result; } static void DisplayToc_with_gui(unsigned long dw); static void DisplayToc_with_gui(unsigned long dw) { unsigned mins; unsigned secnds; unsigned frames; int count_audio_trks; static struct iterator i; if (i.reset == NULL) InitIterator(&i, 1); else i.reset(&i); mins = dw / ( 60*75 ); secnds = ( dw % ( 60*75 ) ) / 75; frames = ( dw % 75 ); /* summary */ count_audio_trks = 0; if ((global.verbose & SHOW_STARTPOSITIONS) != 0) { if (global.illleadout_cd != 0 && have_CD_extra == 0) { fprintf( stderr, "Tracks:%u > %u:%02u.%02u\n", cdtracks, mins, secnds, frames ); } else { fprintf( stderr, "Tracks:%u %u:%02u.%02u\n", cdtracks, mins, secnds, frames ); } } if (global.quiet == 0) { fprintf( stderr, "CDINDEX discid: %s\n", global.cdindex_id); fprintf( stderr, "CDDB discid: 0x%08lx", (unsigned long) global.cddb_id); if (have_CDDB != 0) { fprintf(stderr, " CDDBP titles: resolved\n"); } else { fprintf(stderr, "\n"); } if (have_CD_text != 0) { fprintf(stderr, "CD-Text: detected\n"); dump_cdtext_info(); } else { fprintf(stderr, "CD-Text: not detected\n"); } if (have_CD_extra != 0) { fprintf(stderr, "CD-Extra: detected\n"); dump_extra_info(have_CD_extra); } else { fprintf(stderr, "CD-Extra: not detected\n"); } fprintf( stderr, "Album title: '%s'", (void *)global.disctitle != NULL ? quote(global.disctitle) : ""); fprintf( stderr, " from '%s'\n", (void *)global.creator != NULL ? quote(global.creator) : ""); } count_audio_trks = 0; if ((global.verbose & (SHOW_TOC | SHOW_STARTPOSITIONS | SHOW_SUMMARY | SHOW_TITLES)) != 0 && i.hasNextTrack(&i)) { TOC *o = i.getNextTrack(&i); while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); int from; from = GETTRACK(o); fprintf(stderr, "T%02d:", from); if (IS__DATA(o)) { /* * Special case of cd extra */ unsigned int real_start = have_CD_extra ? have_CD_extra : GETSTART(o); dw = (unsigned long) (GETSTART(p) - real_start); mins = dw / ( 60*75 ); secnds = ( dw % ( 60*75 )) / 75; frames = ( dw % 75 ); if ( global.verbose & SHOW_STARTPOSITIONS ) fprintf(stderr, " %7u", real_start ); if ( global.verbose & SHOW_TOC ) fprintf(stderr, " %2u:%02u.%02u", mins, secnds, frames ); if ( global.verbose & SHOW_SUMMARY ) fprintf(stderr, " data %s %s N/A", /* how recorded */ IS__INCREMENTAL(o) ? "incremental" : "uninterrupted", /* copy-permission */ IS__COPYRIGHTED(o) ? "copydenied" : "copyallowed" ); fputs("\n", stderr); } else { dw = (unsigned long) (GETSTART(p) - GETSTART(o)); mins = dw / ( 60*75 ); secnds = ( dw % ( 60*75 )) / 75; frames = ( dw % 75 ); if ( global.verbose & SHOW_STARTPOSITIONS ) fprintf(stderr, " %7u", GETSTART(o) ); if ( global.verbose & SHOW_TOC ) fprintf(stderr, " %2u:%02u.%02u", mins, secnds, frames ); if ( global.verbose & SHOW_SUMMARY ) fprintf(stderr, " audio %s %s %s", /* how recorded */ IS__PREEMPHASIZED(o) ? "pre-emphasized" : "linear", /* copy-permission */ IS__COPYRIGHTED(o) ? "copydenied" : "copyallowed", /* channels */ IS__QUADRO(o) ? "quadro" : "stereo"); /* Title */ if ( global.verbose & SHOW_TITLES ) { fprintf(stderr, " title '%s' from ", (void *) global.tracktitle[GETTRACK(o)] != NULL ? quote(global.tracktitle[GETTRACK(o)]) : "" ); fprintf(stderr, "'%s'", (void *) global.trackcreator[GETTRACK(o)] != NULL ? quote(global.trackcreator[GETTRACK(o)]) : "" ); } fputs("\n", stderr); count_audio_trks++; } o = p; } /* while */ if ( global.verbose & SHOW_STARTPOSITIONS ) if (GETTRACK(o) == CDROM_LEADOUT) { fprintf(stderr, "Leadout: %7u\n", GETSTART(o)); } } /* if */ } static void DisplayToc_no_gui(unsigned long dw); static void DisplayToc_no_gui(unsigned long dw) { unsigned mins; unsigned secnds; unsigned frames; int count_audio_trks; unsigned ii = 0; static struct iterator i; if (i.reset == NULL) InitIterator(&i, 1); else i.reset(&i); mins = dw / ( 60*75 ); secnds = ( dw % ( 60*75 ) ) / 75; frames = ( dw % 75 ); /* summary */ count_audio_trks = 0; if (i.hasNextTrack(&i)) { TOC *o = i.getNextTrack(&i); while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); int from; from = GETTRACK(o); while ( p != NULL && GETTRACK(p) != CDROM_LEADOUT && GETFLAGS(o) == GETFLAGS(p) ) { o = p; p = i.getNextTrack(&i); } if ((global.verbose & SHOW_SUMMARY) == 0) continue; if (IS__DATA(o)) { fputs( " DATAtrack recorded copy-permitted tracktype\n" , stderr); fprintf(stderr, " %2d-%2d %13.13s %14.14s data\n", from, GETTRACK(o), /* how recorded */ IS__INCREMENTAL(o) ? "incremental" : "uninterrupted", /* copy-perm */ IS__COPYRIGHTED(o) ? "no" : "yes" ); } else { fputs( "AUDIOtrack pre-emphasis copy-permitted tracktype channels\n" , stderr); fprintf(stderr, " %2d-%2d %12.12s %14.14s audio %1c\n", from, GETTRACK(o), IS__PREEMPHASIZED(o) ? "yes" : "no", IS__COPYRIGHTED(o) ? "no" : "yes", IS__QUADRO(o) ? '4' : '2' ); count_audio_trks++; } o = p; } } if ((global.verbose & SHOW_STARTPOSITIONS) != 0) { if (global.illleadout_cd != 0 && have_multisession == 0) { fprintf ( stderr, "Table of Contents: total tracks:%u, (total time more than %u:%02u.%02u)\n", cdtracks, mins, secnds, frames ); } else { fprintf ( stderr, "Table of Contents: total tracks:%u, (total time %u:%02u.%02u)\n", cdtracks, mins, secnds, frames ); } } i.reset(&i); if ((global.verbose & SHOW_TOC) != 0 && i.hasNextTrack(&i)) { TOC *o = i.getNextTrack(&i); for (; i.hasNextTrack(&i);) { TOC *p = i.getNextTrack(&i); if ( GETTRACK(o) <= MAXTRK ) { unsigned char brace1, brace2; unsigned trackbeg; trackbeg = have_multisession && IS__DATA(o) ? have_multisession : GETSTART(o); dw = (unsigned long) (GETSTART(p) - trackbeg); mins = dw / ( 60*75 ); secnds = ( dw % ( 60*75 )) / 75; frames = ( dw % 75 ); if ( IS__DATA(o) ) { /* data track display */ brace1 = '['; brace2 = ']'; } else if (have_multisession && GETTRACK(o) == LastAudioTrack()) { /* corrected length of * last audio track in cd extra */ brace1 = '|'; brace2 = '|'; } else { /* audio track display */ brace1 = '('; brace2 = ')'; } fprintf ( stderr, " %2u.%c%2u:%02u.%02u%c", GETTRACK(o), brace1, mins, secnds, frames, brace2 ); ii++; if ( ii % 5 == 0 ) fputs( ",\n", stderr ); else if (ii != cdtracks) fputc ( ',', stderr ); } o = p; } /* for */ if ( (ii % 5) != 0 ) fputs( "\n", stderr ); } /* if */ if ((global.verbose & SHOW_STARTPOSITIONS) != 0) { fputs ("\nTable of Contents: starting sectors\n", stderr); ii = 0; i.reset(&i); if (i.hasNextTrack(&i)) { TOC *o = i.getNextTrack(&i); for ( ; i.hasNextTrack(&i);) { TOC *p = i.getNextTrack(&i); fprintf ( stderr, " %2u.(%8u)", GETTRACK(o), have_multisession && GETTRACK(o) == FirstDataTrack() ? have_multisession : GETSTART(o) #ifdef DEBUG_CDDB +150 #endif ); ii++; if ( (ii) % 5 == 0 ) fputs( ",\n", stderr ); else fputc ( ',', stderr ); o = p; } fprintf ( stderr, " lead-out(%8u)", GETSTART(o)); fputs ("\n", stderr); } } if (global.quiet == 0) { fprintf(stderr, "CDINDEX discid: %s\n", global.cdindex_id); fprintf( stderr, "CDDB discid: 0x%08lx", (unsigned long) global.cddb_id); if (have_CDDB != 0) { fprintf(stderr, " CDDBP titles: resolved\n"); } else { fprintf(stderr, "\n"); } if (have_CD_text != 0) { fprintf(stderr, "CD-Text: detected\n"); } else { fprintf(stderr, "CD-Text: not detected\n"); } if (have_CD_extra != 0) { fprintf(stderr, "CD-Extra: detected\n"); } else { fprintf(stderr, "CD-Extra: not detected\n"); } } if ((global.verbose & SHOW_TITLES) != 0) { int maxlen = 0; if ( global.disctitle != NULL ) { fprintf( stderr, "Album title: '%s'", global.disctitle); if ( global.creator != NULL ) { fprintf( stderr, "\t[from %s]", global.creator); } fputs("\n", stderr); } i.reset(&i); for ( ; i.hasNextTrack(&i);) { TOC *p = i.getNextTrack(&i); int jj = GETTRACK(p); if ( global.tracktitle[jj] != NULL ) { int len = strlen((char *)global.tracktitle[jj]); maxlen = max(maxlen, len); } } maxlen = (maxlen + 12 + 8 + 7)/8; i.reset(&i); for ( ; i.hasNextTrack(&i); ) { TOC *p = i.getNextTrack(&i); int jj; if (IS__DATA(p)) continue; jj = GETTRACK(p); if (jj == CDROM_LEADOUT) break; if ( maxlen != 3 ) { if ( global.tracktitle[jj] != NULL ) { fprintf( stderr, "Track %2u: '%s'", jj, global.tracktitle[jj]); } else { fprintf( stderr, "Track %2u: '%s'", jj, ""); } if ( global.trackcreator[jj] != NULL && global.trackcreator[jj][0] != '\0' #if 1 && (global.creator == NULL || 0 != strcmp((char *)global.creator,(char *)global.trackcreator[jj])) #endif ) { int j; char *o = global.tracktitle[jj] != NULL ? (char *)global.tracktitle[jj] : ""; for ( j = 0; j < (maxlen - ((int)strlen(o) + 12)/8); j++) fprintf(stderr, "\t"); fprintf( stderr, "[from %s]", global.trackcreator[jj]); } fputs("\n", stderr); } } } } void DisplayToc(void) { unsigned long dw; /* special handling of pseudo-red-book-audio cds */ if (cdtracks > 1 && Get_StartSector(CDROM_LEADOUT) < Get_StartSector(cdtracks)) { global.illleadout_cd = 1; can_read_illleadout(); } /* get total time */ if (global.illleadout_cd == 0) dw = (unsigned long) Get_StartSector(CDROM_LEADOUT) - Get_StartSector(1); else dw = (unsigned long) Get_StartSector(cdtracks ) - Get_StartSector(1); if ( global.gui == 0 ) { /* table formatting when in cmdline mode */ DisplayToc_no_gui( dw ); } else if (global.gui == 1) { /* line formatting when in gui mode */ DisplayToc_with_gui( dw ); } if (global.illleadout_cd != 0) { if (global.quiet == 0) { fprintf(stderr, "CD with illegal leadout position detected!\n"); } if (global.reads_illleadout == 0) { /* limit accessible tracks * to lowered leadout position */ restrict_tracks_illleadout(); if (global.quiet == 0) { fprintf(stderr, "The cdrom drive firmware does not permit access beyond the leadout position!\n"); } if (global.verbose & (SHOW_ISRC | SHOW_INDICES)) { global.verbose &= ~(SHOW_ISRC | SHOW_INDICES); fprintf(stderr, "Switching index scan and ISRC scan off!\n"); } if (global.quiet == 0) { fprintf(stderr, "Audio extraction will be limited to track %ld with maximal %ld sectors...\n", LastTrack(), Get_EndSector(LastTrack())+1 ); } } else { /* The cdrom drive can read beyond the * indicated leadout. We patch a new leadout * position to the maximum: * 99 minutes, 59 seconds, 74 frames */ patch_real_end(150 + (99*60+59)*75 + 74); if (global.quiet == 0) { fprintf(stderr, "Restrictions apply, since the size of the last track is unknown!\n"); } } } } static void Read_MCN_toshiba(subq_chnl **sub_ch); static void Read_MCN_toshiba(subq_chnl **sub_ch) { if (Toshiba3401() != 0 && global.quiet == 0 && ((*sub_ch) != 0 || (((subq_catalog *)(*sub_ch)->data)->mc_valid & 0x80))) { /* no valid MCN yet. do more searching */ long h = Get_AudioStartSector(1); while (h <= Get_AudioStartSector(1) + 100) { if (Toshiba3401()) ReadCdRom(get_scsi_p(), RB_BASE->data, h, global.nsectors); (*sub_ch) = ReadSubQ(get_scsi_p(), GET_CATALOGNUMBER,0); if ((*sub_ch) != NULL) { subq_catalog *subq_cat; subq_cat = (subq_catalog *) (*sub_ch)->data; if ((subq_cat->mc_valid & 0x80) != 0) { break; } } h += global.nsectors; } } } static void Get_Set_MCN(void); static void Get_Set_MCN(void) { subq_chnl *sub_ch; subq_catalog *subq_cat = NULL; fprintf(stderr, "scanning for MCN..."); sub_ch = ReadSubQ(get_scsi_p(), GET_CATALOGNUMBER,0); #define EXPLICIT_READ_MCN_ISRC 1 #if EXPLICIT_READ_MCN_ISRC == 1 /* TOSHIBA HACK */ Read_MCN_toshiba( &sub_ch ); #endif if (sub_ch != NULL) subq_cat = (subq_catalog *)sub_ch->data; if (sub_ch != NULL && (subq_cat->mc_valid & 0x80) != 0 && global.quiet == 0) { /* unified format guesser: * format MCN all digits in bcd * 1 13 * A: ab cd ef gh ij kl m0 0 0 0 0 0 0 Plextor 6x Rel. 1.02 * B: 0a 0b 0c 0d 0e 0f 0g 0h 0i 0j 0k 0l 0m Toshiba 3401 * C: AS AS AS AS AS AS AS AS AS AS AS AS AS ASCII SCSI-2 Plextor 4.5x and 6x Rel. 1.06 */ unsigned char *cp = subq_cat->media_catalog_number; if (!(cp[8] | cp[9] | cp[10] | cp[11] | cp[12]) && ((cp[0] & 0xf0) | (cp[1] & 0xf0) | (cp[2] & 0xf0) | (cp[3] & 0xf0) | (cp[4] & 0xf0) | (cp[5] & 0xf0) | (cp[6] & 0xf0))) { /* reformat A: to B: */ cp[12] = cp[6] >> 4; cp[11] = cp[5] & 0xf; cp[10] = cp[5] >> 4; cp[ 9] = cp[4] & 0xf; cp[ 8] = cp[4] >> 4; cp[ 7] = cp[3] & 0xf; cp[ 6] = cp[3] >> 4; cp[ 5] = cp[2] & 0xf; cp[ 4] = cp[2] >> 4; cp[ 3] = cp[1] & 0xf; cp[ 2] = cp[1] >> 4; cp[ 1] = cp[0] & 0xf; cp[ 0] = cp[0] >> 4; } if (!isdigit(cp[0]) && (memcmp(subq_cat->media_catalog_number, "\0\0\0\0\0\0\0\0\0\0\0\0\0", 13) != 0)) { sprintf((char *) subq_cat->media_catalog_number, "%1.1X%1.1X%1.1X%1.1X%1.1X%1.1X%1.1X%1.1X%1.1X%1.1X%1.1X%1.1X%1.1X", subq_cat->media_catalog_number [0], subq_cat->media_catalog_number [1], subq_cat->media_catalog_number [2], subq_cat->media_catalog_number [3], subq_cat->media_catalog_number [4], subq_cat->media_catalog_number [5], subq_cat->media_catalog_number [6], subq_cat->media_catalog_number [7], subq_cat->media_catalog_number [8], subq_cat->media_catalog_number [9], subq_cat->media_catalog_number [10], subq_cat->media_catalog_number [11], subq_cat->media_catalog_number [12] ); } if (memcmp(subq_cat->media_catalog_number,"0000000000000",13) != 0) { Set_MCN(subq_cat->media_catalog_number); } } } static void Read_ISRC_toshiba(subq_chnl **sub_ch, unsigned tr); static void Read_ISRC_toshiba(subq_chnl **sub_ch, unsigned tr) { if (Toshiba3401() != 0) { int j; j = (Get_AudioStartSector(tr)/100 + 1) * 100; do { ReadCdRom(get_scsi_p(), RB_BASE->data, j, global.nsectors); *sub_ch = ReadSubQ(get_scsi_p(), GET_TRACK_ISRC, Get_Tracknumber(tr)); if (*sub_ch != NULL) { subq_track_isrc * subq_tr; subq_tr = (subq_track_isrc *) (*sub_ch)->data; if (subq_tr != NULL && (subq_tr->tc_valid & 0x80) != 0) break; } j += global.nsectors; } while (j < (Get_AudioStartSector(tr)/100 + 1) * 100 + 100); } } static void Get_Set_ISRC(unsigned tr); static void Get_Set_ISRC(unsigned tr) { subq_chnl *sub_ch; subq_track_isrc * subq_tr; fprintf(stderr, "\rscanning for ISRCs: %d ...", tr); subq_tr = NULL; sub_ch = ReadSubQ(get_scsi_p(), GET_TRACK_ISRC, tr); #if EXPLICIT_READ_MCN_ISRC == 1 /* TOSHIBA HACK */ Read_ISRC_toshiba( &sub_ch, tr ); #endif if (sub_ch != NULL) subq_tr = (subq_track_isrc *)sub_ch->data; if (sub_ch != NULL && (subq_tr->tc_valid & 0x80) && global.quiet == 0) { unsigned char p_start[16]; unsigned char *p = p_start; unsigned char *cp = subq_tr->track_isrc; /* unified format guesser: * there are 60 bits and 15 bytes available. * 5 * 6bit-items + two zero fill bits + 7 * 4bit-items * * A: ab cd ef gh ij kl mn o0 0 0 0 0 0 0 0 Plextor 6x Rel. 1.02 * B: 0a 0b 0c 0d 0e 0f 0g 0h 0i 0j 0k 0l 0m 0n 0o Toshiba 3401 * C: AS AS AS AS AS AS AS AS AS AS AS AS AS AS AS ASCII SCSI-2 * eg 'G''B''-''A''0''7''-''6''8''-''0''0''2''7''0' makes most sense * D: 'G''B''A''0''7''6''8''0''0''2''7''0'0 0 0 Plextor 6x Rel. 1.06 and 4.5x R. 1.01 and 1.04 */ /* Check for format A: */ if (!(cp[8] | cp[9] | cp[10] | cp[11] | cp[12] | cp[13] | cp[14]) && ((cp[0] & 0xf0) | (cp[1] & 0xf0) | (cp[2] & 0xf0) | (cp[3] & 0xf0) | (cp[4] & 0xf0) | (cp[5] & 0xf0) | (cp[6] & 0xf0) | (cp[7] & 0xf0))) { #if DEBUG_ISRC fprintf(stderr, "a!\t"); #endif /* reformat A: to B: */ cp[14] = cp[7] >> 4; cp[13] = cp[6] & 0xf; cp[12] = cp[6] >> 4; cp[11] = cp[5] & 0xf; cp[10] = cp[5] >> 4; cp[ 9] = cp[4] & 0xf; cp[ 8] = cp[4] >> 4; cp[ 7] = cp[3] & 0xf; cp[ 6] = cp[3] >> 4; cp[ 5] = cp[2] & 0xf; cp[ 4] = cp[2] >> 4; cp[ 3] = cp[1] & 0xf; cp[ 2] = cp[1] >> 4; cp[ 1] = cp[0] & 0xf; cp[ 0] = cp[0] >> 4; #if DEBUG_ISRC fprintf(stderr, "a->b: %15.15s\n", cp); #endif } /* Check for format B: * If not yet in ASCII format, do the conversion */ if (cp[0] < '0' && cp[1] < '0') { /* coding table for International Standard Recording Code */ static char bin2ISRC[] = { '0','1','2','3','4','5','6','7','8','9', /* 10 */ ':',';','<','=','>','?','@', /* 17 */ 'A','B','C','D','E','F','G','H','I','J','K', /* 28 */ 'L','M','N','O','P','Q','R','S','T','U','V', /* 39 */ 'W','X','Y','Z', /* 43 */ #if 1 '[','\\',']','^','_','`', /* 49 */ 'a','b','c','d','e','f','g','h','i','j','k', /* 60 */ 'l','m','n','o' /* 64 */ #endif }; /* build 6-bit vector of coded values */ unsigned ind; int bits; #if DEBUG_ISRC fprintf(stderr, "b!\n"); #endif ind = (cp[0] << 26) + (cp[1] << 22) + (cp[2] << 18) + (cp[3] << 14) + (cp[4] << 10) + (cp[5] << 6) + (cp[6] << 2) + (cp[7] >> 2); if ((cp[7] & 3) == 3) { if (global.verbose) { fprintf(stderr, "Recorder-ID encountered: "); for (bits = 0; bits < 30; bits +=6) { unsigned binval = (ind & (ULONG_C(0x3f) << (24-bits))) >> (24-bits); if ((binval < sizeof(bin2ISRC)) && (binval <= 9 || binval >= 16)) { fprintf(stderr, "%X", bin2ISRC[binval]); } } fprintf(stderr, "%.1X%.1X%.1X%.1X%.1X%.1X%.1X", subq_tr->track_isrc [8] & 0x0f, subq_tr->track_isrc [9] & 0x0f, subq_tr->track_isrc [10] & 0x0f, subq_tr->track_isrc [11] & 0x0f, subq_tr->track_isrc [12] & 0x0f, subq_tr->track_isrc [13] & 0x0f, subq_tr->track_isrc [14] & 0x0f ); fprintf(stderr, "\n"); } return; } if ((cp[7] & 3) != 0) { fprintf(stderr, "unknown mode 3 entry C1=0x%02x, C2=0x%02x\n", (cp[7] >> 1) & 1, cp[7] & 1); return; } /* decode ISRC due to IEC 908 */ for (bits = 0; bits < 30; bits +=6) { unsigned binval = (ind & ((unsigned long) 0x3fL << (24L-bits))) >> (24L-bits); if ((binval >= sizeof(bin2ISRC)) || (binval > 9 && binval < 16)) { /* Illegal ISRC, dump and skip */ int y; Get_ISRC(tr)[0] = '\0'; fprintf(stderr, "\nIllegal ISRC for track %d, skipped: ", tr); for (y = 0; y < 15; y++) { fprintf(stderr, "%02x ", cp[y]); } fputs("\n", stderr); return; } *p++ = bin2ISRC[binval]; /* insert a dash after two country characters for legibility */ if (bits == 6) *p++ = '-'; } /* format year and serial number */ sprintf ((char *)p, "-%.1X%.1X-%.1X%.1X%.1X%.1X%.1X", subq_tr->track_isrc [8] & 0x0f, subq_tr->track_isrc [9] & 0x0f, subq_tr->track_isrc [10] & 0x0f, subq_tr->track_isrc [11] & 0x0f, subq_tr->track_isrc [12] & 0x0f, subq_tr->track_isrc [13] & 0x0f, subq_tr->track_isrc [14] & 0x0f ); #if DEBUG_ISRC fprintf(stderr, "b: %15.15s!\n", p_start); #endif } else { /* It might be in ASCII, surprise */ int ii; for (ii = 0; ii < 12; ii++) { if (cp[ii] < '0' || cp[ii] > 'Z') { break; } } if (ii != 12) { int y; Get_ISRC(ii)[0] = '\0'; fprintf(stderr, "\nIllegal ISRC for track %d, skipped: ", ii+1); for (y = 0; y < 15; y++) { fprintf(stderr, "%02x ", cp[y]); } fputs("\n", stderr); return; } #if DEBUG_ISRC fprintf(stderr, "ascii: %15.15s!\n", cp); #endif for (ii = 0; ii < 12; ii++) { #if 1 if ((ii == 2 || ii == 5 || ii == 7) && cp[ii] != ' ') *p++ = '-'; #endif *p++ = cp[ii]; } if (p - p_start >= 16) *(p_start + 15) = '\0'; else *p = '\0'; } if (memcmp(p_start,"00-000-00-00000",15) != 0) { Set_ISRC(tr, p_start); } } } /* get and display Media Catalog Number ( one per disc ) * and Track International Standard Recording Codes (for each track) */ void Read_MCN_ISRC(void) { if ((global.verbose & SHOW_MCN) != 0) { if (Get_MCN()[0] == '\0') { Get_Set_MCN(); } if (Get_MCN()[0] != '\0') fprintf(stderr, "\rMedia catalog number: %13.13s\n", Get_MCN()); else fprintf(stderr, "\rNo media catalog number present.\n"); } if ((global.verbose & SHOW_ISRC) != 0) { static struct iterator i; InitIterator(&i, 1); while (i.hasNextTrack(&i)) { struct TOC *p = i.getNextTrack(&i); unsigned ii = GETTRACK(p); if (ii == CDROM_LEADOUT) break; if (!IS__AUDIO(p)) continue; if (GETISRC(p)[0] == '\0') { Get_Set_ISRC(ii); } if (GETISRC(p)[0] != '\0') { fprintf (stderr, "\rT: %2d ISRC: %15.15s\n", ii, GETISRC(p)); fflush(stderr); } } /* for all tracks */ fputs("\n", stderr); } /* if SHOW_ISRC */ } static int playing = 0; static subq_chnl *ReadSubChannel(unsigned sec); static subq_chnl *ReadSubChannel(unsigned sec) { subq_chnl *sub_ch; /* * For modern drives implement a direct method. If the drive supports * reading of subchannel data, do direct reads. */ if (ReadSubChannels != NULL) { get_scsi_p()->silent++; sub_ch = ReadSubChannels(get_scsi_p(), sec); get_scsi_p()->silent--; if (sub_ch == NULL /*&& (usal_sense_key(get_scsi_p()) == 5)*/) { /* command is not implemented */ ReadSubChannels = NULL; #if defined DEBUG_SUB fprintf(stderr, "\nCommand not implemented: switching ReadSubChannels off !\n"); #endif goto fallback; } /* check the adress mode field */ if ((sub_ch->control_adr & 0x0f) == 0) { /* no Q mode information present at all, weird */ sub_ch->control_adr = 0xAA; } if ((int)(sub_ch->control_adr & 0x0f) > 0x01) { /* this sector just has no position information. * we try the one before and then the one after. */ if (sec > 1) { sec -= 1; sub_ch = ReadSubChannels(get_scsi_p(), sec); if (sub_ch == NULL) return NULL; sec += 1; } if ((sub_ch->control_adr & 0x0f) != 0x01) { sec += 2; sub_ch = ReadSubChannels(get_scsi_p(), sec); if (sub_ch == NULL) return NULL; sec -= 2; } } /* check adress mode field for position information */ if ((sub_ch->control_adr & 0x0f) == 0x01) { return sub_ch; } ReadSubChannels = NULL; fprintf(stderr, "\nCould not get position information (%02x) for sectors %d, %d, %d: switching ReadSubChannels off !\n", sub_ch->control_adr &0x0f, sec-1, sec, sec+2); } /* * We rely on audio sectors here!!! * The only method that worked even with my antique Toshiba 3401, * is playing the sector and then request the subchannel afterwards. */ fallback: /* We need a conformed audio track here! */ /* Fallback to ancient method */ if (-1 == Play_at(get_scsi_p(), sec, 1)) { return NULL; } playing = 1; sub_ch = ReadSubQ(get_scsi_p(), GET_POSITIONDATA,0); return sub_ch; } static int ReadSubControl(unsigned sec); static int ReadSubControl(unsigned sec) { subq_chnl *sub_ch = ReadSubChannel(sec); if (sub_ch == NULL) return -1; return sub_ch->control_adr & 0xf0; } static int HaveSCMS(unsigned StartSector); static int HaveSCMS(unsigned StartSector) { int i; int cr; int copy_bits_set = 0; for (i = 0; i < 8; i++) { cr = ReadSubControl(StartSector + i); if (cr == -1) continue; (cr & 0x20) ? copy_bits_set++ : 0; } return (copy_bits_set >= 1 && copy_bits_set < 8); } void Check_Toc(void) { /* detect layout */ /* detect tracks */ } static int GetIndexOfSector(unsigned sec, unsigned track) { subq_chnl *sub_ch = ReadSubChannel(sec); if (sub_ch == NULL) { if ((long)sec == Get_EndSector(track)) { fprintf(stderr, "Driver and/or firmware bug detected! Drive cannot play the very last sector (%u)!\n", sec); } return -1; } /* can we trust that these values are hex and NOT bcd? */ if ((sub_ch->track >= 0x10) && (sub_ch->track - track > 5)) { /* change all values from bcd to hex */ sub_ch->track = (sub_ch->track >> 4)*10 + (sub_ch->track & 0x0f); sub_ch->index = (sub_ch->index >> 4)*10 + (sub_ch->index & 0x0f); } #if 1 /* compare tracks */ if (sub_ch->index != 0 && track != sub_ch->track) { if (global.verbose) fprintf(stderr, "\ntrack mismatch: %1d, in-track subchannel: %1d (index %1d, sector %1d)\n", track, sub_ch->track, sub_ch->index, sec); } #endif /* compare control field with the one from the TOC */ if ((Get_Flags(track) & 0xf0) != (sub_ch->control_adr & 0xf0)) { int diffbits = (Get_Flags(track) & 0xf0) ^ (sub_ch->control_adr & 0xf0); if ((diffbits & 0x80) == 0x80) { /* broadcast difference */ if (global.verbose) fprintf(stderr, "broadcast type conflict detected -> TOC:%s, subchannel:%s\n", (sub_ch->control_adr & 0x80) == 0 ? "broadcast" : "nonbroadcast" ,(sub_ch->control_adr & 0x80) != 0 ? "broadcast" : "nonbroadcast" ); } if ((diffbits & 0x40) == 0x40) { /* track type difference */ if (global.verbose) fprintf(stderr, "track type conflict detected -> TOC:%s, subchannel:%s\n", (sub_ch->control_adr & 0x40) == 0 ? "data" : "audio" ,(sub_ch->control_adr & 0x40) != 0 ? "data" : "audio" ); } if ((diffbits & 0x20) == 0x20 && !Get_SCMS(track)) { /* copy permission difference is a sign for SCMS * and is treated elsewhere. */ if (global.verbose) fprintf(stderr, "difference: TOC:%s, subchannel:%s\ncorrecting TOC...\n", (sub_ch->control_adr & 0x20) == 0 ? "unprotected" : "copyright protected", (sub_ch->control_adr & 0x20) != 0 ? "unprotected" : "copyright protected" ); toc_entry(track, (Get_Flags(track) & 0xDF) | (sub_ch->control_adr & 0x20), Get_Tracknumber(track), Get_ISRC(track), Get_AudioStartSector(track), Get_Mins(track), Get_Secs(track), Get_Frames(track) ); } if ((diffbits & 0x10) == 0x10) { /* preemphasis difference */ if (global.verbose) fprintf(stderr, "difference: TOC:%s, subchannel:%s preemphasis\ncorrecting TOC...\n", (sub_ch->control_adr & 0x10) == 0 ? "with" : "without", (sub_ch->control_adr & 0x10) != 0 ? "with" : "without" ); toc_entry(track, (Get_Flags(track) & 0xEF) | (sub_ch->control_adr & 0x10), Get_Tracknumber(track), Get_ISRC(track), Get_AudioStartSector(track), Get_Mins(track), Get_Secs(track), Get_Frames(track) ); } } return sub_ch ? sub_ch->index == 244 ? 1 : sub_ch->index : -1; } static int ScanBackwardFrom(unsigned sec, unsigned limit, int *where, unsigned track); static int ScanBackwardFrom(unsigned sec, unsigned limit, int *where, unsigned track) { unsigned lastindex = 0; unsigned mysec = sec; /* try to find the transition of index n to index 0, * if the track ends with an index 0. */ while ((lastindex = GetIndexOfSector(mysec, track)) == 0) { if (mysec < limit+75) { break; } mysec -= 75; } if (mysec == sec) { /* there is no pre-gap in this track */ if (where != NULL) *where = -1; } else { /* we have a pre-gap in this track */ if (lastindex == 0) { /* we did not cross the transition yet -> search backward */ do { if (mysec < limit+1) { break; } mysec --; } while ((lastindex = GetIndexOfSector(mysec,track)) == 0); if (lastindex != 0) { /* successful */ mysec ++; /* register mysec as transition */ if (where != NULL) *where = (int) mysec; } else { /* could not find transition */ if (!global.quiet) fprintf(stderr, "Could not find index transition for pre-gap.\n"); if (where != NULL) *where = -1; } } else { int myindex = -1; /* we have crossed the transition -> search forward */ do { if (mysec >= sec) { break; } mysec ++; } while ((myindex = GetIndexOfSector(mysec,track)) != 0); if (myindex == 0) { /* successful */ /* register mysec as transition */ if (where != NULL) *where = (int) mysec; } else { /* could not find transition */ if (!global.quiet) fprintf(stderr, "Could not find index transition for pre-gap.\n"); if (where != NULL) *where = -1; } } } return lastindex; } #ifdef USE_LINEAR_SEARCH static int linear_search(int searchInd, unsigned int Start, unsigned int End, unsigned track); static int linear_search(int searchInd, unsigned int Start, unsigned int End, unsigned track) { int l = Start; int r = End; for (; l <= r; l++ ) { int ind; ind = GetIndexOfSector(l, track); if ( searchInd == ind ) { break; } } if ( l <= r ) { /* Index found. */ return l; } return -1; } #endif #ifndef USE_LINEAR_SEARCH #undef DEBUG_BINSEARCH static int binary_search(int searchInd, unsigned int Start, unsigned int End, unsigned track); static int binary_search(int searchInd, unsigned Start, unsigned End, unsigned track) { int l = Start; int r = End; int x = 0; int ind; while ( l <= r ) { x = ( l + r ) / 2; /* try to avoid seeking */ ind = GetIndexOfSector(x, track); if ( searchInd == ind ) { break; } else { if ( searchInd < ind ) r = x - 1; else l = x + 1; } } #ifdef DEBUG_BINSEARCH fprintf(stderr, "(%d,%d,%d > ",l,x,r); #endif if ( l <= r ) { /* Index found. Now find the first position of this index */ /* l=LastPos x=found r=NextPos */ r = x; while ( l < r-1 ) { x = ( l + r ) / 2; /* try to avoid seeking */ ind = GetIndexOfSector(x, track); if ( searchInd == ind ) { r = x; } else { l = x; } #ifdef DEBUG_BINSEARCH fprintf(stderr, "%d -> ",x); #endif } #ifdef DEBUG_BINSEARCH fprintf(stderr, "%d,%d)\n",l,r); #endif if (searchInd == GetIndexOfSector(l, track)) return l; else return r; } return -1; } #endif static void register_index_position(int IndexOffset, index_list **last_index_entry); static void register_index_position(int IndexOffset, index_list **last_index_entry) { index_list *indexentry; /* register higher index entries */ if (*last_index_entry != NULL) { indexentry = (index_list *) malloc( sizeof(index_list) ); } else { indexentry = NULL; } if (indexentry != NULL) { indexentry->next = NULL; (*last_index_entry)->next = indexentry; *last_index_entry = indexentry; indexentry->frameoffset = IndexOffset; #if defined INFOFILES } else { fprintf( stderr, "No memory for index lists. Index positions\nwill not be written in info file!\n"); #endif } } static void Set_SCMS(unsigned long p_track); #undef DEBUG_INDLIST /* experimental code */ /* search for indices (audio mode required) */ unsigned ScanIndices(unsigned track, unsigned cd_index, int bulk) { /* scan for indices. */ /* look at last sector of track. */ /* when the index is not equal 1 scan by bipartition * for offsets of all indices */ unsigned starttrack, endtrack; unsigned startindex, endindex; unsigned j; int LastIndex=0; int n_0_transition; unsigned StartSector; unsigned retval = 0; index_list *baseindex_pool; index_list *last_index_entry; SCSI *usalp = get_scsi_p(); static struct iterator i; InitIterator(&i, 1); EnableCdda(usalp, 0, 0); EnableCdda(usalp, 1, CD_FRAMESIZE_RAW + 16); if (!global.quiet && !(global.verbose & SHOW_INDICES)) fprintf(stderr, "seeking index start ..."); if (bulk != 1) { starttrack = track; endtrack = track; } else { starttrack = 1; endtrack = cdtracks; } baseindex_pool = (index_list *) malloc( sizeof(index_list) * (endtrack - starttrack + 1)); #ifdef DEBUG_INDLIST fprintf(stderr, "index0-mem-pool %p\n", baseindex_pool); #endif while (i.hasNextTrack(&i)) { struct TOC *p = i.getNextTrack(&i); unsigned ii = GETTRACK(p); if ( ii < starttrack || IS__DATA(p) ) continue; /* skip nonaudio tracks */ if ( ii > endtrack ) break; if ( global.verbose & SHOW_INDICES ) { if (global.illleadout_cd && global.reads_illleadout && ii == endtrack) { fprintf(stderr, "Analysis of track %d skipped due to unknown length\n", ii); } } if (global.illleadout_cd && global.reads_illleadout && ii == endtrack) continue; StartSector = Get_AudioStartSector(ii); if (HaveSCMS(StartSector)) { Set_SCMS(ii); } if ( global.verbose & SHOW_INDICES ) { fprintf( stderr, "\rindex scan: %d...", ii ); fflush (stderr); } LastIndex = ScanBackwardFrom(Get_EndSector(ii), StartSector, &n_0_transition, ii); if (LastIndex > 99) continue; if (baseindex_pool != NULL) { #ifdef DEBUG_INDLIST #endif /* register first index entry for this track */ baseindex_pool[ii - starttrack].next = NULL; baseindex_pool[ii - starttrack].frameoffset = StartSector; global.trackindexlist[ii] = &baseindex_pool[ii - starttrack]; #ifdef DEBUG_INDLIST #endif } else { global.trackindexlist[ii] = NULL; } last_index_entry = global.trackindexlist[ii]; if (LastIndex < 2) { register_index_position(n_0_transition, &last_index_entry); continue; } if ((global.verbose & SHOW_INDICES) && LastIndex > 1) fprintf(stderr, "\rtrack %2d has %d indices, index table (pairs of 'index: frame offset')\n", ii, LastIndex); startindex = 0; endindex = LastIndex; for (j = startindex; j <= endindex; j++) { int IndexOffset; /* this track has indices */ #ifdef USE_LINEAR_SEARCH /* do a linear search */ IndexOffset = linear_search(j, StartSector, Get_EndSector(ii), ii); #else /* do a binary search */ IndexOffset = binary_search(j, StartSector, Get_EndSector(ii), ii); #endif if (IndexOffset != -1) { StartSector = IndexOffset; } if (j == 1) last_index_entry->frameoffset = IndexOffset; else if (j > 1) register_index_position(IndexOffset, &last_index_entry); if ( IndexOffset == -1 ) { if (global.verbose & SHOW_INDICES) { if (global.gui == 0) { fprintf(stderr, "%2u: N/A ",j); if (((j + 1) % 8) == 0) fputs("\n", stderr); } else { fprintf(stderr, "\rT%02d I%02u N/A\n",ii,j); } } } else { if (global.verbose & SHOW_INDICES) { if (global.gui == 0) { fprintf(stderr, "%2u:%6lu ", j, IndexOffset-Get_AudioStartSector(ii) ); if (((j + 1) % 8) == 0) fputs("\n", stderr); } else { fprintf(stderr, "\rT%02d I%02u %06lu\n", ii, j, IndexOffset-Get_AudioStartSector(ii) ); } } if (track == ii && cd_index == j) { retval = IndexOffset-Get_AudioStartSector(ii); } } /* if IndexOffset */ } /* for index */ register_index_position(n_0_transition, &last_index_entry); /* sanity check. clear all consecutive nonindex entries (frameoffset -1) from the end. */ { index_list *ip = global.trackindexlist[ii]; index_list *iq = NULL; index_list *lastgood = iq; while (ip != NULL) { if (ip->frameoffset == -1) { /* no index available */ if (lastgood == NULL) { /* if this is the first one in a sequence, store predecessor */ lastgood = iq; } } else { /* this is a valid index, reset marker */ lastgood = NULL; } iq = ip; ip = ip->next; } /* terminate chain at the last well defined entry. */ if (lastgood != NULL) lastgood->next = NULL; } if (global.gui == 0 && (global.verbose & SHOW_INDICES) && ii != endtrack) fputs("\n", stderr); } /* for tracks */ if (global.gui == 0 && (global.verbose & SHOW_INDICES)) fputs("\n", stderr); if (playing != 0) StopPlay(get_scsi_p()); EnableCdda(usalp, 0, 0); EnableCdda(usalp, 1, CD_FRAMESIZE_RAW); return retval; } static unsigned char MCN[14]; static void Set_MCN(unsigned char *MCN_arg) { memcpy(MCN, MCN_arg, 14); MCN[13] = '\0'; } unsigned char *Get_MCN(void) { return MCN; } static TOC g_toc [MAXTRK+1]; /* hidden track + 100 regular tracks */ /*#define IS_AUDIO(i) (!(g_toc[i].bFlags & 0x40))*/ int TOC_entries(unsigned tracks, unsigned char *a, unsigned char *b, int binvalid) { int i; for (i = 1; i <= (int)tracks; i++) { unsigned char *p; unsigned long dwStartSector; if (binvalid) { p = a + 8*(i-1); g_toc[i].bFlags = p[1]; g_toc[i].bTrack = p[2]; g_toc[i].ISRC[0] = 0; dwStartSector = a_to_u_4_byte(p+4); g_toc[i].dwStartSector = dwStartSector; lba_2_msf((long)dwStartSector, &g_toc[i].mins, &g_toc[i].secs, &g_toc[i].frms); } else { p = b + 8*(i-1); g_toc[i].bFlags = p[1]; g_toc[i].bTrack = p[2]; g_toc[i].ISRC[0] = 0; if ((int)((p[5]*60 + p[6])*75 + p[7]) >= 150) { g_toc[i].dwStartSector = (p[5]*60 + p[6])*75 + p[7] -150; } else { g_toc[i].dwStartSector = 0; } g_toc[i].mins = p[5]; g_toc[i].secs = p[6]; g_toc[i].frms = p[7]; } } return 0; } void toc_entry(unsigned nr, unsigned flag, unsigned tr, unsigned char *ISRC, unsigned long lba, int m, int s, int f) { if (nr > MAXTRK) return; g_toc[nr].bFlags = flag; g_toc[nr].bTrack = tr; if (ISRC) { strncpy((char *)g_toc[nr].ISRC, (char *)ISRC, sizeof(g_toc[nr].ISRC) -1); g_toc[nr].ISRC[sizeof(g_toc[nr].ISRC) -1] = '\0'; } g_toc[nr].dwStartSector = lba; g_toc[nr].mins = m; g_toc[nr].secs = s; g_toc[nr].frms = f; } int patch_real_end(unsigned long sector) { g_toc[cdtracks+1].dwStartSector = sector; return 0; } static int patch_cd_extra(unsigned track, unsigned long sector) { if (track <= cdtracks) g_toc[track].dwStartSector = sector; return 0; } static int restrict_tracks_illleadout(void) { struct TOC *o = &g_toc[cdtracks+1]; int i; for (i = cdtracks; i >= 0; i--) { struct TOC *p = &g_toc[i]; if (GETSTART(o) > GETSTART(p)) break; } patch_cd_extra(i+1, GETSTART(o)); cdtracks = i; return 0; } static void Set_ISRC(int track, const unsigned char *ISRC_arg) { if (track <= (int)cdtracks) { memcpy(Get_ISRC(track), ISRC_arg, 16); } } unsigned char *Get_ISRC(unsigned long p_track) { if (p_track <= cdtracks) return g_toc[p_track].ISRC; return NULL; } static void patch_to_audio(unsigned long p_track) { if (p_track <= cdtracks) g_toc[p_track].bFlags &= ~0x40; } int Get_Flags(unsigned long p_track) { if (p_track <= cdtracks) return g_toc[p_track].bFlags; return -1; } int Get_Mins(unsigned long p_track) { if (p_track <= cdtracks) return g_toc[p_track].mins; return -1; } int Get_Secs(unsigned long p_track) { if (p_track <= cdtracks) return g_toc[p_track].secs; return -1; } int Get_Frames(unsigned long p_track) { if (p_track <= cdtracks) return g_toc[p_track].frms; return -1; } int Get_Preemphasis(unsigned long p_track) { if (p_track <= cdtracks) return g_toc[p_track].bFlags & 0x10; return -1; } static void Set_SCMS(unsigned long p_track) { g_toc[p_track].SCMS = 1; } int Get_SCMS(unsigned long p_track) { if (p_track <= cdtracks) return g_toc[p_track].SCMS; return -1; } int Get_Copyright(unsigned long p_track) { if (p_track <= cdtracks) { if (g_toc[p_track].SCMS) return 1; return ((int)g_toc[p_track].bFlags & 0x20) >> 4; } return -1; } int Get_Datatrack(unsigned long p_track) { if (p_track <= cdtracks) return g_toc[p_track].bFlags & 0x40; return -1; } int Get_Channels(unsigned long p_track) { if (p_track <= cdtracks) return g_toc[p_track].bFlags & 0x80; return -1; } int Get_Tracknumber(unsigned long p_track) { if (p_track <= cdtracks) return g_toc[p_track].bTrack; return -1; } static int useHiddenTrack(void) { return 0; } static void it_reset(struct iterator *this); static void it_reset(struct iterator *this) { this->index = this->startindex; } static int it_hasNextTrack(struct iterator *this); static struct TOC *it_getNextTrack(struct iterator *this); static int it_hasNextTrack(struct iterator *this) { return this->index <= (int)cdtracks+1; } static struct TOC *it_getNextTrack(struct iterator *this) { /* if ( (*this->hasNextTrack)(this) == 0 ) return NULL; */ if ( this->index > (int)cdtracks+1 ) return NULL; return &g_toc[ this->index++ ]; } static void InitIterator(struct iterator *iter, unsigned long p_track) { if (iter == NULL) return; iter->index = iter->startindex = useHiddenTrack() ? 0 : p_track; iter->reset = it_reset; iter->getNextTrack = it_getNextTrack; iter->hasNextTrack = it_hasNextTrack; } #if 0 static struct iterator *NewIterator(void); static struct iterator *NewIterator () { struct iterator *retval; retval = malloc (sizeof(struct iterator)); if (retval != NULL) { InitIterator(retval, 1); } return retval; } #endif long Get_AudioStartSector(unsigned long p_track) { #if 1 if (p_track == CDROM_LEADOUT) p_track = cdtracks + 1; if (p_track <= cdtracks +1 && IS__AUDIO(&g_toc[p_track])) return GETSTART(&g_toc[p_track]); #else static struct iterator i; if (i.reset == NULL) InitIterator(&i, p_track); else i.reset(&i); if (p_track == cdtracks + 1) p_track = CDROM_LEADOUT; while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); if (GETTRACK(p) == p_track) { if (IS__DATA(p)) { return -1; } return GETSTART(p); } } #endif return -1; } long Get_StartSector(unsigned long p_track) { #if 1 if (p_track == CDROM_LEADOUT) p_track = cdtracks + 1; if (p_track <= cdtracks +1) return GETSTART(&g_toc[p_track]); #else static struct iterator i; if (i.reset == NULL) InitIterator(&i, p_track); else i.reset(&i); if (p_track == cdtracks + 1) p_track = CDROM_LEADOUT; while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); if (GETTRACK(p) == p_track) { return GETSTART(p); } } #endif return -1; } long Get_EndSector(unsigned long p_track) { #if 1 if (p_track <= cdtracks) return GETSTART(&g_toc[p_track+1])-1; #else static struct iterator i; if (i.reset == NULL) InitIterator(&i, p_track); else i.reset(&i); if (p_track == cdtracks + 1) p_track = CDROM_LEADOUT; while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); if (GETTRACK(p) == p_track) { p = i.getNextTrack(&i); if (p == NULL) { return -1; } return GETSTART(p)-1; } } #endif return -1; } long FirstTrack(void) { static struct iterator i; if (i.reset == NULL) InitIterator(&i, 1); else i.reset(&i); if (i.hasNextTrack(&i)) { return GETTRACK(i.getNextTrack(&i)); } return -1; } long FirstAudioTrack(void) { static struct iterator i; if (i.reset == NULL) InitIterator(&i, 1); else i.reset(&i); while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); unsigned ii = GETTRACK(p); if (ii == CDROM_LEADOUT) break; if (IS__AUDIO(p)) { return ii; } } return -1; } long FirstDataTrack(void) { static struct iterator i; if (i.reset == NULL) InitIterator(&i, 1); else i.reset(&i); while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); if (IS__DATA(p)) { return GETTRACK(p); } } return -1; } long LastTrack(void) { return g_toc[cdtracks].bTrack; } long LastAudioTrack(void) { long j = -1; static struct iterator i; if (i.reset == NULL) InitIterator(&i, 1); else i.reset(&i); while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); if (IS__AUDIO(p) && (GETTRACK(p) != CDROM_LEADOUT)) { j = GETTRACK(p); } } return j; } long Get_LastSectorOnCd(unsigned long p_track) { long LastSec = 0; static struct iterator i; if (global.illleadout_cd && global.reads_illleadout) return 150+(99*60+59)*75+74; if (i.reset == NULL) InitIterator(&i, p_track); else i.reset(&i); if (p_track == cdtracks + 1) p_track = CDROM_LEADOUT; while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); if (GETTRACK(p) < p_track) continue; LastSec = GETSTART(p); if (IS__DATA(p)) break; } return LastSec; } int Get_Track(unsigned long sector) { static struct iterator i; if (i.reset == NULL) InitIterator(&i, 1); else i.reset(&i); if (i.hasNextTrack(&i)) { TOC *o = i.getNextTrack(&i); while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); if ((GETSTART(o) <= sector) && (GETSTART(p) > sector)) { if (IS__DATA(o)) { return -1; } else { return GETTRACK(o); } } o = p; } } return -1; } int CheckTrackrange(unsigned long from, unsigned long upto) { static struct iterator i; if (i.reset == NULL) InitIterator(&i, from); else i.reset(&i); while (i.hasNextTrack(&i)) { TOC *p = i.getNextTrack(&i); if (GETTRACK(p) < from) continue; if (GETTRACK(p) == upto) return 1; /* data tracks terminate the search */ if (IS__DATA(p)) return 0; } /* track not found */ return 0; } #ifdef USE_PARANOIA long cdda_disc_firstsector(void *d); long cdda_disc_firstsector(void *d) { return Get_StartSector(FirstAudioTrack()); } int cdda_tracks(void *d); int cdda_tracks(void *d) { return LastAudioTrack() - FirstAudioTrack() +1; } int cdda_track_audiop(void *d, int track); int cdda_track_audiop(void *d, int track) { return Get_Datatrack(track) == 0; } long cdda_track_firstsector(void *d, int track); long cdda_track_firstsector(void *d, int track) { return Get_AudioStartSector(track); } long cdda_track_lastsector(void *d, int track); long cdda_track_lastsector(void *d, int track) { return Get_EndSector(track); } long cdda_disc_lastsector(void *d); long cdda_disc_lastsector(void *d) { return Get_LastSectorOnCd(cdtracks) - 1; } int cdda_sector_gettrack(void *d,long sector); int cdda_sector_gettrack(void *d, long sector) { return Get_Track(sector); } #endif cdrkit-1.1.11/icedax/aifc.c0000644000372500001440000001544310536265343014445 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)aifc.c 1.5 01/10/27 Copyright 1998,1999 Heiko Eissfeldt */ /*** * CopyPolicy: GNU Public License 2 applies * Copyright (C) by Heiko Eissfeldt * * * --------------------------------------------------------------------- * definitions for aifc pcm output * --------------------------------------------------------------------- */ #include "config.h" #include "mytype.h" #include #include #include #include #include #include "byteorder.h" #include "sndfile.h" typedef UINT4 FOURCC; /* a four character code */ typedef struct CHUNKHDR { FOURCC ckid; /* chunk ID */ UINT4 dwSize; /* chunk size */ } CHUNKHDR; #define mmioFOURCC(ch0, ch1, ch2, ch3) \ ((UINT4)(unsigned char)(ch3) | ((UINT4)(unsigned char)(ch2) << 8) | \ ((UINT4)(unsigned char)(ch1) << 16) | ((UINT4)(unsigned char)(ch0) << 24)) #define FOURCC_FORM mmioFOURCC ('F', 'O', 'R', 'M') #define FOURCC_AIFC mmioFOURCC ('A', 'I', 'F', 'C') #define FOURCC_FVER mmioFOURCC ('F', 'V', 'E', 'R') #define FOURCC_COMM mmioFOURCC ('C', 'O', 'M', 'M') #define FOURCC_NONE mmioFOURCC ('N', 'O', 'N', 'E') #define FOURCC_SSND mmioFOURCC ('S', 'S', 'N', 'D') #define NO_COMPRESSION "not compressed" /* brain dead construction from apple involving bigendian 80-bit doubles. Definitely designed not to be portable. Alignment is a nightmare too. */ typedef struct AIFCHDR { CHUNKHDR formChk; FOURCC formType; CHUNKHDR fverChk; /* Version chunk */ UINT4 timestamp; /* timestamp identifies version */ CHUNKHDR commChk; /* Common chunk */ /* from now on, alignment prevents us from using the original types :-(( */ unsigned char numChannels[2]; /* Audio Channels */ unsigned char numSampleFrames[4]; /* # of samples */ unsigned char samplesize[2]; /* bits per sample */ unsigned char sample_rate[10]; /* sample rate in extended float */ unsigned char compressionType[4]; /* AIFC extension */ unsigned char compressionNameLen; /* AIFC extension */ char compressionName[sizeof(NO_COMPRESSION)]; /* AIFC extension */ unsigned char ssndChkid[4]; /* Sound data chunk */ unsigned char dwSize[4]; /* size of chunk */ unsigned char offset[4]; /* start of 1st sample */ unsigned char blocksize[4]; /* aligned sound data block size */ } AIFCHDR; static AIFCHDR AifcHdr; /* Prototypes */ static int Format_samplerate(unsigned long rate, unsigned char the_rate[10]); static int InitSound(int audio, long channels, unsigned long rate, long nBitsPerSample, unsigned long expected_bytes ); static int ExitSound(int audio, unsigned long nBytesDone); static unsigned long GetHdrSize(void); static unsigned long InSizeToOutSize(unsigned long BytesToDo); struct soundfile aifcsound = { InitSound, /* init header method */ ExitSound, /* exit header method */ GetHdrSize, /* report header size method */ /* get sound samples out */ (int (*)(int audio, unsigned char *buf, unsigned long BytesToDo))write, InSizeToOutSize, /* compressed? output file size */ 1 /* needs big endian samples */ }; /* format the sample rate into an bigendian 10-byte IEEE-754 floating point number */ static int Format_samplerate(unsigned long rate, unsigned char the_rate[10]) { int i; /* normalize rate */ for (i = 0; (rate & 0xffff) != 0; rate <<= 1, i++) { if ((rate & 0x8000) != 0) { break; } } /* set exponent and sign */ the_rate[1] = 14-i; the_rate[0] = 0x40; /* LSB = sign */ /* 16-bit part of mantisse for sample rate */ the_rate[3] = rate & 0xff; the_rate[2] = (rate >> 8) & 0xff; /* initialize lower digits of mantisse */ the_rate[4] = the_rate[5] = the_rate[6] = the_rate[7] = the_rate[8] = the_rate[9] = 0; return 0; } static int InitSound(int audio, long channels, unsigned long rate, long nBitsPerSample, unsigned long expected_bytes) { UINT4 tmp; fillbytes(&AifcHdr, sizeof(AifcHdr), '\0'); AifcHdr.formChk.ckid = cpu_to_be32(FOURCC_FORM); AifcHdr.formChk.dwSize= cpu_to_be32(expected_bytes + offset_of(AIFCHDR,blocksize)+sizeof(AifcHdr.blocksize) - offsetof(AIFCHDR,commChk)); AifcHdr.formType = cpu_to_be32(FOURCC_AIFC); AifcHdr.fverChk.ckid = cpu_to_be32(FOURCC_FVER); AifcHdr.fverChk.dwSize= cpu_to_be32(offsetof(AIFCHDR,commChk) - offsetof(AIFCHDR,timestamp)); AifcHdr.compressionType[0]='N'; AifcHdr.compressionType[1]='O'; AifcHdr.compressionType[2]='N'; AifcHdr.compressionType[3]='E'; AifcHdr.compressionNameLen = sizeof(NO_COMPRESSION)-1; strcpy(AifcHdr.compressionName, NO_COMPRESSION); AifcHdr.timestamp = cpu_to_be32(UINT4_C(0xA2805140)); /* AIFC Version 1 */ AifcHdr.commChk.ckid = cpu_to_be32(FOURCC_COMM); AifcHdr.commChk.dwSize= cpu_to_be32(offset_of(AIFCHDR,ssndChkid) - offset_of(AIFCHDR,numChannels)); AifcHdr.numChannels[1]= channels; tmp = cpu_to_be32(expected_bytes/(channels * (nBitsPerSample/8))); AifcHdr.numSampleFrames[0] = tmp >> 24; AifcHdr.numSampleFrames[1] = tmp >> 16; AifcHdr.numSampleFrames[2] = tmp >> 8; AifcHdr.numSampleFrames[3] = tmp >> 0; AifcHdr.samplesize[1] = nBitsPerSample; Format_samplerate(rate, AifcHdr.sample_rate); memcpy(AifcHdr.ssndChkid, "SSND", 4); tmp = cpu_to_be32(expected_bytes + offset_of(AIFCHDR,blocksize)+sizeof(AifcHdr.blocksize) - offset_of(AIFCHDR, offset)); AifcHdr.dwSize[0] = tmp >> 24; AifcHdr.dwSize[1] = tmp >> 16; AifcHdr.dwSize[2] = tmp >> 8; AifcHdr.dwSize[3] = tmp >> 0; return write (audio, &AifcHdr, sizeof (AifcHdr)); } static int ExitSound(int audio, unsigned long nBytesDone) { UINT4 tmp; AifcHdr.formChk.dwSize= cpu_to_be32(nBytesDone + sizeof(AIFCHDR) - offsetof(AIFCHDR,commChk)); tmp = cpu_to_be32(nBytesDone/( AifcHdr.numChannels[1] * AifcHdr.samplesize[1]/ULONG_C(8))); AifcHdr.numSampleFrames[0] = tmp >> 24; AifcHdr.numSampleFrames[1] = tmp >> 16; AifcHdr.numSampleFrames[2] = tmp >> 8; AifcHdr.numSampleFrames[3] = tmp >> 0; /* If an odd number of bytes has been written, extend the chunk with one dummy byte. This is a requirement for AIFC. */ if ((nBytesDone & 1) && (lseek(audio, 1L, SEEK_CUR) == -1)) { return 0; } /* goto beginning */ if (lseek(audio, 0L, SEEK_SET) == -1) { return 0; } return write (audio, &AifcHdr, sizeof (AifcHdr)); } static unsigned long GetHdrSize() { return sizeof( AifcHdr ); } static unsigned long InSizeToOutSize(unsigned long BytesToDo) { return BytesToDo; } cdrkit-1.1.11/icedax/wav.h0000644000372500001440000000076410477233650014345 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)wav.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ extern struct soundfile wavsound; cdrkit-1.1.11/icedax/sha_func.c0000644000372500001440000003042510536265343015326 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)sha_func.c 1.3 01/10/27 Copyright 1998,1999 Heiko Eissfeldt */ /*____________________________________________________________________________ // // CD Index - The Internet CD Index // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // $Id: sha_func.c,v 1.2 1999/06/04 14:10:07 marc Exp $ //____________________________________________________________________________ */ /* NIST Secure Hash Algorithm */ /* heavily modified by Uwe Hollerbach */ /* from Peter C. Gutmann's implementation as found in */ /* Applied Cryptography by Bruce Schneier */ /* Further modifications to include the "UNRAVEL" stuff, below */ /* portability modifications Heiko Eissfeldt */ /* This code is in the public domain */ #include "config.h" #include #include "sha.h" /* UNRAVEL should be fastest & biggest */ /* UNROLL_LOOPS should be just as big, but slightly slower */ /* both undefined should be smallest and slowest */ #define UNRAVEL /* #define UNROLL_LOOPS */ /* SHA f()-functions */ #define f1(x,y,z) ((x & y) | (~x & z)) #define f2(x,y,z) (x ^ y ^ z) #define f3(x,y,z) ((x & y) | (x & z) | (y & z)) #define f4(x,y,z) (x ^ y ^ z) /* SHA constants */ #define CONST1 ULONG_C(0x5a827999) #define CONST2 ULONG_C(0x6ed9eba1) #define CONST3 ULONG_C(0x8f1bbcdc) #define CONST4 ULONG_C(0xca62c1d6) /* truncate to 32 bits -- should be a null op on 32-bit machines */ #define T32(x) ((x) & ULONG_C(0xffffffff)) /* 32-bit rotate */ #define R32(x,n) T32(((x << n) | (x >> (32 - n)))) /* the generic case, for when the overall rotation is not unraveled */ #define FG(n) \ T = T32(R32(A,5) + CONCAT(f,n(B,C,D)) + E + *WP++ + CONCAT(CONST,n)); \ E = D; D = C; C = R32(B,30); B = A; A = T /* specific cases, for when the overall rotation is unraveled */ #define FA(n) \ T = T32(R32(A,5) + CONCAT(f,n(B,C,D)) + E + *WP++ + CONCAT(CONST,n)); B = R32(B,30) #define FB(n) \ E = T32(R32(T,5) + CONCAT(f,n(A,B,C)) + D + *WP++ + CONCAT(CONST,n)); A = R32(A,30) #define FC(n) \ D = T32(R32(E,5) + CONCAT(f,n(T,A,B)) + C + *WP++ + CONCAT(CONST,n)); T = R32(T,30) #define FD(n) \ C = T32(R32(D,5) + CONCAT(f,n(E,T,A)) + B + *WP++ + CONCAT(CONST,n)); E = R32(E,30) #define FE(n) \ B = T32(R32(C,5) + CONCAT(f,n(D,E,T)) + A + *WP++ + CONCAT(CONST,n)); D = R32(D,30) #define FT(n) \ A = T32(R32(B,5) + CONCAT(f,n(C,D,E)) + T + *WP++ + CONCAT(CONST,n)); C = R32(C,30) /* do SHA transformation */ static void sha_transform(SHA_INFO *sha_info); static void sha_transform(SHA_INFO *sha_info) { int i; BYTE *dp; ULONG T, A, B, C, D, E, W[80], *WP; dp = sha_info->data; /* the following makes sure that at least one code block below is traversed or an error is reported, without the necessity for nested preprocessor if/else/endif blocks, which are a great pain in the nether regions of the anatomy... */ #undef SWAP_DONE #if (SHA_BYTE_ORDER == 1234) #define SWAP_DONE for (i = 0; i < 16; ++i) { T = *((ULONG *) dp); dp += 4; W[i] = ((T << 24) & ULONG_C(0xff000000)) | ((T << 8) & ULONG_C(0x00ff0000)) | ((T >> 8) & ULONG_C(0x0000ff00)) | ((T >> 24) & ULONG_C(0x000000ff)); } #endif /* SHA_BYTE_ORDER == 1234 */ #if (SHA_BYTE_ORDER == 4321) #define SWAP_DONE for (i = 0; i < 16; ++i) { T = *((ULONG *) dp); dp += 4; W[i] = T32(T); } #endif /* SHA_BYTE_ORDER == 4321 */ #if (SHA_BYTE_ORDER == 12345678) #define SWAP_DONE for (i = 0; i < 16; i += 2) { T = *((ULONG *) dp); dp += 8; W[i] = ((T << 24) & ULONG_C(0xff000000)) | ((T << 8) & ULONG_C(0x00ff0000)) | ((T >> 8) & ULONG_C(0x0000ff00)) | ((T >> 24) & ULONG_C(0x000000ff)); T >>= 32; W[i+1] = ((T << 24) & ULONG_C(0xff000000)) | ((T << 8) & ULONG_C(0x00ff0000)) | ((T >> 8) & ULONG_C(0x0000ff00)) | ((T >> 24) & ULONG_C(0x000000ff)); } #endif /* SHA_BYTE_ORDER == 12345678 */ #if (SHA_BYTE_ORDER == 87654321) #define SWAP_DONE for (i = 0; i < 16; i += 2) { T = *((ULONG *) dp); dp += 8; W[i] = T32(T >> 32); W[i+1] = T32(T); } #endif /* SHA_BYTE_ORDER == 87654321 */ #ifndef SWAP_DONE error Unknown byte order -- you need to add code here #endif /* SWAP_DONE */ for (i = 16; i < 80; ++i) { W[i] = W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16]; #if (SHA_VERSION == 1) W[i] = R32(W[i], 1); #endif /* SHA_VERSION */ } A = sha_info->digest[0]; B = sha_info->digest[1]; C = sha_info->digest[2]; D = sha_info->digest[3]; E = sha_info->digest[4]; WP = W; #ifdef UNRAVEL FA(1); FB(1); FC(1); FD(1); FE(1); FT(1); FA(1); FB(1); FC(1); FD(1); FE(1); FT(1); FA(1); FB(1); FC(1); FD(1); FE(1); FT(1); FA(1); FB(1); FC(2); FD(2); FE(2); FT(2); FA(2); FB(2); FC(2); FD(2); FE(2); FT(2); FA(2); FB(2); FC(2); FD(2); FE(2); FT(2); FA(2); FB(2); FC(2); FD(2); FE(3); FT(3); FA(3); FB(3); FC(3); FD(3); FE(3); FT(3); FA(3); FB(3); FC(3); FD(3); FE(3); FT(3); FA(3); FB(3); FC(3); FD(3); FE(3); FT(3); FA(4); FB(4); FC(4); FD(4); FE(4); FT(4); FA(4); FB(4); FC(4); FD(4); FE(4); FT(4); FA(4); FB(4); FC(4); FD(4); FE(4); FT(4); FA(4); FB(4); sha_info->digest[0] = T32(sha_info->digest[0] + E); sha_info->digest[1] = T32(sha_info->digest[1] + T); sha_info->digest[2] = T32(sha_info->digest[2] + A); sha_info->digest[3] = T32(sha_info->digest[3] + B); sha_info->digest[4] = T32(sha_info->digest[4] + C); #else /* !UNRAVEL */ #ifdef UNROLL_LOOPS FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); #else /* !UNROLL_LOOPS */ for (i = 0; i < 20; ++i) { FG(1); } for (i = 20; i < 40; ++i) { FG(2); } for (i = 40; i < 60; ++i) { FG(3); } for (i = 60; i < 80; ++i) { FG(4); } #endif /* !UNROLL_LOOPS */ sha_info->digest[0] = T32(sha_info->digest[0] + A); sha_info->digest[1] = T32(sha_info->digest[1] + B); sha_info->digest[2] = T32(sha_info->digest[2] + C); sha_info->digest[3] = T32(sha_info->digest[3] + D); sha_info->digest[4] = T32(sha_info->digest[4] + E); #endif /* !UNRAVEL */ } /* initialize the SHA digest */ void sha_init(SHA_INFO *sha_info); void sha_init(SHA_INFO *sha_info) { sha_info->digest[0] = ULONG_C(0x67452301); sha_info->digest[1] = ULONG_C(0xefcdab89); sha_info->digest[2] = ULONG_C(0x98badcfe); sha_info->digest[3] = ULONG_C(0x10325476); sha_info->digest[4] = ULONG_C(0xc3d2e1f0); sha_info->count_lo = 0L; sha_info->count_hi = 0L; sha_info->local = 0; } /* update the SHA digest */ void sha_update(SHA_INFO *sha_info, BYTE *buffer, int count); void sha_update(SHA_INFO *sha_info, BYTE *buffer, int count) { int i; ULONG clo; clo = T32(sha_info->count_lo + ((ULONG) count << 3)); if (clo < sha_info->count_lo) { ++sha_info->count_hi; } sha_info->count_lo = clo; sha_info->count_hi += (ULONG) count >> 29; if (sha_info->local) { i = SHA_BLOCKSIZE - sha_info->local; if (i > count) { i = count; } memcpy(((BYTE *) sha_info->data) + sha_info->local, buffer, i); count -= i; buffer += i; sha_info->local += i; if (sha_info->local == SHA_BLOCKSIZE) { sha_transform(sha_info); } else { return; } } while (count >= SHA_BLOCKSIZE) { memcpy(sha_info->data, buffer, SHA_BLOCKSIZE); buffer += SHA_BLOCKSIZE; count -= SHA_BLOCKSIZE; sha_transform(sha_info); } memcpy(sha_info->data, buffer, count); sha_info->local = count; } /* finish computing the SHA digest */ void sha_final(unsigned char digest[20], SHA_INFO *sha_info); void sha_final(unsigned char digest[20], SHA_INFO *sha_info) { int count; ULONG lo_bit_count, hi_bit_count; lo_bit_count = sha_info->count_lo; hi_bit_count = sha_info->count_hi; count = (int) ((lo_bit_count >> 3) & 0x3f); ((BYTE *) sha_info->data)[count++] = 0x80; if (count > SHA_BLOCKSIZE - 8) { memset(((BYTE *) sha_info->data) + count, 0, SHA_BLOCKSIZE - count); sha_transform(sha_info); memset((BYTE *) sha_info->data, 0, SHA_BLOCKSIZE - 8); } else { memset(((BYTE *) sha_info->data) + count, 0, SHA_BLOCKSIZE - 8 - count); } sha_info->data[56] = (unsigned char) ((hi_bit_count >> 24) & 0xff); sha_info->data[57] = (unsigned char) ((hi_bit_count >> 16) & 0xff); sha_info->data[58] = (unsigned char) ((hi_bit_count >> 8) & 0xff); sha_info->data[59] = (unsigned char) ((hi_bit_count >> 0) & 0xff); sha_info->data[60] = (unsigned char) ((lo_bit_count >> 24) & 0xff); sha_info->data[61] = (unsigned char) ((lo_bit_count >> 16) & 0xff); sha_info->data[62] = (unsigned char) ((lo_bit_count >> 8) & 0xff); sha_info->data[63] = (unsigned char) ((lo_bit_count >> 0) & 0xff); sha_transform(sha_info); digest[ 0] = (unsigned char) ((sha_info->digest[0] >> 24) & 0xff); digest[ 1] = (unsigned char) ((sha_info->digest[0] >> 16) & 0xff); digest[ 2] = (unsigned char) ((sha_info->digest[0] >> 8) & 0xff); digest[ 3] = (unsigned char) ((sha_info->digest[0] ) & 0xff); digest[ 4] = (unsigned char) ((sha_info->digest[1] >> 24) & 0xff); digest[ 5] = (unsigned char) ((sha_info->digest[1] >> 16) & 0xff); digest[ 6] = (unsigned char) ((sha_info->digest[1] >> 8) & 0xff); digest[ 7] = (unsigned char) ((sha_info->digest[1] ) & 0xff); digest[ 8] = (unsigned char) ((sha_info->digest[2] >> 24) & 0xff); digest[ 9] = (unsigned char) ((sha_info->digest[2] >> 16) & 0xff); digest[10] = (unsigned char) ((sha_info->digest[2] >> 8) & 0xff); digest[11] = (unsigned char) ((sha_info->digest[2] ) & 0xff); digest[12] = (unsigned char) ((sha_info->digest[3] >> 24) & 0xff); digest[13] = (unsigned char) ((sha_info->digest[3] >> 16) & 0xff); digest[14] = (unsigned char) ((sha_info->digest[3] >> 8) & 0xff); digest[15] = (unsigned char) ((sha_info->digest[3] ) & 0xff); digest[16] = (unsigned char) ((sha_info->digest[4] >> 24) & 0xff); digest[17] = (unsigned char) ((sha_info->digest[4] >> 16) & 0xff); digest[18] = (unsigned char) ((sha_info->digest[4] >> 8) & 0xff); digest[19] = (unsigned char) ((sha_info->digest[4] ) & 0xff); } #ifdef SHA_FOR_C /* compute the SHA digest of a FILE stream */ #define BLOCK_SIZE 8192 void sha_stream(unsigned char digest[20], SHA_INFO *sha_info, FILE *fin); void sha_stream(unsigned char digest[20], SHA_INFO *sha_info, FILE *fin) { int i; BYTE data[BLOCK_SIZE]; sha_init(sha_info); while ((i = fread(data, 1, BLOCK_SIZE, fin)) > 0) { sha_update(sha_info, data, i); } sha_final(digest, sha_info); } /* print a SHA digest */ void sha_print(unsigned char digest[20]); void sha_print(unsigned char digest[20]) { int i, j; for (j = 0; j < 5; ++j) { for (i = 0; i < 4; ++i) { printf("%02x", *digest++); } printf("%c", (j < 4) ? ' ' : '\n'); } } char *sha_version(void); char *sha_version() { #if (SHA_VERSION == 1) static char *version = "SHA-1"; #else static char *version = "SHA"; #endif return(version); } #endif /* SHA_FOR_C */ cdrkit-1.1.11/icedax/aiff.h0000644000372500001440000000076610477233650014457 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)aiff.h 1.2 99/12/19 Copyright 1998,1999 Heiko Eissfeldt */ extern struct soundfile aiffsound; cdrkit-1.1.11/icedax/configure.in0000644000372500001440000000352010471375025015676 0ustar steveusersdnl @(#)configure.in 1.8 06/02/15 Copyright 1998-2003 Heiko Eißfeldt dnl Process this file with autoconf to produce a configure script. AC_INIT(cdda2wav.c) AC_CONFIG_HEADER(lconfig.h) dnl get canonical host AC_CANONICAL_HOST dnl extract cdrtools version from the cdrecord.c file CDRTOOLS_VERSION=`sed -n -f ../../version.sed <../../../cdrecord/cdrecord.c` AC_SUBST(CDRTOOLS_VERSION) dnl set object extension needed for AC_CHECK_HEADERS by autoconf 2.57 dnl _AC_COMPILER_OBJEXT dnl check for posix4 library on Solaris or SunOS case "$host_os" in solaris*|sunos*) AC_CHECK_LIB(posix4, sched_get_priority_max) ;; esac AC_CHECK_LIB(ossaudio, _oss_ioctl) EXTRALIBS="$LIBS" AC_SUBST(EXTRALIBS) dnl check header files AC_CHECK_HEADERS(sys/cdio.h sys/cdrio.h sundev/srreg.h sys/audioio.h sun/audioio.h) AC_CHECK_HEADERS(soundcard.h sys/soundcard.h linux/soundcard.h machine/soundcard.h) AC_CHECK_HEADERS(sys/asoundlib.h windows.h mmsystem.h) AC_CHECK_HEADERS(os2.h os2me.h) case "${ac_cv_header_sys_cdio_h}""${ac_cv_header_sundev_srreg_h}" in *yes*) HAVE_SUN_IOCTL=1 ;; *) HAVE_SUN_IOCTL= ;; esac AC_SUBST(HAVE_SUN_IOCTL) case "${ac_cv_header_sys_audioio_h}""${ac_cv_header_sun_audioio_h}" in *yes*) HAVE_SUNSOUND=1 ;; *) HAVE_SUNSOUND= ;; esac AC_SUBST(HAVE_SUNSOUND) case "${ac_cv_header_machine_soundcard_h}""${ac_cv_header_sys_soundcard_h}""${ac_cv_header_linux_soundcard_h}" in *yes*) HAVE_OSS=1 ;; *) HAVE_OSS= ;; esac AC_SUBST(HAVE_OSS) AC_SUBST(HAVE_SYS_ASOUNDLIB_H) case "${ac_cv_header_windows_h}""${ac_cv_header_mmsystem_h}" in *yesyes*) HAVE_WINSOUND=1 ;; *) HAVE_WINSOUND= ;; esac AC_SUBST(HAVE_WINSOUND) case "${ac_cv_header_os2_h}""${ac_cv_header_os2me_h}" in *yesyes*) HAVE_OS2SOUND=1 ;; *) HAVE_OS2SOUND= ;; esac AC_SUBST(HAVE_OS2SOUND) dnl Checks for library functions. AC_CHECK_FUNCS(strtoul) AC_OUTPUT(local.cnf) cdrkit-1.1.11/icedax/semshm.c0000644000372500001440000002613610537101040015020 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* * Copyright 1998-2002 Heiko Eissfeldt */ #define IPCTST #undef IPCTST /* -------------------------------------------------------------------- */ /* semshm.c */ /* -------------------------------------------------------------------- */ /* int seminstall(key,amount) */ /* int semrequest(semid,semnum) */ /* int semrelease(semid,semnum) */ /* -------------------------------------------------------------------- */ #include "config.h" #if !defined(HAVE_SMMAP) && !defined(HAVE_USGSHM) && !defined(HAVE_DOSALLOCSHAREDMEM) && !defined(HAVE_AREAS) #undef FIFO /* We cannot have a FIFO on this platform */ #endif #if !defined(USE_MMAP) && !defined(USE_USGSHM) #define USE_MMAP #endif #if !defined HAVE_SMMAP && defined FIFO # undef USE_MMAP # define USE_USGSHM /* SYSV shared memory is the default */ #endif #ifdef USE_MMAP /* Only want to have one implementation */ # undef USE_USGSHM /* mmap() is preferred */ #endif #ifdef HAVE_DOSALLOCSHAREDMEM # undef USE_MMAP # undef USE_USGSHM # define USE_OS2SHM # undef USE_BEOS_AREAS #endif #ifdef HAVE_AREAS # undef USE_MMAP # undef USE_USGSHM # undef USE_OS2SHM # define USE_BEOS_AREAS #endif #include #include #include #include #include #include #include #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) #include #include #include #endif #if defined(HAVE_SHMAT) && (HAVE_SHMAT == 1) #include #include #include #endif #ifdef USE_MMAP #if defined(HAVE_SMMAP) && defined(USE_MMAP) #include #endif #endif #include #ifdef USE_BEOS_AREAS #include #endif #include "mytype.h" #include "interface.h" #include "ringbuff.h" #include "global.h" #include "exitcodes.h" #include "semshm.h" #ifdef DEBUG_SHM char *start_of_shm; char *end_of_shm; #endif int flush_buffers(void); /*------ Semaphore interfacing (for special cases only) ----------*/ /*------ Synchronization with pipes is preferred ----------*/ #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) int sem_id; static int seminstall(key_t key, int amount); static int seminstall(key_t key, int amount) { int ret_val; int semflag; semflag = IPC_CREAT | 0600; #ifdef IPCTST fprintf(stderr,"seminstall: key: %d, #sems %d, flags %4x\n", key,amount,semflag); #endif ret_val = semget(key,amount,semflag); if ( ret_val == -1 ) { fprintf(stderr,"semget: (Key %lx, #%d) failed: ", (long)key,amount); perror(""); } return ret_val; } /*-----------------------------------------------------------------*/ int semrequest(int semid, int semnum) { struct sembuf sops[1]; int ret_val; #ifdef IPCTST fprintf(stderr,"pid %d, ReQuest id:num %d:%d\n",getpid(),semid,semnum); #endif sops[0].sem_op = -1; sops[0].sem_num = (short) semnum; sops[0].sem_flg = 0; do { errno = 0; ret_val = semop(semid,sops,1); if (ret_val == -1 && errno != EAGAIN && errno != EINTR) { fprintf(stderr,"Request Sema %d(%d) failed: ",semid,semnum); perror(""); } } while (errno == EAGAIN || errno == EINTR); return(ret_val); } /*-----------------------------------------------------------------*/ int semrelease(int semid, int semnum, int amount) { struct sembuf sops[1]; int ret_val; #ifdef IPCTST fprintf(stderr,"%d RL %d:%d\n",getpid(),semid,semnum); #endif sops[0].sem_op = amount; sops[0].sem_num = (short) semnum; sops[0].sem_flg = 0; ret_val = semop(semid,sops,1); if ( ret_val == -1 && errno != EAGAIN) { fprintf(stderr,"Release Sema %d(%d) failed: ",semid,semnum); perror(""); } return(ret_val); } int flush_buffers() { return 0; } #else /*------ Synchronization with pipes ----------*/ int pipefdp2c[2]; int pipefdc2p[2]; void init_pipes() { if (pipe(pipefdp2c) < 0) { perror("cannot create pipe parent to child"); exit(PIPE_ERROR); } if (pipe(pipefdc2p) < 0) { perror("cannot create pipe child to parent"); exit(PIPE_ERROR); } } void init_parent() { close(pipefdp2c[0]); close(pipefdc2p[1]); } void init_child() { close(pipefdp2c[1]); close(pipefdc2p[0]); } int semrequest(int dummy, int semnum) { if (semnum == FREE_SEM /* 0 */) { int retval; if ((*total_segments_read) - (*total_segments_written) >= global.buffers) { /* parent/reader waits for freed buffers from the child/writer */ *parent_waits = 1; retval = read(pipefdp2c[0], &dummy, 1) != 1; return retval; } } else { int retval; if ((*total_segments_read) == (*total_segments_written)) { /* child/writer waits for defined buffers from the parent/reader */ *child_waits = 1; retval = read(pipefdc2p[0], &dummy, 1) != 1; return retval; } } return 0; } /* ARGSUSED */ int semrelease(int dummy, int semnum, int amount) { if (semnum == FREE_SEM /* 0 */) { if (*parent_waits == 1) { int retval; /* child/writer signals freed buffer to the parent/reader */ *parent_waits = 0; retval = write(pipefdp2c[1], "12345678901234567890", amount) != amount; return retval; } } else { if (*child_waits == 1) { int retval; /* parent/reader signals defined buffers to the child/writer */ *child_waits = 0; retval = write(pipefdc2p[1], "12345678901234567890", amount) != amount; return retval; } } return 0; } int flush_buffers() { if ((*total_segments_read) > (*total_segments_written)) { return write(pipefdc2p[1], "1", 1) != 1; } return 0; } #endif /*------------------- Shared memory interfacing -----------------------*/ #if defined(HAVE_SHMAT) && (HAVE_SHMAT == 1) static int shm_request_nommap(int size, unsigned char **memptr); /* request a shared memory block */ static int shm_request_nommap(int size, unsigned char **memptr) { int ret_val; int shmflag; int SHMEM_ID; int cmd; struct shmid_ds buf; key_t key = IPC_PRIVATE; shmflag = IPC_CREAT | 0600; ret_val = shmget(key,size,shmflag); if ( ret_val == -1 ) { perror("shmget"); return -1; } SHMEM_ID = ret_val; cmd = IPC_STAT; ret_val = shmctl(SHMEM_ID,cmd,&buf); #ifdef IPCTST fprintf(stderr, "%d: shmctl STAT= %d, SHM_ID: %d, key %ld cuid %d cgid %d mode %3o size %d\n", getpid(),ret_val,SHMEM_ID, (long) buf.shm_perm.key,buf.shm_perm.cuid,buf.shm_perm.cgid, buf.shm_perm.mode,buf.shm_segsz); #endif *memptr = (unsigned char *) shmat(SHMEM_ID, NULL, 0); if (*memptr == (unsigned char *) -1) { *memptr = NULL; fprintf( stderr, "shmat failed for %d bytes\n", size); return -1; } if (shmctl(SHMEM_ID, IPC_RMID, 0) < 0) { fprintf( stderr, "shmctl failed to detach shared memory segment\n"); return -1; } #ifdef DEBUG_SHM start_of_shm = *memptr; end_of_shm = (char *)(*memptr) + size; fprintf(stderr, "Shared memory from %p to %p (%d bytes)\n", start_of_shm, end_of_shm, size); #endif return 0; } #endif /* #if defined(HAVE_SHMAT) && (HAVE_SHMAT == 1) */ static int shm_request(int size, unsigned char **memptr); #ifdef USE_USGSHM /* request a shared memory block */ static int shm_request(int size, unsigned char **memptr) { return shm_request_nommap(size, memptr); } #endif /* release semaphores */ void free_sem(void); void free_sem() { #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) int mycmd; union my_semun unused_arg; mycmd = IPC_RMID; /* HP-UX warns here, but 'unused_arg' is not used for this operation */ /* This warning is difficult to avoid, since the structure of the union * generally is not known (os dependent). So we cannot initialize it * properly. */ semctl(sem_id,0,mycmd,unused_arg); #endif } #ifdef USE_MMAP #if defined(HAVE_SMMAP) int shm_id; /* request a shared memory block */ static int shm_request(int size, unsigned char **memptr) { int f; char *addr; #ifdef MAP_ANONYMOUS /* HP/UX */ f = -1; addr = mmap(0, mmap_sizeparm(size), PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, f, 0); #else if ((f = open("/dev/zero", O_RDWR)) < 0) comerr("Cannot open '/dev/zero'.\n"); addr = mmap(0, mmap_sizeparm(size), PROT_READ|PROT_WRITE, MAP_SHARED, f, 0); #endif if (addr == (char *)-1) { #if defined HAVE_SHMAT && (HAVE_SHMAT == 1) unsigned char *address; /* fallback to alternate method */ if (0 != shm_request_nommap(size, &address) || (addr = (char *)address) == NULL) #endif comerr("Cannot get mmap for %d Bytes on /dev/zero.\n", size); } close(f); if (memptr != NULL) *memptr = (unsigned char *)addr; return 0; } #endif /* HAVE_SMMAP */ #endif /* USE_MMAP */ #ifdef USE_OS2SHM /* request a shared memory block */ static int shm_request(int size, unsigned char **memptr) { char *addr; /* * The OS/2 implementation of shm (using shm.dll) limits the size of one * memory segment to 0x3fa000 (aprox. 4MBytes). Using OS/2 native API we * no such restriction so I decided to use it allowing fifos of arbitrary size */ if(DosAllocSharedMem(&addr,NULL,size,0X100L | 0x1L | 0x2L | 0x10L)) comerr("DosAllocSharedMem() failed\n"); if (memptr != NULL) *memptr = (unsigned char *)addr; return 0; } #endif #ifdef USE_BEOS_AREAS /* request a shared memory block */ static int shm_request(int size, unsigned char **memptr) { char *addr; area_id aid; /* positive id of the mapping */ /* round up to a multiple of pagesize. */ size = ((size - 1) | (B_PAGE_SIZE - 1)) + 1; /* * request a shared memory area in user space. */ aid = create_area(AREA_NAME, /* name of the mapping */ (void *)&addr, /* address of shared memory */ B_ANY_ADDRESS, /* type of address constraint */ size, /* size in bytes (multiple of pagesize) */ B_NO_LOCK, /* B_FULL_LOCK, */ /* memory locking */ B_READ_AREA | B_WRITE_AREA); /* read and write permissions */ if (aid < B_OK) comerrno(aid, "create_area() failed\n"); if (memptr != NULL) *memptr = (unsigned char *)addr; return 0; } #endif void *request_shm_sem(unsigned amount_of_sh_mem, unsigned char **pointer) { #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) /* install semaphores for double buffer usage */ sem_id = seminstall(IPC_PRIVATE,2); if ( sem_id == -1 ) { perror("seminstall"); exit(SEMAPHORE_ERROR); } #endif #if defined(FIFO) if (-1 == shm_request(amount_of_sh_mem, pointer)) { perror("shm_request"); exit(SHMMEM_ERROR); } return *pointer; #else return NULL; #endif } cdrkit-1.1.11/librols/0000755000372500001440000000000011456674327013611 5ustar steveuserscdrkit-1.1.11/librols/comerr.c0000644000372500001440000001263010531706104015224 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)comerr.c 1.29 03/06/15 Copyright 1985-1989, 1995-2003 J. Schilling */ /* * Routines for printing command errors * * Copyright (c) 1985-1989, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include /* include try to get size_t */ #include /* Try again for size_t */ #include /* Try again for size_t */ #include #include #include #include #include #ifndef HAVE_STRERROR extern char *sys_errlist[]; extern int sys_nerr; #endif EXPORT int on_comerr __PR((void (*fun)(int, void *), void *arg)); EXPORT void comerr __PR((const char *, ...)); EXPORT void comerrno __PR((int, const char *, ...)); EXPORT int errmsg __PR((const char *, ...)); EXPORT int errmsgno __PR((int, const char *, ...)); LOCAL int _comerr __PR((int, int, const char *, va_list)); EXPORT void comexit __PR((int)); EXPORT char *errmsgstr __PR((int)); typedef struct ex { struct ex *next; void (*func) __PR((int, void *)); void *arg; } ex_t; LOCAL ex_t *exfuncs; EXPORT int on_comerr(func, arg) void (*func) __PR((int, void *)); void *arg; { ex_t *fp; fp = malloc(sizeof (*fp)); if (fp == NULL) return (-1); fp->func = func; fp->arg = arg; fp->next = exfuncs; exfuncs = fp; return (0); } /* VARARGS1 */ #ifdef PROTOTYPES EXPORT void comerr(const char *msg, ...) #else EXPORT void comerr(msg, va_alist) char *msg; va_dcl #endif { va_list args; #ifdef PROTOTYPES va_start(args, msg); #else va_start(args); #endif (void) _comerr(TRUE, geterrno(), msg, args); /* NOTREACHED */ va_end(args); } /* VARARGS2 */ #ifdef PROTOTYPES EXPORT void comerrno(int err, const char *msg, ...) #else EXPORT void comerrno(err, msg, va_alist) int err; char *msg; va_dcl #endif { va_list args; #ifdef PROTOTYPES va_start(args, msg); #else va_start(args); #endif (void) _comerr(TRUE, err, msg, args); /* NOTREACHED */ va_end(args); } /* VARARGS1 */ #ifdef PROTOTYPES EXPORT int errmsg(const char *msg, ...) #else EXPORT int errmsg(msg, va_alist) char *msg; va_dcl #endif { va_list args; int ret; #ifdef PROTOTYPES va_start(args, msg); #else va_start(args); #endif ret = _comerr(FALSE, geterrno(), msg, args); va_end(args); return (ret); } /* VARARGS2 */ #ifdef PROTOTYPES EXPORT int errmsgno(int err, const char *msg, ...) #else EXPORT int errmsgno(err, msg, va_alist) int err; char *msg; va_dcl #endif { va_list args; int ret; #ifdef PROTOTYPES va_start(args, msg); #else va_start(args); #endif ret = _comerr(FALSE, err, msg, args); va_end(args); return (ret); } #ifdef __BEOS__ /* * On BeOS errno is a big negative number (0x80000000 + small number). * We assume that small negative numbers are safe to be used as special * values that prevent printing the errno text. * * We tried to use #if EIO < 0 but this does not work because EIO is * defined to a enum. ENODEV may work as ENODEV is defined to a number * directly. */ #define silent_schily_error(e) ((e) < 0 && (e) >= -1024) #else /* * On UNIX errno is a small non-negative number, so we assume that * negative values cannot be a valid errno and don't print the error * string in this case. However the value may still be used as exit() * code if 'exflg' is set. */ #define silent_schily_error(e) ((e) < 0) #endif LOCAL int _comerr(exflg, err, msg, args) int exflg; int err; const char *msg; va_list args; { char errbuf[20]; char *errnam; char *prognam = get_progname(); if (silent_schily_error(err)) { fprintf(stderr, "%s: ", prognam); vfprintf(stderr, msg, args); } else { errnam = errmsgstr(err); if (errnam == NULL) { (void) snprintf(errbuf, sizeof (errbuf), "Error %d", err); errnam = errbuf; } fprintf(stderr, "%s: %s. ", prognam, errnam); vfprintf(stderr, msg, args); } if (exflg) { comexit(err); /* NOTREACHED */ } return (err); } EXPORT void comexit(err) int err; { while (exfuncs) { (*exfuncs->func)(err, exfuncs->arg); exfuncs = exfuncs->next; } exit(err); /* NOTREACHED */ } EXPORT char * errmsgstr(err) int err; { #ifdef HAVE_STRERROR /* * POSIX compliance may look strange... */ int errsav = geterrno(); char *ret; seterrno(0); ret = strerror(err); err = geterrno(); seterrno(errsav); if (ret == NULL || err) return (NULL); return (ret); #else if (err < 0 || err >= sys_nerr) { return (NULL); } else { return (sys_errlist[err]); } #endif } cdrkit-1.1.11/librols/findbytes.c0000644000372500001440000001147510477233650015744 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)findbytes.c 1.2 03/06/15 Copyright 2000-2003 J. Schilling */ /* * Find a byte with specific value in memory. * * Copyright (c) 2000-2003 J. Schilling * * Based on a strlen() idea from Torbjorn Granlund (tege@sics.se) and * Dan Sahlin (dan@sics.se) and the memchr() suggestion * from Dick Karpinski (dick@cca.ucsf.edu). */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #ifdef PROTOTYPES EXPORT char * findbytes(const void *vp, int cnt, char val) #else EXPORT char * findbytes(vp, cnt, val) const void *vp; register int cnt; char val; #endif { register Uchar uval = (Uchar)val; register const Uchar *cp = (Uchar *)vp; register const Ulong *lp; register Ulong lval; register Ulong lmask; register Ulong magic_mask; /* * Test byte-wise until cp is properly aligned for a long pointer. */ while (--cnt >= 0 && !laligned(cp)) { if (*cp++ == uval) return ((char *)--cp); } cnt++; /* * The magic mask is a long word where all carry bits a clear. * This are bits 8, 16, 24 ... * In addition, the top bit is not set (e.g bit 31 or 63). The magic * mask will look this way: * * bits: 01111110 11111110 ... 11111110 11111111 * bytes: AAAAAAAA BBBBBBBB ... CCCCCCCC DDDDDDDD * * If we add anything to this magic number, no carry bit will change if * it is the first carry bit left to a 0 byte. Adding anything != 0 * to the magic number will just turn the carry bit left to the byte * but does not propagate any further. */ #if SIZE_LONG == 4 magic_mask = 0x7EFEFEFFL; #else #if SIZE_LONG == 8 magic_mask = 0x7EFEFEFEFEFEFEFFL; #else /* * #error will not work for all compilers (e.g. sunos4) * The following line will abort compilation on all compilers * if none of the above is defines. And that's what we want. */ error SIZE_LONG has unknown value #endif #endif lmask = val & 0xFF; lmask |= lmask << 8; lmask |= lmask << 16; #if SIZE_LONG > 4 lmask |= lmask << 32; #endif #if SIZE_LONG > 8 error SIZE_LONG has unknown value #endif for (lp = (const Ulong *)cp; cnt >= sizeof (long); cnt -= sizeof (long)) { /* * We are not looking for 0 bytes so we need to xor with the * long mask of repeated bytes. If any of the bytes matches our * wanted char, we will create a 0 byte in the current long. * But how will we find if at least one byte in a long is zero? * * If we add 'magic_mask' and any of the holes in the magic * mask do not change, we most likely found a 0 byte in the * long word. It is only a most likely match because if bits * 24..30 (ot bits 56..62) are 0 but bit 31 (or bit 63) is set * we will believe that we found a match but there is none. * This will happen if there is 0x80nnnnnn / 0x80nnnnnnnnnnnnnn */ lval = (*lp++ ^ lmask); /* create 0 byte on match */ lval = (lval + magic_mask) ^ ~lval; /* set bits unchanged by +*/ if ((lval & ~magic_mask) != 0) { /* a magic hole was set */ /* * If any of the hole bits did not change by addition, * we most likely had a match. * If this was a correct match, find the matching byte. */ cp = (const Uchar *)(lp - 1); if (cp[0] == uval) return ((char *)cp); if (cp[1] == uval) return ((char *)&cp[1]); if (cp[2] == uval) return ((char *)&cp[2]); if (cp[3] == uval) return ((char *)&cp[3]); #if SIZE_LONG > 4 if (cp[4] == uval) return ((char *)&cp[4]); if (cp[5] == uval) return ((char *)&cp[5]); if (cp[6] == uval) return ((char *)&cp[6]); if (cp[7] == uval) return ((char *)&cp[7]); #endif #if SIZE_LONG > 8 error SIZE_LONG has unknown value #endif } } for (cp = (const Uchar *)lp; --cnt >= 0; ) { if (*cp++ == uval) return ((char *)--cp); } return ((char *)NULL); } cdrkit-1.1.11/librols/seterrno.c0000644000372500001440000000266610477233650015620 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)seterrno.c 1.8 03/06/15 Copyright 1985, 1995-2003 J. Schilling */ /* * Set error number * * Copyright (c) 1985, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #ifndef HAVE_ERRNO_DEF extern int errno; #endif #ifdef seterrno #undef seterrno #endif EXPORT int seterrno(err) int err; { int old = errno; errno = err; return (old); } cdrkit-1.1.11/librols/breakline.c0000644000372500001440000000407710477233650015711 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)breakline.c 1.10 04/09/25 Copyright 1985, 1995-2003 J. Schilling */ /* * break a line pointed to by *buf into fields * returns the number of tokens, the line was broken into (>= 1) * * delim is the delimiter to break at * array[0 .. found-1] point to strings from broken line * array[found ... len] point to '\0' * len is the size of the array * * Copyright (c) 1985, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #ifdef PROTOTYPES EXPORT int breakline(char *buf, register char delim, register char *array[], register int len) #else EXPORT int breakline(buf, delim, array, len) char *buf; register char delim; register char *array[]; register int len; #endif { register char *bp = buf; register char *dp; register int i; register int found; for (i = 0, found = 1; i < len; i++) { for (dp = bp; *dp != '\0' && *dp != delim; dp++) /* LINTED */ ; array[i] = bp; if (*dp == delim) { *dp++ = '\0'; found++; } bp = dp; } return (found); } cdrkit-1.1.11/librols/gethostid.c0000644000372500001440000000337010536265343015742 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)gethostid.c 1.15 03/06/15 Copyright 1995-2003 J. Schilling */ /* * Copyright (c) 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #ifdef HAVE_SYS_SYSTEMINFO_H #include #endif #include #ifndef HAVE_GETHOSTID EXPORT long gethostid __PR((void)); #endif #if !defined(HAVE_GETHOSTID) #if defined(SI_HW_SERIAL) EXPORT long gethostid() { long id; char hbuf[257]; sysinfo(SI_HW_SERIAL, hbuf, sizeof (hbuf)); id = atoi(hbuf); return (id); } #else #include EXPORT long gethostid() { long id = -1L; #ifdef ENOSYS seterrno(ENOSYS); #else seterrno(EINVAL); #endif return (id); } #endif #endif cdrkit-1.1.11/librols/streql.c0000644000372500001440000000277210477233650015267 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)streql.c 1.7 03/06/15 Copyright 1985, 1995-2003 J. Schilling */ /* * Check if two strings are equal * * Copyright (c) 1985, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include EXPORT int streql(a, b) const char *a; const char *b; { register const char *s1 = a; register const char *s2 = b; if (s1 == NULL || s2 == NULL) return (FALSE); while (*s1 == *s2++) if (*s1++ == '\0') return (TRUE); return (FALSE); } cdrkit-1.1.11/librols/stdio/0000755000372500001440000000000011456674327014733 5ustar steveuserscdrkit-1.1.11/librols/stdio/fdown.c0000644000372500001440000000242010477233650016202 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fdown.c 1.10 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" EXPORT int fdown(f) register FILE *f; { down(f); return (fileno(f)); } cdrkit-1.1.11/librols/stdio/ffileread.c0000644000372500001440000000274010477233650017013 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)ffileread.c 1.10 04/09/25 Copyright 1986, 1996-2003 J. Schilling */ /* * Copyright (c) 1986, 1996-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" #include EXPORT int ffileread(f, buf, len) register FILE *f; void *buf; int len; { register int fd; register int ret; down2(f, _IOREAD, _IORW); fd = fileno(f); while ((ret = read(fd, buf, len)) < 0 && geterrno() == EINTR) /* LINTED */ ; return (ret); } cdrkit-1.1.11/librols/stdio/fpipe.c0000644000372500001440000000304410477233650016173 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fpipe.c 1.12 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" EXPORT int fpipe(pipef) FILE *pipef[]; { int filedes[2]; if (pipe(filedes) < 0) return (0); if ((pipef[0] = _fcons((FILE *)0, filedes[0], FI_READ|FI_CLOSE)) != (FILE *)0) { if ((pipef[1] = _fcons((FILE *)0, filedes[1], FI_WRITE|FI_CLOSE)) != (FILE *)0) { return (1); } fclose(pipef[0]); } close(filedes[1]); return (0); } cdrkit-1.1.11/librols/stdio/fdup.c0000644000372500001440000000306710477233650016033 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fdup.c 1.14 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" /* * Note that because of a definition in schilyio.h we are using fseeko()/ftello() * instead of fseek()/ftell() if available. */ EXPORT FILE * fdup(f) register FILE *f; { int newfd; down(f); if ((newfd = dup(fileno(f))) < 0) return ((FILE *) NULL); lseek(newfd, ftell(f), SEEK_SET); return (_fcons((FILE *)0, newfd, (FI_READ | FI_WRITE | FI_CLOSE))); } cdrkit-1.1.11/librols/stdio/cvmod.c0000644000372500001440000000424410477233650016203 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)cvmod.c 2.9 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" #ifndef O_BINARY #define O_BINARY 0 #endif #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif EXPORT int _cvmod(mode, omode, flag) const char *mode; int *omode; int *flag; { while (*mode) { switch (*mode) { case 'r': *omode |= O_RDONLY; *flag |= FI_READ; break; case 'w': *omode |= O_WRONLY; *flag |= FI_WRITE; break; case 'e': *omode |= O_EXCL; break; case 'c': *omode |= O_CREAT; *flag |= FI_CREATE; break; case 't': *omode |= O_TRUNC; *flag |= FI_TRUNC; break; case 'a': *omode |= O_APPEND; *flag |= FI_APPEND; break; case 'u': *flag |= FI_UNBUF; break; /* dummy on UNIX */ case 'b': *omode |= O_BINARY; *flag |= FI_BINARY; break; /* * XXX do we need this ? * XXX May this be a problem? */ case 'l': *omode |= O_LARGEFILE; break; default: raisecond(_badmode, 0L); return (0); } mode++; } if (*flag & FI_READ && *flag & FI_WRITE) { *omode &= ~(O_RDONLY|O_WRONLY); *omode |= O_RDWR; } return (1); } cdrkit-1.1.11/librols/stdio/nixread.c0000644000372500001440000000353210477233650016524 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nixread.c 1.12 04/08/08 Copyright 1986, 1996-2003 J. Schilling */ /* * Non interruptable extended read * * Copyright (c) 1986, 1996-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" #include EXPORT int _nixread(f, buf, count) int f; void *buf; int count; { register char *p = (char *)buf; register int ret; register int total = 0; int oerrno = geterrno(); while (count > 0) { while ((ret = read(f, p, count)) < 0) { if (geterrno() == EINTR) { /* * Set back old 'errno' so we don't change the * errno visible to the outside if we did * not fail. */ seterrno(oerrno); continue; } return (ret); /* Any other error */ } if (ret == 0) /* Something went wrong */ break; total += ret; count -= ret; p += ret; } return (total); } cdrkit-1.1.11/librols/stdio/nixwrite.c0000644000372500001440000000351410477233650016743 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)nixwrite.c 1.5 04/08/08 Copyright 1986, 2001-2003 J. Schilling */ /* * Non interruptable extended write * * Copyright (c) 1986, 2001-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" #include EXPORT int _nixwrite(f, buf, count) int f; void *buf; int count; { register char *p = (char *)buf; register int ret; register int total = 0; int oerrno = geterrno(); while (count > 0) { while ((ret = write(f, p, count)) < 0) { if (geterrno() == EINTR) { /* * Set back old 'errno' so we don't change the * errno visible to the outside if we did * not fail. */ seterrno(oerrno); continue; } return (ret); /* Any other error */ } if (ret == 0) /* EOF */ break; total += ret; count -= ret; p += ret; } return (total); } cdrkit-1.1.11/librols/stdio/filesize.c0000644000372500001440000000262510477233650016706 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)filesize.c 1.13 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" #include EXPORT off_t filesize(f) register FILE *f; { struct stat buf; down(f); if (fstat(fileno(f), &buf) < 0) { raisecond("filesize", 0L); return (-1); } return (buf.st_size); } cdrkit-1.1.11/librols/stdio/flush.c0000644000372500001440000000234010477233650016207 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)flush.c 1.7 04/08/08 Copyright 1986 J. Schilling */ /* * Copyright (c) 1986 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" EXPORT int flush() { return (fflush(stdout)); } cdrkit-1.1.11/librols/stdio/openfd.c0000644000372500001440000000255410477233650016350 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)openfd.c 1.9 04/08/08 Copyright 1986, 1995 J. Schilling */ /* * Copyright (c) 1986, 1995 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" #if defined(_openfd) && !defined(USE_LARGEFILES) # undef _openfd #endif EXPORT int _openfd(name, omode) const char *name; int omode; { return (open(name, omode, 0666)); } cdrkit-1.1.11/librols/stdio/flag.c0000644000372500001440000000617510477233650016011 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)flag.c 2.10 05/06/12 Copyright 1986-2003 J. Schilling */ /* * Copyright (c) 1986-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" #include #ifdef DO_MYFLAG #define FL_INIT 10 EXPORT int _io_glflag; /* global default flag */ LOCAL int _fl_inc = 10; /* increment for expanding flag struct */ EXPORT int _fl_max = FL_INIT; /* max fd currently in _io_myfl */ LOCAL _io_fl _io_smyfl[FL_INIT]; /* initial static space */ EXPORT _io_fl *_io_myfl = _io_smyfl; /* init to static space */ LOCAL int _more_flags __PR((FILE *)); LOCAL int _more_flags(fp) FILE *fp; { register int f = fileno(fp); register int n = _fl_max; register _io_fl *np; while (n <= f) n += _fl_inc; if (_io_myfl == _io_smyfl) { np = (_io_fl *) malloc(n * sizeof (*np)); fillbytes(np, n * sizeof (*np), '\0'); movebytes(_io_smyfl, np, sizeof (_io_smyfl)/sizeof (*np)); } else { np = (_io_fl *) realloc(_io_myfl, n * sizeof (*np)); if (np) fillbytes(&np[_fl_max], (n-_fl_max)*sizeof (*np), '\0'); } if (np) { _io_myfl = np; _fl_max = n; return (_io_get_my_flag(fp)); } else { return (_IONORAISE); } } EXPORT int _io_get_my_flag(fp) register FILE *fp; { register int f = fileno(fp); register _io_fl *fl; if (f >= _fl_max) return (_more_flags(fp)); fl = &_io_myfl[f]; if (fl->fl_io == 0 || fl->fl_io == fp) return (fl->fl_flags); while (fl && fl->fl_io != fp) fl = fl->fl_next; if (fl == 0) return (0); return (fl->fl_flags); } EXPORT void _io_set_my_flag(fp, flag) FILE *fp; int flag; { register int f = fileno(fp); register _io_fl *fl; register _io_fl *fl2; if (f >= _fl_max) (void) _more_flags(fp); fl = &_io_myfl[f]; if (fl->fl_io != (FILE *)0) { fl2 = fl; while (fl && fl->fl_io != fp) fl = fl->fl_next; if (fl == 0) { if ((fl = (_io_fl *) malloc(sizeof (*fl))) == 0) return; fl->fl_next = fl2->fl_next; fl2->fl_next = fl; } } fl->fl_io = fp; fl->fl_flags = flag; } EXPORT void _io_add_my_flag(fp, flag) FILE *fp; int flag; { int oflag = _io_get_my_flag(fp); oflag |= flag; _io_set_my_flag(fp, oflag); } #endif /* DO_MYFLAG */ cdrkit-1.1.11/librols/stdio/filewrite.c0000644000372500001440000000463310477233650017067 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)filewrite.c 1.14 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" static char _writeerr[] = "file_write_err"; #ifdef HAVE_USG_STDIO EXPORT int filewrite(f, vbuf, len) register FILE *f; void *vbuf; int len; { register int n; int cnt; char *buf = vbuf; down2(f, _IOWRT, _IORW); if (f->_flag & _IONBF) { cnt = write(fileno(f), buf, len); if (cnt < 0) { f->_flag |= _IOERR; if (!(my_flag(f) & _IONORAISE)) raisecond(_writeerr, 0L); } return (cnt); } cnt = 0; while (len > 0) { if (f->_cnt <= 0) { if (usg_flsbuf((unsigned char) *buf++, f) == EOF) break; cnt++; if (--len == 0) break; } if ((n = f->_cnt >= len ? len : f->_cnt) > 0) { f->_ptr = (unsigned char *)movebytes(buf, f->_ptr, n); buf += n; f->_cnt -= n; cnt += n; len -= n; } } if (!ferror(f)) return (cnt); if (!(my_flag(f) & _IONORAISE)) raisecond(_writeerr, 0L); return (-1); } #else EXPORT int filewrite(f, vbuf, len) register FILE *f; void *vbuf; int len; { int cnt; char *buf = vbuf; down2(f, _IOWRT, _IORW); if (my_flag(f) & _IOUNBUF) return (write(fileno(f), buf, len)); cnt = fwrite(buf, 1, len, f); if (!ferror(f)) return (cnt); if (!(my_flag(f) & _IONORAISE)) raisecond(_writeerr, 0L); return (-1); } #endif /* HAVE_USG_STDIO */ cdrkit-1.1.11/librols/stdio/niwrite.c0000644000372500001440000000307710477233650016557 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)niwrite.c 1.5 04/08/08 Copyright 1986, 2001-2003 J. Schilling */ /* * Non interruptable write * * Copyright (c) 1986, 2001-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" #include EXPORT int _niwrite(f, buf, count) int f; void *buf; int count; { int ret; int oerrno = geterrno(); while ((ret = write(f, buf, count)) < 0 && geterrno() == EINTR) { /* * Set back old 'errno' so we don't change the errno visible * to the outside if we did not fail. */ seterrno(oerrno); } return (ret); } cdrkit-1.1.11/librols/stdio/ffilewrite.c0000644000372500001440000000251510477233650017232 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)ffilewrite.c 1.6 04/08/08 Copyright 1986 J. Schilling */ /* * Copyright (c) 1986 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" EXPORT int ffilewrite(f, buf, len) register FILE *f; void *buf; int len; { down2(f, _IORWT, _IORW); return (write(fileno(f), (char *)buf, len)); } cdrkit-1.1.11/librols/stdio/fileluopen.c0000644000372500001440000000407310477233650017235 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fileluopen.c 1.17 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" /* * Note that because of a definition in schilyio.h we are using fseeko()/ftello() * instead of fseek()/ftell() if available. */ #ifndef O_NDELAY /* This is undefined on BeOS :-( */ #define O_NDELAY 0 #endif #ifndef O_CREAT #define O_CREAT 0 #endif #ifndef O_TRUNC #define O_TRUNC 0 #endif #ifndef O_EXCL #define O_EXCL 0 #endif /* * fileluopen - open a stream for lun */ EXPORT FILE * fileluopen(f, mode) int f; const char *mode; { int omode = 0; int flag = 0; if (!_cvmod(mode, &omode, &flag)) return ((FILE *) NULL); if (omode & (O_NDELAY|O_CREAT|O_TRUNC|O_EXCL)) { raisecond(_badmode, 0L); return ((FILE *) NULL); } #ifdef F_GETFD if (fcntl(f, F_GETFD, 0) < 0) { raisecond(_badfile, 0L); return ((FILE *) NULL); } #endif #ifdef O_APPEND if (omode & O_APPEND) lseek(f, (off_t)0, SEEK_END); #endif return (_fcons((FILE *)0, f, flag)); } cdrkit-1.1.11/librols/stdio/fcons.c0000644000372500001440000000520010477233650016174 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fcons.c 2.17 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" /* * Note that because of a definition in schilyio.h we are using fseeko()/ftello() * instead of fseek()/ftell() if available. */ LOCAL char *fmtab[] = { "", /* 0 FI_NONE */ "r", /* 1 FI_READ */ "w", /* 2 FI_WRITE **1) */ "r+", /* 3 FI_READ | FI_WRITE */ "b", /* 4 FI_NONE | FI_BINARY */ "rb", /* 5 FI_READ | FI_BINARY */ "wb", /* 6 FI_WRITE | FI_BINARY **1) */ "r+b", /* 7 FI_READ | FI_WRITE | FI_BINARY */ /* + FI_APPEND */ "", /* 0 FI_NONE */ /* ... */ "r", /* 1 FI_READ */ "a", /* 2 FI_WRITE **1) */ "a+", /* 3 FI_READ | FI_WRITE */ "b", /* 4 FI_NONE | FI_BINARY */ "rb", /* 5 FI_READ | FI_BINARY */ "ab", /* 6 FI_WRITE | FI_BINARY **1) */ "a+b", /* 7 FI_READ | FI_WRITE | FI_BINARY */ }; /* * NOTES: * 1) fdopen() guarantees not to create/trunc files in this case * * "w" will create/trunc files with fopen() * "a" will create files with fopen() */ EXPORT FILE * _fcons(fd, f, flag) register FILE *fd; int f; int flag; { int my_gflag = _io_glflag; if (fd == (FILE *)NULL) fd = fdopen(f, fmtab[flag&(FI_READ|FI_WRITE|FI_BINARY | FI_APPEND)]); if (fd != (FILE *)NULL) { if (flag & FI_APPEND) { (void) fseek(fd, (off_t)0, SEEK_END); } if (flag & FI_UNBUF) { setbuf(fd, NULL); my_gflag |= _IOUNBUF; } set_my_flag(fd, my_gflag); /* must clear it if fd is reused */ return (fd); } if (flag & FI_CLOSE) close(f); return ((FILE *) NULL); } cdrkit-1.1.11/librols/stdio/filemopen.c0000644000372500001440000000315210477233650017046 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)filemopen.c 1.4 05/08/18 Copyright 1986, 1995-2005 J. Schilling */ /* * Copyright (c) 1986, 1995-2005 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" EXPORT FILE * #ifdef PROTOTYPES filemopen(const char *name, const char *mode, mode_t cmode) #else filemopen(name, mode, cmode) const char *name; const char *mode; mode_t cmode; #endif { int ret; int omode = 0; int flag = 0; if (!_cvmod(mode, &omode, &flag)) return ((FILE *) NULL); if ((ret = open(name, omode, cmode)) < 0) return ((FILE *) NULL); return (_fcons((FILE *)0, ret, flag | FI_CLOSE)); } cdrkit-1.1.11/librols/stdio/schilyio.h0000644000372500001440000001473610477233650016732 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)schilyio.h 2.22 04/09/04 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _STDIO_SCHILYIO_H #define _STDIO_SCHILYIO_H #include #include #include #include #include #include #ifdef NO_USG_STDIO # ifdef HAVE_USG_STDIO # undef HAVE_USG_STDIO # endif #endif /*#if _LFS_LARGEFILE*/ #ifdef HAVE_LARGEFILES /* * XXX We may need to put this code to a more global place to allow all * XXX users of fseek()/ftell() to automaticaly use fseeko()/ftello() * XXX if the latter are available. * * If HAVE_LARGEFILES is defined, it is guaranteed that fseeko()/ftello() * both are available. */ # define fseek fseeko # define ftell ftello #else /* !HAVE_LARGEFILES */ /* * If HAVE_LARGEFILES is not defined, we depend on specific tests for * fseeko()/ftello() which must have been done before the tests for * Large File support have been done. * Note that this only works if the tests used below are really done before * the Large File autoconf test is run. This is because autoconf does no * clean testing but instead cumulatively modifes the envivonment used for * testing. */ #ifdef HAVE_FSEEKO # define fseek fseeko #endif #ifdef HAVE_FTELLO # define ftell ftello #endif #endif /* * speed things up... */ #ifndef _OPENFD_SRC #ifdef _openfd #undef _openfd #endif #define _openfd(name, omode) (open(name, omode, 0666)) #endif #define DO_MYFLAG /* use local flags */ /* * Flags used during fileopen(), ... by _fcons()/ _cvmod() */ #define FI_NONE 0x0000 /* no flags defined */ #define FI_READ 0x0001 /* open for reading */ #define FI_WRITE 0x0002 /* open for writing */ #define FI_BINARY 0x0004 /* open in binary mode */ #define FI_APPEND 0x0008 /* append on each write */ #define FI_CREATE 0x0010 /* create if nessecary */ #define FI_TRUNC 0x0020 /* truncate file on open */ #define FI_UNBUF 0x0080 /* dont't buffer io */ #define FI_CLOSE 0x1000 /* close file on error */ /* * local flags */ #define _IONORAISE 01 /* do no raisecond() on errors */ #define _IOUNBUF 02 /* do unbuffered i/o */ #ifdef DO_MYFLAG struct _io_flags { FILE *fl_io; /* file pointer */ struct _io_flags /* pointer to next struct */ *fl_next; /* if more file pointer to same fd */ int fl_flags; /* my flags */ }; typedef struct _io_flags _io_fl; extern int _io_glflag; /* global default flag */ extern _io_fl *_io_myfl; /* array of structs to hold my flags */ extern int _fl_max; /* max fd currently in _io_myfl */ /* * if fileno > max * expand * else if map[fileno].pointer == 0 * return 0 * else if map[fileno].pointer == p * return map[fileno].flags * else * search list */ #define flp(p) (&_io_myfl[fileno(p)]) #ifdef MY_FLAG_IS_MACRO #define my_flag(p) ((int)fileno(p) >= _fl_max ? \ _io_get_my_flag(p) : \ ((flp(p)->fl_io == 0 || flp(p)->fl_io == p) ? \ flp(p)->fl_flags : \ _io_get_my_flag(p))) #else #define my_flag(p) _io_get_my_flag(p) #endif #define set_my_flag(p, v) _io_set_my_flag(p, v) #define add_my_flag(p, v) _io_add_my_flag(p, v) extern int _io_get_my_flag __PR((FILE *)); extern void _io_set_my_flag __PR((FILE *, int)); extern void _io_add_my_flag __PR((FILE *, int)); #else /* DO_MYFLAG */ #define my_flag(p) _IONORAISE /* Always noraise */ #define set_my_flag(p, v) /* Ignore */ #define add_my_flag(p, v) /* Ignore */ #endif /* DO_MYFLAG */ #ifdef HAVE_USG_STDIO /* * Use the right filbuf()/flsbuf() function. */ #ifdef HAVE___FILBUF # define usg_filbuf(fp) __filbuf(fp) # define usg_flsbuf(c, fp) __flsbuf(c, fp) /* * Define prototypes to verify if our interface is right */ extern int __filbuf __PR((FILE *)); /*extern int __flsbuf __PR(());*/ #else # ifdef HAVE__FILBUF # define usg_filbuf(fp) _filbuf(fp) # define usg_flsbuf(c, fp) _flsbuf(c, fp) /* * Define prototypes to verify if our interface is right */ extern int _filbuf __PR((FILE *)); /*extern int _flsbuf __PR(());*/ # else /* * no filbuf() but this will not happen on USG_STDIO systems. */ # endif #endif /* * Do not check this because flsbuf()'s 1st parameter may be * int SunOS * unsigned int Apollo * unsigned char HP-UX-11 * * Note that the interface is now checked by autoconf. */ /*extern int _flsbuf __PR((int, FILE *));*/ #else /* * If we are on a non USG system we cannot down file pointers */ #undef DO_DOWN #endif #ifndef DO_DOWN /* * No stream checking */ #define down(f) #define down1(f, fl1) #define down2(f, fl1, fl2) #else /* * Do stream checking (works only on USG stdio) * * New version of USG stdio. * _iob[] holds only a small amount of pointers. * Aditional space is allocated. * We may check only if the file pointer is != NULL * and if iop->_flag refers to a stream with appropriate modes. * If _iob[] gets expanded by malloc() we cannot check upper bound. */ #define down(f) ((f) == 0 || (f)->_flag == 0 ? \ (raisecond(_badfile, 0L), (FILE *)0) : (f)) #define down1(f, fl1) ((f) == 0 || (f)->_flag == 0 ? \ (raisecond(_badfile, 0L), (FILE *)0) : \ (((f)->_flag & fl1) != fl1 ? \ (raisecond(_badop, 0L), (FILE *)0) : \ (f))) #define down2(f, fl1, fl2) ((f) == 0 || (f)->_flag == 0 ? \ (raisecond(_badfile, 0L), (FILE *)0) : \ (((f)->_flag & fl1) != fl1 && \ ((f)->_flag & fl2) != fl2 ? \ (raisecond(_badop, 0L), (FILE *)0) : \ (f))) #endif /* DO_DOWN */ extern char _badfile[]; extern char _badmode[]; extern char _badop[]; #endif /* _STDIO_SCHILYIO_H */ cdrkit-1.1.11/librols/stdio/filereopen.c0000644000372500001440000000552410477233650017225 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)filereopen.c 1.15 04/08/08 Copyright 1986, 1995 J. Schilling */ /* * open new file on old stream * * Copyright (c) 1986, 1995 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" /* * Note that because of a definition in schilyio.h we are using fseeko()/ftello() * instead of fseek()/ftell() if available. */ LOCAL char *fmtab[] = { "", /* 0 FI_NONE */ "r", /* 1 FI_READ */ "r+", /* 2 FI_WRITE **1) */ "r+", /* 3 FI_READ | FI_WRITE */ "b", /* 4 FI_NONE | FI_BINARY */ "rb", /* 5 FI_READ | FI_BINARY */ "r+b", /* 6 FI_WRITE | FI_BINARY **1) */ "r+b", /* 7 FI_READ | FI_WRITE | FI_BINARY */ /* + FI_APPEND */ "", /* 0 FI_NONE */ /* ... */ "r", /* 1 FI_READ */ "a", /* 2 FI_WRITE **1) */ "a+", /* 3 FI_READ | FI_WRITE */ "b", /* 4 FI_NONE | FI_BINARY */ "rb", /* 5 FI_READ | FI_BINARY */ "ab", /* 6 FI_WRITE | FI_BINARY **1) */ "a+b", /* 7 FI_READ | FI_WRITE | FI_BINARY */ }; /* * NOTES: * 1) there is no fopen() mode that opens for writing * without creating/truncating at the same time. * * "w" will create/trunc files with fopen() * "a" will create files with fopen() */ EXPORT FILE * filereopen(name, mode, fp) const char *name; const char *mode; FILE *fp; { int ret; int omode = 0; int flag = 0; if (!_cvmod(mode, &omode, &flag)) return ((FILE *) NULL); /* * create/truncate file if necessary */ if ((ret = _openfd(name, omode)) < 0) return ((FILE *) NULL); close(ret); fp = freopen(name, fmtab[flag & (FI_READ | FI_WRITE | FI_BINARY | FI_APPEND)], fp); if (fp != (FILE *) NULL) { set_my_flag(fp, 0); /* must clear it if fp is reused */ if (flag & FI_APPEND) { (void) fseek(fp, (off_t)0, SEEK_END); } if (flag & FI_UNBUF) { setbuf(fp, NULL); add_my_flag(fp, _IOUNBUF); } } return (fp); } cdrkit-1.1.11/librols/stdio/fileopen.c0000644000372500001440000000276310477233650016700 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fileopen.c 1.11 05/08/18 Copyright 1986, 1995-2005 J. Schilling */ /* * Copyright (c) 1986, 1995-2005 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" EXPORT FILE * fileopen(name, mode) const char *name; const char *mode; { int ret; int omode = 0; int flag = 0; if (!_cvmod(mode, &omode, &flag)) return ((FILE *) NULL); if ((ret = _openfd(name, omode)) < 0) return ((FILE *) NULL); return (_fcons((FILE *)0, ret, flag | FI_CLOSE)); } cdrkit-1.1.11/librols/stdio/fileseek.c0000644000372500001440000000310410477233650016654 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fileseek.c 1.12 04/08/08 Copyright 1986, 1996-2003 J. Schilling */ /* * Copyright (c) 1986, 1996-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" /* * Note that because of a definition in schilyio.h we are using fseeko()/ftello() * instead of fseek()/ftell() if available. */ static char _seekerr[] = "file_seek_err"; EXPORT int fileseek(f, pos) register FILE *f; off_t pos; { int ret; down(f); ret = fseek(f, pos, SEEK_SET); if (ret < 0 && !(my_flag(f) & _IONORAISE)) raisecond(_seekerr, 0L); return (ret); } cdrkit-1.1.11/librols/stdio/fileread.c0000644000372500001440000000453210477233650016646 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fileread.c 1.14 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" static char _readerr[] = "file_read_err"; #ifdef HAVE_USG_STDIO EXPORT int fileread(f, buf, len) register FILE *f; void *buf; int len; { int cnt; register int n; down2(f, _IOREAD, _IORW); if (f->_flag & _IONBF) { cnt = _niread(fileno(f), buf, len); if (cnt < 0) { f->_flag |= _IOERR; if (!(my_flag(f) & _IONORAISE)) raisecond(_readerr, 0L); } if (cnt == 0 && len) f->_flag |= _IOEOF; return (cnt); } cnt = 0; while (len > 0) { if (f->_cnt <= 0) { if (usg_filbuf(f) == EOF) break; f->_cnt++; f->_ptr--; } n = f->_cnt >= len ? len : f->_cnt; buf = (void *)movebytes(f->_ptr, buf, n); f->_ptr += n; f->_cnt -= n; cnt += n; len -= n; } if (!ferror(f)) return (cnt); if (!(my_flag(f) & _IONORAISE)) raisecond(_readerr, 0L); return (-1); } #else EXPORT int fileread(f, buf, len) register FILE *f; void *buf; int len; { int cnt; down2(f, _IOREAD, _IORW); if (my_flag(f) & _IOUNBUF) return (_niread(fileno(f), buf, len)); cnt = fread(buf, 1, len, f); if (!ferror(f)) return (cnt); if (!(my_flag(f) & _IONORAISE)) raisecond(_readerr, 0L); return (-1); } #endif /* HAVE_USG_STDIO */ cdrkit-1.1.11/librols/stdio/fgetline.c0000644000372500001440000000374711264456302016673 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fgetline.c 1.8 04/09/25 Copyright 1986, 1996-2003 J. Schilling */ /* * Copyright (c) 1986, 1996-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" /* * XXX should we check if HAVE_USG_STDIO is defined and * XXX use something line memccpy to speed things up ??? */ EXPORT int rols_fgetline(f, buf, len) register FILE *f; char *buf; register int len; { register int c = '\0'; register char *bp = buf; register int nl = '\n'; down2(f, _IOREAD, _IORW); for (;;) { if ((c = getc(f)) < 0) break; if (c == nl) break; if (--len > 0) { *bp++ = (char)c; } else { /* * Read up to end of line */ while ((c = getc(f)) >= 0 && c != nl) /* LINTED */ ; break; } } *bp = '\0'; /* * If buffer is empty and we hit EOF, return EOF */ if (c < 0 && bp == buf) return (c); return (bp - buf); } EXPORT int rols_getline(buf, len) char *buf; int len; { return (rols_fgetline(stdin, buf, len)); } cdrkit-1.1.11/librols/stdio/file_raise.c0000644000372500001440000000303310477233650017170 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)file_raise.c 1.8 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ /* * Copyright (c) 1986, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" EXPORT void file_raise(f, flg) register FILE *f; int flg; { int oflag; extern int _io_glflag; if (f == (FILE *)NULL) { if (flg) _io_glflag &= ~_IONORAISE; else _io_glflag |= _IONORAISE; return; } down(f); oflag = my_flag(f); if (flg) oflag &= ~_IONORAISE; else oflag |= _IONORAISE; set_my_flag(f, oflag); } cdrkit-1.1.11/librols/stdio/dat.c0000644000372500001440000000241410477233650015640 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)dat.c 1.3 03/06/15 Copyright 1986, 1996-2003 J. Schilling */ /* * Copyright (c) 1986, 1996-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ char _badfile[] = "bad_file"; char _badmode[] = "bad_file_mode"; char _badop[] = "bad_file_op"; cdrkit-1.1.11/librols/stdio/niread.c0000644000372500001440000000307410477233650016335 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)niread.c 1.12 04/08/08 Copyright 1986, 1996-2003 J. Schilling */ /* * Non interruptable read * * Copyright (c) 1986, 1996-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" #include EXPORT int _niread(f, buf, count) int f; void *buf; int count; { int ret; int oerrno = geterrno(); while ((ret = read(f, buf, count)) < 0 && geterrno() == EINTR) { /* * Set back old 'errno' so we don't change the errno visible * to the outside if we did not fail. */ seterrno(oerrno); } return (ret); } cdrkit-1.1.11/librols/stdio/filepos.c0000644000372500001440000000263310477233650016534 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)filepos.c 1.10 04/08/08 Copyright 1986, 1996-2003 J. Schilling */ /* * Copyright (c) 1986, 1996-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" /* * Note that because of a definition in schilyio.h we are using fseeko()/ftello() * instead of fseek()/ftell() if available. */ EXPORT off_t filepos(f) register FILE *f; { down(f); return (ftell(f)); } cdrkit-1.1.11/librols/stdio/fileclose.c0000644000372500001440000000237010477233650017036 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fileclose.c 1.7 04/08/08 Copyright 1986 J. Schilling */ /* * Copyright (c) 1988 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" EXPORT int fileclose(f) FILE *f; { down(f); return (fclose(f)); } cdrkit-1.1.11/librols/stdio/peekc.c0000644000372500001440000000254410477233650016163 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)peekc.c 1.7 04/08/08 Copyright 1986, 1996-2003 J. Schilling */ /* * Copyright (c) 1986, 1996-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" EXPORT int peekc(f) FILE *f; { int c; down2(f, _IOREAD, _IORW); if (ferror(f)) return (EOF); if ((c = getc(f)) != EOF) ungetc(c, f); return (c); } cdrkit-1.1.11/librols/stdio/filestat.c0000644000372500001440000000246710477233650016713 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)filestat.c 1.9 04/08/08 Copyright 1985 J. Schilling */ /* * Copyright (c) 1985 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "schilyio.h" #include EXPORT int filestat(f, stbuf) FILE *f; struct stat *stbuf; { down(f); return (fstat(fileno(f), stbuf)); } cdrkit-1.1.11/librols/movebytes.c0000644000372500001440000000612210477233650015763 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)movebytes.c 1.13 03/06/15 Copyright 1985, 1989, 1995-2003 J. Schilling */ /* * move data * * Copyright (c) 1985, 1989, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #define DO8(a) a; a; a; a; a; a; a; a; EXPORT char * movebytes(fromv, tov, cnt) const void *fromv; void *tov; int cnt; { register const char *from = fromv; register char *to = tov; register int n; /* * If we change cnt to be unsigned, check for == instead of <= */ if ((n = cnt) <= 0) return (to); if (from >= to) { /* * source is on higher adresses than destination: * move bytes forwards */ if (n >= (int)(8 * sizeof (long))) { if (l2aligned(from, to)) { register const long *froml = (const long *)from; register long *tol = (long *)to; register int rem = n % (8 * sizeof (long)); n /= (8 * sizeof (long)); do { DO8 (*tol++ = *froml++); } while (--n > 0); from = (const char *)froml; to = (char *)tol; n = rem; } if (n >= 8) { n -= 8; do { DO8 (*to++ = *from++); } while ((n -= 8) >= 0); n += 8; } if (n > 0) do { *to++ = *from++; } while (--n > 0); return (to); } if (n > 0) do { *to++ = *from++; } while (--n > 0); return (to); } else { char *ep; /* * source is on lower adresses than destination: * move bytes backwards */ to += n; from += n; ep = to; if (n >= (int)(8 * sizeof (long))) { if (l2aligned(from, to)) { register const long *froml = (const long *)from; register long *tol = (long *)to; register int rem = n % (8 * sizeof (long)); n /= (8 * sizeof (long)); do { DO8 (*--tol = *--froml); } while (--n > 0); from = (const char *)froml; to = (char *)tol; n = rem; } if (n >= 8) { n -= 8; do { DO8 (*--to = *--from); } while ((n -= 8) >= 0); n += 8; } if (n > 0) do { *--to = *--from; } while (--n > 0); return (ep); } if (n > 0) do { *--to = *--from; } while (--n > 0); return (ep); } } cdrkit-1.1.11/librols/getav0.c0000644000372500001440000000635510536265343015144 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)getav0.c 1.16 04/05/09 Copyright 1985, 1995-2004 J. Schilling */ /* * Get arg vector by scanning the stack * * Copyright (c) 1985, 1995-2004 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #if !defined(AV_OFFSET) || !defined(FP_INDIR) # ifdef HAVE_SCANSTACK # undef HAVE_SCANSTACK # endif #endif #ifdef HAVE_SCANSTACK #include #define is_even(p) ((((long)(p)) & 1) == 0) #define even(p) (((long)(p)) & ~1L) #ifdef __future__ #define even(p) (((long)(p)) - 1) /* will this work with 64 bit ?? */ #endif EXPORT char **getmainfp __PR((void)); EXPORT char **getavp __PR((void)); EXPORT char *getav0 __PR((void)); EXPORT char ** getmainfp() { register struct frame *fp; char **av; #if FP_INDIR > 0 register int i = 0; #endif /* * As the SCO OpenServer C-Compiler has a bug that may cause * the first function call to getfp() been done before the * new stack frame is created, we call getfp() twice. */ (void) getfp(); fp = (struct frame *)getfp(); if (fp == NULL) return (NULL); while (fp->fr_savfp) { if (fp->fr_savpc == NULL) break; if (!is_even(fp->fr_savfp)) { fp = (struct frame *)even(fp->fr_savfp); if (fp == NULL) break; fp = (struct frame *)((SIGBLK *)fp)->sb_savfp; continue; } fp = (struct frame *)fp->fr_savfp; #if FP_INDIR > 0 i++; #endif } #if FP_INDIR > 0 i -= FP_INDIR; fp = (struct frame *)getfp(); if (fp == NULL) return (NULL); while (fp->fr_savfp) { if (fp->fr_savpc == NULL) break; if (!is_even(fp->fr_savfp)) { fp = (struct frame *)even(fp->fr_savfp); if (fp == NULL) break; fp = (struct frame *)((SIGBLK *)fp)->sb_savfp; continue; } fp = (struct frame *)fp->fr_savfp; if (--i <= 0) break; } #endif av = (char **)fp; return (av); } EXPORT char ** getavp() { register struct frame *fp; char **av; fp = (struct frame *)getmainfp(); if (fp == NULL) return (NULL); av = (char **)(((char *)fp) + AV_OFFSET); /* aus avoffset.h */ /* -> avoffset.c */ return (av); } EXPORT char * getav0() { return (getavp()[0]); } #else EXPORT char * getav0() { return ("???"); } #endif /* HAVE_SCANSTACK */ cdrkit-1.1.11/librols/astoull.c0000644000372500001440000000771310477233650015440 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)astoll.c 1.3 03/06/15 Copyright 1985, 2000-2005 J. Schilling */ /* * astoll() converts a string to long long * * Leading tabs and spaces are ignored. * Both return pointer to the first char that has not been used. * Caller must check if this means a bad conversion. * * leading "+" is ignored * leading "0" makes conversion octal (base 8) * leading "0x" makes conversion hex (base 16) * * Llong is silently reverted to long if the compiler does not * support long long. * * Copyright (c) 1985, 2000-2005 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #ifndef HAVE_ERRNO_DEF extern int errno; #endif #define is_space(c) ((c) == ' ' || (c) == '\t') #define is_digit(c) ((c) >= '0' && (c) <= '9') #define is_hex(c) (\ ((c) >= 'a' && (c) <= 'f') || \ ((c) >= 'A' && (c) <= 'F')) #define is_lower(c) ((c) >= 'a' && (c) <= 'z') #define is_upper(c) ((c) >= 'A' && (c) <= 'Z') #define to_lower(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A'+'a' : (c)) #if ('i' + 1) < 'j' #define BASE_MAX ('i' - 'a' + 10 + 1) /* This is EBCDIC */ #else #define BASE_MAX ('z' - 'a' + 10 + 1) /* This is ASCII */ #endif EXPORT char *astoull __PR((const char *s, Ullong *l)); EXPORT char *astoullb __PR((const char *s, Ullong *l, int base)); EXPORT char * astoull(s, l) register const char *s; Ullong *l; { return (astoullb(s, l, 0)); } EXPORT char * astoullb(s, l, base) register const char *s; Ullong *l; register int base; { #ifdef DO_SIGNED int neg = 0; #endif register Ullong ret = (Ullong)0; Ullong maxmult; register int digit; register char c; if (base > BASE_MAX || base == 1 || base < 0) { errno = EINVAL; return ((char *)s); } while (is_space(*s)) s++; if (*s == '+') { s++; } else if (*s == '-') { #ifndef DO_SIGNED errno = EINVAL; return ((char *)s); #else s++; neg++; #endif } if (base == 0) { if (*s == '0') { base = 8; s++; if (*s == 'x' || *s == 'X') { s++; base = 16; } } else { base = 10; } } maxmult = TYPE_MAXVAL(Ullong) / base; for (; (c = *s) != 0; s++) { if (is_digit(c)) { digit = c - '0'; #ifdef OLD } else if (is_hex(c)) { digit = to_lower(c) - 'a' + 10; #else } else if (is_lower(c)) { digit = c - 'a' + 10; } else if (is_upper(c)) { digit = c - 'A' + 10; #endif } else { break; } if (digit < base) { if (ret > maxmult) goto overflow; ret *= base; if (TYPE_MAXVAL(Ullong) - ret < digit) goto overflow; ret += digit; } else { break; } } #ifdef DO_SIGNED if (neg) ret = -ret; #endif *l = ret; return ((char *)s); overflow: for (; (c = *s) != 0; s++) { if (is_digit(c)) { digit = c - '0'; } else if (is_lower(c)) { digit = c - 'a' + 10; } else if (is_upper(c)) { digit = c - 'A' + 10; } else { break; } if (digit >= base) break; } *l = TYPE_MAXVAL(Ullong); errno = ERANGE; return ((char *)s); } cdrkit-1.1.11/librols/strdup.c0000644000372500001440000000317310536265343015272 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)strdup.c 1.1 03/02/27 Copyright 2003 J. Schilling */ /* * strdup() to be used if missing on libc * * Copyright (c) 2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #ifndef HAVE_STRDUP EXPORT char * strdup(s) const char *s; { unsigned i = strlen(s) + 1; char *res = malloc(i); if (res == NULL) return (NULL); if (i > 16) { movebytes(s, res, (int) i); } else { char *s2 = res; while ((*s2++ = *s++) != '\0') ; } return (res); } #endif /* HAVE_STRDUP */ cdrkit-1.1.11/librols/getargs.c0000644000372500001440000004735310536265343015415 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)getargs.c 2.37 04/09/25 Copyright 1985, 1988, 1994-2003 J. Schilling */ #define NEW /* * Copyright (c) 1985, 1988, 1994-2003 J. Schilling * * 1.3.88 Start implementation of release 2 */ /* * Parse arguments on a command line. * Format string type specifier (appearing directly after flag name): * '' BOOL * '!' BOOL with size modifier +++ NEU +++ (XXX nicht fertig) * '*' string * '?' char * '#' number * '&' call function * '+' inctype +++ NEU +++ * * The '#' and '+' types may have size modifiers added: * 'c'/'C' char * 's'/'S' short * 'i'/'I' int (default) * 'l'/'L' long * 'll'/'LL' long long * * The format string 'f* ' may be used to disallow -ffoo for f* * * XXX This is currently only implemented for the '*' format */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* LINTLIBRARY */ #include #include #include #include #include #include #include #include #define NOARGS 0 /* No more args */ #define NOTAFLAG 1 /* Not a flag type argument */ #define BADFLAG (-1) /* Not a valid flag argument */ #define BADFMT (-2) /* Error in format string */ #define NOTAFILE (-3) /* Seems to be a flag type arg */ int _getargs __PR((int *, char *const **, const char *, BOOL, va_list)); LOCAL int dofile __PR((int *, char *const **, const char **)); LOCAL int doflag __PR((int *, char *const **, const char *, const char *, BOOL, va_list)); LOCAL int dosflags __PR((const char *, const char *, BOOL, va_list)); LOCAL int checkfmt __PR((const char *)); LOCAL int checkeql __PR((const char *)); LOCAL va_list va_dummy; LOCAL char fmtspecs[] = "#?*&+"; /*LOCAL char fmtspecs[] = "#?*&+!";*/ #define isfmtspec(c) (strchr(fmtspecs, c) != NULL) /*--------------------------------------------------------------------------- | | get flags until a non flag type argument is reached | +---------------------------------------------------------------------------*/ /* VARARGS3 */ #ifdef PROTOTYPES EXPORT int getargs(int *pac, char *const **pav, const char *fmt, ...) #else EXPORT int getargs(pac, pav, fmt, va_alist) int *pac; char **pav[]; char *fmt; va_dcl #endif { va_list args; int ret; #ifdef PROTOTYPES va_start(args, fmt); #else va_start(args); #endif ret = _getargs(pac, pav, fmt, TRUE, args); va_end(args); return (ret); } /*--------------------------------------------------------------------------- | | get all flags on the command line, do not stop on files | +---------------------------------------------------------------------------*/ /* VARARGS3 */ #ifdef PROTOTYPES EXPORT int getallargs(int *pac, char *const **pav, const char *fmt, ...) #else EXPORT int getallargs(pac, pav, fmt, va_alist) int *pac; char **pav[]; char *fmt; va_dcl #endif { va_list args; int ret; #ifdef PROTOTYPES va_start(args, fmt); #else va_start(args); #endif for (; ; (*pac)--, (*pav)++) { if ((ret = _getargs(pac, pav, fmt, TRUE, args)) != NOTAFLAG) break; } va_end(args); return (ret); } /*--------------------------------------------------------------------------- | | get next non flag type argument (i.e. a file) | +---------------------------------------------------------------------------*/ EXPORT int getfiles(pac, pav, fmt) int *pac; char *const *pav[]; const char *fmt; { return (_getargs(pac, pav, fmt, FALSE, va_dummy)); } /*--------------------------------------------------------------------------- | | check args until the next non flag type argmument is reached | *pac is decremented, *pav is incremented so that the | non flag type argument is at *pav[0] | | return code: | NOARGS no more args | NOTAFLAG not a flag type argument | BADFLAG a non-matching flag type argument | BADFMT bad syntax in format string | | +---------------------------------------------------------------------------*/ /*LOCAL*/ int _getargs(pac, pav, fmt, setargs, args) register int *pac; register char *const **pav; const char *fmt; BOOL setargs; va_list args; { const char *argp; int ret; for (; *pac > 0; (*pac)--, (*pav)++) { argp = **pav; ret = dofile(pac, pav, &argp); if (ret != NOTAFILE) return (ret); ret = doflag(pac, pav, argp, fmt, setargs, args); if (ret != NOTAFLAG) return (ret); } return (NOARGS); } /*--------------------------------------------------------------------------- | | check if *pargp is a file type argument | +---------------------------------------------------------------------------*/ LOCAL int dofile(pac, pav, pargp) register int *pac; register char *const **pav; const char **pargp; { register const char *argp = *pargp; if (argp[0] == '-') { /* * "-" is a special non flag type argument * that usually means take stdin instead of a named file */ if (argp[1] == '\0') return (NOTAFLAG); /* * "--" is a prefix to take the next argument * as non flag type argument * NOTE: Posix requires "--" to indicate the end of the * flags on the command line. But we are currently not * Posix. */ if (argp[1] == '-' && argp[2] == '\0') { if (--(*pac) > 0) { (*pav)++; return (NOTAFLAG); } else { return (NOARGS); } } } /* * now check if it may be flag type argument * flag type arguments begin with a '-', a '+' or contain a '=' * i.e. -flag +flag or flag= */ if (argp[0] != '-' && argp[0] != '+' && (!checkeql(argp))) return (NOTAFLAG); return (NOTAFILE); } /*--------------------------------------------------------------------------- | | compare argp with the format string | if a match is found store the result a la scanf in one of the | arguments pointed to in the va_list | | If setargs is FALSE, only check arguments for getfiles() | in this case, va_list may be a dummy arg. | +---------------------------------------------------------------------------*/ LOCAL int doflag(pac, pav, argp, fmt, setargs, oargs) int *pac; char *const **pav; register const char *argp; register const char *fmt; BOOL setargs; va_list oargs; { char argstr[2]; long val; Llong llval; int singlecharflag = 0; BOOL isspec; BOOL hasdash = FALSE; BOOL doubledash = FALSE; BOOL haseql = checkeql(argp); const char *sargp; const char *sfmt = fmt; va_list args; char *const *spav = *pav; int spac = *pac; void *curarg = (void *)0; /* * flags beginning with '-' don't have to include the '-' in * the format string. * flags beginning with '+' have to include it in the format string. */ if (argp[0] == '-') { argp++; hasdash = TRUE; /* * Implement legacy support for --longopt * If we find a double dash, we do not look for combinations * of boolean single char flags. */ if (argp[0] == '-') { argp++; doubledash = TRUE; /* * Allow -- only for long options. */ if (argp[1] == '\0') { return (BADFLAG); } } } sargp = argp; /* * Initialize 'args' to the start of the argument list. * I don't know any portable way to copy an arbitrary * C object so I use a system-specific routine * (probably a macro) from stdarg.h. (Remember that * if va_list is an array, 'args' will be a pointer * and '&args' won't be what I would need for memcpy.) * It is a system requirement for SVr4 compatibility * to be able to do this assgignement. If your system * defines va_list to be an array but does not define * va_copy() you are lost. * This is needed to make sure, that 'oargs' will not * be clobbered. */ va_copy(args, oargs); if (setargs) curarg = va_arg(args, void *); /* * check if the first flag in format string is a singlechar flag */ if (fmt[1] == ',' || fmt[1] == '+' || fmt[1] == '\0') singlecharflag++; /* * check the whole format string for a match */ for (;;) { for (; *fmt; fmt++, argp++) { if (*fmt == '\\') { /* * Allow "#?*&+" to appear inside a flag. * NOTE: they must be escaped by '\\' only * inside the the format string. */ fmt++; isspec = FALSE; } else { isspec = isfmtspec(*fmt); } /* * If isspec is TRUE, the arg beeing checked starts * like a valid flag. Argp now points to the rest. */ if (isspec) { /* * If *argp is '+' and we are on the * beginning of the arg that is currently * checked, this cannot be an inc type flag. */ if (*argp == '+' && argp == sargp) continue; /* * skip over to arg of flag */ if (*argp == '=') { argp++; } else if (*argp != '\0' && haseql) { /* * Flag and arg are not separated by a * space. * Check here for: * xxxxx=yyyyy match on '&' * Checked before: * abc=yyyyy match on 'abc&' * or 'abc*' * or 'abc#' * We come here if 'argp' starts with * the same sequence as a valid flag * and contains an equal sign. * We have tested before if the text * before 'argp' matches exactly. * At this point we have no exact match * and we only allow to match * the special pattern '&'. * We need this e.g. for 'make'. * We allow any flag type argument to * match the format string "&" to set * up a function that handles all odd * stuff that getargs will not grok. * In addition, to allow getargs to be * used for CPP type flags we allow to * match -Dabc=xyz on 'D&'. Note that * Dabc=xyz will not match 'D&'. */ if ((!hasdash && argp != sargp) || *fmt != '&') goto nextarg; } /* * The format string 'f* ' may be used * to disallow -ffoo for f* * * XXX This is currently only implemented for * XXX the '*' format */ if (!haseql && *argp != '\0' && fmt[0] == '*' && fmt[1] == ' ') goto nextarg; /* * *arpp == '\0' || !haseql * We come here if 'argp' starts with * the same sequence as a valid flag. * This will match on the following args: * -farg match on 'f*' * -f12 match on 'f#' * +12 match on '+#' * -12 match on '#' * and all args that are separated from * their flags. * In the switch statement below, we check * if the text after 'argp' (if *argp != 0) or * the next arg is a valid arg for this flag. */ break; } else if (*fmt == *argp) { if (argp[1] == '\0' && (fmt[1] == '\0' || fmt[1] == ',')) { if (setargs) *((int *)curarg) = TRUE; return (checkfmt(fmt)); /* XXX */ } } else { /* * skip over to next format identifier * & reset arg pointer */ nextarg: while (*fmt != ',' && *fmt != '\0') { /* function has extra arg on stack */ if (*fmt == '&' && setargs) curarg = va_arg(args, void *); fmt++; } argp = sargp; break; } } switch (*fmt) { case '\0': /* * Boolean type has been tested before. */ if (singlecharflag && !doubledash && (val = dosflags(sargp, sfmt, setargs, oargs)) != BADFLAG) return (val); return (BADFLAG); case ',': fmt++; if (fmt[1] == ',' || fmt[1] == '+' || fmt[1] == '\0') singlecharflag++; if (setargs) curarg = va_arg(args, void *); continue; case '*': if (*argp == '\0') { if (*pac > 1) { (*pac)--; (*pav)++; argp = **pav; } else { return (BADFLAG); } } if (fmt[1] == ' ') /* To disallow -ffoo for f* */ fmt++; if (setargs) *((const char **)curarg) = argp; return (checkfmt(fmt)); case '?': /* * If more than one char arg, it * cannot be a character argument. */ if (argp[1] != '\0') goto nextchance; if (setargs) *((char *)curarg) = *argp; return (checkfmt(fmt)); case '+': /* * inc type is similar to boolean, * there is no arg in argp to convert. */ if (*argp != '\0') goto nextchance; /* * If *fmt is '+' and we are on the beginning * of the format desciptor that is currently * checked, this cannot be an inc type flag. */ if (fmt == sfmt || fmt[-1] == ',') goto nextchance; if (fmt[1] == 'l' || fmt[1] == 'L') { if (fmt[2] == 'l' || fmt[2] == 'L') { if (setargs) *((Llong *)curarg) += 1; fmt += 2; } else { if (setargs) *((long *)curarg) += 1; fmt++; } } else if (fmt[1] == 's' || fmt[1] == 'S') { if (setargs) *((short *)curarg) += 1; fmt++; } else if (fmt[1] == 'c' || fmt[1] == 'C') { if (setargs) *((char *)curarg) += 1; fmt++; } else { if (fmt[1] == 'i' || fmt[1] == 'I') fmt++; if (setargs) *((int *)curarg) += 1; } argstr[0] = *fmt; argstr[1] = '\0'; return (checkfmt(fmt)); case '#': if (*argp == '\0') { if (*pac > 1) { (*pac)--; (*pav)++; argp = **pav; } else { return (BADFLAG); } } if (*astoll(argp, &llval) != '\0') { /* * arg is not a valid number! * go to next format in the format string * and check if arg matches any other type * in the format specs. */ nextchance: while (*fmt != ',' && *fmt != '\0') { if (*fmt == '&' && setargs) curarg = va_arg(args, void *); fmt++; } argp = sargp; *pac = spac; *pav = spav; continue; } val = (long)llval; if (fmt[1] == 'l' || fmt[1] == 'L') { if (fmt[2] == 'l' || fmt[2] == 'L') { if (setargs) *((Llong *)curarg) = llval; fmt += 2; } else { if (setargs) *((long *)curarg) = val; fmt++; } } else if (fmt[1] == 's' || fmt[1] == 'S') { if (setargs) *((short *)curarg) = (short)val; fmt++; } else if (fmt[1] == 'c' || fmt[1] == 'C') { if (setargs) *((char *)curarg) = (char)val; fmt++; } else { if (fmt[1] == 'i' || fmt[1] == 'I') fmt++; if (setargs) *((int *)curarg) = (int)val; } argstr[0] = *fmt; argstr[1] = '\0'; return (checkfmt(fmt)); case '&': if (*argp == '\0') { if (*pac > 1) { (*pac)--; (*pav)++; argp = **pav; } else { return (BADFLAG); } } if ((val = checkfmt(fmt)) != NOTAFLAG) return (val); if (setargs) { int ret; void *funarg = va_arg(args, void *); ret = ((*(getargfun)curarg) (argp, funarg)); if (ret != NOTAFILE) return (ret); fmt++; } else { return (val); } /* * Called function returns NOTAFILE: try next format. */ } } } /*--------------------------------------------------------------------------- | | parse args for combined single char flags | +---------------------------------------------------------------------------*/ typedef struct { void *curarg; /* The pointer to the arg to modify */ short count; /* The number of times a sc flag appears */ char c; /* The single char flag character */ char type; /* The type of the single char flag */ } sflags; LOCAL int dosflags(argp, fmt, setargs, oargs) register const char *argp; register const char *fmt; BOOL setargs; va_list oargs; { #define MAXSF 32 sflags sf[MAXSF]; va_list args; register sflags *rsf = sf; register int nsf = 0; register const char *p = argp; register int i; register void *curarg = (void *)0; char type; /* * Initialize 'args' to the start of the argument list. * I don't know any portable way to copy an arbitrary * C object so I use a system-specific routine * (probably a macro) from stdarg.h. (Remember that * if va_list is an array, 'args' will be a pointer * and '&args' won't be what I would need for memcpy.) * It is a system requirement for SVr4 compatibility * to be able to do this assgignement. If your system * defines va_list to be an array but does not define * va_copy() you are lost. * This is needed to make sure, that 'oargs' will not * be clobbered. */ va_copy(args, oargs); if (setargs) curarg = va_arg(args, void *); while (*p) { for (i = 0; i < nsf; i++) { if (rsf[i].c == *p) break; } if (i >= MAXSF) return (BADFLAG); if (i == nsf) { rsf[i].curarg = (void *)0; rsf[i].count = 0; rsf[i].c = *p; rsf[i].type = (char)-1; nsf++; } rsf[i].count++; p++; } while (*fmt) { if (!isfmtspec(*fmt) && (fmt[1] == ',' || fmt[1] == '+' || fmt[1] == '\0') && strchr(argp, *fmt)) { for (i = 0; i < nsf; i++) { if (rsf[i].c == *fmt) { if (fmt[1] == '+') { fmt++; if (fmt[1] == ',' || fmt[1] == '\0') { rsf[i].type = 'i'; } else if ((fmt[1] == 'l' || fmt[1] == 'L') && (fmt[2] == 'l' || fmt[2] == 'L')) { /* * Type 'Q'uad (ll) */ rsf[i].type = 'Q'; fmt++; } else { /* * Type 'l','i','s','c' */ rsf[i].type = fmt[1]; } } else { /* * ',' or '\0' for BOOL */ rsf[i].type = fmt[1]; } rsf[i].curarg = curarg; break; } } } while (*fmt != ',' && *fmt != '\0') { /* function has extra arg on stack */ if (*fmt == '&' && setargs) curarg = va_arg(args, void *); fmt++; } if (*fmt != '\0') fmt++; if (setargs) curarg = va_arg(args, void *); } for (i = 0; i < nsf; i++) { type = rsf[i].type; if (type == (char)-1) { return (BADFLAG); } if (rsf[i].curarg) { if (type == ',' || type == '\0') { *((int *)rsf[i].curarg) = TRUE; } else if (type == 'i' || type == 'I') { *((int *)rsf[i].curarg) += rsf[i].count; } else if (type == 'l' || type == 'L') { *((long *)rsf[i].curarg) += rsf[i].count; } else if (type == 'Q') { *((Llong *)rsf[i].curarg) += rsf[i].count; } else if (type == 's' || type == 'S') { *((short *)rsf[i].curarg) += rsf[i].count; } else if (type == 'c' || type == 'C') { *((char *)rsf[i].curarg) += rsf[i].count; } else { return (BADFLAG); } } } return (NOTAFLAG); } /*--------------------------------------------------------------------------- | | If the next format character is a comma or the string delimiter, | there are no invalid format specifiers. Return success. | Otherwise raise the getarg_bad_format condition. | +---------------------------------------------------------------------------*/ LOCAL int checkfmt(fmt) const char *fmt; { char c; c = *(++fmt); /* non constant expression */ if (c == ',' || c == '\0') { return (NOTAFLAG); } else { raisecond("getarg_bad_format", (long)fmt); return (BADFMT); } } /*--------------------------------------------------------------------------- | | Parse the string as long as valid characters can be found. | Valid flag identifiers are chosen from the set of | alphanumeric characters, '-' and '_'. | If the next character is an equal sign the string | contains a valid flag identifier. | +---------------------------------------------------------------------------*/ LOCAL int checkeql(str) register const char *str; { register unsigned char c; for (c = (unsigned char)*str; isalnum(c) || c == '_' || c == '-'; c = *str++) /* LINTED */ ; return (c == '='); } cdrkit-1.1.11/librols/default.c0000644000372500001440000000742010760521377015375 0ustar steveusers/* * Copyright 2006 Eduard Bloch * * Uses my config parser code and small wrappers to provide the old interface. * */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include enum parstate { KEYBEGINSEARCH, KEYCOMPARE, EQSIGNSEARCH, VALBEGINSEARCH, LASTCHARSEARCH }; #define GETVAL_BUF_LEN 512 #define isUspace(x) isspace( (int) (unsigned char) x) static FILE *glob_cfg_ptr = NULL; /* * Warning, uses static line buffer, not reentrant. NULL returned if the key isn't found. */ static char *get_value(FILE *srcfile, const char *key, int dorewind) { static char linebuf[GETVAL_BUF_LEN]; if(!srcfile) return ((char *) NULL); if(dorewind) rewind(srcfile); if(!key) return NULL; next_line: while(fgets(linebuf, sizeof(linebuf)-1, srcfile)) { int i; int keybeg=0; int s=KEYBEGINSEARCH; char *ret=NULL; int lastchar=0; /* simple state machine, char position moved by the states (or not), * state change is done by the state (or not) */ for( i=0 ; i #include #define DO8(a) a; a; a; a; a; a; a; a; EXPORT void swabbytes(vp, cnt) void *vp; register int cnt; { register char *bp = (char *)vp; register char c; cnt /= 2; /* even count only */ while ((cnt -= 8) >= 0) { DO8(c = *bp++; bp[-1] = *bp; *bp++ = c;); } cnt += 8; while (--cnt >= 0) { c = *bp++; bp[-1] = *bp; *bp++ = c; } } cdrkit-1.1.11/librols/astoll.c0000644000372500001440000000532510477233650015250 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)astoll.c 1.3 03/06/15 Copyright 1985, 2000-2003 J. Schilling */ /* * astoll() converts a string to long long * * Leading tabs and spaces are ignored. * Both return pointer to the first char that has not been used. * Caller must check if this means a bad conversion. * * leading "+" is ignored * leading "0" makes conversion octal (base 8) * leading "0x" makes conversion hex (base 16) * * Llong is silently reverted to long if the compiler does not * support long long. * * Copyright (c) 1985, 2000-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #define is_space(c) ((c) == ' ' || (c) == '\t') #define is_digit(c) ((c) >= '0' && (c) <= '9') #define is_hex(c) (\ ((c) >= 'a' && (c) <= 'f') || \ ((c) >= 'A' && (c) <= 'F')) #define to_lower(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A'+'a' : (c)) char * astoll(s, l) register const char *s; Llong *l; { return (astollb(s, l, 0)); } char * astollb(s, l, base) register const char *s; Llong *l; register int base; { int neg = 0; register Llong ret = (Llong)0; register int digit; register char c; while (is_space(*s)) s++; if (*s == '+') { s++; } else if (*s == '-') { s++; neg++; } if (base == 0) { if (*s == '0') { base = 8; s++; if (*s == 'x' || *s == 'X') { s++; base = 16; } } else { base = 10; } } for (; (c = *s) != 0; s++) { if (is_digit(c)) { digit = c - '0'; } else if (is_hex(c)) { digit = to_lower(c) - 'a' + 10; } else { break; } if (digit < base) { ret *= base; ret += digit; } else { break; } } if (neg) ret = -ret; *l = ret; return ((char *)s); } cdrkit-1.1.11/librols/gethostname.c0000644000372500001440000000357310536265343016273 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)gethostname.c 1.15 03/10/04 Copyright 1995 J. Schilling */ /* * Copyright (c) 1995 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #ifdef HAVE_SYS_SYSTEMINFO_H #include #endif #include #ifndef HAVE_GETHOSTNAME EXPORT int gethostname __PR((char *name, int namelen)); #ifdef SI_HOSTNAME EXPORT int gethostname(name, namelen) char *name; int namelen; { if (sysinfo(SI_HOSTNAME, name, namelen) < 0) return (-1); return (0); } #else #if defined(HAVE_UNAME) && defined(HAVE_SYS_UTSNAME_H) #include #include EXPORT int gethostname(name, namelen) char *name; int namelen; { struct utsname uts; if (uname(&uts) < 0) return (-1); strncpy(name, uts.nodename, namelen); return (0); } #endif #endif #endif /* HAVE_GETHOSTNAME */ cdrkit-1.1.11/librols/strcatl.c0000644000372500001440000000371610477233650015430 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)strcatl.c 1.12 03/10/29 Copyright 1985, 1989, 1995-2003 J. Schilling */ /* * list version of strcat() * * concatenates all past first parameter until a NULL pointer is reached * * WARNING: a NULL constant is not a NULL pointer, so a caller must * cast a NULL constant to a pointer: (char *)NULL * * returns pointer past last character (to '\0' byte) * * Copyright (c) 1985, 1989, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include /* VARARGS3 */ #ifdef PROTOTYPES EXPORT char * strcatl(char *to, ...) #else EXPORT char * strcatl(to, va_alist) char *to; va_dcl #endif { va_list args; register char *p; register char *tor = to; #ifdef PROTOTYPES va_start(args, to); #else va_start(args); #endif while ((p = va_arg(args, char *)) != NULL) { while ((*tor = *p++) != '\0') { tor++; } } *tor = '\0'; va_end(args); return (tor); } cdrkit-1.1.11/librols/CMakeLists.txt0000644000372500001440000000204411304054475016335 0ustar steveusersPROJECT (LIBROLS C) INCLUDE_DIRECTORIES(../include ../libhfs_iso ${CMAKE_BINARY_DIR} ../wodim ${CMAKE_BINARY_DIR}/include) SET(LIBROLS_SRCS astoi.c astoll.c astoull.c breakline.c cmpbytes.c comerr.c error.c fexec.c fillbytes.c getargs.c getav0.c getdomainname.c geterrno.c gethostid.c gethostname.c getpagesize.c handlecond.c movebytes.c raisecond.c rename.c saveargs.c seterrno.c spawn.c strcatl.c strdup.c streql.c swabbytes.c usleep.c stdio/cvmod.c stdio/dat.c stdio/fcons.c stdio/fdown.c stdio/fdup.c stdio/ffileread.c stdio/ffilewrite.c stdio/fgetline.c stdio/file_raise.c stdio/fileclose.c stdio/fileluopen.c stdio/filemopen.c stdio/fileopen.c stdio/filepos.c stdio/fileread.c stdio/filereopen.c stdio/fileseek.c stdio/filesize.c stdio/filestat.c stdio/filewrite.c stdio/flag.c stdio/flush.c stdio/fpipe.c stdio/niread.c stdio/niwrite.c stdio/nixread.c stdio/nixwrite.c stdio/openfd.c stdio/peekc.c default.c) ADD_LIBRARY (rols STATIC ${CMAKE_CURRENT_SOURCE_DIR}/../include/xconfig.h ${CMAKE_CURRENT_SOURCE_DIR}/../include/align.h ${LIBROLS_SRCS}) cdrkit-1.1.11/librols/raisecond.c0000644000372500001440000001157210760521377015723 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)raisecond.c 1.18 04/05/09 Copyright 1985, 1989, 1995-2004 J. Schilling */ /* * raise a condition (software signal) */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Check for installed condition handlers. * If a handler is found, the function is called with the appropriate args. * If no handler is found or no handler signals success, * the program will be aborted. * * Copyright (c) 1985, 1989, 1995-2004 J. Schilling */ #include #include #include #include #include #include #include #include #include #if !defined(AV_OFFSET) || !defined(FP_INDIR) # ifdef HAVE_SCANSTACK # undef HAVE_SCANSTACK # endif #endif /* * Macros to print to stderr without stdio, to avoid screwing up. */ #ifndef STDERR_FILENO #define STDERR_FILENO 2 #endif #define eprints(a) do { int ret; ret = write(STDERR_FILENO, (a), sizeof (a)-1); } while (0) #define eprintl(a) do { int ret; ret = write(STDERR_FILENO, (a), strlen(a)); } while (0) #define is_even(p) ((((long)(p)) & 1) == 0) #define even(p) (((long)(p)) & ~1L) #ifdef __future__ #define even(p) (((long)(p)) - 1) /* will this work with 64 bit ?? */ #endif LOCAL void raiseabort __PR((const char *)); #ifdef HAVE_SCANSTACK #include #define next_frame(vp) do { \ if (((struct frame *)(vp))->fr_savfp == 0) { \ vp = (void *)0; \ break; \ } \ if (((struct frame *)(vp))->fr_savpc == 0) { \ vp = (void *)0; \ break; \ } \ vp = \ (void *)((struct frame *)(vp))->fr_savfp; \ } while (vp != NULL && is_even(vp)); \ vp = (struct frame *)even(vp); #else EXPORT SIGBLK *__roothandle; #define next_frame(vp) vp = (((SIGBLK *)(vp))->sb_savfp); #endif LOCAL BOOL framehandle __PR((SIGBLK *, const char *, const char *, long)); /* * Loop through the chain of procedure frames on the stack. * * Frame pointers normally have even values. * Frame pointers of procedures with an installed handler are marked odd. * The even base value, in this case actually points to a SIGBLK which * holds the saved "real" frame pointer. * The SIGBLK mentioned above may me the start of a chain of SIGBLK's, * containing different handlers. */ EXPORT void raisecond(signame, arg2) const char *signame; long arg2; { register void *vp = NULL; #ifdef HAVE_SCANSTACK /* * As the SCO OpenServer C-Compiler has a bug that may cause * the first function call to getfp() been done before the * new stack frame is created, we call getfp() twice. */ (void) getfp(); vp = getfp(); next_frame(vp); #else vp = __roothandle; #endif while (vp) { if (framehandle((SIGBLK *)vp, signame, signame, arg2)) return; else if (framehandle((SIGBLK *)vp, "any_other", signame, arg2)) return; #ifdef HAVE_SCANSTACK vp = (struct frame *)((SIGBLK *)vp)->sb_savfp; #endif next_frame(vp); } /* * No matching handler that signals success found. * Print error message and abort. */ raiseabort(signame); /* NOTREACHED */ } /* * Loop through the handler chain for a procedure frame. * * If no handler with matching name is found, return FALSE, * otherwise the first handler with matching name is called. * The return value in the latter case depends on the called function. */ LOCAL BOOL framehandle(sp, handlename, signame, arg2) register SIGBLK *sp; const char *handlename; const char *signame; long arg2; { for (; sp; sp = sp->sb_signext) { if (sp->sb_signame != NULL && streql(sp->sb_signame, handlename)) { if (sp->sb_sigfun == NULL) { /* deactivated */ return (FALSE); } else { return (*sp->sb_sigfun)(signame, sp->sb_sigarg, arg2); } } } return (FALSE); } LOCAL void raiseabort(signame) const char *signame; { eprints("Condition not caught: "); eprintl(signame); eprints(".\n"); abort(); /* NOTREACHED */ } cdrkit-1.1.11/librols/cmpbytes.c0000644000372500001440000000543110536265343015576 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)cmpbytes.c 1.15 03/06/15 Copyright 1988, 1995-2003 J. Schilling */ /* * compare data * * Copyright (c) 1988, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #define DO8(a) a; a; a; a; a; a; a; a; EXPORT int cmpbytes(fromp, top, cnt) const void *fromp; const void *top; int cnt; { register const char *from = (char *)fromp; register const char *to = (char *)top; register int n; register int i; /* * If we change cnt to be unsigned, check for == instead of <= */ if ((n = cnt) <= 0) return (cnt); /* * Compare byte-wise until properly aligned for a long pointer. */ i = sizeof (long) - 1; while (--n >= 0 && --i >= 0 && !l2aligned(from, to)) { if (*to++ != *from++) goto cdiff; } n++; if (n >= (int)(8 * sizeof (long))) { if (l2aligned(from, to)) { register const long *froml = (const long *)from; register const long *tol = (const long *)to; register int rem = n % (8 * sizeof (long)); n /= (8 * sizeof (long)); do { DO8( if (*tol++ != *froml++) break; ); } while (--n > 0); if (n > 0) { --froml; --tol; to = (const char *)tol; from = (const char *)froml; goto ldiff; } to = (const char *)tol; from = (const char *)froml; n = rem; } if (n >= 8) { n -= 8; do { DO8( if (*to++ != *from++) goto cdiff; ); } while ((n -= 8) >= 0); n += 8; } if (n > 0) do { if (*to++ != *from++) goto cdiff; } while (--n > 0); return (cnt); } if (n > 0) do { if (*to++ != *from++) goto cdiff; } while (--n > 0); return (cnt); ldiff: n = sizeof (long); do { if (*to++ != *from++) goto cdiff; } while (--n > 0); cdiff: return (--from - (char *)fromp); } cdrkit-1.1.11/librols/saveargs.c0000644000372500001440000000544410477233650015567 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)saveargs.c 1.11 03/07/13 Copyright 1995-2003 J. Schilling */ /* * save argc, argv for command error printing routines * * Copyright (c) 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #if !defined(AV_OFFSET) || !defined(FP_INDIR) # ifdef HAVE_SCANSTACK # undef HAVE_SCANSTACK # endif #endif static int ac_saved; static char **av_saved; static char *av0_saved; static char *progname_saved; static char av0_sp[32]; /* av0 space, avoid malloc() in most cases */ static char prn_sp[32]; /* name space, avoid malloc() in most cases */ static char dfl_str[] = "?"; EXPORT void save_args(ac, av) int ac; char *av[]; { int slen; ac_saved = ac; av_saved = av; if (av0_saved && av0_saved != av0_sp) free(av0_saved); slen = strlen(av[0]) + 1; if (slen <= (int)sizeof (av0_sp)) av0_saved = av0_sp; else av0_saved = malloc(slen); if (av0_saved) strcpy(av0_saved, av[0]); } EXPORT int saved_ac() { return (ac_saved); } EXPORT char ** saved_av() { return (av_saved); } EXPORT char * saved_av0() { return (av0_saved); } EXPORT void set_progname(name) const char *name; { int slen; if (progname_saved && progname_saved != prn_sp) free(progname_saved); slen = strlen(name) + 1; if (slen <= sizeof (prn_sp)) progname_saved = prn_sp; else progname_saved = malloc(slen); if (progname_saved) strcpy(progname_saved, name); } EXPORT char * get_progname() { #ifdef HAVE_SCANSTACK char *progname; #endif if (progname_saved) return (progname_saved); if (av0_saved) return (av0_saved); #ifdef HAVE_SCANSTACK progname = getav0(); /* scan stack to get argv[0] */ if (progname) return (progname); #endif return (dfl_str); } cdrkit-1.1.11/librols/usleep.c0000644000372500001440000000661710536265343015254 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)usleep.c 1.17 03/06/15 Copyright 1995-2003 J. Schilling */ /* * Copyright (c) 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #define usleep __nothing_ /* prototype in unistd.h may be different */ #include #include #include #ifdef HAVE_POLL_H # include #else # ifdef HAVE_SYS_POLL_H # include # endif #endif #ifdef HAVE_SYS_SYSTEMINFO_H #include #endif #include #undef usleep #ifndef HAVE_USLEEP EXPORT int usleep __PR((int usec)); #endif #ifdef OPENSERVER /* * Don't use the usleep() from libc on SCO's OPENSERVER. * It will kill our processes with SIGALRM. * SCO has a usleep() prototype in unistd.h, for this reason we * #define usleep to __nothing__ before including unistd.h */ #undef HAVE_USLEEP #endif #ifdef apollo /* * Apollo sys5.3 usleep is broken. Define a version based on time_$wait. */ #include #include #undef HAVE_USLEEP #endif #if !defined(HAVE_USLEEP) EXPORT int usleep(usec) int usec; { #if defined(apollo) /* * Need to check apollo before HAVE_SELECT, because Apollo has select, * but it's time wait feature is also broken :-( */ #define HAVE_USLEEP /* * XXX Do these vars need to be static on Domain/OS ??? */ static time_$clock_t DomainDelay; static status_$t DomainStatus; /* * DomainDelay is a 48 bit value that defines how many 4uS periods to * delay. Since the input value range is 32 bits, the upper 16 bits of * DomainDelay must be zero. So we just divide the input value by 4 to * determine how many "ticks" to wait */ DomainDelay.c2.high16 = 0; DomainDelay.c2.low32 = usec / 4; time_$wait(time_$relative, DomainDelay, &DomainStatus); #endif /* Apollo */ #if defined(HAVE_SELECT) && !defined(HAVE_USLEEP) #define HAVE_USLEEP struct timeval tv; tv.tv_sec = usec / 1000000; tv.tv_usec = usec % 1000000; select(0, 0, 0, 0, &tv); #endif #if defined(HAVE_POLL) && !defined(HAVE_USLEEP) #define HAVE_USLEEP if (poll(0, 0, usec/1000) < 0) comerr("poll delay failed.\n"); #endif #if defined(HAVE_NANOSLEEP) && !defined(HAVE_USLEEP) #define HAVE_USLEEP struct timespec ts; ts.tv_sec = usec / 1000000; ts.tv_nsec = (usec % 1000000) * 1000; nanosleep(&ts, 0); #endif #if !defined(HAVE_USLEEP) #define HAVE_USLEEP sleep((usec+500000)/1000000); #endif return (0); } #endif cdrkit-1.1.11/librols/error.c0000644000372500001440000000321610517750703015076 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)error.c 1.13 03/06/15 Copyright 1985, 1989, 1995-2003 J. Schilling */ /* * fprintf() on standard error stdio stream * * Copyright (c) 1985, 1989, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include /* VARARGS1 */ #ifdef PROTOTYPES EXPORT int schily_error(const char *fmt, ...) #else EXPORT int schily_error(fmt, va_alist) char *fmt; va_dcl #endif { va_list args; int ret; #ifdef PROTOTYPES va_start(args, fmt); #else va_start(args); #endif ret = vfprintf(stderr, fmt, args); va_end(args); return (ret); } cdrkit-1.1.11/librols/fillbytes.c0000644000372500001440000000462210477233650015746 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fillbytes.c 1.13 03/06/15 Copyright 1987, 1995-2003 J. Schilling */ /* * fill memory with data * * Copyright (c) 1987, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #define DO8(a) a; a; a; a; a; a; a; a; #define cval ((char) lval) #ifdef PROTOTYPES EXPORT char * fillbytes(void *tov, int cnt, char val) #else EXPORT char * fillbytes(tov, cnt, val) void *tov; int cnt; char val; #endif { register char *to = (char *)tov; register int n; register long lval; /* * If we change cnt to be unsigned, check for == instead of <= */ if ((n = cnt) <= 0) return (to); lval = val & 0xFF; /* * Assign byte-wise until properly aligned for a long pointer. */ while (--n >= 0 && !laligned(to)) { *to++ = cval; } n++; if (n >= (int)(8 * sizeof (long))) { register int rem = n % (8 * sizeof (long)); lval |= (lval<<8); lval |= (lval<<16); #if SIZE_LONG > SIZE_INT lval |= (lval<<32); #endif n /= (8 * sizeof (long)); { register long *tol = (long *)to; do { DO8 (*tol++ = lval); } while (--n > 0); to = (char *)tol; } n = rem; if (n >= 8) { n -= 8; do { DO8 (*to++ = cval); } while ((n -= 8) >= 0); n += 8; } if (n > 0) do { *to++ = cval; } while (--n > 0); return (to); } if (n > 0) do { *to++ = cval; } while (--n > 0); return (to); } cdrkit-1.1.11/librols/getdomainname.c0000644000372500001440000000513111264456302016551 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)getdomainname.c 1.16 03/06/15 Copyright 1995-2003 J. Schilling */ /* * Copyright (c) 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #ifdef HAVE_SYS_SYSTEMINFO_H #include #endif #include #ifndef HAVE_GETDOMAINNAME EXPORT int getdomainname __PR((char *name, int namelen)); #endif /*#undef HAVE_GETDOMAINNAME*/ /*#undef SI_SRPC_DOMAIN*/ #if !defined(HAVE_GETDOMAINNAME) && defined(SI_SRPC_DOMAIN) #define FUNC_GETDOMAINNAME EXPORT int getdomainname(name, namelen) char *name; int namelen; { if (sysinfo(SI_SRPC_DOMAIN, name, namelen) < 0) return (-1); return (0); } #endif #if !defined(HAVE_GETDOMAINNAME) && !defined(FUNC_GETDOMAINNAME) #define FUNC_GETDOMAINNAME #include #include #include EXPORT int getdomainname(name, namelen) char *name; int namelen; { FILE *f; char name1[1024]; char *p; char *p2; name[0] = '\0'; f = fileopen("/etc/resolv.conf", "r"); if (f == NULL) return (-1); while (rols_fgetline(f, name1, sizeof (name1)) >= 0) { if ((p = strchr(name1, '#')) != NULL) *p = '\0'; /* * Skip leading whitespace. */ p = name1; while (*p != '\0' && (*p == ' ' || *p == '\t')) p++; if (strncmp(p, "domain", 6) == 0) { p += 6; while (*p != '\0' && (*p == ' ' || *p == '\t')) p++; if ((p2 = strchr(p, ' ')) != NULL) *p2 = '\0'; if ((p2 = strchr(p, '\t')) != NULL) *p2 = '\0'; strncpy(name, p, namelen); fclose(f); return (0); } } fclose(f); return (0); } #endif cdrkit-1.1.11/librols/snprintf.c0000644000372500001440000000462610477233650015620 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)snprintf.c 1.9 04/05/09 Copyright 1985, 1996-2004 J. Schilling */ /* * Copyright (c) 1985, 1996-2004 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define snprintf __nothing__ /* prototype may be wrong (e.g. IRIX) */ #include #include /* include try to get size_t */ #include /* Try again for size_t */ #include /* Try again for size_t */ #include #include #include #undef snprintf EXPORT int snprintf __PR((char *, size_t maxcnt, const char *, ...)); typedef struct { char *ptr; int count; } *BUF, _BUF; #ifdef PROTOTYPES static void _cput(char c, long l) #else static void _cput(c, l) char c; long l; #endif { register BUF bp = (BUF)l; if (--bp->count > 0) { *bp->ptr++ = c; } else { /* * Make sure that there will never be a negative overflow. */ bp->count++; } } /* VARARGS2 */ #ifdef PROTOTYPES EXPORT int snprintf(char *buf, size_t maxcnt, const char *form, ...) #else EXPORT int snprintf(buf, maxcnt, form, va_alist) char *buf; unsigned maxcnt; char *form; va_dcl #endif { va_list args; int cnt; _BUF bb; bb.ptr = buf; bb.count = maxcnt; #ifdef PROTOTYPES va_start(args, form); #else va_start(args); #endif cnt = format(_cput, (long)&bb, form, args); va_end(args); if (maxcnt > 0) *(bb.ptr) = '\0'; if (bb.count < 0) return (-1); return (cnt); } cdrkit-1.1.11/librols/geterrno.c0000644000372500001440000000261310477233650015574 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)geterrno.c 1.9 03/06/15 Copyright 1985, 1995-2003 J. Schilling */ /* * Get error number * * Copyright (c) 1985, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #ifndef HAVE_ERRNO_DEF extern int errno; #endif #ifdef geterrno #undef geterrno #endif EXPORT int geterrno() { return (errno); } cdrkit-1.1.11/librols/handlecond.c0000644000372500001440000001630510477233650016051 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)handlecond.c 1.22 04/05/09 Copyright 1985-2004 J. Schilling */ /* * setup/clear a condition handler for a software signal */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * A procedure frame is marked to have handlers if the * previous freme pointer for this procedure is odd. * The even base value, in this case actually points to a SIGBLK which * holds the saved "real" frame pointer. * The SIGBLK mentioned above may me the start of a chain of SIGBLK's, * containing different handlers. * * This will work on processors which support a frame pointer chain * on the stack. * On a processor which doesn't support this I think of a method * where handlecond() has an own chain of frames, holding chains of * SIGBLK's. * In this case, a parameter has to be added to handlecond() and * unhandlecond(). This parameter will be an opaque cookie which is zero * on the first call to handlecond() in a procedure. * A new cookie will be returned by handlecond() which must be used on * each subsequent call to handlecond() and unhandlecond() in the same * procedure. * * Copyright (c) 1985-2004 J. Schilling */ #include #include #include #include #include #include #include #include #if !defined(AV_OFFSET) || !defined(FP_INDIR) # ifdef HAVE_SCANSTACK # undef HAVE_SCANSTACK # endif #endif #ifdef HAVE_SCANSTACK #include #else extern SIGBLK *__roothandle; #endif /* HAVE_SCANSTACK */ #define is_even(p) ((((long)(p)) & 1) == 0) #define even(p) (((long)(p)) & ~1L) #if defined(__sun) && defined(__i386) /* * Solaris x86 has a broken frame.h which defines the frame ptr to int. */ #define odd(p) (((Intptr_t)(p)) | 1) #else #define odd(p) (void *)(((Intptr_t)(p)) | 1) #endif #ifdef __future__ #define even(p) (((long)(p)) - 1) /* will this work with 64 bit ?? */ #endif EXPORT void starthandlecond __PR((SIGBLK *sp)); #ifdef PROTOTYPES EXPORT void handlecond(const char *signame, register SIGBLK *sp, int (*func)(const char *, long, long), long arg1) #else EXPORT void handlecond(signame, sp, func, arg1) char *signame; register SIGBLK *sp; BOOL (*func)(); long arg1; #endif { register SIGBLK *this; register SIGBLK *last = (SIGBLK *)NULL; #ifdef HAVE_SCANSTACK struct frame *fp = (struct frame *)NULL; #endif int slen; if (signame == NULL || (slen = strlen(signame)) == 0) { raisecond("handle_bad_name", (long)signame); abort(); } #ifdef HAVE_SCANSTACK fp = (struct frame *)getfp(); fp = (struct frame *)fp->fr_savfp; /* point to frame of caller */ if (is_even(fp->fr_savfp)) { /* * Easy case: no handlers yet * save real framepointer in sp->sb_savfp */ sp->sb_savfp = (long **)fp->fr_savfp; this = (SIGBLK *)NULL; } else { this = (SIGBLK *)even(fp->fr_savfp); } #else this = __roothandle; #endif for (; this; this = this->sb_signext) { if (this == sp) { /* * If a SIGBLK is reused, the name must not change. */ if (this->sb_signame != NULL && !streql(this->sb_signame, signame)) { raisecond("handle_reused_block", (long)signame); abort(); } sp->sb_sigfun = func; sp->sb_sigarg = arg1; return; } if (this->sb_signame != NULL && streql(this->sb_signame, signame)) { if (last == (SIGBLK *)NULL) { /* * 'this' is the first entry in chain */ if (this->sb_signext == (SIGBLK *)NULL) { /* * only 'this' entry is in chain, copy * saved real frame pointer into new sp */ sp->sb_savfp = this->sb_savfp; } else { #ifdef HAVE_SCANSTACK /* * make second entry first link in chain */ this->sb_signext->sb_savfp = this->sb_savfp; fp->fr_savfp = odd(this->sb_signext); #else /* * Cannot happen if scanning the stack * is not possible... */ raisecond("handle_is_empty", (long)0); abort(); #endif } continue; /* don't trash 'last' ptr */ } else { last->sb_signext = this->sb_signext; } } last = this; } sp->sb_signext = (SIGBLK *)NULL; sp->sb_signame = signame; sp->sb_siglen = slen; sp->sb_sigfun = func; sp->sb_sigarg = arg1; /* * If there is a chain append to end of the chain, else make it first */ if (last) last->sb_signext = sp; #ifdef HAVE_SCANSTACK else fp->fr_savfp = odd(sp); #else /* * Cannot happen if scanning the stack is not possible... */ else { raisecond("handle_is_empty", (long)0); abort(); } #endif } EXPORT void starthandlecond(sp) register SIGBLK *sp; { #ifdef HAVE_SCANSTACK struct frame *fp = NULL; /* * As the SCO OpenServer C-Compiler has a bug that may cause * the first function call to getfp() been done before the * new stack frame is created, we call getfp() twice. */ (void) getfp(); #endif sp->sb_signext = (SIGBLK *)NULL; sp->sb_signame = NULL; sp->sb_siglen = 0; sp->sb_sigfun = (handlefunc_t)NULL; sp->sb_sigarg = 0; #ifdef HAVE_SCANSTACK fp = (struct frame *)getfp(); fp = (struct frame *)fp->fr_savfp; /* point to frame of caller */ if (is_even(fp->fr_savfp)) { /* * Easy case: no handlers yet * save real framepointer in sp */ sp->sb_savfp = (long **)fp->fr_savfp; fp->fr_savfp = odd(sp); } else { raisecond("handle_not_empty", (long)0); abort(); } #else sp->sb_savfp = (long **)__roothandle; __roothandle = sp; #endif } EXPORT void unhandlecond(sp) register SIGBLK *sp; { #ifdef HAVE_SCANSTACK register struct frame *fp; register SIGBLK *sps; /* * As the SCO OpenServer C-Compiler has a bug that may cause * the first function call to getfp() been done before the * new stack frame is created, we call getfp() twice. */ (void) getfp(); fp = (struct frame *)getfp(); fp = (struct frame *)fp->fr_savfp; /* point to frame of caller */ if (!is_even(fp->fr_savfp)) { /* if handlers */ sps = (SIGBLK *)even(fp->fr_savfp); /* point to SIGBLK */ /* real framepointer */ #if defined(__sun) && defined(__i386) fp->fr_savfp = (intptr_t)sps->sb_savfp; #else fp->fr_savfp = (struct frame *)sps->sb_savfp; #endif } #else if (__roothandle == NULL) { raisecond("handle_is_empty", (long)0); abort(); } /* * Pop top level handler chain. */ __roothandle = (SIGBLK *)__roothandle->sb_savfp; #endif } cdrkit-1.1.11/librols/rename.c0000644000372500001440000000641310536265343015220 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)rename.c 1.6 04/09/04 Copyright 1998-2003 J. Schilling */ /* * rename() for old systems that don't have it. * * Copyright (c) 1998-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define rename __nothing__ #include #ifndef HAVE_RENAME #include /* XXX not OK but needed for js_xx() in schily.h */ #include #include #include #include #include #include #include #include #undef rename #include #ifndef MAXPATHNAME #define MAXPATHNAME 1024 #endif #if MAXPATHNAME < 1024 #undef MAXPATHNAME #define MAXPATHNAME 1024 #endif #define MAXNAME MAXPATHNAME #define FILEDESC struct stat #ifndef HAVE_LSTAT #define lstat stat #endif EXPORT int rename(old, new) const char *old; const char *new; { char nname[MAXNAME]; char bakname[MAXNAME]; char strpid[32]; int strplen; BOOL savpresent = FALSE; BOOL newpresent = FALSE; int serrno; FILEDESC ostat; FILEDESC xstat; serrno = geterrno(); if (lstat(old, &ostat) < 0) return (-1); if (lstat(new, &xstat) >= 0) { newpresent = TRUE; if (ostat.st_dev == xstat.st_dev && ostat.st_ino == xstat.st_ino) return (0); /* old == new we are done */ } strplen = snprintf(strpid, sizeof (strpid), ".%lld", (Llong)getpid()); if (strlen(new) <= (MAXNAME-strplen) || strchr(&new[MAXNAME-strplen], '/') == NULL) { /* * Save old version of file 'new'. */ strncpy(nname, new, MAXNAME-strplen); nname[MAXNAME-strplen] = '\0'; snprintf(bakname, sizeof (bakname), "%s%s", nname, strpid); unlink(bakname); if (link(new, bakname) >= 0) savpresent = TRUE; } if (newpresent) { if (rmdir(new) < 0) { if (geterrno() == ENOTDIR) { if (unlink(new) < 0) return (-1); } else { return (-1); } } } /* * Now add 'new' name to 'old'. */ if (link(old, new) < 0) { serrno = geterrno(); /* * Make sure not to loose old version of 'new'. */ if (savpresent) { unlink(new); link(bakname, new); unlink(bakname); } seterrno(serrno); return (-1); } if (unlink(old) < 0) return (-1); unlink(bakname); /* Fails in most cases... */ seterrno(serrno); /* ...so restore errno */ return (0); } #endif /* HAVE_RENAME */ cdrkit-1.1.11/librols/getpagesize.c0000644000372500001440000000331510557233453016256 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)getpagesize.c 1.1 01/11/28 Copyright 2001 J. Schilling */ /* * Copyright (c) 2001 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #ifndef HAVE_GETPAGESIZE #include #include #ifdef HAVE_SYS_PARAM_H #include #endif #include #ifdef HAVE_OS_H #include /* BeOS for B_PAGE_SIZE */ #endif int getpagesize(void) { #ifdef _SC_PAGESIZE return sysconf(_SC_PAGESIZE); #else # ifdef PAGESIZE /* Traditional UNIX page size from param.h */ return PAGESIZE; # else # ifdef B_PAGE_SIZE /* BeOS page size from OS.h */ return B_PAGE_SIZE; # else return 512; # endif # endif #endif } #endif /* HAVE_GETPAGESIZE */ cdrkit-1.1.11/librols/astoi.c0000644000372500001440000000565010477233650015072 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)astoi.c 1.8 03/06/15 Copyright 1985, 1995-2003 J. Schilling */ /* * astoi() converts a string to int * astol() converts a string to long * * Leading tabs and spaces are ignored. * Both return pointer to the first char that has not been used. * Caller must check if this means a bad conversion. * * leading "+" is ignored * leading "0" makes conversion octal (base 8) * leading "0x" makes conversion hex (base 16) * * Copyright (c) 1985, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #define is_space(c) ((c) == ' ' || (c) == '\t') #define is_digit(c) ((c) >= '0' && (c) <= '9') #define is_hex(c) (\ ((c) >= 'a' && (c) <= 'f') || \ ((c) >= 'A' && (c) <= 'F')) #define to_lower(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A'+'a' : (c)) #ifdef notdef EXPORT int atoi(s) char *s; { long l; (void) astol(s, &l); return ((int) l); } EXPORT long atol(s) char *s; { long l; (void) astol(s, &l); return (l); } #endif EXPORT char * astoi(s, i) const char *s; int *i; { long l; char *ret; ret = astol(s, &l); *i = l; return (ret); } EXPORT char * astol(s, l) register const char *s; long *l; { return (astolb(s, l, 0)); } EXPORT char * astolb(s, l, base) register const char *s; long *l; register int base; { int neg = 0; register long ret = 0L; register int digit; register char c; while (is_space(*s)) s++; if (*s == '+') { s++; } else if (*s == '-') { s++; neg++; } if (base == 0) { if (*s == '0') { base = 8; s++; if (*s == 'x' || *s == 'X') { s++; base = 16; } } else { base = 10; } } for (; (c = *s) != 0; s++) { if (is_digit(c)) { digit = c - '0'; } else if (is_hex(c)) { digit = to_lower(c) - 'a' + 10; } else { break; } if (digit < base) { ret *= base; ret += digit; } else { break; } } if (neg) ret = -ret; *l = ret; return ((char *)s); } cdrkit-1.1.11/librols/fexec.c0000644000372500001440000002036411264456302015040 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fexec.c 1.24 04/06/06 Copyright 1985, 1995-2004 J. Schilling */ /* * Execute a program with stdio redirection * * Copyright (c) 1985, 1995-2004 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #define rols_fexecl __nothing_1_ /* prototype in schily.h is wrong */ #define rols_fexecle __nothing_2_ /* prototype in schily.h is wrong */ #include #undef rols_fexecl #undef rols_fexecle int rols_fexecl __PR((const char *, FILE *, FILE *, FILE *, ...)); int rols_fexecle __PR((const char *, FILE *, FILE *, FILE *, ...)); #include #include #include #include #ifdef JOS # include #else # include #endif #include #include #include #define MAX_F_ARGS 16 extern char **environ; LOCAL void fdcopy __PR((int, int)); LOCAL void fdmove __PR((int, int)); LOCAL const char *chkname __PR((const char *, const char *)); LOCAL const char *getpath __PR((char * const *)); #ifdef PROTOTYPES EXPORT int rols_fexecl(const char *name, FILE *in, FILE *out, FILE *err, ...) #else EXPORT int rols_fexecl(name, in, out, err, va_alist) char *name; FILE *in; FILE *out; FILE *err; va_dcl #endif { va_list args; int ac = 0; char *xav[MAX_F_ARGS]; char **av; char **pav; char *p; int ret; #ifdef PROTOTYPES va_start(args, err); #else va_start(args); #endif while (va_arg(args, char *) != NULL) ac++; va_end(args); if (ac < MAX_F_ARGS) { pav = av = xav; } else { pav = av = (char **)malloc((ac+1)*sizeof (char *)); if (av == 0) return (-1); } #ifdef PROTOTYPES va_start(args, err); #else va_start(args); #endif do { p = va_arg(args, char *); *pav++ = p; } while (p != NULL); va_end(args); ret = rols_fexecv(name, in, out, err, ac, av); if (av != xav) free(av); return (ret); } #ifdef PROTOTYPES EXPORT int rols_fexecle(const char *name, FILE *in, FILE *out, FILE *err, ...) #else EXPORT int rols_fexecle(name, in, out, err, va_alist) char *name; FILE *in; FILE *out; FILE *err; va_dcl #endif { va_list args; int ac = 0; char *xav[MAX_F_ARGS]; char **av; char **pav; char *p; char **env; int ret; #ifdef PROTOTYPES va_start(args, err); #else va_start(args); #endif while (va_arg(args, char *) != NULL) ac++; env = va_arg(args, char **); va_end(args); if (ac < MAX_F_ARGS) { pav = av = xav; } else { pav = av = (char **)malloc((ac+1)*sizeof (char *)); if (av == 0) return (-1); } #ifdef PROTOTYPES va_start(args, err); #else va_start(args); #endif do { p = va_arg(args, char *); *pav++ = p; } while (p != NULL); va_end(args); ret = rols_fexecve(name, in, out, err, av, env); if (av != xav) free(av); return (ret); } EXPORT int rols_fexecv(name, in, out, err, ac, av) const char *name; FILE *in, *out, *err; int ac; char *av[]; { av[ac] = NULL; /* force list to be null terminated */ return (rols_fexecve(name, in, out, err, av, environ)); } EXPORT int rols_fexecve(name, in, out, err, av, env) const char *name; FILE *in, *out, *err; char * const av[], * const env[]; { char nbuf[MAXPATHNAME+1]; char *np; const char *path; int ret; int fin; int fout; int ferr; #ifndef JOS int o[3]; int f[3]; int errsav; o[0] = o[1] = o[2] = f[0] = f[1] = f[2] = 0; #endif fflush(out); fflush(err); fin = fdown(in); fout = fdown(out); ferr = fdown(err); #ifdef JOS /* * If name contains a pathdelimiter ('/' on unix) * or name is too long ... * try exec without path search. */ if (find('/', name) || strlen(name) > MAXFILENAME) { ret = exec_env(name, fin, fout, ferr, av, env); } else if ((path = getpath(env)) == NULL) { ret = exec_env(name, fin, fout, ferr, av, env); if ((ret == ENOFILE) && strlen(name) <= (sizeof (nbuf) - 6)) { strcatl(nbuf, "/bin/", name, (char *)NULL); ret = exec_env(nbuf, fin, fout, ferr, av, env); if (ret == EMISSDIR) ret = ENOFILE; } } else { int nlen = strlen(name); for (;;) { np = nbuf; /* * JOS always uses ':' as PATH Environ separator */ while (*path != ':' && *path != '\0' && np < &nbuf[MAXPATHNAME-nlen-2]) { *np++ = *path++; } *np = '\0'; if (*nbuf == '\0') strcatl(nbuf, name, (char *)NULL); else strcatl(nbuf, nbuf, "/", name, (char *)NULL); ret = exec_env(nbuf, fin, fout, ferr, av, env); if (ret == EMISSDIR) ret = ENOFILE; if (ret != ENOFILE || *path == '\0') break; path++; } } return (ret); #else /* JOS */ if (fin != 0) { f[0] = fcntl(0, F_GETFD, 0); o[0] = dup(0); fcntl(o[0], F_SETFD, 1); fdcopy(fin, 0); } if (fout != 1) { f[1] = fcntl(1, F_GETFD, 0); o[1] = dup(1); fcntl(o[1], F_SETFD, 1); fdcopy(fout, 1); } if (ferr != 2) { f[2] = fcntl(2, F_GETFD, 0); o[2] = dup(2); fcntl(o[2], F_SETFD, 1); fdcopy(ferr, 2); } if (fin != 0) close(fin); if (fout != 1) close(fout); if (ferr != 2) close(ferr); /* * If name contains a pathdelimiter ('/' on unix) * or name is too long ... * try exec without path search. */ #ifdef FOUND_MAXFILENAME if (strchr(name, '/') || strlen(name) > (unsigned)MAXFILENAME) { #else if (strchr(name, '/')) { #endif ret = execve(name, av, env); } else if ((path = getpath(env)) == NULL) { ret = execve(name, av, env); if ((geterrno() == ENOENT) && strlen(name) <= (sizeof (nbuf) - 6)) { strcatl(nbuf, "/bin/", name, (char *)NULL); ret = execve(nbuf, av, env); } } else { int nlen = strlen(name); for (;;) { np = nbuf; while (*path != PATH_ENV_DELIM && *path != '\0' && np < &nbuf[MAXPATHNAME-nlen-2]) { *np++ = *path++; } *np = '\0'; if (*nbuf == '\0') strcatl(nbuf, name, (char *)NULL); else strcatl(nbuf, nbuf, "/", name, (char *)NULL); ret = execve(nbuf, av, env); if (geterrno() != ENOENT || *path == '\0') break; path++; } } errsav = geterrno(); /* reestablish old files */ if (ferr != 2) { fdmove(2, ferr); fdmove(o[2], 2); if (f[2] == 0) fcntl(2, F_SETFD, 0); } if (fout != 1) { fdmove(1, fout); fdmove(o[1], 1); if (f[1] == 0) fcntl(1, F_SETFD, 0); } if (fin != 0) { fdmove(0, fin); fdmove(o[0], 0); if (f[0] == 0) fcntl(0, F_SETFD, 0); } seterrno(errsav); return (ret); #endif /* JOS */ } #ifndef JOS LOCAL void fdcopy(fd1, fd2) int fd1; int fd2; { close(fd2); fcntl(fd1, F_DUPFD, fd2); } LOCAL void fdmove(fd1, fd2) int fd1; int fd2; { fdcopy(fd1, fd2); close(fd1); } #endif /*---------------------------------------------------------------------------- | | get PATH from env | +----------------------------------------------------------------------------*/ LOCAL const char * getpath(env) char * const *env; { char * const *p = env; const char *p2; if (p != NULL) { while (*p != NULL) { if ((p2 = chkname("PATH", *p)) != NULL) return (p2); p++; } } return (NULL); } /*---------------------------------------------------------------------------- | | Check if name is in environment. | Return pointer to value name is found. | +----------------------------------------------------------------------------*/ LOCAL const char * chkname(name, ev) const char *name; const char *ev; { for (;;) { if (*name != *ev) { if (*ev == '=' && *name == '\0') return (++ev); return (NULL); } name++; ev++; } } cdrkit-1.1.11/librols/spawn.c0000644000372500001440000000673311264456302015102 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)spawn.c 1.17 04/09/25 Copyright 1985, 1989, 1995-2003 J. Schilling */ /* * Spawn another process/ wait for child process * * Copyright (c) 1985, 1989, 1995-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #define fspawnl __nothing__ /* prototype in schily.h is wrong */ #define spawnl __nothing__ /* prototype in schily.h is wrong */ #include #undef fspawnl #undef spawnl #include #include #include #include #include #define MAX_F_ARGS 16 EXPORT int fspawnl __PR((FILE *, FILE *, FILE *, ...)); EXPORT int fspawnv(in, out, err, argc, argv) FILE *in; FILE *out; FILE *err; int argc; char * const argv[]; { int pid; if ((pid = fspawnv_nowait(in, out, err, argv[0], argc, argv)) < 0) return (pid); return (wait_chld(pid)); } /* VARARGS3 */ #ifdef PROTOTYPES EXPORT int fspawnl(FILE *in, FILE *out, FILE *err, ...) #else EXPORT int fspawnl(in, out, err, va_alist) FILE *in; FILE *out; FILE *err; va_dcl #endif { va_list args; int ac = 0; char *xav[MAX_F_ARGS]; char **av; char **pav; char *p; int ret; #ifdef PROTOTYPES va_start(args, err); #else va_start(args); #endif while (va_arg(args, char *) != NULL) ac++; va_end(args); if (ac < MAX_F_ARGS) { pav = av = xav; } else { pav = av = (char **)malloc((ac+1)*sizeof (char *)); if (av == 0) return (-1); } #ifdef PROTOTYPES va_start(args, err); #else va_start(args); #endif do { p = va_arg(args, char *); *pav++ = p; } while (p != NULL); va_end(args); ret = fspawnv(in, out, err, ac, av); if (av != xav) free(av); return (ret); } EXPORT int fspawnv_nowait(in, out, err, name, argc, argv) FILE *in; FILE *out; FILE *err; const char *name; int argc; char * const argv[]; { int pid = -1; /* Initialization needed to make GCC happy */ int i; for (i = 1; i < 64; i *= 2) { if ((pid = fork()) >= 0) break; sleep(i); } if (pid != 0) return (pid); /* * silly: fexecv must set av[ac] = NULL * so we have to cast argv tp (char **) */ rols_fexecv(name, in, out, err, argc, (char **)argv); exit(geterrno()); /* NOTREACHED */ } EXPORT int wait_chld(pid) int pid; { int died; WAIT_T status; do { do { died = wait(&status); } while (died < 0 && geterrno() == EINTR); if (died < 0) return (died); } while (died != pid); if (WCOREDUMP(status)) unlink("core"); return (WEXITSTATUS(status)); } cdrkit-1.1.11/Changelog0000644000372500001440000106443111456674043013761 0ustar steveuserscdrkit (1.1.11) RELEASED; urgency=low [ Steve McIntyre ] * genisoimage: Fix silly bug in MD5 output in template files. (Debian bug #596681) * genisoimage: Minor tweaks to the the genisoimage.1 man page. * genisoimage: Update references to atterer.org (Debian bug #596860) * genisoimage.1: Make the description of the md5-list format clearer. [ Mike Paul ] * genisoimage: Use memmove() instead of strcpy() when cleaning up graft points. -- Steve McIntyre <93sam@debian.org> Fri, 23 Apr 2010 00:30:18 +0100 cdrkit (1.1.10) RELEASED; urgency=low [ Steve McIntyre ] * genisoimage: add support for sha256 and sha512 checksum generation when making jigdo files. * genisoimage: checksumming with lots of algorithms can be very time-consuming, so split it out into multiple threads if possible. * genisoimage: allow user to specify which checksum algorithms to run on the command line. * Fix FTBFS with missing xconfig.h. Thanks to Matt Kraai for the patch. [ Nikola Pajkovsky ] * genisoimage: fix string overflow breakage when using the -root option (https://bugzilla.redhat.com/show_bug.cgi?id=508449) [ Peter Samuelson ] * librols: remove or rename several functions that clash with POSIX. Fix up callers. -- Steve McIntyre <93sam@debian.org> Thu, 14 May 2009 00:28:48 +0100 cdrkit (1.1.9) RELEASED; urgency=low [ Steve McIntyre ] * wodim: In -msinfo mode, only suggest dvd+rw-mediainfo in verbose mode. Thanks to Michael Karcher for the patch. * genisoimage: undo a mistake in the directory permissions change in the last release. Fixes handling of deep directory structures. -- Steve McIntyre <93sam@debian.org> Sun, 26 Oct 2008 15:43:54 -0700 cdrkit (1.1.8) RELEASED; urgency=low [ Steve McIntyre ] * genisoimage/joliet.c: Fix a potential memory corruption bug. * genisoimage/md5.c: Trivial cleanup * genisoimage/genisoimage.[c1]: Add command-line support for -jigdo-template-compress * genisoimage/sha1.h: Fix a type issue that broke sha1 support on 64-bit arches. * genisoimage/checksum.[ch]: Added test code; changed internal layout slightly to make for easier debug. * genisoimage: Applied patch from Roman Rakus to preserve directory permissions. * genisoimage: Add a patch from Ivan Shmakov. "-o -" will now write to stdout, as typical for command line programs. And we will try not to corrupt stdout by default if it's a terminal. * genisoimage/genisoimage.1: Add a mention of -chrp-boot. * genisoimage/mac_label.c: Fix an over-keen s/mkisofs/genisoimage. -- Steve McIntyre <93sam@debian.org> Mon, 25 May 2008 21:22:26 +0100 cdrkit (1.1.7.1) RELEASED; urgency=low [ Steve McIntyre ] * Re-spin the 1.1.7 release with a few silly release process errors fixed. -- Steve McIntyre <93sam@debian.org> Mon, 17 Mar 2008 21:25:56 +0000 cdrkit (1.1.7) RELEASED; urgency=low [ Harald Hoyer ] * lots of fixes to prevent gcc warnings * Fix for Joliet directory length bug in genisoimage [ Peter Samuelson ] * wodim.1: small fixes. [ Steve McIntyre ] * genisoimage/jte.c: add support for bzip2-compressed templates * genisoimage/jte.c: fix bzip2-compressed template data to be compatible with jigdo. * genisoimage/jte.c: fix exclude list handling. * genisoimage/checksum.[ch]: Add a generic infrastructure for checksums so we can use sha1/ as well as just md5sum. Will make things much faster for generating sha1sums for images and jigdos. * genisoimage/sha1.[ch]: Add GPL-licensed SHA1 implementation. * s/mkisofs/genisoimage/ in ABOUT -- Steve McIntyre <93sam@debian.org> Mon, 17 Mar 2008 20:07:58 +0000 cdrkit (1.1.6) RELEASED; urgency=low [ Vladimir Nadvornik ] * genisoimage/eltorito.c: care about inhibit flags when preparing eltorito boot catalog directory entry, avoiding possible crashes [ Eduard Bloch] * ALL: customize the base manpage subdirectory below PREFIX using the new MANSUBDIR variable * make sure that the buffer is flushed and drive is ready before closing session * icedax: find libossaudio on OpenBSD and use it * icedax: fixed bug with --devices (unnoticed segfault due to wrong list_devices arguments) * wodim/scsi_scan.h: moved Linux-specific recorder location guesser to an extra method for automatic drive opening, and added an alternative guessing method, using list_devices(...) picking up the first drive having appropriate device type in the inquiry info. This generic method is also used on Linux when the original guesser fails. * wodim/wodim.c: count all track sizes when looking for an appropriate drive -- Eduard Bloch Sun, 06 May 2007 16:39:08 +0200 cdrkit (1.1.5.1) RELEASED; urgency=low * resync with cosmetical last-minute changes from Peter Samuelson * Makefile: "release" target extension to make the Debian related source file creation more convinient -- Eduard Bloch Sat, 21 Apr 2007 11:30:35 +0200 cdrkit (1.1.5) RELEASED; urgency=low * wodim: explicite warning and more grace time if user manually specifies a size less than 301 sectors, which is likely to be a mistake from copy-pasting of genisoimage -print-size output and omitting the block factor * wodim: Native device name management directly in libusal now, the rewritten device scan method uses it directly. If the backend driver does not implement native names handling, the old-style IDs are displayed. * libusal: native device name management, implemented on Linux and Win32(SPT) for now * libusal: ATA is now mapped directly into the b/t/l namespace, with some workarounds to provide backward compatibility * libusal: For SCSI devices, use only scd* on kernel 2.6 and sg* on kernel 2.4 until proper locking scheme is established * libusal: always return a known value in usal_sense_table(...), from a patch from SUSE (cdrkit-dvd-fix.patch) * genisoimage: customized the default APPID string in genisoimage * genisoimage: restored support for iso9660 file sizes up to 4GB-1 * genisoimage: forced MAGIC_ERROR definition for older version, thanks to Thomas Schmidt * genisoimage: avoid pointless warnings on filetype of /.. -- Eduard Bloch Sat, 21 Apr 2007 10:17:35 +0200 cdrkit (1.1.4) RELEASED; urgency=low [ Eduard Bloch ] * On Linux, do device scanning on /dev/sr first and fallback to /dev/sg and others only then, thus having better chances to use the same exclusive lock as other programs when the user provided only the b/t/l device specification, since the Linux kernel is not able to coordinate the locking between the userspace interfaces * some refactoring, moved new Linux specific extensions to scsi-linux-sg.c, more relaxed device opening checks on scanning * some more warnings about b/t/l syntax deprecation -- Eduard Bloch Sun, 01 Apr 2007 21:49:03 +0200 cdrkit (1.1.3) RELEASED; urgency=medium [ Eduard Bloch ] * Fixed fishing for transfer size in sysfs, now ready for /dev/class/scsi_generic contents * Fixed /dev/sg%d pattern scan in --devices, now iterating over modern style device files. Thanks to Thomas Schmidt. * Dealing with the last newline char when processing /proc/sys/dev/cdrom/info contents * print the track size in the info message when guessing * added some missing or probably missing definitions in wodim/CMakeLists.txt, restoring the reading from inf files * passing through the real file size to the UDF generator. Creating incorrect iso9660 but having it this way is better than no LFS at all. * removed md5* parts and integration from icedax, patch by Vladimir Nadvornik * various small bugfixes or cosmetic fixes picked from still GPLed parts of cdrtools-2.01.01a24, excluding meta changes and big tree.c and mkisofs.c refactoring. Stream file name option enabled now. * wodim.1: "you have 4 seconds to abort ..." * defaults.c: Correct fallback to CDR_FIFOSIZE and correct error message on bad input. * tell the user his device is busy on Linux because it's mounted, after looking at /proc/mounts [ Peter Samuelson ] * Clean up Linux-2.6 CD/DVD-R drive detection, clearer error messages. -- Eduard Bloch Mon, 26 Mar 2007 17:35:10 +0200 cdrkit (1.1.2) RELEASED; urgency=low [ Stefan Huehner ] * more Cstyle cleanups [ Eduard Bloch ] * stop confusion and bailing out if burnfree/burnproof options have been explicitely specified * be move carefull with -dummy when the DVD media may not support it * extracting drive's default speed in attach_mdvd() * automatic recorder device guessing code, currently Linux-only [ Peter Samuelson ] * Fix icedax cddb query, based on a patch from Heiko Schlenker -- Eduard Bloch Sat, 13 Jan 2007 00:45:38 +0100 cdrkit (1.1.1) RELEASED; urgency=low * added geteltorito script from Rainer Krienke [ Eduard Bloch ] * more verbose abort message if track is specified with some maintainance command (#369677) * Added more DVD related fixes from SuSE's wodim-1.0pre5cvs-6.src.rpm * --devices option for wodim (modeled after cdrskin's output), working on Linux and Cygwin * Open-By-Device-Letter mode on Cygwin * -msifile=... option to store -msinfo output reliably in a dedicated file * clear profile names printing (using code from libburnia, thanks to Thomas Schmidt) * cleanup with unused embedded CVS revision strings from Schilling and more gcc -Wall correctness * reenabled -format functionality (bug in program function control flow) * get maximum DMA buffer size from sysfs on Linux, where possible * enable BURN-Free by default where possible * setting argv[0] to wodim if someone is cheating and calls it as cdrecord. Avoids confusion and printing of the wrong app name in the help output. * more documentation updates WRT cdda2wav->icedax renaming, more table formating fixes in icedax.1 * genisoimage documentation updates, mkisofs name changes [ Thomas Schmidt ] * workaround for older libmagic API * code for clear profile name mapping [ Peter Samuelson ] * expand where genisoimage looks for the config file - same places mkisofs looks plus a few more. (We may wish to trim this back some.) * major cleanups to genisoimage.1 manpage; split out the part about .genisoimagerc to a new page genisoimagerc.5. [ Steve Langasek ] * allow hppa and alpha boot code to coexist in one ISO image [ Arkadiusz Miskiewicz ] * Fake prefix line in the version output of readom to keep compatibility with frontends -- Eduard Bloch Sat, 30 Dec 2006 16:45:40 +0100 cdrkit (1.1.0) RELEASED; urgency=medium [ Eduard Bloch ] * replacement of libdeflt, config parser rewrite; more user-friendly, more flexible/tolerant now * config overhaul, much more dynamic checks, including fixes for SunOS and AIX environment, including proper libiconv detection, and processing of LDFLAGS provided by user. Also fixed confusing double-checks for some of the variables in cdda2wav.c. * mass renaming of applications and libraries, see FAQ * dirsplit -S fix, oversized have been possible before * consistent version display * cleanup of libschily, removed unused/superfluous parts (assumed having a modern POSIX compliant environment). Renamed to librols (RemainsOfLibSchily). * reenabled selection of the DVD driver, accidentaly disabled in 1.0, when beeing in non-verbose mode * made dirsplit work with file symlinks * incorporated some OpenSUSE patches: + cdrkit-HZ.patch (with initialized value, *sic*) + cdrkit-dvd-fix.patch (return code tracking) + cdrkit-gcc-workaround.patch + cdrkit-mkisofs-fail-on-large-file.patch (don't just skip them) + cdrkit-mkisofs-grow-check.patch (tolerate grown files) + cdrkit-perms.patch (not breaking on missing device files) [ Christian Fromme ] * big cleanup, phase I, getting rid from Cstyle function definitions in applications [ Lorenz Minder ] * user output junk filter in icedax/toc.c * flexible ascii conversion buffer -- Eduard Bloch Sat, 02 Dec 2006 18:43:14 +0100 cdrkit (1.0) RELEASED; urgency=low [ Eduard Bloch ] * mapping of ATAPI: -> ATA: method on linux-2.6 and some code beautification * added a atexit handler to stop the FIFO process more reliably, since Schilling's constructs seem to terminate the application on too many places * print Burnfree state/preparation messages only with high verbosity [ Dennis Vshivkov ] * sorted display of files when needed [ Joerg Jaspert] * Remove all the printing of useless messages. This is based on GPLed code, so we follow the letter of the GPL as it is interpreted by 99% of the world, including its authors. Especially as Joerg was never able to give us any clear explanation what other license he may think cdrtools had, despite us asking multiple times. So we have no other choice than to take whats written down, and thats GPL. -- Joerg Jaspert Mon, 20 Nov 2006 19:25:10 +0100 cdrkit (1.0pre5) RELEASED; urgency=low [ Eduard Bloch ] * added better check for capability.h and FATAL_ERROR if it's missing on Linux * wodim.1 updates, ie. moved suid howto to README.suidroot, Linux bashing to README.linux, more notes about non-root usage * more carefull description of the role of previous developer and his own project * fixed libmagic detection * rewrote README.mkisofs, README.win32 * better track numbers extraction command in cdda2ogg/cdda2mp3 * reenabled (forgotten) support for libedc * table formating fixes in cdda2wav.1, helps small terminals * AIX 5l port * killing FIFO process on ungraceful termination * scsi-linux-sg.c: skipping unallowed devices, cleanup/consolidation of the old workaround(s) for ATA now for SCSI too * renamed error function to schily_error because it started to wreak random havoc after harmless header moving (conflict with incompatible GNU version) * restored scsi-remote.c compilation, moved to libscg sources, used instead of rdummy.c * added optional omiting of DMA speed tests [ Vladimir Nadvornik ] * enabled CLONE feature in wodim's config [ Modestas Vainius ] * dropped . from the include path and fixed mkisofs source to use the local headers [ Lorenz Minder ] * Fix of the joliet_strlen signature * Code refactoring around *cvt* declarations to make the conditional compilation more reliable, especially on BSD and AIX * include/utypes.h: guard to preserve SIZE_T_MAX [ Christian Fromme ] * detailed review and correction of author related data in manpages and README files [ Peter Samuelson, Tollef Fog Heen ] * typo and grammar fixes in mkisofs.8 * Remove several instances of %r in printf-like statements, in preparation for removing the libschily format-string implementation -- Eduard Bloch Wed, 6 Sep 2006 22:05:30 +0200 cdrkit (1.0pre4) RELEASED; urgency=low [ Eduard Bloch ] * Added checks for libcam to make (k)FreeBSD compilation work (untested) * added clarifications about changes to all source files * adapted initial message to display the copyright more clearly * adapted copyright and contact information in scgcheck manpage * adapted contact information in btcflash manpage, also added a reference to its original author which has been missing [ Peter Samuelson ] * Cleanups: unused macros/defines * Unified and simplified the build-host data crawling methods [ Juergen Weigert ] * Various documentation corrections, replaced cdrecord->wodim where it is appropriate and legal on many visible locations -- Eduard Bloch Mon, 4 Sep 2006 23:36:58 +0200 cdrkit (1.0pre3) unstable; urgency=low [ Eduard Bloch ] * Added FAQ ("where wodim name comes from") * Moved the NULL pointer check on cdr_t to a place before it is used for DVD feature checks (otherwise it would crash when run on any pure CD-ROM reader) * Added test for WORDS_BIGENDIAN * copied values from align.h to another set of sizeof-reflecting defines in xconfig.h * workarounds for almost all "you are not allowed to modify that {version checking,quality assurance,other-important-looking-wording}" parts, replacing the output of "schily" where the commend said that we are forced to. One part in cdrecord.c still remains, the comment sounds too dangerous to be touched. * forced FIFO define, suggested by Peter [ Peter Samuelson ] * Created cmake test and code snippet for HAVE_C_BITFIELDS [ Michael Ablassmeier ] * Typo fixes in mkisofs messages and unified identical ones with a macro [Joerg Jaspert] * Released as 1.0pre3 -- Eduard Bloch Mon, 4 Sep 2006 09:56:38 +0200 cdrkit (1.0pre2) RELEASED; urgency=low * Took zisofs_tools out of the global build system and restored its original Makefile. Its own build system works better. -- Eduard Bloch Sun, 03 Sep 2006 22:14:31 +0200 cdrkit (1.0pre1) RELEASED; urgency=low [ See http://bugs.debian.org/$BUGNR for detailed explanations ] * The Big Fork to an independent project called cdrkit + using the last clearly stated GPLed versions of files from cdrtools-2.01.01a08 (closes: #353403, 372486) + we play the upstream role now, using our patches and we like them (closes: #361450) + renamed relevant works to avoid claims of "potential defamation" or "damage of reputation" (closes: #350738) + custom CMake based build system used instead of the original one, since we understand it better (closes: #350739 and hopefully closes: #350254, reopen if not). It seems to be portable among the platforms supported by Debian, it needs a bit of work for porting to non-Linux plattforms, though. * removed most of the anti-linux2.6 program messages (unless being in verbose mode). (closes: #377145) * changed default config file location to /etc/wodim.conf * added more meaningful error message on -dvd-video failure (closes: #324586) * minor cdda2mp3/cdda2ogg scripts fixes suggested by Fabian Pietsch, plus fixes for unreliable encoder detection (closes: #283794, #344443) plus possible override of preset CDDA_DEVICE variable fixed. Made the list of selected audiotracks modifiable, see manpage (closes: #344445) * sync with 4:2.01+01a01-4ubuntu4: + merged README.ATAPI.setup with README.ATAPI.setup.ubuntu. Kernel 2.6 part now in the beginning and reflecting the reality (dev=/dev/drive syntax, no SUID requirement, closes: #304230, 377736) + 02_cdrecord_default_conf.dpatch: changed /dev/cdrom to /dev/cdrw which is more likely to match the correct device on udev using systems * 36_ATA_scanbus_ignore_locked.dpatch to ignore busy devices (eg. hda harddisk) while scanning with dev=ATA (closes: #310689, #309250, #317793, 360295, * Included 37_clean_dvdsup.dpatch (closes: #312062) based on cdrtools-2.01.01a04-dvd.patch.bz2 from http://people.mandriva.com/~warly/files/cdrtools/ with few updates to work with a08. Also implements a fallback to ATA: bus in the -scanbus operation (closes: #310689, #278894). This patch is used instead of the old 07_.... Enabled permanently, disabled the "cheatcode processing" in debian/rules. Also eliminates some useability problems that have been pushed to our users (closes: #325766, #271114, #312062, #353176). * Updated dirsplit to version 0.3.3, zisofs-tools to 1.0.7 (with a custom CMakeFile.txt for easier integration and config.h updated manually for now) * minor cdda2mp3/cdda2ogg scripts fixes suggested by Fabian Pietsch, plus fixes for unreliable encoder detection (closes: #283794, #344443) plus possible override of preset CDDA_DEVICE variable fixed * added additional script manpages from Oleksandr Moskalenko (closes: #295438) * changed -speed to speed= in cdrecord.1 for consistency (closes: #344214) * Anti-Root-Requirements: + 39_nonroot_skips_rezero_unit.dpatch - don't run rezero_unit() as root which is a) most likely not needed (even admited in the comment) and b) causes the whole scsi transport system to terminate + 40_stop_setuid_games.dpatch - another workaround for problems introduced in a03 - looks like Linux kernel does reject an application trying to change the UID between ioctls (closes: #335253, 374685, 330506, 329308, 374345, 377421) * Ubuntu's 40_fix_bad_spelling.dpatch integrated (typo in wodim.dfl) * increased hash size in mkisofs/hash.c (closes: #327270) * more decent info message about locale detection -- Eduard Bloch Sun, 03 Sep 2006 22:14:31 +0200 cdrkit (2.01.01a08+X.15) UNRELEASED; urgency=low * Removed cdrtools-2.01.01a05-ossdvd.patch.bz2 again (threw bogus error messages in TAO mode), used 37_clean_dvdsup.dpatch (from Warly/Mandriva) instead -- Eduard Bloch Wed, 23 Aug 2006 15:03:46 +0200 cdrkit (2.01.01a08+X.15) UNRELEASED; urgency=low * Applied cdrtools-2.01.01a05-ossdvd.patch.bz2 slightly adapted to work with a08. -- Eduard Bloch Wed, 23 Aug 2006 15:03:46 +0200 cdrkit (2.01.01a08+X.14) UNRELEASED; urgency=low * 39_nonroot_skips_rezero_unit (don't try to run rezero_unit when not beeing root) * 40_stop_setuid_games (dont't try to cheat the kernel with delayed seteuid) -- Eduard Bloch Wed, 23 Aug 2006 14:44:53 +0200 cdrkit (2.01.01a08+X.13) UNRELEASED; urgency=low * 34_JTE (Jigdo Template Extraction, by Steve) * 36_ATA_scanbus_ignore_locked (skip busy devices when scaning, by myself) * 38_script_manpages: added as readmult.1 and pitchplay.1, currently no list_audio_tracks script there so moved to scrips/ -- Eduard Bloch Wed, 23 Aug 2006 14:35:30 +0200 cdrkit (2.01.01a08+X.12) UNRELEASED; urgency=low * 31_gnu-kfreebsd.dpatch with minor adoptions (needs testing!) * 33_extra_arch_boot_support (extra arches, by Steve) -- Eduard Bloch Wed, 23 Aug 2006 14:29:32 +0200 cdrkit (2.01.01a08+X.11) UNRELEASED; urgency=low * 26_author_locale (ASCII transliteration of Jörg in the standard credits message) * 28_cdda2wav_interface (Linux friendly cdda2wav behaviour) * 30_doc_typo_fixes (various documentation/message fixes) -- Eduard Bloch Wed, 23 Aug 2006 14:23:03 +0200 cdrkit (2.01.01a08+X.10) UNRELEASED; urgency=low * Applied 23_o_excl (exclusive device opening) * Applied 24_debug_tmpfile (more safe/secure log file location) * 25_mkisofs_iconv_manpage (hints about extra charsets) -- Eduard Bloch Wed, 23 Aug 2006 14:20:05 +0200 cdrkit (2.01.01a08+X.09) UNRELEASED; urgency=low * Applied 18_donotopen_hda.dpatch - don't insist on opening unrelated IDE devices * 20_rsh-bugfix.dpatch - make really sure that the program does seteuid right or exit * 22_linux_rawio_capability.dpatch: get Linux capabilities as needed -- Eduard Bloch Wed, 23 Aug 2006 14:11:47 +0200 cdrkit (2.01.01a08+X.08) UNRELEASED; urgency=low * mkisofs iconv support with log message adapted, added to CMake build system as appropriate -- Eduard Bloch Wed, 23 Aug 2006 13:57:10 +0200 cdrkit (2.01.01a08+X.07) UNRELEASED; urgency=low * Applied patches: 07_noadvertising (strip adds for commercial cdrecord-proDVD), 08_privacy (mkisofs revealing the exact command line) -- Eduard Bloch Wed, 23 Aug 2006 13:54:54 +0200 cdrkit (2.01.01a08+X.06) UNRELEASED; urgency=low * Applied 06_dautipps - better hints about ATAPI usage howto and -joliet-long workaround -- Eduard Bloch Wed, 23 Aug 2006 13:52:50 +0200 cdrkit (2.01.01a08+X.05) UNRELEASED; urgency=low * Bits from 03_script.dpatch by Joerg Jaspert and Eduard Bloch: Linux-friendly device location for cdda scripts and better encoder selection -- Eduard Bloch Wed, 23 Aug 2006 13:49:56 +0200 cdrkit (2.01.01a08+X.04) UNRELEASED; urgency=low * Added bits from 02_paths.dpatch by Joerg Jaspert : /var/log directory location and SILO relevant paths -- Eduard Bloch Wed, 23 Aug 2006 13:46:55 +0200 cdrkit (2.01.01a08+X.03) UNRELEASED; urgency=low * adapted cdrecord/cdrecord.dfl for modern Linux system, based on bits from 02_cdrecord_default_conf.dpatch by Zack Cerza -- Eduard Bloch Wed, 23 Aug 2006 13:43:15 +0200 cdrkit (2.01.01a08+X.02) UNRELEASED; urgency=low * Converted to use a CMake based filesystem. Generating relevant things with its mechanisms instead of inc/*. Dropped BUILD, INSTALL files, rewrote COMPILE fall to reflect the new build method. * Added GNUmakefile which has rules to bootstrap the CMake build system and then pass the actuall call to it. GNUmakefile is the prefered script used by gmake. Users with other make implementations should run cmake manually. -- Eduard Bloch Wed, 23 Aug 2006 13:35:23 +0200 cdrkit (2.01.01a08+X.01) UNRELEASED; urgency=low * moved documentation around, READMEs/ directory contains a structure, moved mkisofs docs from the source directory to it -- Eduard Bloch Tue, 22 Aug 2006 12:40:05 +0200 ***** Version 2.01 ******** Wed Sep 8 20:26:34 2004 Joerg Schilling * cdrecord.c 1.297 * readcd.c 1.74 * cdrecord.c 1.296 Version -> 2.01 Sat Sep 4 22:28:05 2004 Joerg Schilling * scsidefs.h 1.28 * scsisense.h 2.18 * scsicdb.h 2.19 * scsireg.h 1.31 * scgcmd.h 2.22 Cstyle Wed Aug 25 13:28:57 2004 Joerg Schilling * cdrecord.c 1.295 Warnung fuer Linux-2.6.8.1 neu Tue Aug 24 01:11:42 2004 Joerg Schilling * scsi-remote.c 1.16 Auch die euid auf pw->pw_uid setzen bevor exec(RSH gemacht wird Thu Aug 19 12:14:09 2004 Joerg Schilling * cdrecord.c 1.294 Version -> 2.01a38 Thu Aug 19 12:08:26 2004 Joerg Schilling * cdrecord.c 1.293 linuxcheck() im %I% verbessert ;-) Mon Aug 16 16:42:17 2004 Joerg Schilling * cdrecord.c 1.292 Version -> 2.01a37 SuSE Kommentar erweitert. Sun Aug 8 23:04:39 2004 Joerg Schilling * scsi_mmc.c 1.10 struct features & struct profiles -> LOCAL Thu Aug 5 10:26:18 2004 Joerg Schilling * cdrecord.c 1.291 Kommentar vor linuxcheck() erweitert Wed Aug 4 02:30:51 2004 Joerg Schilling * cdrecord.c 1.290 Version -> 2.01a36 max_dma ist nun 4/5 der DMA Speed statt 1/2 Warnung wegen Linux-2.6 eingebaut Warnung wegen SuSE Linux eingebaut Sat Jul 31 17:41:06 2004 Joerg Schilling * cdrecord.c 1.289 Version -> 2.01a35 Check auf dma_speed > 0, dma_speed Test nur wenn tracks > 0 Mon Jul 19 11:10:00 2004 Joerg Schilling * scsi-wnt.c 1.45 SPTI nicht bei NT-4.0 als Default Sun Jul 18 01:26:08 2004 Joerg Schilling * cdrecord.c 1.288 Version -> 2.01a34 Mehr Tests auf Korektheit der Werte (sinnvoller Bereich in get_dmaspeed()) dma_speed nur dann auswerten wenn > 0 Sun Jul 11 02:28:23 2004 Joerg Schilling * cdrecord.1 1.103 CDR_FORCESPEED domumentiert Sun Jul 11 01:57:27 2004 Joerg Schilling * skel.c 1.3 * readcd.c 1.73 * xio.c 1.11 -> NEED_O_BINARY Sun Jul 11 01:32:49 2004 Joerg Schilling * readcd.c 1.72 * skel.c 1.2 MINGW32 neu Sun Jul 11 01:30:12 2004 Joerg Schilling * xio.c 1.10 setmode() auch bei MINGW32 Fri Jul 9 00:05:39 2004 Joerg Schilling * cdrecord.c 1.287 Version -> 2.01a33 get_dmaspeed() neu kein nice() bei __DJGPP__ Fri Jun 18 17:46:20 2004 Joerg Schilling * scsi-wnt.c 1.44 if (isdigit(vers) -> if (isdigit(vers[0]) (bug korrigiert Fri Jun 18 01:17:54 2004 Joerg Schilling * drv_dvdplus.c 1.15 * drv_dvd.c 1.118 long dvd_next_addr -> LOCAL long dvd_next_addr Thu Jun 17 23:20:27 2004 Joerg Schilling * scsierrs.c 2.29 * scsitransp.c 1.91 Bitfeld Typen fuer printf() auf int casten wegen IRIX cc Thu Jun 17 11:24:48 2004 Joerg Schilling * readcd.c 1.71 Verbose Ausgabe fuer Fehlerkorrekturen nochmals angepasst Sun Jun 13 16:28:28 2004 Joerg Schilling * readcd.c 1.70 maxtry neu Sun Jun 13 16:00:20 2004 Joerg Schilling * readcd.c 1.69 Ausgabe der maximale Anzahl der Retries Sat Jun 12 15:14:49 2004 Joerg Schilling * drv_dvdplus.c 1.14 * drv_dvd.c 1.117 RAW & TAO Schreibmodi nach check_writemodes() loeschen damit niemand cdrecord -raw fuer DVDs aufruft Sat Jun 12 13:48:12 2004 Joerg Schilling * scsi-linux-ata.c 1.7 Warntext geaendert Fri Jun 11 16:49:15 2004 Joerg Schilling * readcd.c 1.68 Version -> 2.01a32 -scanbus funktioniert nun auch wenn dev= nicht angegeben und /etc/default/cdrecord vorhanden Auflistung der defekten Sektoren in allozierter Liste Thu Jun 10 10:58:19 2004 Joerg Schilling * cdrecord.1 1.102 Schreibfehler Wed Jun 2 22:54:33 2004 Joerg Schilling * cdrecord.1 1.101 -clone dokumentiert Tue May 25 17:33:15 2004 Joerg Schilling * readcd.c 1.67 Vsersion -> 2.01a31 Tue May 25 17:32:29 2004 Joerg Schilling * readcd.c 1.66 -scanbus neu Tue May 25 01:36:00 2004 Joerg Schilling * cdrecord.h 1.161 * scsi_cdr.c 1.137 * drv_mmc.c 1.157 write_buffer() neu und write_buffer() in drv_mmc.c -> yamaha_write_buffer() Thu May 20 16:42:12 2004 Joerg Schilling * scsi-linux-sg.c 1.83 Kommentar gegen die Debian patches fuer /dev/hd* Thu May 20 16:24:11 2004 Joerg Schilling * scsi-linux-ata.c 1.6 Bis zu 25 /dev/hd%c Files oeffnen Thu May 20 16:14:33 2004 Joerg Schilling * scsi-linux-sg.c 1.82 Kommentare um dumme Leute von SuSE davon abzuhalten wichtige Warnungen wegzupatchen Thu May 20 15:50:38 2004 Joerg Schilling * cdrecord.1 1.100 Kommentar zu benoetigten Root Rechten neu Thu May 20 15:35:52 2004 Joerg Schilling * cdrecord.c 1.286 Bessere Kommentare gegen SuSE die cdrecord nicht als root laufen lasse wollen Wed May 19 00:54:29 2004 Joerg Schilling * cdrecord.c 1.285 Make sure you are root. nur ausgeben wenn euid != 0 Wed May 19 00:47:48 2004 Joerg Schilling * cdrecord.c 1.284 Version -> 2.01a29 reload geht nun auch fuer Notebook Laufwerke wieder Wed May 19 00:45:26 2004 Joerg Schilling * cdrecord.h 1.160 * scsi_mmc.c 1.9 print_format_capacities() neu Wed May 19 00:27:28 2004 Joerg Schilling * cdrecord.1 1.99 Bessere beschreibung der Hintergruende fuer eine gute Wahl der FIFO Groesse (fs=) Mon May 17 00:38:17 2004 Joerg Schilling * cdrecord.1 1.98 Bessere Dokumentation fuer DVD Mon May 17 00:18:21 2004 Joerg Schilling * scsilog.c 1.17 Besserer Kommentar Sun May 16 23:46:51 2004 Joerg Schilling * drv_mmc.c 1.156 bei OPC "Power calibration area almost full" nicht als Fehler auffassen Sun May 16 17:01:24 2004 Joerg Schilling * cdrecord.1 1.97 Bessere Dokumentation der driver= Option Sun May 16 01:37:11 2004 Joerg Schilling * cdrecord.1 1.96 Diverse kleinere Schreibfehler beseitigt Sun May 16 01:26:52 2004 Joerg Schilling * cdrecord.1 1.95 Eißfeldt -> Ei\*sfeldt µsec -> \*msec Sat May 15 23:14:18 2004 Joerg Schilling * subchan.c 1.19 index Variable -> curindex wegen GCC Shadow Warnung Sun May 9 17:59:31 2004 Joerg Schilling * skel.c 1.1 date and time created 04/05/09 16:59:31 by joerg Fri Apr 23 00:51:24 2004 Joerg Schilling * scsi-wnt.c 1.43 Padding fuer ASPI CMD Struktur damit auch 32 Byte Sense Daten von SPTI gehen Wed Apr 21 01:48:32 2004 Joerg Schilling * scsi-wnt.c 1.42 Support fuer SPTI & Kontroller mit mehr als einem SCSI Bus Bei SPTI ist SENSE_LEN max nun 32 Sun Apr 18 13:26:43 2004 Joerg Schilling * scsi-linux-sg.c 1.81 MAX-SCG -> 256 wegen Linux USB Implementierung Fri Apr 16 15:29:34 2004 Joerg Schilling * scsi_scan.c 1.19 Bis zu 256 Busse scannen. Thu Apr 15 16:35:46 2004 Joerg Schilling * cdrecord.c 1.283 Version -> 2.01a28 Mon Apr 12 16:13:47 2004 Joerg Schilling * cdrecord.1 1.94 Read Book -> Red Book Tue Apr 6 11:59:03 2004 Joerg Schilling * cdrecord.c 1.282 Bessere Fehlermeldung bei fehlendem -pad/-shorttrack Mon Mar 15 01:59:49 2004 Joerg Schilling * cdrecord.c 1.281 Kommentar fuer cuefile= & -raw Wed Mar 10 21:54:36 2004 Joerg Schilling * readcd.c 1.65 * cdrecord.1 1.93 * cdrecord.c 1.280 ts= Doku besser Mon Mar 8 00:43:39 2004 Joerg Schilling * scsi-linux-sg.c 1.80 Fehler if (sp->u_sense.cmd_sense != 0 -> if (sp->u_sense.cmd_sense[0] != 0 korrigiert Wenn ASC/ASQ und auch alle zusaetzlichen Bits/Key in Byte 2 0 sind, dann loeschen wir CHECK CONDITION wieder weil das ein Linux USB Problem ist wo z.B. wegen einem DMA Underrun REQUEST SENSE geschickt wurde und das Laufwerk erwartungemaesz mit NO SENSE geantwortet hat Sun Mar 7 23:43:08 2004 Joerg Schilling * cdrecord.c 1.279 Version -> 2.01a27 Thu Mar 4 09:24:11 2004 Joerg Schilling * cdrecord.c 1.278 Bugfix: Nach Umstellung des Tests auf Schreibmodus Option ging nur noch TAO Wed Mar 3 01:27:14 2004 Joerg Schilling * drv_dvd.c 1.115 * cue.c 1.20 * isosize.c 1.9 * drv_simul.c 1.47 * getnum.c 1.2 * movesect.c 1.3 Cstyle Tue Mar 2 21:02:42 2004 Joerg Schilling * misc.c 1.4 * cue.c 1.19 Copyright -> 2004 Tue Mar 2 02:53:06 2004 Joerg Schilling * modes.c 1.25 * fifo.c 1.47 * drv_mmc.c 1.155 * drv_sony.c 1.70 * drv_dvdplus.c 1.13 * drv_7501.c 1.15 * diskid.c 1.37 * defaults.c 1.11 * crc16.c 1.6 * cdr_drv.c 1.36 * clone.c 1.7 * drv_philips.c 1.68 * readcd.c 1.64 * scsi_cdr.c 1.136 * scsi_scan.c 1.18 * iso9660.h 1.5 * xio.h 1.2 * cdtext.h 1.5 Cstyle Tue Mar 2 01:13:42 2004 Joerg Schilling * wm_track.c 1.4 Copyright -> 2004 Mon Mar 1 11:08:40 2004 Joerg Schilling * cdrecord.h 1.159 * mmcvendor.h 1.3 * scsilog.h 1.4 * scsimmc.h 1.10 * drv_jvc.c 1.80 * scsi_mmc.c 1.8 * cdtext.c 1.10 * scsilog.c 1.16 * auinfo.c 1.23 * cdrecord.c 1.277 * audiosize.c 1.19 * sector.c 1.12 * subchan.c 1.17 * wm_packet.c 1.24 * xio.c 1.8 Cstyle Mon Mar 1 11:02:43 2004 Joerg Schilling * scsimmc.h 1.11 * subchan.c 1.18 * wm_packet.c 1.25 * xio.c 1.9 * sector.c 1.13 Copyright -> 2004 Sun Feb 29 21:49:03 2004 Joerg Schilling * cdrecord.c 1.276 Cstyle Sun Feb 29 18:19:58 2004 Joerg Schilling * cdrecord.c 1.275 Version -> 2.01a26 -tao/-sao neu Sun Feb 29 18:13:20 2004 Joerg Schilling * cdrecord.1 1.92 -tao Option neu, -sao Option als Alias fuer -dao Sun Feb 22 16:41:57 2004 Joerg Schilling * cdrecord.1 1.91 Schreibfehler Sun Feb 22 15:53:51 2004 Joerg Schilling * readcd.c 1.63 * cdrecord.h 1.158 * defaults.c 1.10 cdr_defaults() Prototy -> neues defaults.h Sun Feb 22 15:53:00 2004 Joerg Schilling * defaults.h 1.1 date and time created 04/02/22 15:53:00 by joerg Sun Feb 1 21:32:58 2004 Joerg Schilling * adip.h 1.1 date and time created 04/02/01 21:32:58 by joerg Fri Jan 23 23:10:42 2004 Joerg Schilling * scsi-wnt.c 1.41 dev=ATAPI:1,0 geht nun wieder Mon Jan 19 21:29:24 2004 Joerg Schilling * drv_dvd.c 1.113 * cdrecord.c 1.274 * drv_dvdplus.c 1.12 * wm_packet.c 1.23 trackp[i].padsecs * secsize -> (Llong)trackp[i].padsecs * secsize, damit kein Integeroverflow mehr stattfindet Thu Jan 15 22:24:39 2004 Joerg Schilling * scsi-wnt.c 1.40 w2k_or_newer() neu um bei NT-4.0 wegen DMA Problemen mit SPTI per Default mit ASPI zu betreiben Debug prints fuer bessere Beurteilung der Funktionsweise Thu Jan 15 02:22:38 2004 Joerg Schilling * scsi-mac-iokit.c 1.9 memset sense 0 wieder eingebaut bis endgueltig geklaert ist wie es sein sollte Thu Jan 15 01:55:36 2004 Joerg Schilling * scsi-hpux.c 1.31 * scsi-linux-pg.c 1.43 * scsi-vms.c 1.33 * scsi-os2.c 1.25 * scsi-wnt.c 1.39 * scsi-remote.c 1.15 * scsi-unixware.c 1.36 * scsi-qnx.c 1.3 * scsi-osf.c 1.26 * scsi-sgi.c 1.36 * scsi-bsd.c 1.42 * scsi-bsd-os.c 1.28 * scsi-beos.c 1.22 Umbau fuer Cstyle Thu Jan 15 01:05:25 2004 Joerg Schilling * scsi-openserver.c 1.31 Aenderungen fuer Cstyle Thu Jan 15 00:50:11 2004 Joerg Schilling * scsi-next.c 1.32 * scsi-linux-ata.c 1.5 Umbau wegen Cstyle Wed Jan 14 20:05:52 2004 Joerg Schilling * drv_dvd.c 1.112 Unbenutzte Variablen beseitigt Wed Jan 14 20:04:33 2004 Joerg Schilling * scsi-sun.c 1.82 Aumbau fuer Cstyle Wed Jan 14 19:57:28 2004 Joerg Schilling * scsi-sun.c 1.81 Ueberfluessige Variable sb beseitigt Wed Jan 14 18:54:48 2004 Joerg Schilling * scsi-apollo.c 1.5 * scsi-amigaos.c 1.6 * scsi-aix.c 1.36 * scsi-linux-sg.c 1.79 * scsiopen.c 1.95 * scsitransp.c 1.90 * scgsettarget.c 1.2 * scsihelp.c 1.4 Umbau fuer cstyle Wed Jan 14 15:37:47 2004 Joerg Schilling * scsi-linux-sg.c 1.78 LF_ATA Flag neu Wed Jan 14 01:14:27 2004 Joerg Schilling * scsi-mac-iokit.c 1.8 ux_errno wird nun korrekt gesetzt wenn ein Kommando schiefgeht Die Sense Daten werden nicht mehr gelöscht Author ist nun "schily", denn das Modul kommt nun teilweise dirch scgcheck Tue Jan 13 20:43:44 2004 Joerg Schilling * scsi-mac-iokit.c 1.7 Umbau fuer Cstyle Mon Jan 12 00:36:04 2004 Joerg Schilling * drv_mmc.c 1.154 Besserer Kommentar bei den Profilen in identify Mon Jan 12 00:33:39 2004 Joerg Schilling * cdr_drv.c 1.35 dp bei error() ueberpruefen um coredumps bei cdrecord -xd zu verhindern Sun Jan 11 18:42:14 2004 Joerg Schilling * scsi-linux-sg.c 1.77 Versuch das /dev/hd* Interface von Linux-2.6 besser zu unterstützen. Sun Jan 11 16:18:48 2004 Joerg Schilling * scsi-linux-sg.c 1.76 Kommentar verbessert Sun Jan 11 14:39:45 2004 Joerg Schilling * scsi-wnt.c 1.38 w2kstyle_create() umgestellt und so repariert, dasy kein unzulaessiger Speicherzugriff mehr erfolgt Sun Jan 11 14:09:19 2004 Joerg Schilling * scsi-wnt.c 1.37 loas_aspi() neu Sun Jan 11 13:28:56 2004 Joerg Schilling * scsi-wnt.c 1.36 Aenderungen damit cdrecord -scanbus dev=ASPI geht Wed Jan 7 00:38:26 2004 Joerg Schilling * cdrecord.h 1.157 * scsi_scan.c 1.17 * scsi-mac-iokit.c 1.6 * scsi-sun.c 1.80 * scsi-wnt.c 1.34 * scsitransp.c 1.89 * cdrecord.c 1.273 Copyright -> 2004 Wed Jan 7 00:20:32 2004 Joerg Schilling * scsi-wnt.c 1.35 Anderer Version String fuer SPTI Wed Jan 7 00:03:55 2004 Joerg Schilling * cdrecord.c 1.272 Version -> 2.01a24 Tue Jan 6 23:58:43 2004 Joerg Schilling * cue.c 1.18 Wenn FILE Anweisung im CUE Sheet keinen Slash (/) enthaelt, dann wird der Filename auch im Directory des CUE Sheets gesucht Tue Jan 6 23:52:52 2004 Joerg Schilling * scsitransp.c 1.88 Version -> 0.8 Tue Jan 6 23:33:20 2004 Joerg Schilling * scsi-wnt.c 1.33 Cstyle Tue Jan 6 23:21:14 2004 Joerg Schilling * scsi-wnt.c 1.32 SPTI Unterdrueckung von nocht CD-ROM deaktiviert Tue Jan 6 23:10:18 2004 Joerg Schilling * scsi-wnt.c 1.31 Erste Version mit SPTI Support Tue Jan 6 17:58:47 2004 Joerg Schilling * scsi-mac-iokit.c 1.5 scgo_havebus() korrigiert (war immer FALSE) damit pxupgrade funktioniert Tue Jan 6 01:01:59 2004 Joerg Schilling * drv_mmc.c 1.153 cmd_dummy statt init_mmc in den Treiberstrukturen fuer CD-ROM Leser Sun Jan 4 15:26:25 2004 Joerg Schilling * scsi-sun.c 1.79 Erste Version einer UID Verwaltung die fuer Solaris 9 USCSI gebraucht wird Fri Jan 2 16:05:57 2004 Joerg Schilling * scsi-sun.c 1.78 Erste Version die mit Volume Management arbeitet Fri Jan 2 16:05:21 2004 Joerg Schilling * cdrecord.c 1.271 Version -> 2.01a23 Fri Jan 2 16:05:06 2004 Joerg Schilling * scsi_scan.c 1.16 Hack fuer fd == -1 -> Kein Zugriff auf LW -> '?' statt '*' Tue Dec 30 14:20:00 2003 Joerg Schilling * cdrecord.c 1.270 Schreibfehler will not not Korrigiert Mon Dec 29 15:25:05 2003 Joerg Schilling * cdrecord.1 1.90 Bessere Beschreibung und Beispiel fuer -setdropts driveropts= Wed Dec 24 11:51:56 2003 Joerg Schilling * drv_mmc.c 1.152 Hinweis auf RAW bei nicht funktionierendem CUE Sheet Tue Dec 23 13:48:33 2003 Joerg Schilling * cdrecord.c 1.269 Version -> 2.01a21 Hack fuer POSIX_PRIORITY_SCHEDULING Bug (wir brauchen root Rechte um die Pri zu verringern) Sun Dec 21 14:29:21 2003 Joerg Schilling * cdrecord.1 1.89 Neuer Absatz ueber ATAPI auf erster Seite. Thu Dec 18 17:10:58 2003 Joerg Schilling * scsitransp.c 1.87 Aehnlicher Text wie in cdrecord.c wenn !defined(IS_SCHILY_XCONFIG) Thu Dec 18 17:10:26 2003 Joerg Schilling * cdrecord.c 1.268 Neuer Text fuer modifizierte Versionen ohne Support Thu Dec 18 17:09:41 2003 Joerg Schilling * cdrecord.1 1.88 .sp verschoben auf Wunsch von Eric Raymond Tue Dec 16 00:42:16 2003 Joerg Schilling * cdrecord.c 1.267 Security Test Ausgabe nun auch ohne Root Zugriff sichtbar Mon Dec 15 16:40:59 2003 Joerg Schilling * cdrecord.c 1.266 Ausgabe des Resultats des Security Checks Mon Dec 15 09:19:24 2003 Joerg Schilling * drv_mmc.c 1.151 Copyright -> 2003 Mon Dec 15 09:18:14 2003 Joerg Schilling * drv_mmc.c 1.150 Ein DVD Brenner wird nun auch erkannt wenn er nur MMC-3 und nicht MMC-2 konform ist Hinweis auf ftp://ftp.berlios.de/pub/cdrecord/ProDVD/ Mon Dec 15 07:32:55 2003 Joerg Schilling * cdrecord.c 1.265 comexit(0); nach "erstem" -force blank unit entfernt damit auch mit dem Ricoh-5125 Medien erweckt werden koennen Thu Dec 11 12:59:54 2003 Joerg Schilling * scsireg.h 1.30 #ifdef __SCG_COMPAT_ zum enablen von info/ident/revision -> vendor_info/prod_ident/prod_revision Thu Dec 11 12:55:42 2003 Joerg Schilling * scsi_scan.c 1.15 * scsi_cdr.c 1.135 info -> vendor_info, ident -> prod_ident, revision -> prod_revision Wed Dec 10 00:42:39 2003 Joerg Schilling * scsi-dos.c 1.11 Hinweis auf http://bootcd.narod.ru/ Wed Dec 10 00:40:49 2003 Joerg Schilling * cdrecord.c 1.264 Hinweis auf ftp://ftp.berlios.de/pub/cdrecord/ProDVD/ Wed Dec 10 00:19:03 2003 Joerg Schilling * cdrecord.c 1.263 Version -> 2.01a20 FIFO Abschalten wenn fifosize < 2*bufsize Tue Dec 9 20:52:14 2003 Joerg Schilling * cdrecord.1 1.87 ..sp -> .sp Schreibfehler Sun Nov 30 13:50:31 2003 Joerg Schilling * scsi-dos.c 1.10 schcgeck funktioniert nun, kein DMAresid und max sense_count 18 Sun Nov 30 00:00:01 2003 Joerg Schilling * xio.c 1.7 * readcd.c 1.62 #include auch fuer DJGPP Sat Nov 29 23:36:39 2003 Joerg Schilling * scsi-dos.c 1.9 Srb.Type.ExecSCSICmd.SenseLen = DEF_SENSE_LEN; -> Srb.Type.ExecSCSICmd.SenseLen = (SENSE_LEN+2); Sat Nov 29 23:11:56 2003 Joerg Schilling * readcd.c 1.61 Version -> 2.01a20 Sat Nov 29 23:10:16 2003 Joerg Schilling * xio.c 1.6 setmode(fileno, O_BINARY) auch fuer DJGPP Sat Nov 29 23:10:00 2003 Joerg Schilling * readcd.c 1.60 #include fuer __CYGWIN32__/__EMX__ setmode(fileno, O_BINARY) auch fuer DJGPP Sat Nov 29 23:03:06 2003 Joerg Schilling * scsi-dos.c 1.8 Sense_len & sense_count korrekt beachten SS_ERR -> vor die invalid Device & Cannot Select Bus cases im switch in send_cmd() Sat Nov 29 22:28:57 2003 Joerg Schilling * scsi-dos.c 1.7 Schreibfehler is statt if beseitigt Sat Nov 29 19:11:41 2003 Joerg Schilling * scsi-os2.c 1.24 Return (0) statt -1 bei FATAL Error in send_cmd() wenn kein gueltiges Target gesetzt ist Sat Nov 29 19:10:48 2003 Joerg Schilling * scsi-dos.c 1.6 Neuer AspiLoaded Counter fuer mehrfaches Oeffnen Sat Nov 29 19:06:55 2003 Joerg Schilling * scsi-wnt.c 1.30 Return (0) statt -1 bei FATAL Error in send_cmd() wenn kein gueltiges Target gesetzt ist SS_ERR mit cp->SRB_TargStat != 0 ist nun SCG_NO_ERROR AspiLoaded ist nun integer Counter damit mehrere open()s moeglich sind Sat Nov 29 19:04:36 2003 Joerg Schilling * scsi-dos.c 1.5 Return (0) statt -1 bei FATAL Error in send_cmd() wenn kein gueltiges Target gesetzt ist SS_ERR mit Srb.Type.ExecSCSICmd.TargStat != 0 ist nun SCG_NO_ERROR Sat Nov 29 18:58:35 2003 Joerg Schilling * scsi-dos.c 1.4 Cstyle Sat Nov 29 18:30:44 2003 Joerg Schilling * scsi-dos.c 1.3 Umbau auf _go32_dpmi_allocate_real_mode_callback_retf() Fri Nov 28 10:25:15 2003 Joerg Schilling * scsi-dos.c 1.2 Callback Funktion neu Fri Nov 28 02:33:18 2003 Joerg Schilling * scsihack.c 1.43 scsi-dos.c neu Fri Nov 14 10:55:14 2003 Joerg Schilling * scsi-dos.c 1.1 date and time created 03/11/14 10:55:14 by joerg Sun Nov 2 23:50:22 2003 Joerg Schilling * fifo.c 1.46 fifo_percent() fragt nun (sp == NULL) ab um festzustellen of der FIFO aus ist Wed Oct 29 15:33:45 2003 Joerg Schilling * scsi-remote.c 1.14 strcatl()/concat()/*execl() casten nun NULL im letzten Arg nach (char *)NULL Wed Oct 1 00:39:23 2003 Joerg Schilling * cdrecord.h 1.156 Kommentar ueber minimale FIFO Groesse Sun Aug 24 13:15:10 2003 Joerg Schilling * cdrecord.1 1.86 driveropts in /Etc/default/cdrecord dokumentiert Tue Jul 22 21:43:08 2003 Joerg Schilling * cdrecord.c 1.262 Version -> 2.01a17 Mon Jul 21 00:06:31 2003 Joerg Schilling * cdrecord.h 1.155 * cdrecord.1 1.85 * cdrecord.c 1.261 Neue Option ts= Fri Jul 18 10:04:20 2003 Joerg Schilling * readcd.c 1.59 Version -> 2.01a17 Teilweise #ifndef EXTVERS -> #ifdef CLONE_WRITE fuer genauere Beschreibung des Kodes Fri Jul 18 10:03:04 2003 Joerg Schilling * scsi_cdr.c 1.134 Kommentar Hinweis in cdr_underrun() Fri Jul 11 11:43:25 2003 Joerg Schilling * cdrecord.1 1.84 Schreibfehler Sun Jul 6 00:04:14 2003 Joerg Schilling * scsi-os2.c 1.23 EIO statt EINVAL damit Scan fuer Targets > 7 klappt Sat Jun 21 21:42:56 2003 Joerg Schilling * scsi-sun.c 1.77 Workaround fuer Solaris 8 x86 Bug: DKIOCINFO liefert 256 kB DMAsize aber nur 68 kB geht bei ATAPI & DMA Sat Jun 21 19:42:26 2003 Joerg Schilling * readcd.c 1.58 Neue Option -factor Fri Jun 20 22:47:08 2003 Joerg Schilling * readcd.c 1.57 Neue Option ts= fuer Transfer size Fri Jun 20 22:32:59 2003 Joerg Schilling * readcd.c 1.56 Residual count auswerten beim Lesen Fri Jun 20 22:21:33 2003 Joerg Schilling * readcd.c 1.55 prstats_silent() Prototyp neu Versuch damit klarzukommen dasz einige BS (UnixWare) nicht mit odd byte DMA bei ATAPI klarkommen (READ FULL TOC) Ausgabe aller Lead out startzeiten bei -clone (READ FULL TOC) Geschwindigkeitsangaben beziehen sich auf 1000 Byte == 1 kb Hack to write empty disks geht mit end == 1 statt end == 0 Tue Jun 17 19:23:35 2003 Joerg Schilling * cdrecord.1 1.83 Schreibfehler Tue Jun 17 19:18:00 2003 Joerg Schilling * auinfo.c 1.22 samples -> nsamples wegen samples() Makro und K&R C Sat May 31 21:58:05 2003 Joerg Schilling * scsi-amigaos.c 1.5 Neue Version von Thomas Langer Sat May 31 19:41:16 2003 Joerg Schilling * scsi-amigaos.c 1.4 Eingerueckt nach cstyle Sat May 31 18:34:37 2003 Joerg Schilling * cdrecord.c 1.260 GPL Hinweise besser formuliert, Schreibfehler in usage() beseitigt Sat May 31 18:10:38 2003 Joerg Schilling * cdrecord.1 1.82 Schreibfehler berichtigt & -format dokumentiert Sat May 31 18:09:46 2003 Joerg Schilling * auinfo.c 1.21 Fix fuer fehlerhafte Erkennung von *.inf Dateien die Meldung 'WARNING: Stdin is connected to a terminal.' verursacht Fri May 16 13:02:58 2003 Joerg Schilling * scsi-remote.c 1.13 js_snprintf(devname, sizeof(devname), device); -> js_snprintf(devname, sizeof(devname), "%s", device); Wed May 14 18:59:12 2003 Joerg Schilling * cdrecord.c 1.259 CD-Text -text Aktivierung durch trackp[MAX_TRACK+1].flags |= TI_TEXT Kein CD-text mehr wenn track[0].flags & TI_TEXT schon gesetzt (durch textfile=) Wed May 14 18:57:53 2003 Joerg Schilling * cue.c 1.17 CD-Text aus CDTEXTFILE nur noch wenn trackp[MAX_TRACK+1].flags & TI_TEXT Wed May 14 18:56:55 2003 Joerg Schilling * cdrecord.1 1.81 Neue erweiterte CD-Text Behandlung beschrieben Wed May 14 02:24:17 2003 Joerg Schilling * cdrecord.c 1.258 Version -> 2.01a15, Diverse Umstellungen damit tracks == 0 Abfragen bei cuefile=xxx korrekt behandelt werden Wed May 14 02:21:07 2003 Joerg Schilling * xio.c 1.5 while(pp) -> for (; pp; pp = pp->x_next) damit continue bei x_name == NULL nicht zur Endlosschleife wird Tue May 13 23:26:57 2003 Joerg Schilling * cdrecord.1 1.80 speed= Behandlung besser erklaert und Schreibfehler Tue May 13 23:26:14 2003 Joerg Schilling * cue.c 1.16 TI_SWAB bei FILE ... WAVE setzen Tue May 13 13:07:03 2003 Joerg Schilling * xio.c 1.4 pp->x_name == NULL voer strcmp geaendert Tue May 13 13:05:00 2003 Joerg Schilling * xio.c 1.3 Neue Knoten korrekt in Liste ein und aushaengen Mon May 12 02:17:00 2003 Joerg Schilling * drv_mmc.c 1.149 Support fuer TM_QUADRO/TM_ALLOW_COPY neu Hack fuer CUE Sheet Handling mit MODE2/CDI trackp[i].dbtype == DB_RAW Fuer Lead-In/Lead-Out werden nun die Bits fuer Datengroesse wegmaskiert Mon May 12 01:39:30 2003 Joerg Schilling * cdrecord.c 1.257 setleadinout() setzt nun trackp[tracks+1].tracktype aus trackp[tracks].tracktype Mon May 12 01:38:03 2003 Joerg Schilling * cue.c 1.15 Erste funktionierende Version Mon May 12 00:26:35 2003 Joerg Schilling * drv_dvdplus.c 1.8 Canot -> Cannot Schreibfehler beseitigt Mon May 12 00:25:29 2003 Joerg Schilling * cdrecord.h 1.154 parsecue()/fparsecue() neu Mon May 12 00:22:57 2003 Joerg Schilling * cdrecord.c 1.256 Version -> 2.01a14, Neue Option cuefile=, Kein Aufruf von checkdsize() wenn tracks == 0 (tsize == -150) Mon May 12 00:20:55 2003 Joerg Schilling * cdrecord.1 1.79 einfache erste cuefile= Doku Sun May 11 21:47:29 2003 Joerg Schilling * cdrecord.h 1.153 TI_QUADRO & is_quadro() neu Sun May 11 21:46:53 2003 Joerg Schilling * xio.c 1.2 Schutz gegen Coredump wenn pp->x_name == NULL Sat May 10 16:15:14 2003 Joerg Schilling * cue.c 1.14 Erster Ansatz fuer parse_file() Sat May 10 15:05:46 2003 Joerg Schilling * cue.c 1.13 struct state neu cueopen()/neednextitem()/needword()/needitem()/checkextra()/cueabort() neu Fri May 9 10:10:42 2003 Joerg Schilling * cue.c 1.12 keyw_t Arrays -> LOCAL Fri May 9 10:08:10 2003 Joerg Schilling * cue.c 1.11 Parser Funktionen -> LOCAL Fri May 9 10:00:21 2003 Joerg Schilling * cue.c 1.10 Erster Ansatz zum weiteren parsieren der Keywort Zeilen mit den Funktionen parse_*() Fri May 9 09:58:25 2003 Joerg Schilling * cdtext.c 1.9 #include cdtext.h vor cdrecord.h wegen gettextptr() und den Typ textptr_t Fri May 9 09:57:08 2003 Joerg Schilling * auinfo.c 1.20 * cdrecord.h 1.152 gettextptr() ist nun nicht mehr LOCAL Fri May 9 09:56:24 2003 Joerg Schilling * cdtext.h 1.4 #define CDTEXT_H fuer Erkennung dasz cdtext.h includiert wurde Thu May 8 20:13:07 2003 Joerg Schilling * cue.c 1.9 Umgestellt fuer mehr "Ordnung" Thu May 8 19:57:21 2003 Joerg Schilling * cue.c 1.8 Definitionen fuer alle Schluesselworte Thu May 8 19:44:42 2003 Joerg Schilling * cue.c 1.7 getlocal() beseitigt, parsecue()/fparsecue() neu Thu May 8 19:38:55 2003 Joerg Schilling * scsiopen.c 1.94 js_snprintf(errs, slen, scgp->errstr) -> js_snprintf(errs, slen, "%s", scgp->errstr) Thu May 8 19:38:14 2003 Joerg Schilling * drv_mmc.c 1.148 get_speeds_plextor() geht nicht mit alten LW, daher Ausfuerung im silent Mode Thu May 8 00:45:07 2003 Joerg Schilling * cue.c 1.6 Reihenfolge der Keyworte Kommentar Wed May 7 23:46:01 2003 Joerg Schilling * cdrecord.h 1.151 * wm_packet.c 1.22 * fifo.c 1.45 * cdrecord.c 1.255 Umbau auf 'xio' Wed May 7 20:31:31 2003 Joerg Schilling * xio.h 1.1 * xio.c 1.1 date and time created 03/05/07 19:31:31 by joerg Tue May 6 23:57:09 2003 Joerg Schilling * cdrecord.h 1.150 * cdrecord.1 1.78 * cdrecord.c 1.254 -abort Option neu Tue May 6 19:12:27 2003 Joerg Schilling * cue.c 1.5 Kommentar verbessert, lookup() mit table Parameter Tue May 6 00:35:47 2003 Joerg Schilling * cue.c 1.4 Kommentar verbessert Tue May 6 00:23:14 2003 Joerg Schilling * cue.c 1.3 Umbau auf Makefilesystem, ungetline()/getlocal() neu Sun May 4 18:41:33 2003 Joerg Schilling * cdrecord.1 1.77 Beschreibung der Audio Kopie aus Pipe Sun May 4 18:36:46 2003 Joerg Schilling * cdrecord.c 1.253 Version -> 2.01a13 Sun May 4 18:35:19 2003 Joerg Schilling * cdrecord.h 1.149 * cdrecord.c 1.252 * auinfo.c 1.19 Neue Funktion auinfosize() fuer AudioCDs aus Pipe Brennen Sun May 4 15:46:38 2003 Joerg Schilling * cdrecord.c 1.251 Neue Funktion opentracks() und Umstellung des Trackparsing Sun May 4 15:18:21 2003 Joerg Schilling * fifo.c 1.44 STDIN wird nicht mehr geschossen damit Audio "On the Fly" moeglich wird Sun May 4 15:16:43 2003 Joerg Schilling * cdrecord.h 1.148 Neues Track Flag TI_USEINFO, tracktype/dbtype nun Uchar Sun May 4 12:52:00 2003 Joerg Schilling * cdrecord.c 1.250 setuid(getuid()) nachdem alle root Dinge erledigt sind (hoffentlich) Sat May 3 20:09:17 2003 Joerg Schilling * scsitransp.h 1.54 * scsitransp.c 1.86 scg_fprascii()/scg_prascii()/scg_sprascii() neu Sat May 3 19:39:32 2003 Joerg Schilling * cdrecord.c 1.249 gracewait setzt nun didgrace auf TRUE um doppeltes Warten zu vermeiden Fri May 2 22:49:20 2003 Joerg Schilling * scsi-unixware.c 1.35 Debug error() beseitigt Fri May 2 22:46:35 2003 Joerg Schilling * scsi-unixware.c 1.34 xpopen() neu damit suid root Binaries gehen, denn /etc/scsi/pdiconfig geht nicht wenn euid != uid Tue Apr 29 22:59:14 2003 Joerg Schilling * cdrecord.c 1.248 Version -> 2.01a11 Tue Apr 29 20:59:54 2003 Joerg Schilling * cdrecord.c 1.247 * cdrecord.1 1.76 Neue Optionen -xa/-xamix und -multi/-mode2/-xa1/-xa2/-cdi korrigiert Tue Apr 29 20:41:16 2003 Joerg Schilling * drv_mmc.c 1.147 Support fuer TAO -mode2 Tue Apr 29 20:40:26 2003 Joerg Schilling * cdrecord.h 1.147 Definitionen fuer Daten Sektor Typen Tue Apr 29 00:27:20 2003 Joerg Schilling * drv_mmc.c 1.146 Bessere Ausgabe fuer formatierte RW Medien Tue Apr 29 00:26:27 2003 Joerg Schilling * scsi_mmc.c 1.7 Ausgave des Current Profile auf separater Zeile Wed Apr 23 23:25:27 2003 Joerg Schilling * drv_dvdplus.c 1.5 Ungebrauchte Variablen beseitigt Wed Apr 23 23:20:27 2003 Joerg Schilling * scsi_cdr.c 1.133 read_track_info() Bug gefixt (type Bits waren in cmd_cdb[2] statt cmd_cdb[1]) Wed Apr 23 23:19:24 2003 Joerg Schilling * cdrecord.c 1.246 gracewait() umstrukturiert Wed Apr 23 23:18:13 2003 Joerg Schilling * scsi_mmc.c 1.6 * drv_mmc.c 1.145 * cdrecord.h 1.146 print_profiles() neu Tue Apr 22 22:36:02 2003 Joerg Schilling * cdrecord.c 1.245 Return Code von (*dp->cdr_init)(scgp, dp) auswerten Tue Apr 22 19:08:58 2003 Joerg Schilling * cdrecord.c 1.244 raise_fdlim versucht nun nicht mehr z.B. ein Limit von 256 auf 109 zu "erhoehen". Tue Apr 22 17:47:29 2003 Joerg Schilling * drv_mmc.c 1.144 Fehlendes " ergaenzt Tue Apr 22 17:46:28 2003 Joerg Schilling * drv_mmc.c 1.143 Bessere Fehlermeldung fuer get next writable address auf formatierte CD-RW Tue Apr 22 17:42:06 2003 Joerg Schilling * cdrecord.c 1.243 Mehr Fehlermeldungen wenn in der Hauptschleife Fehler auftreten. Tue Apr 22 01:08:46 2003 Joerg Schilling * cdrecord.c 1.242 Version -> 2.01a11, gracewait() mit didgrace Parameter fuer Ausgabe ohne Warten Mon Apr 21 15:49:58 2003 Joerg Schilling * cdrecord.c 1.241 Format Code mit #ifdef DRV_DVD auskommentiert Mon Apr 21 15:40:04 2003 Joerg Schilling * drv_mmc.c 1.142 CL_TYPE_* #defines neu fuer scsi_close_tr_session() Mon Apr 21 15:39:13 2003 Joerg Schilling * cdrecord.c 1.240 -format & BOOL gracedone neu Mon Apr 21 15:23:22 2003 Joerg Schilling * cdrecord.h 1.145 * scsi_cdr.c 1.132 request_sense_b()/reserve_tr_rzone() neu Mon Apr 21 14:22:51 2003 Joerg Schilling * cdrecord.c 1.239 Umbau auf gracewait() Sun Apr 20 16:26:57 2003 Joerg Schilling * scsi_mmc.c 1.5 get_format_capacities() neu Sun Apr 20 16:22:26 2003 Joerg Schilling * drv_mmc.c 1.141 read_track_info() mit erweiterten Parametern (Type) -> TI_TYPE_TRACK Sun Apr 20 16:21:22 2003 Joerg Schilling * scsi_cdr.c 1.131 read_track_info() mit erweiterten Parametern (Type), read_rzone_info() aus drv_dvd.c durch read_track_info() Sun Apr 20 16:20:40 2003 Joerg Schilling * cdrecord.h 1.144 F_FORMAT neu, WM_FORMAT neu, DSF_DVD_PLUS_R/DSF_DVD_PLUS_RW/DSF_NEED_FORMAT neu read_track_info() mit erweiterten Parametern (Type), read_rzone_info() aus drv_dvd.c durch read_track_info() get_format_capacities()/read_format_capacities() neu Sun Apr 20 15:52:45 2003 Joerg Schilling * scsimmc.h 1.9 struct disk_info um dbit & bg_format_stat erweitert Sun Apr 20 15:13:25 2003 Joerg Schilling * scsireg.h 1.29 struct scsi_format_header um immed/tryout/ipattern Bits erweitert struct scsi_format_cap_header neu struct scsi_format_cap_desc neu struct scsi_cap_data neu Sun Apr 20 15:04:56 2003 Joerg Schilling * scsicdb.h 2.18 NACA Bit im Control Byte neu Fri Apr 18 16:53:04 2003 Joerg Schilling * drv_dvd.c 1.106 * drv_mmc.c 1.140 * cdrecord.h 1.143 * scsi_cdr.c 1.130 read_dvd_structure() nun mit addr und layer Parameter Fri Apr 18 16:51:11 2003 Joerg Schilling * scsi_mmc.c 1.4 Unbenutze & Uninitialisierte Variablen beseitigt Thu Apr 17 23:13:07 2003 Joerg Schilling * cdr_drv.c 1.34 DVD+ Treiber neu Thu Apr 17 23:09:29 2003 Joerg Schilling * drv_mmc.c 1.139 Treibertexte besser eingerueckt Umleitung auf DVD+ Treiber bei DVD+ Medium Aufruf der dp->cdr_identify(scgp, dp, scgp->inq) Routine bei Weiterleitung auf DVD Treiber Thu Apr 17 09:45:56 2003 Joerg Schilling * drv_sony.c 1.69 * drv_philips.c 1.67 * cdr_drv.c 1.33 * cdrecord.h 1.142 * drv_simul.c 1.46 * drv_dvd.c 1.105 * drv_jvc.c 1.79 * drv_7501.c 1.14 * drv_mmc.c 1.138 cdr_format() Funktion neu Thu Apr 17 02:32:05 2003 Joerg Schilling * drv_mmc.c 1.137 load_media() fuer get_curprofile() im Silent Mode, wenn es ein CD Brenner ist dann wird nicht der CD-ROM Treiber returniert Thu Apr 17 01:10:51 2003 Joerg Schilling * drv_mmc.c 1.136 SCSI-3/MMC-3 medien Tests neu um DVD+ zu erkennen Thu Apr 17 00:04:06 2003 Joerg Schilling * scsi_mmc.c 1.3 Vermeiden von pname(profile) ohne #defne DRV_DVD Wed Apr 16 23:40:46 2003 Joerg Schilling * drv_mmc.c 1.135 mmc_getval() weiter nach hinten - nach Korrektur der Inquiry Daten fuer ATAPI Wed Apr 16 22:49:41 2003 Joerg Schilling * drv_mmc.c 1.134 Treiber ID Text (Kommentar) verbessert Wed Apr 16 22:42:59 2003 Joerg Schilling * drv_sony.c 1.68 Cue sheet Option auf 3 setzen Wed Apr 16 22:40:00 2003 Joerg Schilling * cdrecord.1 1.75 Hinweis auf mkisofs -print-size bei SAO/RAW Wed Apr 16 22:28:03 2003 Joerg Schilling * cdr_drv.c 1.32 SCSI-3/mmc-3 Support fuer DVD + DDCD Erkennung mit get_proflist() Wed Apr 16 22:25:56 2003 Joerg Schilling * scsimmc.h 1.8 struct rzone_info um lra_v erweitert struct mmc_performance_header / struct mmc_performance / struct mmc_exceptions / struct mmc_write_speed / struct mmc_streaming neu Wed Apr 16 22:01:14 2003 Joerg Schilling * cdrecord.h 1.141 get_proflist()/get_wproflist() aus scsi_mmc.c neu Wed Apr 16 22:00:33 2003 Joerg Schilling * scsi_mmc.c 1.2 get_conflen()/get_profiles()/get_proflist()/get_wproflist() neu Wed Apr 16 00:49:27 2003 Joerg Schilling * drv_mmc.c 1.133 get_speeds_plextor() komplett in die Statistik Funktion verlagert Wed Apr 16 00:28:09 2003 Joerg Schilling * scsi_mmc.c 1.1 date and time created 03/04/15 23:28:09 by joerg Wed Apr 16 00:28:00 2003 Joerg Schilling * cdrecord.h 1.140 scsi_mmc.c Definitionen neu Wed Apr 16 00:12:54 2003 Joerg Schilling * drv_mmc.c 1.132 Trebertabellen aufgeraeumt Tue Apr 15 18:57:54 2003 Joerg Schilling * cdrecord.h 1.139 track_base(tp) Makro repariert (tp)->track statt (tp)->trackno Tue Apr 15 10:01:43 2003 Joerg Schilling * drv_dvd.c 1.104 TAO Fake beseitigt Sun Apr 13 21:54:15 2003 Joerg Schilling * drv_sony.c 1.67 #include timedefs.h fehlte Sun Apr 13 18:54:27 2003 Joerg Schilling * drv_sony.c 1.66 Erste SAO Implementierung (ohne MCN/ISRC/multi-session) Sun Apr 13 17:15:15 2003 Joerg Schilling * drv_dvd.c 1.103 * drv_simul.c 1.45 * drv_jvc.c 1.78 * drv_mmc.c 1.131 * drv_7501.c 1.13 * cdrecord.c 1.238 * cdrecord.h 1.138 * drv_philips.c 1.66 cdr_abort_session() neu Sun Apr 13 17:10:44 2003 Joerg Schilling * drv_mmc.c 1.130 "Selected write speed:" -> "Last selected write speed:" Sun Apr 13 13:59:26 2003 Joerg Schilling * scsi_cdr.c 1.129 Intelligenteres scsi_load() kennt nun CDR_CADDYLOAD Sun Apr 13 13:54:27 2003 Joerg Schilling * drv_philips.c 1.65 Yamaha CDR-100 nun mit scsi_load() Sun Apr 13 13:36:00 2003 Joerg Schilling * cdrecord.c 1.237 Version -> 2.01a10, Neue Funktion print_drflags() Sun Apr 13 13:35:26 2003 Joerg Schilling * cdrecord.h 1.137 Kommentar verbessert Sun Apr 13 12:28:01 2003 Joerg Schilling * cdrecord.c 1.236 * scsi_cdr.c 1.128 scsi_load()/scsi_unload() nun mit korrektem Return Wert (int statt BOOL) und Auswertung des Return Wertes in load_media()/unload_media() Fri Apr 11 15:31:30 2003 Joerg Schilling * drv_mmc.c 1.129 * drv_7501.c 1.12 (*dp->cdr_gen_cue)() Aufruf nun ueber Pointer Fri Apr 11 15:27:44 2003 Joerg Schilling * drv_dvd.c 1.102 * drv_simul.c 1.44 * drv_mmc.c 1.128 * cdr_drv.c 1.31 * cdrecord.h 1.136 * drv_7501.c 1.11 (*dp->cdr_send_cue)() nun mit cdr_t * Parameter Fri Apr 11 15:18:57 2003 Joerg Schilling * drv_7501.c 1.10 * drv_simul.c 1.43 * drv_philips.c 1.64 * drv_dvd.c 1.101 * drv_mmc.c 1.127 * drv_sony.c 1.65 * drv_jvc.c 1.77 * cdrecord.h 1.135 * cdrecord.c 1.235 Neue Funktion (*cdr_gen_cue)() Fri Apr 11 01:25:58 2003 Joerg Schilling * drv_mmc.c 1.126 get_speeds_plextor() nun mit 3 int * Parametern, Ausgabe der Maximalen Brenngeschwindigkeit in stats_mmc() Fri Apr 11 00:53:30 2003 Joerg Schilling * cdrecord.c 1.234 * cdrecord.h 1.134 is_sao() & TI_SAO neu, checktsize() ueberprueft nun ob ein Track mit unbekannter Laenge in SAO/RAW mode vorhanden ist und bricht ab Thu Apr 10 21:18:42 2003 Joerg Schilling * drv_philips.c 1.63 * drv_simul.c 1.42 * drv_7501.c 1.9 * cdr_drv.c 1.30 * cdrecord.h 1.133 * drv_jvc.c 1.76 * drv_dvd.c 1.100 * drv_sony.c 1.64 * scsi_cdr.c 1.127 * drv_mmc.c 1.125 * cdrecord.c 1.233 cdr_check_recovery()/cdr_recover()/cdr_close_session() nun mit cdr_t * Parameter Thu Apr 10 19:19:22 2003 Joerg Schilling * cdrecord.h 1.132 Kommentar eingerueckt Thu Apr 10 19:15:16 2003 Joerg Schilling * cdrecord.c 1.232 * cdrecord.h 1.131 * drv_sony.c 1.63 * drv_simul.c 1.41 * drv_philips.c 1.62 * drv_mmc.c 1.124 * drv_7501.c 1.8 * drv_jvc.c 1.75 * drv_dvd.c 1.99 cdr_init() neu, cdr_speed_select() nun ohne "dummy" Parameter Thu Apr 10 15:32:14 2003 Joerg Schilling * drv_mmc.c 1.123 get_speeds_plextor() neu Sun Apr 6 15:49:07 2003 Joerg Schilling * cdrecord.1 1.74 Neue driveropts= speedread/singlesession/hidecdr Sun Apr 6 15:48:07 2003 Joerg Schilling * cdrecord.c 1.231 (*dp->cdr_set_speed_dummy)() Aufruf bei -setdropts zwischen cdr_opt1() und cdr_opt2() Sun Apr 6 15:45:45 2003 Joerg Schilling * drv_mmc.c 1.122 Support fuer Plextor PowerRec, SpeedReeed, SongleSession, HideCDR Sun Apr 6 02:19:35 2003 Joerg Schilling * cdrecord.c 1.230 * cdrecord.h 1.130 #defines und Auswertung fuer CDR_SINGLESESS/CDR_HIDE_CDR/CDR_SPEEDREAD neu Sat Apr 5 22:35:50 2003 Joerg Schilling * cdrecord.h 1.129 * cdrecord.c 1.229 * cdrecord.1 1.73 Neue Option -setdropts Sat Apr 5 20:51:06 2003 Joerg Schilling * drv_mmc.c 1.121 mmc_load/mmc_unload() auskommentiert Sat Apr 5 20:46:51 2003 Joerg Schilling * drv_mmc.c 1.120 opt2_mmc() neu und Kode aus open_session_mmc() dorthin bewegt Sat Apr 5 20:43:36 2003 Joerg Schilling * scsi_cdr.c 1.126 * cdrecord.c 1.228 Bessere Buffer underrun Erkennung und Beschreibung Sat Apr 5 15:49:22 2003 Joerg Schilling * drv_sony.c 1.62 * drv_mmc.c 1.119 * drv_simul.c 1.40 * drv_7501.c 1.7 * cdrecord.c 1.227 * drv_philips.c 1.61 * drv_jvc.c 1.74 * cdrecord.h 1.128 * drv_dvd.c 1.97 (*dp->cdr_opt2)(scgp, dp) neu Sat Apr 5 15:37:12 2003 Joerg Schilling * cdrecord.c 1.226 Buffer Underrun Vorhersage verbessert (kein loeschen am Trackanfang & zusaetzlicher Test auf leres RAM) Sat Apr 5 01:42:33 2003 Joerg Schilling * drv_mmc.c 1.118 Read Burn Proof Counter fuer Plextor Fri Apr 4 23:48:28 2003 Joerg Schilling * scsi-unixware.c 1.33 Reset Support neu Fri Apr 4 00:44:59 2003 Joerg Schilling * cdrecord.c 1.225 -packet impliziert nun nicht mehr TAO Fri Apr 4 00:35:13 2003 Joerg Schilling * drv_7501.c 1.6 cw7501__do_cue() nun korrekt LOCAL Fri Apr 4 00:30:05 2003 Joerg Schilling * auinfo.c 1.18 * subchan.c 1.16 trackp->tracktype & TOC_MASK wegen TOCF_DUMMY/TOCF_MULTI Fri Apr 4 00:29:09 2003 Joerg Schilling * drv_sony.c 1.61 * drv_simul.c 1.39 * drv_7501.c 1.5 * drv_philips.c 1.60 * cdrecord.h 1.127 * cdrecord.c 1.224 * drv_mmc.c 1.117 * drv_jvc.c 1.73 * drv_dvd.c 1.96 cdr_open_session()/cdr_fixate() ohne multi/dummy Parameter -> track[0].tracktype Thu Apr 3 22:49:10 2003 Joerg Schilling * drv_jvc.c 1.72 * drv_dvd.c 1.95 * wm_packet.c 1.21 * cdrecord.c 1.223 Casting wegen Signed/Unsigned Arithmetik bei ANSI C Thu Apr 3 22:32:30 2003 Joerg Schilling * drv_sony.c 1.60 * drv_7501.c 1.4 * drv_simul.c 1.38 * drv_dvd.c 1.94 * drv_philips.c 1.59 * drv_mmc.c 1.116 * drv_jvc.c 1.71 * cdrecord.c 1.222 * cdrecord.h 1.126 cdr_open_session()/cdr_fixate() Treiberinterface nun ohne toctype Parameter -> trackp[0]->tracktype Thu Apr 3 20:51:34 2003 Joerg Schilling * fifo.c 1.43 int -> Uint wegen Ansi C Vergleich Thu Apr 3 20:46:46 2003 Joerg Schilling * clone.c 1.6 first/last int -> Uint wegen Ansi C Vergleich Thu Apr 3 20:42:01 2003 Joerg Schilling * subchan.c 1.15 j int -> Uint wegen Ansi C Vergleich Thu Apr 3 18:16:00 2003 Joerg Schilling * cdrecord.c 1.221 Neue Option -lock prtimediff() -> misc.c Version -> 2.01a09 Thu Apr 3 18:15:00 2003 Joerg Schilling * cdrecord.1 1.72 Neue Option -lock Thu Apr 3 18:14:43 2003 Joerg Schilling * misc.c 1.3 prtimediff() aus cdrecord.c neu Thu Apr 3 18:14:05 2003 Joerg Schilling * drv_mmc.c 1.115 int/Uint Vergleiche gecastet test auf tracksize < 0 vor do_cue() Versuch zu erreichen dasz is_packet(trackp) nicht mehr is_tao(trackp) impliziert Thu Apr 3 18:11:45 2003 Joerg Schilling * cdrecord.h 1.125 F_DLCK & prtimediff() neu Thu Apr 3 18:11:22 2003 Joerg Schilling * drv_7501.c 1.3 Support fuer SAO neu Sun Mar 30 22:16:25 2003 Joerg Schilling * drv_7501.c 1.2 Schreibsupport fuer TAO Sun Mar 30 13:50:02 2003 Joerg Schilling * cdrecord.c 1.220 * drv_mmc.c 1.114 Eingerueckt nach cstyle Sat Mar 29 20:27:16 2003 Joerg Schilling * scsi-unixware.c 1.32 Auswertung von scbp->sc_comp_code und Setzten von sp->error Thu Mar 27 12:11:17 2003 Joerg Schilling * readcd.c 1.54 meshpoints=# Option neu Thu Mar 27 01:15:30 2003 Joerg Schilling * cdrecord.c 1.219 2002 -> 2003 Thu Mar 27 01:03:48 2003 Joerg Schilling * cdr_drv.c 1.29 cw7501 neu Thu Mar 27 01:02:47 2003 Joerg Schilling * drv_7501.c 1.1 date and time created 03/03/27 01:02:47 by joerg Thu Mar 27 00:53:40 2003 Joerg Schilling * cdrecord.c 1.218 Version -> 2.01a07, Unterdrueckung von "Warning: blockdesc secsize %d differs from cap secsize %d\n" wenn scgp->cap->c_bsize == 0 Thu Mar 27 00:45:34 2003 Joerg Schilling * cdrecord.h 1.124 Eingerueckt nach cstyle Thu Mar 27 00:43:06 2003 Joerg Schilling * drv_mmc.c 1.113 mmc_load()/mmc_unload() mit 2. Parameter cdr_t * Tue Mar 25 18:48:41 2003 Joerg Schilling * scsi-qnx.c 1.2 sccsid -> __sccsid Mon Mar 24 23:25:04 2003 Joerg Schilling * cdrecord.c 1.217 Version -> 2.01a06, Handler fuer SGIHUP/SIGTERM, cdr_underrun() neu Mon Mar 24 23:23:38 2003 Joerg Schilling * scsi_cdr.c 1.125 * cdrecord.h 1.123 cdr_underrun() neu Mon Mar 24 13:01:28 2003 Joerg Schilling * scsi-unixware.c 1.31 Beseitigung von fdesc[MAX_SCG][MAX_TGT][MAX_LUN] und Verkleinerung von sdidevs[scg][tgt][lun] Nun kann wirklich scg_open() mehrmals aufgerufen werden. Sun Mar 23 21:10:45 2003 Joerg Schilling * scsi-unixware.c 1.30 valid/atapi/initiator -> flags mit SDI_* Bit #defines Sun Mar 23 17:33:07 2003 Joerg Schilling * scsi-unixware.c 1.29 Besseres Verhalten fuer scgcheck Sun Mar 23 15:14:23 2003 Joerg Schilling * scsi-unixware.c 1.28 Eingerueckt wegen cstyle(1) Sun Mar 23 14:12:01 2003 Joerg Schilling * scsihack.c 1.42 Support fuer QNX neu Sun Mar 23 14:11:14 2003 Joerg Schilling * scsi-qnx.c 1.1 date and time created 03/03/23 14:11:14 by joerg Thu Mar 6 16:39:42 2003 Joerg Schilling * fifo.c 1.42 faio_wait_on_buffer() mit Prototype implementierung wegen SCO cc Thu Mar 6 16:27:52 2003 Joerg Schilling * cdrecord.1 1.71 Beschreibung fuer -xa1 -xa2, ... berichtigt Fri Feb 7 12:34:37 2003 Joerg Schilling * cdrecord.1 1.70 Schreibfehler beseitigt Sun Feb 2 14:13:07 2003 Joerg Schilling * scsi-remote.c 1.12 Umgestellt, damit es auch ohne rcmd() geht Tue Jan 28 01:19:39 2003 Joerg Schilling * drv_mmc.c 1.112 Workaround fuer LG TAO Audio Formware bug: audio_pause_len = 150 Tue Jan 7 14:09:28 2003 Joerg Schilling * scsi_cdr.c 1.124 Ausgabe Save/Set Modepages auch auf stderr wie Rest der Zeile Tue Jan 7 14:08:43 2003 Joerg Schilling * drv_mmc.c 1.111 set_mode_params() ist BOOL, daher ist Abfrage auf < 0 falsch Tue Dec 24 16:28:38 2002 Joerg Schilling * cdrecord.1 1.69 Version -> 2.0 Tue Dec 24 14:16:34 2002 Joerg Schilling * cdrecord.c 1.216 Mail Adresse -> schilling@fokus.fhg.de Vermeidung von "Cannot write CD's >= 100 minutes.\n" bei DVDs Mon Dec 16 22:26:39 2002 Joerg Schilling * cdrecord.1 1.68 Mailing Lists geupdated, Hinweis auf cddb= bei den cdda2wav Beispielen *************** Release 2.0 ******************* Sat Nov 30 17:43:51 2002 Joerg Schilling * readcd.c 1.53 * cdrecord.c 1.215 Version -> 2.0 Sat Nov 30 16:11:27 2002 Joerg Schilling * cdrecord.c 1.214 DVD-Pro Check for Tracksize-known only if ntracks > 0 Sat Nov 30 13:01:27 2002 Joerg Schilling * drv_mmc.c 1.110 Allow Medium removal after load Media for DVD/CD recognition as drecord -checkdrive would otherwise lock the tray if it has been open before Sat Nov 30 12:55:17 2002 Joerg Schilling * scsi-osf.c 1.25 Debug output with SCSI Status Byte Fri Nov 22 17:55:41 2002 Joerg Schilling * cdrecord.1 1.67 RSH= und RSCSI= documented for ssh(1) RSCSI Fri Nov 22 17:40:35 2002 Joerg Schilling * scsi-remote.c 1.11 Support for non-root rcmd() and ssh(2) Fri Nov 22 17:35:54 2002 Joerg Schilling * fifo.c 1.41 AmigaOS Support with ix_vfork()/ix_vfork_resume() and separate var buf_idx_reader for vfork() Thu Nov 21 22:28:57 2002 Joerg Schilling * cdrecord.c 1.213 New Option minbuf= Thu Nov 21 22:23:10 2002 Joerg Schilling * cdrecord.1 1.66 minbuf= Option new Tue Nov 19 19:13:34 2002 Joerg Schilling * scsiopen.c 1.93 Fix for Coredump with dev=/dev/rsr1c:@,0 Sun Nov 10 19:18:04 2002 Joerg Schilling * diskid.c 1.36 Orange Forum Embargo Warning only if mp->msf_min == 97 for DVDs Mon Nov 4 18:12:16 2002 Joerg Schilling * fifo.c 1.40 close(f) /dev/zero oly if /dev/zero has been opened Sun Nov 3 16:32:52 2002 Joerg Schilling * scsi_cdr.c 1.123 * cdrecord.h 1.122 write_xscsi()/seek_scsi()/seek_g0()/seek_g1() new Sat Nov 2 22:11:55 2002 Joerg Schilling * cdrecord.c 1.212 Version -> 1.11a40, _POSIX_MEMLOCK/_POSIX_PRIORITY_SCHEDULING Test POSIX 2001 conformant Sun Oct 27 15:19:29 2002 Joerg Schilling * cdrecord.c 1.211 New Wait Feature free the IDE Busses if Source&Destination are on the same cable (use -immed) Sun Oct 27 14:57:11 2002 Joerg Schilling * cdrecord.1 1.65 New Wait (usleep) Feature for -immed documented Sun Oct 27 14:42:36 2002 Joerg Schilling * cdrecord.h 1.121 New Flag RF_WR_WAIT to actively free the IDE Busses via usleep() Sun Oct 27 02:26:26 2002 Joerg Schilling * cdrecord.c 1.210 * wm_packet.c 1.20 * drv_jvc.c 1.70 Change from trackp->padsize ->trackp->padsecs Sun Oct 27 02:02:38 2002 Joerg Schilling * cdrecord.h 1.120 Change from trackp->padsize ->trackp->padsecs New Sektor based Makros Sminutes(s)/Sseconds(s)/Shseconds(s)/Sframes(s) Sun Oct 27 01:20:58 2002 Joerg Schilling * cdrecord.1 1.64 Better docukmentation for padsize= Sat Oct 26 23:13:47 2002 Joerg Schilling * scsi_cdr.c 1.122 Text Generic mmc2 DVD -> Generic mmc2 DVD-R/DVD-RW Sat Oct 26 20:21:15 2002 Joerg Schilling * wm_packet.c 1.19 Support printing the fill ratio of the drive buffer and the actual write speed Fri Oct 25 15:06:33 2002 Joerg Schilling * drv_mmc.c 1.109 ATIP printinf for speed better -> %2d (reserved val %2d) Fri Oct 25 15:05:21 2002 Joerg Schilling * cdrecord.c 1.209 pad_track() now shows Drive buffer fill% and speed Verbose prinrting for write_track_data() and pad_track() unified Fri Oct 25 00:49:04 2002 Joerg Schilling * cdrecord.c 1.208 Warning for cdrecord blank=fast if drive does not like -> Try cdrecord blank=all write_track_data() now computes trackp->isecsize from trackp->isecsize to trackp->secsize Fri Oct 25 00:18:19 2002 Joerg Schilling * drv_mmc.c 1.108 BURN-Free was not used -> BURN-Free was never needed Fri Oct 25 00:06:12 2002 Joerg Schilling * drv_mmc.c 1.107 Test for 0xFF:0xFF/0xFF with dsp->ds_maxblocks == 716730 -> dsp->ds_maxblocks == 1166730 because we now use forceposivive in msf_to_lba() Thu Oct 24 23:47:23 2002 Joerg Schilling * drv_mmc.c 1.106 di_to_dstat() now always sets dsp->ds_first_leadin to allow 2. setting for Yamaha AudioMaster Wed Oct 23 22:46:02 2002 Joerg Schilling * cdrecord.c 1.207 Version -> 1.11a39, Only cdrecord dev=help calls scg_help() no automatic printing if scg_open() fails Wed Oct 23 22:40:41 2002 Joerg Schilling * cdrecord.1 1.63 Many changes tp prepare for 2.0 Wed Oct 23 22:21:46 2002 Joerg Schilling * scsi-linux-ata.c 1.4 Workaround for Linux Kernel design bug: CDROM_SEND_PACKET stes errno to EINVAL if Sense Key is "Invalid Command" Mon Oct 21 19:20:33 2002 Joerg Schilling * scsi-linux-sg.c 1.75 /dev/sg* read loop again with 1000 loops but only if 'f' is a RAW device Typo fixed Sun Oct 20 15:28:58 2002 Joerg Schilling * scsi-linux-sg.c 1.74 sg_clearnblock() new to alow to clear O_NONBLOCK directly after open(.., ...|O_NONBLOCK) Sat Oct 19 22:04:23 2002 Joerg Schilling * cdrecord.c 1.206 Version -> 1.11a38, Support for libscg Help Sat Oct 19 21:28:22 2002 Joerg Schilling * scsiopen.c 1.92 * scsihack.c 1.41 scg_help() Funktion new Sat Oct 19 21:27:21 2002 Joerg Schilling * scsitransp.c 1.85 Version -> 0.7 Sat Oct 19 21:26:25 2002 Joerg Schilling * scsi-wnt.c 1.29 * scsi-vms.c 1.32 * scsi-unixware.c 1.27 * scsi-sun.c 1.76 * scsi-sgi.c 1.35 * scsi-remote.c 1.10 * scsi-osf.c 1.24 * scsi-os2.c 1.22 * scsi-openserver.c 1.30 * scsi-next.c 1.31 * scsi-mac-iokit.c 1.4 * scsi-linux-sg.c 1.73 * scsi-linux-pg.c 1.42 * scsi-linux-ata.c 1.3 * scsi-hpux.c 1.30 * scsi-bsd.c 1.41 * scsi-bsd-os.c 1.27 * scsi-beos.c 1.21 * scsi-apollo.c 1.4 * scsi-amigaos.c 1.3 * scsi-aix.c 1.35 scgo_help() Funktion new Sat Oct 19 19:14:05 2002 Joerg Schilling * scsitransp.h 1.53 Parameter tcomment new in __scg_help() Sat Oct 19 14:02:47 2002 Joerg Schilling * scsitransp.h 1.52 Help functions new Fri Oct 18 17:25:31 2002 Joerg Schilling * scsi-linux-sg.c 1.72 Modified Cleanup read() loop in sg_initdev() by request from Linus Torvalds Fri Oct 18 17:20:00 2002 Joerg Schilling * scsi-sun.c 1.75 open Warnung von error() auf js_fprintf((FILE *)scgp->errfile umgestellt Fri Oct 18 17:16:48 2002 Joerg Schilling * scsiopen.c 1.91 * scsi-linux-ata.c 1.2 * scsi-sun.c 1.74 Allow unified dev=ATAPI, dev=ATAPI:, dev=USCSI, dev=USCSI: Sun Oct 13 21:40:59 2002 Joerg Schilling * scsi-linux-sg.c 1.71 open(name, 2) -> O_RDWR.... sg_initdev() with better loop to read possible rests from driver (requested by Linus Torvalds) Sun Oct 13 21:23:54 2002 Joerg Schilling * scsi-sun.c 1.73 * scsi-linux-pg.c 1.41 open(name, 2) -> O_RDWR.... Sat Oct 12 13:53:52 2002 Joerg Schilling * sector.c 1.11 Initialize Testsector in encspeed() to make resulting speed independent from junk on the stack Thu Oct 10 23:43:33 2002 Joerg Schilling * cdrecord.c 1.205 Change wording from DAO -> SAO Wed Oct 9 19:36:09 2002 Joerg Schilling * scsireg.h 1.28 New device types for Inquiry Wed Oct 9 19:35:44 2002 Joerg Schilling * scsitransp.c 1.84 scg_fprintdev() New device types for Inquiry Tue Oct 8 00:57:50 2002 Joerg Schilling * scsi-unixware.c 1.26 Handle EBUSY for multiple opens Mon Oct 7 22:19:15 2002 Joerg Schilling * sector.c 1.10 * cdrecord.h 1.119 * cdrecord.c 1.204 Verbose printing of the LEC encoding speed -> encspeed() Sat Oct 5 22:07:27 2002 Joerg Schilling * cdrecord.c 1.203 call cdr_buffer_cap() in Silent mode to make sure buggy drives (CW-7585) will not print constantly error messages Sat Oct 5 18:07:46 2002 Joerg Schilling * scsi-linux-ata.c 1.1 date and time created 02/10/05 17:07:46 by joerg Sat Oct 5 17:48:27 2002 Joerg Schilling * scsi-linux-sg.c 1.70 Support for CDROM_SEND_PACKET in scsi-linux-ata.c new SCSI Timeout now may be distinguished from SCSI selection Timeout by implementing a workarounf for a Linux kernel bug Sat Oct 5 00:02:52 2002 Joerg Schilling * scsi-sun.c 1.72 Do not open all /dev/scg* devices if not in SCAN mode ENXIO for USCSI means selection Timeout Fri Oct 4 23:59:05 2002 Joerg Schilling * scsi-vms.c 1.31 Warn for missing Scanbus, up to 26 IDE Controller from Chip.Dancy@hp.com Wed Oct 2 21:44:22 2002 Joerg Schilling * cdrecord.c 1.202 Version -> 1.11a36, #ifdef HAVE_LIB_EDC_ECC to allow compilation without libedc Wed Oct 2 02:22:32 2002 Joerg Schilling * fifo.c 1.39 Allow again compilation with #undef FIFO Wed Oct 2 00:54:52 2002 Joerg Schilling * scsiopen.c 1.90 replace comma by semikolon Wed Oct 2 00:48:49 2002 Joerg Schilling * scsi-vms.c 1.30 gk_chan is Unsigned but there was a comparison <= 0 scsi status scsi_sts now correct for ATAPI Sat Sep 28 20:36:58 2002 Joerg Schilling * drv_mmc.c 1.105 deflt_writemodes_mmc() now with fallback to SAO if TAO is not supported Sat Sep 28 14:53:33 2002 Joerg Schilling * cdrecord.c 1.201 -force Wirkung auf RAW Speed nur noch bis maximal das was eine CPU kann Neue environment Variable "CDR_FORCERAWSPEED" Sat Sep 28 14:46:54 2002 Joerg Schilling * sector.c 1.9 EDC_SCRAMBLE_NOSWAP #define in old libedc new Fri Sep 27 17:39:00 2002 Joerg Schilling * cdrecord.c 1.200 Limit gracetime to 999, Do not use \b with wait time because seconds may use more than one column Fri Sep 27 16:40:46 2002 Joerg Schilling * drv_simul.c 1.37 DVD max speed -> 1000 Fri Sep 27 14:33:00 2002 Joerg Schilling * cdrecord.c 1.199 Drive current speed/Drive default speed/Drive max speed printing now with lverbose > 1 Hint to Heiko with Encoding speed printing Fri Sep 27 14:30:18 2002 Joerg Schilling * drv_mmc.c 1.104 Max Speed in struct from 370 -> 372, mmc_opthelp()/hasdrvopt()/get_justlink_ricoh() now with EXPORT Bug with dp->cdr_dstat->ds_dr_cur_wspeed fixed, set dp->cdr_speeddef/dp->cdr_speedmax from drive values Fri Sep 27 14:28:27 2002 Joerg Schilling * drv_dvd.c 1.89 Change to use new driveropts= method from drv_mmc.c Fri Sep 27 14:25:18 2002 Joerg Schilling * drv_simul.c 1.36 Max Speed for CD from 370 -> 372 Thu Sep 26 03:06:39 2002 Joerg Schilling * scsi_cdr.c 1.121 scsi_load()scsi_unload() now may be called with cdr_t * 0 Wed Sep 25 18:05:41 2002 Joerg Schilling * drv_mmc.c 1.103 scsi_blank()/scsi_close_tr_session()/scsi_flush_cache() with immed Flag Wed Sep 25 16:12:10 2002 Joerg Schilling * cdrecord.h 1.117 * cdrecord.c 1.198 * drv_simul.c 1.35 * drv_philips.c 1.58 * scsi_cdr.c 1.120 * drv_dvd.c 1.88 start/stop, load/unload, flush_cache with immed Parameter Wed Sep 25 14:22:26 2002 Joerg Schilling * drv_jvc.c 1.69 * drv_dvd.c 1.87 * drv_mmc.c 1.102 * cdr_drv.c 1.28 * cdrecord.c 1.197 * cdrecord.h 1.116 blank() driver function now weith cdr_t * parameter for F_IMMED Wed Sep 25 13:52:12 2002 Joerg Schilling * cdrecord.c 1.196 -immed new Wed Sep 25 13:51:28 2002 Joerg Schilling * cdrecord.c 1.195 F_DVD -> TI_DVD (was wrong) Wed Sep 25 13:13:11 2002 Joerg Schilling * cdrecord.h 1.115 F_DVD -> TI_DVD (was wrong), F_IMMED new Wed Sep 25 00:38:52 2002 Joerg Schilling * cdrecord.c 1.194 * cdrecord.h 1.114 * drv_sony.c 1.59 * drv_simul.c 1.34 * drv_philips.c 1.57 * drv_mmc.c 1.101 * drv_jvc.c 1.68 * drv_dvd.c 1.86 close_track()/fixate() enhanced by cdr_t * Parameter Tue Sep 24 21:28:33 2002 Joerg Schilling * drv_mmc.c 1.100 mmc_set_speed() new to allow drives that don't like speed=1 Tue Sep 24 18:40:42 2002 Joerg Schilling * cdrecord.c 1.193 Version -> 1.11a35, Do not print Zeit/speed Statistics if writing did not yet start Tue Sep 24 18:36:56 2002 Joerg Schilling * scsi_cdr.c 1.119 Modify speed printing to include CD/DVD Speed Mon Sep 23 15:42:22 2002 Joerg Schilling * drv_simul.c 1.33 Simulate Next Writable Address (for TAO) Mon Sep 23 15:39:22 2002 Joerg Schilling * cdrecord.c 1.192 Move Comment out of #ifdef DRV_DVD Mon Sep 23 15:17:56 2002 Joerg Schilling * cdrecord.c 1.191 Fix Pregap handling for DVD (no 150 Sektors per Track) Sun Sep 22 01:35:18 2002 Joerg Schilling * cdrecord.h 1.113 F_DVD new Sun Sep 22 00:11:57 2002 Joerg Schilling * drv_dvd.c 1.85 Set DVD Flag in driverstructure because it is now used Sat Sep 21 23:59:25 2002 Joerg Schilling * drv_simul.c 1.32 Set DVD Flags, calculate DVD speed correctly, correct real time spend in usleep() Sat Sep 21 01:33:16 2002 Joerg Schilling * cdrecord.c 1.190 Version -> 1.11a34, Late check for tracks == 0 only if -fix was not used Fri Sep 20 01:58:54 2002 Joerg Schilling * auinfo.c 1.17 -auinfo should be superceede -scms / -copy Thu Sep 12 17:16:35 2002 Joerg Schilling * cdrecord.c 1.189 Statistics order new and better, Print new statistics even on abort Thu Sep 12 17:03:42 2002 Joerg Schilling * cdrecord.h 1.112 New Flags RF_DID_STAT/RF_DID_CDRSTAT Thu Sep 12 16:42:57 2002 Joerg Schilling * drv_philips.c 1.56 Modified -> reload_media() Thu Sep 12 15:52:20 2002 Joerg Schilling * drv_mmc.c 1.99 cdr_dstat->ds_dr_max_rspeed/cdr_dstat->ds_dr_cur_rspeed neu cdr_dstat->ds_dr_max_speed/cdr_dstat->ds_dr_cur_speed -> cdr_dstat->ds_dr_max_wspeed/cdr_dstat->ds_dr_cur_wspeed scsi_set_speed() with MMC-3 rotctl Parameter Thu Sep 12 15:47:01 2002 Joerg Schilling * cdrecord.c 1.188 Version -> 1.11a33, ds_dr_max_speed -> ds_dr_max_wspeed Thu Sep 12 15:43:36 2002 Joerg Schilling * drv_dvd.c 1.84 * scsi_cdr.c 1.118 * cdrecord.h 1.111 scsi_set_speed() mit MMC-3 rotctl Parameter Thu Sep 12 14:37:26 2002 Joerg Schilling * drv_mmc.c 1.98 dsp->ds_flags with DSF_HIGHSP_ERA / DSF_ULTRASP_ERA New Speed Tabels for HS and UHS RW media atip_printspeed() new Print A1 ATIP Werte also in hex Modify ATIP printout for UHS CD-RW Thu Sep 12 13:34:49 2002 Joerg Schilling * cdrecord.c 1.187 Driveropts print MMC,MMC-2,MMC-3 -force now allows to write faster data in -raw Data Checks for Ultra High speed CD-RW for old writers Do not print average write speed if data size is unknown Thu Sep 12 13:27:10 2002 Joerg Schilling * scsi_cdr.c 1.117 Enhancements for MMC-2 & MMC-3 in -prcap (mode Page 2A) Wed Sep 11 21:23:48 2002 Joerg Schilling * scsireg.h 1.27 MMC-2 & MMC-3 enhancements for Mode Page 2A Wed Sep 11 20:47:35 2002 Joerg Schilling * cdrecord.h 1.110 CDR_MMC/CDR_MMC2/CDR_MMC3 new Wed Sep 11 15:13:20 2002 Joerg Schilling * subchan.c 1.14 end = 0 for useless GCC Warning 'end' might be uninitialized Wed Sep 11 15:01:55 2002 Joerg Schilling * cdrecord.h 1.109 trackp->dataoff/tracks/track/trackno -> Uchar DSF_HIGHSP_ERA & DSF_ULTRASP_ERA new CDR_ALLOC without top Bit for GCC Warning Wed Sep 11 14:59:46 2002 Joerg Schilling * drv_dvd.c 1.83 * auinfo.c 1.16 Cast for trackp->track* -> Uchar Wed Sep 11 14:59:07 2002 Joerg Schilling * drv_sony.c 1.58 Constant 0xFFFFFFFF with #ifdef for K&R/ANSI Sun Sep 1 23:43:15 2002 Joerg Schilling * cdrecord.c 1.186 Print minimal Drive Buffer fill ratio Sun Sep 1 23:42:39 2002 Joerg Schilling * drv_mmc.c 1.97 DiskT@2 Support new Sun Sep 1 23:33:34 2002 Joerg Schilling * cdrecord.h 1.108 Several new ds_* Vars for better Statistics Sun Sep 1 21:27:35 2002 Joerg Schilling * cdrecord.c 1.185 cdrstats() now guesses Buffer underruns and prints average write speed Sun Sep 1 17:42:59 2002 Joerg Schilling * drv_mmc.c 1.96 cdr_stats() Function new speed_select_mmc() with 2nd Parameter dp for FORCESPEED driveropts=foesecpeed new driveropts=tattooinfo new driveropts=tattoofile=name new hasdrvopt() fixed: missing break nach past recognised Option Sun Sep 1 16:50:22 2002 Joerg Schilling * cdrecord.c 1.184 Buffer Cap print every 1 MB Fri Aug 30 13:57:26 2002 Joerg Schilling * cdrecord.c 1.183 Version -> 1.11a32, CDR_DISKTATTOO new, (*dp->cdr_stats)(scgp, dp); for Burn-Free Statistics Fri Aug 30 13:42:33 2002 Joerg Schilling * cdrecord.h 1.107 New driverinterfacefunction cdr_stats() CDR_DISKTATTOO new Fri Aug 30 13:41:21 2002 Joerg Schilling * drv_sony.c 1.57 * drv_simul.c 1.31 * drv_philips.c 1.55 * drv_jvc.c 1.67 * drv_dvd.c 1.82 New driverinterfacefunction cdr_stats() Thu Aug 29 21:40:34 2002 Joerg Schilling * drv_sony.c 1.56 * drv_simul.c 1.30 * drv_philips.c 1.54 * drv_jvc.c 1.66 * drv_dvd.c 1.81 * cdrecord.h 1.106 * cdrecord.c 1.182 New Parameter cdr_t *dp for cdr_set_speed_dummy() for "forcespeed" Thu Aug 29 17:12:40 2002 Joerg Schilling * mmcvendor.h 1.2 link_counter is [2]. Mon Aug 26 17:47:17 2002 Joerg Schilling * drv_mmc.c 1.95 Turning... messages -> stdout Mon Aug 26 01:56:39 2002 Joerg Schilling * drv_mmc.c 1.94 JustLink Support new Mon Aug 26 01:22:08 2002 Joerg Schilling * mmcvendor.h 1.1 date and time created 02/08/26 00:22:08 by joerg Tue Aug 20 01:11:19 2002 Joerg Schilling * drv_mmc.c 1.93 mmc_opt1() new Yamaha Audio Master Support new Be more careful with test_write (-dummy) in deflt_writemodes_mmc() Check driveropts= already in attach_mmc() and turn into flags Tue Aug 20 00:06:22 2002 Joerg Schilling * cdrecord.c 1.181 Call dp->cdr_opt1() _before_ set speed/dummy and before the first Size Check Mon Aug 19 02:30:52 2002 Joerg Schilling * cdrecord.c 1.180 Do not clear ds_cdrflags after attach() Mon Aug 19 01:12:18 2002 Joerg Schilling * cdrecord.c 1.179 driveropts=help new in short usage() Mon Aug 19 00:45:49 2002 Joerg Schilling * cdrecord.h 1.105 * drv_dvd.c 1.80 * drv_simul.c 1.29 * drv_jvc.c 1.65 * drv_sony.c 1.55 * drv_philips.c 1.53 cdr_t->cdr_opt1() new Mon Aug 19 00:40:47 2002 Joerg Schilling * cdrecord.c 1.178 dataoff = 16 as Default in autoaudio to allow cdrecord -raw to work without -data Mon Aug 19 00:34:46 2002 Joerg Schilling * cdrecord.c 1.177 Call (*dp->cdr_opt1)(scgp, dp) for Yamaha Audio Master, then 2. Check for size Sat Aug 17 01:13:39 2002 Joerg Schilling * drv_mmc.c 1.92 Yamaha Audio Master recognition, Varirec in driveropts=help, Varirec recognition Sat Aug 17 00:52:44 2002 Joerg Schilling * cdrecord.h 1.104 Calling sequence comment new Sat Aug 17 00:04:28 2002 Joerg Schilling * sector.c 1.8 Max RAW speed in metering raised from 100x -> 1000x Fri Aug 16 02:39:01 2002 Joerg Schilling * cdrecord.c 1.176 * cdrecord.h 1.103 CDR_VARIREC / CDR_AUDIOMASTER / CDR_FORCESPEED new Wed Aug 14 23:43:34 2002 Joerg Schilling * cdrecord.c 1.175 Version -> 1.11a30, Speed test for RAW data sectors Wed Aug 14 20:50:55 2002 Joerg Schilling * defaults.c 1.9 Allow Space as separator in /etc/default/cdrecord Wed Aug 14 01:04:46 2002 Joerg Schilling * cdrecord.h 1.102 * sector.c 1.7 encspeed() new Tue Aug 13 23:45:22 2002 Joerg Schilling * sector.c 1.6 HAVE_LIB_EDC_ECC/HAVE_NEW_LIB_EDC/CLONE_WRITE new Tue Jul 30 00:22:27 2002 Joerg Schilling * cdrecord.c 1.174 Version ->1.11a28, tracksize/secsize ->itracksize/isecsize for debug printf Mon Jul 29 22:22:12 2002 Joerg Schilling * cdrecord.h 1.101 track_base() Macro new, typedef struct ofile ofile_t new Mon Jul 29 21:58:12 2002 Joerg Schilling * subchan.c 1.13 Shift ISRC & MCN by one to the end if the are on an index change Sun Jul 28 23:19:55 2002 Joerg Schilling * drv_simul.c 1.28 Flags with allen possible write modi and with CDR_TRAYLOAD to avoid Sun Jul 28 13:54:08 2002 Joerg Schilling * subchan.c 1.12 better comment Thu Jul 25 03:25:39 2002 Joerg Schilling * subchan.c 1.11 Support for ISRC/MCN in RAW Mode new (but witout index shift) Tue Jul 23 23:47:58 2002 Joerg Schilling * subchan.c 1.10 First loop in fillsubch() removed because it is identical to second loop Tue Jul 23 23:32:31 2002 Joerg Schilling * subchan.c 1.9 fillsubch() now coeerect for audio Pregap between Tracks korrekt with relative time counting downwards Sun Jul 21 18:21:24 2002 Joerg Schilling * drv_mmc.c 1.91 set dsp->{ds_disktype!ds_trfirst!ds_trlast!ds_trfirst_ls} from dip->* Do not cast malloc() anymore Check write_cdtext() Returncode Prepare for just Link Sun Jul 21 18:13:25 2002 Joerg Schilling * drv_dvd.c 1.79 set CDR_BURNFREE Flag, set dsp->{ds_disktype!ds_trfirst!ds_trlast!ds_trfirst_ls} from dip->* Sun Jul 21 18:07:21 2002 Joerg Schilling * cdrecord.c 1.173 Version -> 1.11a27, Define Warning that needs to be printed if Source has been changed, Better messages for wrong DVD-RW write speed, reload_media() at end Ende of RAW Write Sun Jul 21 17:52:54 2002 Joerg Schilling * scsi_cdr.c 1.116 * auinfo.c 1.15 malloc() Cast removed Sun Jul 21 17:51:44 2002 Joerg Schilling * drv_sony.c 1.54 dsp->ds_diskid now is UInt32_t Sun Jul 21 17:44:11 2002 Joerg Schilling * cdrecord.h 1.100 struct disk_status with Typen from utypes.h Mon Jul 8 00:31:04 2002 Joerg Schilling * wm_session.c 1.4 * wm_packet.c 1.18 * subchan.c 1.8 * fifo.c 1.38 * drv_mmc.c 1.90 * drv_jvc.c 1.64 * clone.c 1.5 * cdrecord.h 1.99 * cdrecord.c 1.172 'tracks' outside driver interface removed and replaced by trackp->tracks Sun Jul 7 22:30:24 2002 Joerg Schilling * drv_jvc.c 1.63 Better rebuild old driver interface in next_wr_address_jvc() Sun Jul 7 22:28:35 2002 Joerg Schilling * wm_packet.c 1.17 * drv_mmc.c 1.89 * cdr_drv.c 1.27 * cdrecord.h 1.98 * cdrecord.c 1.171 * drv_sony.c 1.53 * drv_simul.c 1.27 * drv_philips.c 1.52 * drv_jvc.c 1.62 * drv_dvd.c 1.77 trackno/tracks Parameter in driverinterface removed for new Struct Member Sat Jul 6 21:19:22 2002 Joerg Schilling * cdrecord.c 1.170 * cdrecord.h 1.97 track_t now with tracks and track for simplified driverinterface Sat Jul 6 18:20:27 2002 Joerg Schilling * cdrecord.h 1.96 * cdrecord.c 1.169 * drv_sony.c 1.52 * drv_simul.c 1.26 * drv_philips.c 1.51 * drv_mmc.c 1.88 * drv_jvc.c 1.61 * drv_dvd.c 1.76 cdr_speeddef/cdr_speedmax new and do not default to speed= 1 but to cdr_speeddef Fri Jul 5 23:11:39 2002 Joerg Schilling * cdrecord.c 1.168 Version -> 1.11a26 wm2name[] with better systematics Bugfix for High Speed CD-RW that could not be written anymore at 10x speed New test for too slow writing of a CD-RW Modename for blank only now is "BLANK" Text: write XXX mode -> real XXX mode SAO & RAW start (leadin) Code -> drv_mmc.c Correctly print the current DVD writespeed Fri Jul 5 21:36:25 2002 Joerg Schilling * cdrecord.h 1.95 New driverfunction write_leadin, WM_ * Macros with better system, new Macro wm_base(), RF_LEADIN new Fri Jul 5 21:31:48 2002 Joerg Schilling * drv_mmc.c 1.87 New driverfunction write_leadin_mmc() with Code from cdrecord main function Fri Jul 5 21:26:04 2002 Joerg Schilling * drv_sony.c 1.51 * drv_simul.c 1.25 * drv_philips.c 1.50 * drv_jvc.c 1.60 * drv_dvd.c 1.75 New driverfunction write_leadin as dummy Thu Jul 4 13:01:36 2002 Joerg Schilling * cdrecord.c 1.167 Version -> 1.11a25 Print Writemodes (new) set_wrmode() new restructuring: cdr_t->cdr_dstat is now used dp->cdr_dstat->ds_cdrflags |= RF_PRATIP new Check for ultra low speed media in High Speed writer Check for high speed media in Low Speed writer Avoid that cdrecord -- speed=8 causes speed=8 to be ignored as file type arg Thu Jul 4 12:55:52 2002 Joerg Schilling * cdrecord.h 1.94 restructuring: cdr_t->cdr_dstat is now used New Write Mode WM_* definitions Thu Jul 4 12:53:14 2002 Joerg Schilling * drv_dvd.c 1.74 * drv_mmc.c 1.86 * drv_philips.c 1.49 * drv_sony.c 1.50 Check for dp->cdr_dstat->ds_cdrflags & RF_PRATIP Fill dsp->ds_flags |= DSF_ERA and dsp->ds_at_*_speed Tue Jul 2 19:55:47 2002 Joerg Schilling * drv_sony.c 1.49 * drv_simul.c 1.24 * drv_philips.c 1.48 * drv_jvc.c 1.59 * cdr_drv.c 1.26 * drv_mmc.c 1.85 * drv_dvd.c 1.73 dstat_t * now is a Member of cdr_t -> better handling of special funcs Tue Jul 2 15:18:31 2002 Joerg Schilling * drv_mmc.c 1.84 get_atip() now is always usable (not only if PRINT_ATIP has been defined) Sun Jun 16 15:58:37 2002 Joerg Schilling * scsi_cdr.c 1.115 Comment -> mmc-2 Fri May 31 22:09:39 2002 Joerg Schilling * scsi_cdr.c 1.114 wait_unit_ready() fast Abort even if k == SC_MEDIUM_ERROR Wed May 29 01:43:13 2002 Joerg Schilling * scsi-wnt.c 1.28 Better printf() format strings for DWORD Wed May 29 01:02:28 2002 Joerg Schilling * cdtext.h 1.3 List of language codes enhanced Wed May 29 00:55:22 2002 Joerg Schilling * fifo.c 1.37 palign() Macro with (UIntptr_t) Cast Wed May 29 00:54:26 2002 Joerg Schilling * cdrecord.c 1.166 Version -> 1.11a24, gracetime= in usage(), printf() Format correkt for bmtime() Wed May 29 00:51:56 2002 Joerg Schilling * cdrecord.1 1.62 gracetime= new Wed May 29 00:50:03 2002 Joerg Schilling * cdtext.c 1.8 Avoid Coredump if a single .inf File is missing and trackp[i].text is NULL -> ->textcodes does not work Mon May 20 17:08:41 2002 Joerg Schilling * scsi-aix.c 1.34 palign() -> with UIntptr_t cast Mon May 20 16:38:23 2002 Joerg Schilling * scsi-remote.c 1.9 avoid Integeroverflow with %.*s and 64 bit Mon May 20 14:28:12 2002 Joerg Schilling * scsi-sun.c 1.71 Cast (int)req.uscsi_buflen/(int)req.uscsi_resid forr 64 bit Mon May 13 02:02:09 2002 Joerg Schilling * cdrecord.c 1.165 Version -> 1.11a23, Flush Cache with exit() in Silent Mode to avoid problem with cdrecord -toc and CD-ROMs Mon May 13 02:00:49 2002 Joerg Schilling * fifo.c 1.36 * drv_mmc.c 1.83 * drv_jvc.c 1.58 * drv_dvd.c 1.71 * cdrecord.h 1.93 New Typ tsize_t instead of off_t for Track size Vars > sizeof(long) on non-largefile OS Sat May 4 21:55:38 2002 Joerg Schilling * cdrecord.c 1.164 Avoid that abort via ^C kills a running SCSI Command Sat May 4 21:42:56 2002 Joerg Schilling * scsitransp.c 1.83 * scsitransp.h 1.51 Callback Function at Ende of SCSI Command Sat May 4 18:10:05 2002 Joerg Schilling * cdrecord.c 1.163 Version -> 1.11a22 gracetime= Option new Now use geterrno()/seterrno() reload_media() reads from stdder if input is from stdin Sat May 4 16:00:13 2002 Joerg Schilling * cdrecord.c 1.162 printf() Formats enhanced to get non jumping output with DVDs Sat May 4 15:36:45 2002 Joerg Schilling * drv_dvd.c 1.70 always set CDR_TAO|CDR_SAO in cdr_flags to allow speudo-DAO Mode Sat May 4 15:34:41 2002 Joerg Schilling * cdrecord.h 1.92 MIN_GRACE_TIME new Sat Apr 20 22:29:26 2002 Joerg Schilling * fifo.c 1.35 Now use geterrno()/seterrno() Tue Apr 16 19:20:40 2002 Joerg Schilling * scsierrs.c 2.28 New Errorstrings from 29.5.2001 Tue Apr 9 22:48:58 2002 Joerg Schilling * diskid.c 1.35 Embargo Message now better Tue Apr 9 22:41:41 2002 Joerg Schilling * cdrecord.h 1.91 F_STDIN Flag new Sat Mar 30 12:26:12 2002 Joerg Schilling * drv_dvd.c 1.69 Make drecord -atip print useful things Wed Mar 27 23:36:26 2002 Joerg Schilling * drv_dvd.c 1.68 maxblocks computing corrected (now even works with Panasonic) Tue Mar 26 19:18:31 2002 Joerg Schilling * subchan.c 1.7 create SCMS Bit set COPY Bit in TOC and sub channels Tue Mar 26 19:10:32 2002 Joerg Schilling * cdrecord.c 1.161 Version -> 1.11a19 Tue Mar 26 19:07:15 2002 Joerg Schilling * auinfo.c 1.14 Albumperformer= new Tue Mar 26 19:02:58 2002 Joerg Schilling * cdtext.c 1.7 textfile= not-existent caused a Coredump Sun Mar 24 23:39:28 2002 Joerg Schilling * cdrecord.c 1.160 SCMS and Copy permitted printing new, Version -> 1.11a18 Sun Mar 24 23:38:11 2002 Joerg Schilling * auinfo.c 1.13 SCMS as new value for Copy_permitted= Sun Mar 10 00:24:19 2002 Joerg Schilling * cdrecord.c 1.159 Print real write speed Sat Mar 9 23:21:05 2002 Joerg Schilling * drv_mmc.c 1.82 remiove typo in hasdrvopt() Sat Mar 9 23:03:00 2002 Joerg Schilling * drv_mmc.c 1.81 first VariRec Support Sat Mar 9 21:15:48 2002 Joerg Schilling * drv_dvd.c 1.65 Burn-PROOF Support new, try tp make Panasonic DVD-R working Sat Mar 9 20:20:16 2002 Joerg Schilling * cdrecord.c 1.158 IS_SCHILY_XCONFIG new, Short Usage with susage() new Fri Mar 8 16:48:58 2002 Joerg Schilling * cdrecord.c 1.157 Version print Lizens better, -cdi sets toctype Fri Mar 8 16:46:54 2002 Joerg Schilling * scsitransp.c 1.82 Version -> 0.6 Tue Mar 5 23:34:46 2002 Joerg Schilling * defaults.c 1.8 NULL Pointer for args is now OK to allow to be used with readcd Tue Mar 5 23:32:00 2002 Joerg Schilling * cdrecord.h 1.90 getnum()/getllnum() from cdrecord.c -> getnum.c Tue Mar 5 23:26:31 2002 Joerg Schilling * cdrecord.c 1.156 Version -> 1.11a17 getnum()/getllnum() -> getnum.c cdr_defaults() changed to allow to be used with readcd.c Tue Mar 5 23:20:48 2002 Joerg Schilling * getnum.c 1.1 date and time created 02/03/05 23:20:48 by joerg Mon Mar 4 23:42:43 2002 Joerg Schilling * diskid.c 1.34 * drv_mmc.c 1.80 * drv_dvd.c 1.64 * scsi_cdr.c 1.113 * drv_simul.c 1.23 * fifo.c 1.34 * crc16.c 1.5 * crc16.h 1.3 * cdrecord.h 1.89 Copyright -> 2002 Mon Mar 4 23:32:08 2002 Joerg Schilling * cdtext.h 1.2 Comment for Text Language code now better Mon Mar 4 23:21:31 2002 Joerg Schilling * cdrecord.c 1.155 better comment for Version printing for not working Branches Mon Mar 4 22:43:47 2002 Joerg Schilling * cdrecord.c 1.154 Comments for Sector size Mon Mar 4 22:42:12 2002 Joerg Schilling * defaults.c 1.7 Copyright -> 2002 new Function open_cdrdefaults(), Comment that states that "/etc/default/cdrecord" may not be changed Fri Mar 1 22:37:21 2002 Joerg Schilling * diskid.c 1.33 Better Text for unknown ID Codes Thu Feb 28 23:04:45 2002 Joerg Schilling * auinfo.c 1.12 readtstr() now looks for rightmost ' from right to left, readtag("CDINDEX_DISCID=") -> readtstr("CDINDEX_DISCID=") Sun Feb 24 15:44:34 2002 Joerg Schilling * cdrecord.c 1.153 Copyright -> 2002 Sat Feb 23 22:00:51 2002 Joerg Schilling * cdtext.c 1.6 First Support for CD-Text Synthesis with new functions text_txt()/packtext()/anytext()/fillup_pack()/fillpack() Sat Feb 23 21:44:33 2002 Joerg Schilling * cdtext.h 1.1 date and time created 02/02/23 21:44:33 by joerg Sat Feb 23 21:21:10 2002 Joerg Schilling * cdrecord.1 1.61 -text/textfile= Options documented Sat Feb 23 21:17:42 2002 Joerg Schilling * cdrecord.c 1.152 Version -> 1.11a15, Option -text new, char * textfile not global anymore Sat Feb 23 21:10:53 2002 Joerg Schilling * auinfo.c 1.11 First CD-Text Support Sat Feb 23 17:24:48 2002 Joerg Schilling * cdrecord.h 1.88 void *text new in struct track, packtext() Prototype new Sat Feb 23 16:01:50 2002 Joerg Schilling * drv_mmc.c 1.79 CD-Text Cue sheet for Lead-in does not depend anymore from char *textfile but from trackp[0].flags & TI_TEXT Wed Feb 20 19:39:39 2002 Joerg Schilling * scsi_cdr.c 1.112 * drv_dvd.c 1.63 * drv_simul.c 1.22 * fifo.c 1.33 #ifndef DEBUG around #define DEBUG Tue Feb 19 22:10:23 2002 Joerg Schilling * cdtext.c 1.5 setuptextdata() new Fri Feb 15 00:46:56 2002 Joerg Schilling * crc16.h 1.2 * crc16.c 1.4 flip_crc_error_cor() with bsize Parameter and EXPORT instead of LOCAL cdtext_crc_ok() removed -> cdtext.c Fri Feb 15 00:42:47 2002 Joerg Schilling * cdtext.c 1.4 Flip error correction for Text CRC correction Automatic Text Size Header recognition Sun Feb 10 12:43:07 2002 Joerg Schilling * scsi-openserver.c 1.29 MAX-DMA -> 63kB, -scanbus contolled by env Vars Sat Feb 9 17:29:02 2002 Joerg Schilling * diskid.c 1.32 Warning for guessed IDs Tue Jan 29 20:46:42 2002 Joerg Schilling * diskid.c 1.31 Removed wrong (now superfluous) IDs Thu Jan 24 00:03:25 2002 Joerg Schilling * diskid.c 1.30 "Advanced Digital Media", "Moser Baer India Limited", "NAN-YA Plastics Corporation", "SHENZEN SG&GAST DIGITAL OPTICAL DISCS" new from Plextools binary m_grandadvance[] was superfluous (m_grandadv[]) "WEALTH FAIR INVESTMENT LIMITE" typo fixed (D missing). Fri Jan 18 12:43:58 2002 Joerg Schilling * scsi-linux-sg.c 1.69 do not try to use the PG driver if open(device) fails Fri Dec 7 22:40:31 2001 Joerg Schilling * scsi_cdr.c 1.111 scsi_in_progress() with additional sense qualifier 0x04 for CyberDrive Sun Dec 2 15:42:53 2001 Joerg Schilling * scsi-beos.c 1.20 Typo removed, Support for BeOS 5 Sun Dec 2 15:37:36 2001 Joerg Schilling * scsi-amigaos.c 1.2 Reworked the error handling code Sun Dec 2 13:44:43 2001 Joerg Schilling * scsi-amigaos.c 1.1 date and time created 01/12/02 13:44:43 by joerg Tue Nov 27 20:25:39 2001 Joerg Schilling * scsihack.c 1.40 Copyright + 2001 Tue Nov 27 20:24:18 2001 Joerg Schilling * scsihack.c 1.39 scsi-amigaos.c new Tue Nov 27 02:10:34 2001 Joerg Schilling * cdrecord.c 1.151 NEED_SYS_SOCKET_H for BeOS new Version -> 1.11a13 cdr_buffer_cap() environment for Plasmon RF41xx better Tue Nov 27 02:08:47 2001 Joerg Schilling * drv_philips.c 1.47 Comment for buffer_cap dummy function for the Plasmon RF41xx better Tue Nov 13 16:17:05 2001 Joerg Schilling * cdrecord.h 1.87 * drv_dvd.c 1.62 * cdrecord.c 1.150 New Flag DSF_DVD, better overcapacity output for DVD Sun Nov 11 18:30:47 2001 Joerg Schilling * drv_dvd.c 1.61 Comment for ACARD TECH AEC-7720 ATAPI<->SCSI adaptor better Sun Nov 11 17:53:42 2001 Joerg Schilling * scsi-remote.c 1.8 Test HAVE_RCMD new Thu Nov 1 19:15:46 2001 Joerg Schilling * drv_simul.c 1.21 Now using timedefs.h Wed Oct 31 19:29:35 2001 Joerg Schilling * scsi_cdr.c 1.110 For ACARD TECH AEC-7720 ATAPI<->SCSI adaptor read Mode Page list only in debug mode Wed Oct 31 00:24:58 2001 Joerg Schilling * scsi_cdr.c 1.109 sense_secsize() now calles mode_sense() first with 12 Bytes and again with 0xFE Bytes for Moge Page List Wed Oct 31 00:17:27 2001 Joerg Schilling * drv_mmc.c 1.78 check_writemodes_mmc() -> EXPORT, read_dvd_structure() now with mit 32 byte instead of 15 bytes len Parameter Wed Oct 31 00:06:47 2001 Joerg Schilling * cdrecord.h 1.86 Prototyp for check_writemodes_mmc() Tue Oct 30 23:12:03 2001 Joerg Schilling * scsireg.h 1.26 cd_mode_page_05 intel byteorder link_size was wrong Tue Oct 30 21:36:53 2001 Joerg Schilling * cdrecord.c 1.147 DVD Check code did code exit() for non MMC CD writers version -> 1.11a10 Mon Oct 29 19:12:29 2001 Joerg Schilling * scsi-mac-iokit.c 1.3 Include Liste reworked Mon Oct 29 18:57:46 2001 Joerg Schilling * cd_misc.c 1.10 * misc.c 1.2 * modes.c 1.24 * diskid.c 1.29 * drv_simul.c 1.20 * fifo.c 1.32 * wm_track.c 1.3 * wm_session.c 1.3 * wm_packet.c 1.16 avoid sys/types.h Sat Oct 27 02:56:16 2001 Joerg Schilling * scsi-remote.c 1.7 Test for HAVE_NETDB_H for rcmd() Sat Oct 27 02:55:30 2001 Joerg Schilling * scsierrs.c 2.27 #include for size_t for snprintf() Sat Oct 27 02:53:49 2001 Joerg Schilling * fifo.c 1.31 Test for HAVE_FORK new Sat Oct 27 02:53:18 2001 Joerg Schilling * cdtext.c 1.3 casts because sizeof() on MacOS X is long Thu Oct 25 16:19:08 2001 Joerg Schilling * scsi-mac-iokit.c 1.2 Unitnitialised Var dict, plugInResult format string ... GCC error removed Thu Oct 25 02:03:56 2001 Joerg Schilling * scsihack.c 1.38 Support for MaxOS X (Darwin-1.4) Thu Oct 25 02:03:11 2001 Joerg Schilling * scsi-mac-iokit.c 1.1 date and time created 01/10/25 01:03:11 by joerg Wed Oct 17 19:40:22 2001 Joerg Schilling * cdrecord.c 1.146 initialize scgp with NUL brackets around if (p = senv_field(6)) Tue Oct 16 17:03:53 2001 Joerg Schilling * drv_dvd.c 1.57 * cdrecord.c 1.144 * cdrecord.h 1.85 * drv_simul.c 1.19 * drv_sony.c 1.48 * drv_philips.c 1.46 * drv_mmc.c 1.77 * drv_jvc.c 1.57 New Structuremember cdr_cmdflags in cdr_t Tue Oct 16 15:57:05 2001 Joerg Schilling * cdrecord.c 1.143 Better error messages for DVD Demo Mode > 1 GB Wed Oct 10 23:04:03 2001 Joerg Schilling * cdrecord.c 1.139 number() corrected - had wrong if/then/else Structure for T/P/G Multiplyer Tue Oct 9 02:19:36 2001 Joerg Schilling * cdrecord.c 1.138 sys/types.h & sys/stat.h -> statdefs.h, -> 1.11a09 Tue Oct 9 01:42:05 2001 Joerg Schilling * audiosize.c 1.18 * isosize.c 1.8 sys/types.h & sys/stat.h -> statdefs.h Sun Oct 7 21:27:14 2001 Joerg Schilling * scsi-linux-pg.c 1.40 * scsi-linux-sg.c 1.68 Better error messages for Scanbus if /dev/sg* or /dev/pg* cannot be opened Sun Oct 7 21:03:23 2001 Joerg Schilling * drv_mmc.c 1.76 Modifications to allow recognition of CD/DVD writer Sun Oct 7 20:41:51 2001 Joerg Schilling * cdr_drv.c 1.25 xdebug for DVD/CD writer recognition Sun Oct 7 19:01:25 2001 Joerg Schilling * drv_dvd.c 1.55 read_dvd_structure() from drv_dvd.c -> scsi_cdr.c for Pioneer A03 DVD-R/CD-R reload_media() only if writing later Sun Oct 7 13:35:21 2001 Joerg Schilling * scsi_cdr.c 1.108 * cdrecord.h 1.84 read_dvd_structure() from drv_dvd.c -> scsi_cdr.c for Pioneer A03 DVD-R/CD-R Thu Sep 27 19:01:30 2001 Joerg Schilling * scsidefs.h 1.27 #undef DEV_UNKNOWN for True64 Thu Sep 13 19:10:03 2001 Joerg Schilling * scsi_cdr.c 1.107 * cdr_drv.c 1.24 * drv_dvd.c 1.54 * cdrecord.h 1.83 Modifications to allow recognition of CD/DVD writer Thu Sep 13 19:01:46 2001 Joerg Schilling * cdrecord.c 1.137 cdrecord -version now may print cdrecord-Clone, Modifications to allow recognition of CD/DVD writer Thu Sep 13 15:36:21 2001 Joerg Schilling * scsidefs.h 1.26 DEV_MMC_DVD_WR new Thu Sep 13 14:31:05 2001 Joerg Schilling * scsi-sun.c 1.70 maxdma for USCSI to default if == -1 (e.g. for TAPE), Debug print the RQ Buffer. Tue Sep 11 14:04:03 2001 Joerg Schilling * scsi_cdr.c 1.106 Open CD-Text File in Binary Tue Sep 11 03:06:31 2001 Joerg Schilling * scsi-linux-sg.c 1.67 Timeout Workaround for ioctl() Tue Sep 4 14:04:25 2001 Joerg Schilling * cdrecord.c 1.136 DEMO_SPEED new Thu Aug 9 16:38:21 2001 Joerg Schilling * cdrecord.h 1.82 * cdrecord.c 1.135 #define GRACE_TIME 9 new Fri Jul 20 13:17:21 2001 Joerg Schilling * drv_mmc.c 1.75 * cdrecord.c 1.134 * cdrecord.h 1.81 RF_BLANK new to avoid opening the tray before blanking Version -> 1.11a07 Thu Jul 19 00:28:36 2001 Joerg Schilling * scsi-remote.c 1.6 Now using _niread()/_nixwrite() Thu Jul 12 23:40:28 2001 Joerg Schilling * scsidefs.h 1.25 Taiyo Yuden EW-50 new Thu Jul 12 23:35:08 2001 Joerg Schilling * scsi_cdr.c 1.105 * cdr_drv.c 1.23 * drv_philips.c 1.45 New driver for Taiyo Yuden EW-50 because it swabs audio bytes compared to Philips CDD-521 Thu Jul 12 23:33:28 2001 Joerg Schilling * fifo.c 1.30 Better Debug messages for FIFO adresse/size Thu Jul 5 00:08:38 2001 Joerg Schilling * sector.c 1.5 Match new libedc Thu Jun 28 13:19:02 2001 Joerg Schilling * drv_mmc.c 1.74 Use -DSAO_RAW -DSAO_RAW_TEST for SAO RAW tests only Wed Jun 27 10:04:03 2001 Joerg Schilling * clone.c 1.4 clone_cue() for Test Wed Jun 27 09:51:19 2001 Joerg Schilling * cdrecord.c 1.133 CDR_SRAW16 removed Wed Jun 27 09:47:10 2001 Joerg Schilling * scsimmc.h 1.6 * scsi_cdr.c 1.104 struct ftrackdesc -> scsimmc.h Wed Jun 27 09:35:13 2001 Joerg Schilling * scsi_cdr.c 1.103 struct tocheader definition removed because it is in scsimmc.h Sun Jun 24 22:35:23 2001 Joerg Schilling * drv_mmc.c 1.73 check_writemodes_mmc() now resety silent correctly, deflt_writemodes_mmc() new Sun Jun 24 19:55:02 2001 Joerg Schilling * cdrecord.h 1.80 CDR_SRAW16 disabled, because SAO supports only RAW96x Fri Jun 22 08:42:55 2001 Joerg Schilling * scsimmc.h 1.5 struct tocheader now with Uchar Wed Jun 20 21:53:55 2001 Joerg Schilling * subchan.c 1.6 min Struktur member -> pmin Wed Jun 20 21:53:34 2001 Joerg Schilling * cdr_drv.c 1.22 #include for printf() Wed Jun 20 21:53:03 2001 Joerg Schilling * cdrecord.c 1.132 Changes for GCC-3.0 & Linux include file bugs for printf() (is a #define), 1.11a04 -> 1.11a05 Tue Jun 19 12:26:49 2001 Joerg Schilling * cdrecord.c 1.131 Usage() with textfile=, 1.11a03 -> 1.11a04 Tue Jun 19 12:22:30 2001 Joerg Schilling * cdtext.c 1.2 Modifications for RAW CD-Text Tue Jun 19 11:39:08 2001 Joerg Schilling * cdrecord.h 1.79 * subchan.c 1.5 addrw() new for CD-Text Support in RAW mode Tue Jun 19 02:10:37 2001 Joerg Schilling * cdrecord.h 1.78 * cdrecord.c 1.130 BUF_SIZE -> CDR_BUF_SIZE & from cdrecord.c -> cdrecord.h Tue Jun 19 01:04:54 2001 Joerg Schilling * cdrecord.c 1.129 Do not call exit() if interrupting during wait time via ^C Mon Jun 18 09:29:52 2001 Joerg Schilling * cdtext.c 1.1 date and time created 01/06/18 08:29:52 by joerg Mon Jun 18 08:55:07 2001 Joerg Schilling * drv_mmc.c 1.72 * cdrecord.c 1.128 * cdrecord.h 1.77 First CD-Text Support Sat Jun 16 19:20:36 2001 Joerg Schilling * cdrecord.c 1.127 trackp->dataoff new, call on_comerr() earlier Sat Jun 16 18:16:51 2001 Joerg Schilling * cdrecord.h 1.76 Dataoffset in struct track new, is_text() new Sat Jun 16 18:15:05 2001 Joerg Schilling * drv_mmc.c 1.71 Forgotten if (xdebug) Tue Jun 12 22:57:03 2001 Joerg Schilling * cdrecord.c 1.126 -clone new, write mode for -xa1 -xa2, RAW data bug removed Tue Jun 12 22:42:25 2001 Joerg Schilling * sector.c 1.4 recodesectors() -> subrecodesecs()/sunchan.c, scrsectors() without return for AUDIO Tue Jun 12 22:41:37 2001 Joerg Schilling * subchan.c 1.4 subrecodesecs() from sector.c & scrsectors() dummy Tue Jun 12 22:40:59 2001 Joerg Schilling * cdrecord.h 1.75 recodesectors() -> subrecodesecs() Tue Jun 12 01:51:49 2001 Joerg Schilling * cdrecord.h 1.74 Modifications for clone.c Tue Jun 12 01:50:53 2001 Joerg Schilling * clone.c 1.1 date and time created 01/06/12 00:50:53 by joerg Tue Jun 12 01:07:06 2001 Joerg Schilling * subchan.c 1.3 subq/nsubh -> _subq/_nsubh Tue Jun 12 01:05:54 2001 Joerg Schilling * subchan.c 1.2 Changes for clone writing, qwto16() new for clone 16/96 Writing Tue Jun 12 00:12:42 2001 Joerg Schilling * sector.c 1.3 removed unused Vars Mon Jun 11 23:31:00 2001 Joerg Schilling * cdrecord.h 1.73 Enhancements for clone writing Mon Jun 11 23:29:50 2001 Joerg Schilling * sector.c 1.2 scrsectors()/recodesectors() fuer clone writing neu Mon Jun 11 23:12:41 2001 Joerg Schilling * drv_mmc.c 1.70 Checking write modes Message only with xdebug Mon Jun 11 23:11:55 2001 Joerg Schilling * movesect.c 1.2 Make it more general to allow compress and expand Mon Jun 11 23:09:58 2001 Joerg Schilling * auinfo.c 1.10 Comment for ISRC Sat Jun 9 20:13:35 2001 Joerg Schilling * cdrecord.c 1.125 -copy/-nocopy new, Prevent data sectors only in RAW Mode (without libedc_ecc) Sat Jun 9 20:05:59 2001 Joerg Schilling * cdrecord.1 1.60 New Options -raw, -raw96r, -raw96p, -raw16, -copy, -nocopy Wed Jun 6 00:09:58 2001 Joerg Schilling * cdrecord.c 1.124 Any positive startsector for RAW is wriong -> Philips Firmware bug fixed Mon Jun 4 19:28:17 2001 Joerg Schilling * cdrecord.c 1.123 Modifications for RAW Mode cdr_t *dp now allocated BURNFREE printput with Driver Flags OPC also for -blank write_secs() new for all writes on ATAPI print_wrmodes()/check_wrmode() new reload_media() new Mon Jun 4 17:45:49 2001 Joerg Schilling * cdrecord.h 1.72 * drv_dvd.c 1.53 * drv_mmc.c 1.69 New Function reload_media() Mon Jun 4 17:08:05 2001 Joerg Schilling * cdrecord.h 1.71 * wm_packet.c 1.15 Modifications for RAW Mode Mon Jun 4 17:06:21 2001 Joerg Schilling * subchan.c 1.1 date and time created 01/06/04 16:06:21 by joerg Mon Jun 4 16:52:34 2001 Joerg Schilling * crc16.c 1.3 Now correct Code with Inverted CRC Bits Mon Jun 4 16:49:47 2001 Joerg Schilling * auinfo.c 1.9 SECT_AUDIO_NPRE -> SECT_AUDIO_NOPRE Mon Jun 4 16:06:15 2001 Joerg Schilling * crc16.c 1.2 Now using Uint*_t Mon Jun 4 16:02:17 2001 Joerg Schilling * crc16.h 1.1 date and time created 01/06/04 15:02:17 by joerg Mon Jun 4 13:33:19 2001 Joerg Schilling * drv_mmc.c 1.68 Now using CDR_SRAW*, botchexit Abort removed Mon Jun 4 12:53:18 2001 Joerg Schilling * sector.c 1.1 date and time created 01/06/04 11:53:18 by joerg Sun Jun 3 20:51:22 2001 Joerg Schilling * auinfo.c 1.8 Modifications for RAW Mode Sun Jun 3 14:48:57 2001 Joerg Schilling * cdrecord.c 1.122 Use comexit()/comerr() instead of exscsi() New Function do_opc() now also called before blank, -force avoids this Sat Jun 2 21:24:52 2001 Joerg Schilling * movesect.h 1.1 * movesect.c 1.1 date and time created 01/06/02 20:24:52 by joerg Fri Jun 1 07:54:04 2001 Joerg Schilling * cdrecord.1 1.59 burnproof -> burnfree Fri Jun 1 07:46:01 2001 Joerg Schilling * scsi_cdr.c 1.102 BURN-Proof (Sanyo) -> Buffer-Underrun-Free recording Fri Jun 1 07:44:39 2001 Joerg Schilling * fifo.c 1.29 call fill_buf() instead of read_buf() and trackp/secno Parameter for Subcode Generator Fri Jun 1 02:08:55 2001 Joerg Schilling * drv_mmc.c 1.67 BURN-Proof -> BURN-Free Thu May 31 23:31:44 2001 Joerg Schilling * scsireg.h 1.25 BURN Free & link size new Thu May 31 03:21:47 2001 Joerg Schilling * drv_mmc.c 1.66 check_writemodes_mmc() new, is_raw() set write modes Mon May 28 00:51:36 2001 Joerg Schilling * cd_misc.c 1.9 sec_to_msf() new Sun May 27 14:01:28 2001 Joerg Schilling * audiosize.c 1.17 Better comment Thu May 24 19:10:28 2001 Joerg Schilling * auinfo.c 1.7 No exit() if -debug & nindex > 1 Thu May 24 19:09:39 2001 Joerg Schilling * modes.c 1.23 Warning using default data only if not in Silent mode Thu May 24 19:07:13 2001 Joerg Schilling * drv_dvd.c 1.52 * drv_jvc.c 1.56 * drv_simul.c 1.18 * drv_philips.c 1.44 * drv_sony.c 1.47 CDR_DAO -> CDR_SAO, SAO no more predefined - it either does not work or is tested automatically (MMC) Sun May 20 21:23:53 2001 Joerg Schilling * drv_sony.c 1.46 * drv_philips.c 1.43 mask sectype with ST_MASK because of new mode bits Sun May 20 18:51:41 2001 Joerg Schilling * drv_simul.c 1.17 CDR_SIMUL Flag new Fri May 18 21:07:58 2001 Joerg Schilling * cdrecord.h 1.70 F_OVERBURN new, F_RAW / is_raw() new, CDR_SIMUL new Fri May 18 19:30:02 2001 Joerg Schilling * cdrecord.c 1.121 trackp[0].dbtype is set with Data type from Track 1 Fri May 18 19:22:50 2001 Joerg Schilling * drv_mmc.c 1.65 In open_session() wird nun schon der Datenblocktyp fuer den ersten track eingestellt Mon May 14 23:36:07 2001 Joerg Schilling * cdrecord.c 1.120 -overburn new Bracket bug with > 90 min Warning removed > 90 Min Warning only if offizial capacity is exceeded (for DVD-R) -pad implied for next Track with -isosize Win32 Priorities are non contiguous (fix in rt_raisepri()) Mon May 14 22:54:17 2001 Joerg Schilling * cdrecord.h 1.69 F_OVERBURN (-overburn) new Mon May 14 22:53:33 2001 Joerg Schilling * cdrecord.1 1.58 -overburn new, -isosize better documented Sat Apr 28 23:34:12 2001 Joerg Schilling * scsi-remote.c 1.5 Read char with buffer for cygwin Fri Apr 20 11:38:03 2001 Joerg Schilling * scsitransp.c 1.81 scg_svhead() is silent if non verbose Fri Apr 20 11:34:41 2001 Joerg Schilling * scsi-linux-sg.c 1.66 Hack for ide-scsi bug, although there is sense data, SCSI Status is 0 Thu Apr 19 21:52:41 2001 Joerg Schilling * drv_mmc.c 1.64 removed superfluous scgp->silent--; in fixate_mmx(). silent did become negative Thu Apr 19 21:51:26 2001 Joerg Schilling * cdrecord.c 1.119 Enhance wait time in wait_unit_ready() after blank to 240 s for Mitsumi Tue Apr 17 00:58:57 2001 Joerg Schilling * cdrecord.1 1.57 Hint for mailman interface *************** Release 1.10 ******************* Fri Apr 13 20:41:36 2001 Joerg Schilling * cdrecord.c 1.118 Version -> 1.10 final Fri Apr 13 20:40:58 2001 Joerg Schilling * cdrecord.c 1.117 Backwardcounter corrected Fri Apr 13 20:39:09 2001 Joerg Schilling * cdrecord.1 1.56 New Support mail Adresses Wed Apr 11 01:22:18 2001 Joerg Schilling * scsi_cdr.c 1.101 * cdrecord.h 1.68 print_capacity() new with FILE * Parameter Sun Apr 8 02:03:49 2001 Joerg Schilling * modes.c 1.22 scgp->silent--; was oat wrong place Sun Apr 1 14:39:01 2001 Joerg Schilling * cdrecord.1 1.55 Typo Sat Mar 31 23:02:28 2001 Joerg Schilling * modes.c 1.21 unit_ready() before each mode_sense()/mode_select() Sat Mar 31 22:46:28 2001 Joerg Schilling * drv_mmc.c 1.63 Comment for IOMEGA DMA overrun modified (Philips removed) Sun Mar 18 19:39:48 2001 Joerg Schilling * cdrecord.1 1.54 REMOTE SCSI description and new unified SCSI Options Sun Mar 18 19:31:31 2001 Joerg Schilling * cdrecord.c 1.116 Unified SCSI Options Sun Mar 18 19:27:02 2001 Joerg Schilling * scsitransp.c 1.80 Fixed bug that printed SCSI timing without verbose Sun Mar 18 18:37:45 2001 Joerg Schilling * scsitransp.c 1.79 New Functions: scg_svhead()/scg_svtail()/scg__sprinterr() Comments for Functions Print SCSI timing for earch failed SCSI Command Sun Mar 18 18:28:17 2001 Joerg Schilling * scsitransp.h 1.50 New Funstions: scg_svhead()/scg_svtail()/scg__sprinterr() Sun Mar 18 15:37:09 2001 Joerg Schilling * scsitransp.c 1.78 Print Timing without Verbose Sun Mar 18 15:10:18 2001 Joerg Schilling * scsi-wnt.c 1.27 * scsi-vms.c 1.29 * scsi-unixware.c 1.25 * scsi-sgi.c 1.34 * scsi-osf.c 1.23 * scsi-next.c 1.30 * scsi-linux-sg.c 1.65 * scsi-hpux.c 1.29 * scsi-linux-pg.c 1.39 * scsi-bsd.c 1.40 * scsi-bsd-os.c 1.26 * scsi-beos.c 1.19 * scsi-aix.c 1.33 if (scgp->debug) -> if (scgp->debug > 0) Wed Mar 14 00:42:40 2001 Joerg Schilling * scsitransp.h 1.49 * scsitransp.c 1.77 scg_verbose() -> scg_vsetup() Mon Mar 12 23:09:38 2001 Joerg Schilling * cdrecord.c 1.115 Version -> 1.10a17, select_target() uses FILE * Mon Mar 12 23:08:46 2001 Joerg Schilling * scsi_scan.h 1.3 * scsi_scan.c 1.14 comerrno() removed select_target() with FILE * select_target() returns number of Targets Mon Mar 12 23:06:50 2001 Joerg Schilling * cdrecord.h 1.67 * scsi_cdr.c 1.100 printinq() new Mon Mar 12 22:06:05 2001 Joerg Schilling * scsi-linux-sg.c 1.64 Better differentiation SCG_RETRYABLE/SCG_NO_ERROR Set ux_errno if Sense Data present Sun Mar 11 17:10:12 2001 Joerg Schilling * scsi-linux-pg.c 1.38 SCG_RETRYABLE for DMA overrun CHECK CONDITION == SCG_NO_ERROR Sun Mar 11 17:07:48 2001 Joerg Schilling * scsitransp.c 1.76 Remove unused Variables Sun Mar 11 16:56:24 2001 Joerg Schilling * scsitransp.h 1.48 scg_vhead()/scg_vtail()/scg_verbose() & scg_errfflush() new Sun Mar 11 16:55:55 2001 Joerg Schilling * scsitransp.c 1.75 scg_vhead()/scg_vtail()/scg_verbose() & scg_errfflush() new Version -> 0.5 Sat Mar 10 17:53:45 2001 Joerg Schilling * scsitransp.h 1.47 scgp->bufptr new SCG_KVERSION new Sat Mar 10 17:52:53 2001 Joerg Schilling * scsitransp.c 1.74 scgp->bufptr new scgp->scmd->resid < 0 == DMA overrun Sat Mar 10 16:24:00 2001 Joerg Schilling * scsi-linux-sg.c 1.63 SCG_KVERSION new Mon Feb 26 22:20:32 2001 Joerg Schilling * scsi-unixware.c 1.24 New formatting Mon Feb 26 22:18:39 2001 Joerg Schilling * scsi-unixware.c 1.23 Environment "LIBSCG_SCAN_ALL" controls scanning of Harddisks because of system crash Mon Feb 26 16:05:41 2001 Joerg Schilling * cdrecord.c 1.114 Warning if DVD-R code is missing and we found a DVD-R drive Sun Feb 25 13:02:42 2001 Joerg Schilling * fifo.c 1.27 Now using mmapdefs.h Fri Feb 23 17:32:38 2001 Joerg Schilling * scsidefs.h 1.24 ccs() Makro -> is_ccs() Fri Feb 23 00:24:02 2001 Joerg Schilling * fifo.c 1.26 Support for mmap() on Apollo Domain/OS with mmap(0, &size, ...) Thu Feb 22 16:13:27 2001 Joerg Schilling * audiosize.c 1.16 Fixed bug in Prototyp (result from long -> off_t) Thu Feb 22 16:11:07 2001 Joerg Schilling * cdrecord.h 1.66 * wm_packet.c 1.14 * cdrecord.c 1.113 * drv_mmc.c 1.62 * drv_jvc.c 1.54 * drv_dvd.c 1.51 Large File support Thu Feb 22 16:10:53 2001 Joerg Schilling * drv_jvc.c 1.55 padsize Parameter for pad_track() casted to Llong Thu Feb 22 00:57:53 2001 Joerg Schilling * cdr_drv.c 1.21 mconfig.h/unixstd.h for Large Files Thu Feb 22 00:55:35 2001 Joerg Schilling * scsi_scan.c 1.13 #include for Large Files Thu Feb 22 00:54:26 2001 Joerg Schilling * fifo.c 1.25 Large File support Casts for sizeof() [long] on MaxOS X Wed Feb 21 23:32:51 2001 Joerg Schilling * defaults.c 1.6 #include unixstd.h for Large Files Wed Feb 21 23:27:48 2001 Joerg Schilling * auinfo.c 1.6 * isosize.c 1.7 * audiosize.c 1.15 Large File support Tue Feb 20 23:56:44 2001 Joerg Schilling * drv_sony.c 1.45 * drv_philips.c 1.42 unixstd.h for sys/types.h for off_t in cdrecord.h Thu Feb 15 23:09:12 2001 Joerg Schilling * scsihack.c 1.37 Test for HAVE_BSD_DEV_SCSIREG_H for new MacOSX Fri Feb 9 00:35:50 2001 Joerg Schilling * drv_philips.c 1.41 Fixes for Plasmon RF 4100 Tue Jan 23 12:20:32 2001 Joerg Schilling * modes.c 1.20 Cast for singed/unsigned cmparison Mon Jan 15 01:09:05 2001 Joerg Schilling * fifo.c 1.24 %x -> %p Format Sun Jan 7 19:46:42 2001 Joerg Schilling * scsihack.c 1.36 scsi-apollo.c new Sun Jan 7 19:39:40 2001 Joerg Schilling * scsitransp.c 1.73 * scsi-vms.c 1.28 * scsi-unixware.c 1.22 * scsi-linux-pg.c 1.37 * scsi-aix.c 1.32 sense_len check -> scsitransp.c Tue Jan 2 00:09:45 2001 Joerg Schilling * scsitransp.c 1.72 sccsid[] is always used -> without #ifdef lint Fri Dec 29 00:06:35 2000 Joerg Schilling * cdrecord.c 1.112 Lint, 1.10a10, rlimit cast to Llong for SGI Thu Dec 28 23:19:23 2000 Joerg Schilling * scsi_cdr.c 1.99 Modified for Lint Wed Dec 20 18:26:01 2000 Joerg Schilling * scsi-sgi.c 1.33 Cast to caddr_t for SENSEBUF(dsp) Wed Dec 13 20:22:52 2000 Joerg Schilling * scsi-linux-pg.c 1.36 Cast s_cmd.addr = (caddr_t)sp->u_sense.cmd_sense; Tue Dec 12 15:20:46 2000 Joerg Schilling * scsitransp.h 1.46 struct scsi -> struct scg_scsi for AIX Sat Dec 9 22:52:01 2000 Joerg Schilling * scsi-linux-sg.c 1.62 Recognise ENOTTY as errno for failed ioctl() Sat Dec 9 18:20:25 2000 Joerg Schilling * modes.c 1.19 * scsilog.c 1.13 * drv_sony.c 1.44 * drv_philips.c 1.40 * drv_mmc.c 1.61 * drv_jvc.c 1.53 * drv_dvd.c 1.50 u_char -> Uchar Wed Dec 6 12:43:51 2000 Joerg Schilling * cdrecord.c 1.111 atoll() -> libschily Wed Nov 29 17:22:15 2000 Joerg Schilling * scsi-vms.c 1.27 Indented Wed Nov 29 17:18:51 2000 Joerg Schilling * scsi-vms.c 1.26 ATAPI Support and changed for new libscg Interface Fri Nov 24 11:00:58 2000 Joerg Schilling * cdrecord.c 1.110 Workaround for ACER drive that does not return from -dummy Typo in online Help Wed Nov 8 00:06:05 2000 Joerg Schilling * scsitransp.h 1.45 * scsireg.h 1.24 * scsidefs.h 1.23 * scgio.h 2.16 #ifdef __cplusplus extern "C" { Sat Nov 4 15:00:50 2000 Joerg Schilling * fifo.c 1.23 * cdrecord.c 1.109 Printf-like Formats cleaned up Sat Nov 4 14:56:09 2000 Joerg Schilling * scsi_cdr.c 1.98 PIONEER CD-WO DR-R504X -> DEV_PIONEER_DW_S114X Sat Nov 4 14:52:43 2000 Joerg Schilling * cdrecord.h 1.65 DEFAULT_FIFOSIZE -> Long Constant Tue Oct 31 15:58:54 2000 Joerg Schilling * cdrecord.c 1.108 Cygwin-1.x Compatibility Sun Oct 22 13:37:15 2000 Joerg Schilling * scsi-aix.c 1.31 Type in sizeof(devname removed Tue Oct 17 10:35:34 2000 Joerg Schilling * cdrecord.1 1.53 SEE ALSO enhanced Fri Oct 13 11:28:51 2000 Joerg Schilling * scsi-linux-sg.c 1.61 use pg_version() only for PP Wed Sep 20 00:59:38 2000 Joerg Schilling * modes.c 1.18 Code reordered so DMA overrun messages only appears once Sun Sep 17 17:15:06 2000 Joerg Schilling * cdrecord.h 1.64 #define sample -> #define msample for Win32 Fri Sep 8 03:04:50 2000 Joerg Schilling * modes.c 1.17 Warning for Philips DMA overrun Wed Sep 6 23:41:34 2000 Joerg Schilling * scsi_cdr.c 1.97 unit_ready() made better Wed Sep 6 09:59:05 2000 Joerg Schilling * scsitransp.c 1.71 * scsitransp.h 1.44 scg_cmderr() -> scg_cmd_err(), scg_cmd_status() new Tue Sep 5 03:32:34 2000 Joerg Schilling * scsitransp.c 1.70 Default printing to stderr Tue Sep 5 03:06:01 2000 Joerg Schilling * scsitransp.c 1.69 scg__open() returns -1 when SCGO_OPEN fails, to avoid calling scg_fileno() Tue Sep 5 02:30:41 2000 Joerg Schilling * scsi_cdr.c 1.96 allow_atapi() calls unit_ready() before mode_sense() to make it work past a reset Tue Sep 5 02:28:03 2000 Joerg Schilling * modes.c 1.16 Minimal transfer sizeof(struct scsi_mode_header) after DMA overrun Tue Sep 5 02:22:48 2000 Joerg Schilling * drv_mmc.c 1.60 read_toc()/read_disk_info() reads minimal 4 bytes for Philips ATAPI drives Mon Sep 4 20:24:52 2000 Joerg Schilling * cdrecord.1 1.52 Typo removed Sat Sep 2 21:16:00 2000 Joerg Schilling * scsitransp.h 1.43 Drive flags new in SCSI * Sat Sep 2 21:03:48 2000 Joerg Schilling * scsi-wnt.c 1.26 * scsi-vms.c 1.25 * scsi-unixware.c 1.21 * scsi-sgi.c 1.32 * scsi-osf.c 1.22 * scsi-os2.c 1.21 * scsi-next.c 1.29 * scsi-linux-sg.c 1.60 * scsi-linux-pg.c 1.35 * scsi-hpux.c 1.28 * scsi-bsd.c 1.39 * scsi-bsd-os.c 1.25 * scsi-aix.c 1.30 * scsi-beos.c 1.18 All debug printing to stderr (scgp->errfile) Tue Aug 29 23:44:31 2000 Joerg Schilling * scsi-next.c 1.28 * scsi-bsd-os.c 1.24 error codes & return harmonised Tue Aug 29 02:36:09 2000 Joerg Schilling * drv_mmc.c 1.59 set curspeed only if > 0 (SCSI-3 floating point exception in waitfix) Tue Aug 29 02:35:04 2000 Joerg Schilling * scsi_scan.c 1.12 call scg_settarget() in scanbus, to make sure SCSI address for scg_initator_id() is OK Sat Aug 26 10:20:43 2000 Joerg Schilling * drv_mmc.c 1.58 OPC Hack for strange drive that returns from OPC with "UNIT ATTENTION/operator selected write permit" Sat Aug 26 10:15:03 2000 Joerg Schilling * cdrecord.c 1.107 Enhancements for remote SCSI, scg_reset() with what Parameter Sat Aug 26 00:53:10 2000 Joerg Schilling * scsihack.c 1.35 * scsitransp.c 1.68 scsibus/target/lun acess now only with scg_scsibus()/scsi_target()/scg_lun() and scg_settarget() do not initialize target in struct scg_cmd because this is now done in SCG lowlevel code scg__open() from scsihack.c -> scsitransp.c, scg_settarget() -> scgsettarget.c dummy code it now always present Sat Aug 26 00:22:51 2000 Joerg Schilling * scsitransp.h 1.42 scg_settarget() -> scgsettarget.c Fri Aug 25 23:17:25 2000 Joerg Schilling * scsi-wnt.c 1.25 * scsi-vms.c 1.24 * scsi-unixware.c 1.20 * scsi-sgi.c 1.31 * scsi-osf.c 1.21 * scsi-os2.c 1.20 * scsi-next.c 1.27 * scsi-linux-sg.c 1.59 * scsi-linux-pg.c 1.34 * scsi-hpux.c 1.27 * scsi-bsd.c 1.38 * scsi-bsd-os.c 1.23 * scsi-beos.c 1.17 * scsi-aix.c 1.29 scsibus/target/lun acess now only with scg_scsibus()/scsi_target()/scg_lun() and scg_settarget() do not initialize target in struct scg_cmd because this is now done in SCG lowlevel code Thu Aug 24 00:52:32 2000 Joerg Schilling * scsitransp.h 1.41 scg Address Stucture new scg__open() without bus/target/lun Parameter scg_remote() new Wed Aug 23 22:44:26 2000 Joerg Schilling * scsi_scan.c 1.11 * scsilog.c 1.12 * drv_dvd.c 1.49 * drv_jvc.c 1.52 * drv_philips.c 1.39 * drv_sony.c 1.43 * scsi_cdr.c 1.95 scsibus/target/lun acess now only with scg_scsibus()/scsi_target()/scg_lun() and scg_settarget() do not initialize target in struct scg_cmd because this is now done in SCG lowlevel code Sun Aug 20 20:57:32 2000 Joerg Schilling * scsitransp.h 1.40 * scsitransp.c 1.67 * scsihack.c 1.34 * scsi-linux-sg.c 1.58 * scsi-linux-pg.c 1.33 * scsi-sgi.c 1.30 * scsi-next.c 1.26 * scsi-hpux.c 1.26 * scsi-bsd.c 1.37 * scsi-aix.c 1.28 * scsi_scan.c 1.10 Now using scg_settarget() Sat Aug 19 23:24:03 2000 Joerg Schilling * scsitransp.c 1.66 * scsihack.c 1.33 * scsi-wnt.c 1.24 * scsi-vms.c 1.23 * scsi-unixware.c 1.19 * scsi-sgi.c 1.29 * scsi-osf.c 1.20 * scsi-os2.c 1.19 * scsi-next.c 1.25 * scsi-linux-sg.c 1.57 * scsi-linux-pg.c 1.32 * scsi-hpux.c 1.25 * scsi-bsd.c 1.36 * scsi-beos.c 1.16 * scsi-bsd-os.c 1.22 * scsi-aix.c 1.27 * scsitransp.h 1.38 scg_reset() with Function code Parameter Sat Aug 19 22:37:30 2000 Joerg Schilling * cdrecord.h 1.63 * scsitransp.h 1.39 #ifdef's modified for new #define _SCG_*_H Sat Aug 19 21:57:31 2000 Joerg Schilling * scsireg.h 1.23 * scsidefs.h 1.22 * scgio.h 2.15 Correctly made multi include safe with #ifdef _SCG_* Sat Aug 19 21:05:25 2000 Joerg Schilling * scsitransp.c 1.65 sys/param.h removed Sat Aug 19 20:52:31 2000 Joerg Schilling * scsitransp.h 1.37 Now using scg_ops Remote Version #defines, scg__version() removed Sat Aug 19 20:23:20 2000 Joerg Schilling * scsi-sgi.c 1.28 * scsi-osf.c 1.19 * scsierrs.c 2.26 * scsitransp.c 1.64 * scsireg.h 1.22 u_char -> Uchar Sat Aug 19 19:13:16 2000 Joerg Schilling * scsitransp.c 1.63 * scsihack.c 1.32 scsitransp.c and scsihack.c separated Sat Aug 19 17:30:28 2000 Joerg Schilling * scsireg.h 1.21 Status & Sense Definitions from scsireg.h Fri Aug 18 10:40:48 2000 Joerg Schilling * scsi-vms.c 1.22 * scsi-wnt.c 1.23 * scsi-unixware.c 1.18 * scsi-sgi.c 1.27 * scsi-osf.c 1.18 * scsi-os2.c 1.18 * scsi-next.c 1.24 * scsi-linux-sg.c 1.56 * scsi-linux-pg.c 1.31 * scsi-hpux.c 1.24 * scsi-bsd.c 1.35 * scsi-bsd-os.c 1.21 * scsi-beos.c 1.15 * scsihack.c 1.31 * scsi-aix.c 1.26 * scsitransp.c 1.62 Now uses scg_ops Structure and calling via pointers Thu Aug 17 22:50:53 2000 Joerg Schilling * scsitransp.c 1.61 Bracketing typo in scg_sprintresult() removed (printed junk) Wed Aug 16 10:11:08 2000 Joerg Schilling * scsi-wnt.c 1.22 * scsi-vms.c 1.21 * scsi-unixware.c 1.17 * scsi-sgi.c 1.26 * scsi-os2.c 1.17 * scsi-osf.c 1.17 * scsi-next.c 1.23 * scsi-linux-sg.c 1.55 * scsi-hpux.c 1.23 * scsi-linux-pg.c 1.30 * scsi-bsd.c 1.34 * scsi-beos.c 1.14 * scsi-bsd-os.c 1.20 * scsi-aix.c 1.25 * scsihack.c 1.30 * scsitransp.c 1.60 scg_send() now only with scgp* Parameter Sun Aug 13 23:31:37 2000 Joerg Schilling * scsitransp.c 1.59 Buggy braketing corrected (printed 4-5 null Bytes to error output even in silent mode) Fri Aug 4 01:26:24 2000 Joerg Schilling * scsitransp.h 1.36 * scsitransp.c 1.58 Komplett umgebaut damit die Fehlerausgabe in einen String erfolgt Tue Aug 1 00:03:45 2000 Joerg Schilling * scsitransp.h 1.35 * scsitransp.c 1.57 * scsierrs.c 2.25 * scsi-wnt.c 1.21 * scsi-vms.c 1.20 * scsi-unixware.c 1.16 * scsi-sgi.c 1.25 * scsi-osf.c 1.16 * scsi-os2.c 1.16 * scsi-next.c 1.22 * scsi-linux-sg.c 1.54 * scsi-linux-pg.c 1.29 * scsi-hpux.c 1.22 * scsi-bsd.c 1.33 * scsi-bsd-os.c 1.19 * scsi-beos.c 1.13 * scsi-aix.c 1.24 All printf()'s -> js_printf(), sprintf() -> snprintf() Sun Jul 30 15:15:34 2000 Joerg Schilling * scsitransp.c 1.56 * scsitransp.h 1.34 scg_prbytes()/scg_prsense() & scg_printdev() INterface restructured Sun Jul 30 13:52:05 2000 Joerg Schilling * wm_packet.c 1.13 * scsi_scan.c 1.9 * scsilog.c 1.11 * cdrecord.c 1.106 * scsi_cdr.c 1.94 * modes.c 1.15 * drv_sony.c 1.42 * drv_simul.c 1.16 * drv_philips.c 1.38 * drv_mmc.c 1.57 * drv_jvc.c 1.51 * drv_dvd.c 1.48 Restructured for new libscg with scg_*() Thu Jul 27 01:17:47 2000 Joerg Schilling * scsitransp.c 1.55 scg_prbytes()/scg_printdev() now using FILE * Parameter scg__errmsg() restructured to be similar to snprintf() Thu Jul 27 01:15:54 2000 Joerg Schilling * scsierrs.c 2.24 Made similar to snprintf() Thu Jul 27 01:15:02 2000 Joerg Schilling * scsitransp.h 1.33 scg_prbytes()/scg_printdev() now using FILE * Parameter scg__errmsg() restructured to be similar to snprintf() Sun Jul 23 18:01:12 2000 Joerg Schilling * scsierrs.c 2.23 * scsihack.c 1.29 * scsitransp.c 1.54 * scsi-wnt.c 1.20 * scsi-vms.c 1.19 * scsi-unixware.c 1.15 * scsi-osf.c 1.15 * scsi-sgi.c 1.24 * scsi-os2.c 1.15 * scsi-next.c 1.21 * scsi-linux-sg.c 1.53 * scsi-linux-pg.c 1.28 * scsi-hpux.c 1.21 * scsi-bsd.c 1.32 * scsi-beos.c 1.12 * scsi-bsd-os.c 1.18 * scsi-aix.c 1.23 * scsitransp.h 1.32 restructured to use scg_ basieed Function names Sun Jul 23 00:28:09 2000 Joerg Schilling * scsitransp.h 1.31 open_scsi()/close_scsi()/... -> scg_open()/scg_close/... Thu Jul 20 20:12:42 2000 Joerg Schilling * cdrecord.1 1.51 Note for Volmgt & Solaris/USCSI *************** Release 1.9 ******************* Thu Jul 20 19:49:20 2000 joerg * diskid.c 1.28 New Manufacturer: "Grand Advance Technology LTD." Thu Jul 20 19:12:01 2000 Joerg Schilling * cdrecord.c 1.105 Version -> 1.9 99 Minute check better Mon Jul 3 01:19:21 2000 Joerg Schilling * scsi-linux-sg.c 1.52 Type fixed in !scglocal(scgp)->drvers < 0 Mon Jul 3 00:11:20 2000 Joerg Schilling * scsi_cdr.c 1.93 * drv_sony.c 1.41 * drv_dvd.c 1.47 * drv_mmc.c 1.56 * cdrecord.h 1.62 * cd_misc.c 1.8 msf_to_lba() with force_positive Flag for 99 Minute CD's Sun Jul 2 23:22:00 2000 Joerg Schilling * scsi-linux-sg.c 1.51 scsi_raisedma() only for Kernel-2.2.10 and newer Sat Jul 1 13:40:49 2000 Joerg Schilling * scsi-linux-sg.c 1.50 New allocated copy buffer in SCSI * -> local for raisedma Sat Jul 1 13:22:49 2000 Joerg Schilling * scsitransp.c 1.53 * scsi-wnt.c 1.19 * scsi-vms.c 1.18 * scsi-unixware.c 1.14 * scsi-sgi.c 1.23 * scsi-osf.c 1.14 * scsi-os2.c 1.14 * scsi-next.c 1.20 * scsi-linux-sg.c 1.49 * scsi-linux-pg.c 1.27 * scsi-hpux.c 1.20 * scsi-bsd.c 1.31 * scsi-bsd-os.c 1.17 * scsi-beos.c 1.11 * scsi-aix.c 1.22 maxdma/maxbuf new in SCSI * scsi_getbuf() now calls scsi_bufsize() to init new members Sat Jul 1 13:09:43 2000 Joerg Schilling * scsitransp.h 1.30 maxdma/maxbuf new in SCSI * Fri Jun 30 18:43:43 2000 Joerg Schilling * scsi-linux-sg.c 1.48 scsi_raisedma() now called with correct DMA Buffersize Fri Jun 30 18:38:48 2000 Joerg Schilling * scsitransp.c 1.52 * scsihack.c 1.28 * scsi-wnt.c 1.18 * scsi-vms.c 1.17 * scsi-unixware.c 1.13 * scsi-sgi.c 1.22 * scsi-sco.c 1.14 * scsi-osf.c 1.13 * scsi-os2.c 1.13 * scsi-next.c 1.19 * scsi-linux-sg.c 1.47 * scsi-hpux.c 1.19 * scsi-linux-pg.c 1.26 * scsi-bsd.c 1.30 * scsi-beos.c 1.10 * scsi-bsd-os.c 1.16 * scsi-aix.c 1.21 scsi_maxdma() now with 2nd Parameter "amt" for Linux sg driver Tue Jun 27 19:29:05 2000 Joerg Schilling * drv_mmc.c 1.55 Disk Subtype decoder for High Speed RW Tue Jun 27 19:19:51 2000 Joerg Schilling * cdrecord.c 1.104 Support for 99 Minute CD's Tue Jun 27 19:17:16 2000 Joerg Schilling * diskid.c 1.27 99 Minute media in table Mon Jun 26 22:40:39 2000 Joerg Schilling * diskid.c 1.26 Bestdisc Technology Corporation new Mon Jun 26 22:29:17 2000 Joerg Schilling * scsi-bsd.c 1.29 * scsi-bsd-os.c 1.15 * scsi-sgi.c 1.21 * scsi-linux-sg.c 1.46 * scsi-linux-pg.c 1.25 * scsi-next.c 1.18 better error messages into scgp->errstr Fri Jun 23 23:52:39 2000 Joerg Schilling * scsi-linux-sg.c 1.45 pvers && isold -> scglocal Fri Jun 23 23:23:33 2000 Joerg Schilling * scsi-linux-sg.c 1.44 Variable pvers only conditional for unused... warning Fri Jun 23 23:19:00 2000 Joerg Schilling * scsi-linux-sg.c 1.43 Support for SG_IO ioctl() Fri Jun 23 21:40:38 2000 Joerg Schilling * scsitransp.h 1.29 overbose new Thu Jun 22 15:20:18 2000 Joerg Schilling * scsi-linux-sg.c 1.42 SG_SCSI_RESET & SG_SET_RESERVED_SIZE new Wed Jun 21 10:34:52 2000 Joerg Schilling * scsi-linux-pg.c 1.24 Test with ATAPI SCSI status code Wed Jun 21 10:33:31 2000 Joerg Schilling * scsitransp.c 1.51 scsitransp.c split into scsitransp.c & scsi-sun.c Wed Jun 21 10:27:11 2000 Joerg Schilling * scsihack.c 1.27 scsi-sun.c new Tue Jun 20 07:20:40 2000 Joerg Schilling * scsitransp.h 1.28 secured _SCGIO_H -> _SCG_SCSISENSE_H Tue Jun 20 06:09:57 2000 Joerg Schilling * scsi-bsd.c 1.28 ATAPI Support for OpenBSD Sun Jun 4 00:55:02 2000 Joerg Schilling * cdrecord.c 1.103 #include for select() (autoconf Test for AIX), version -> 1.9a02 Sat Jun 3 17:31:06 2000 Joerg Schilling * cdrecord.c 1.102 New Option -shorttrack/-noshorttrack Fri Jun 2 22:37:51 2000 Joerg Schilling * cdrecord.h 1.61 New Flag TI_SHORT_TRACK & is_shorttrk() macro Fri Jun 2 22:32:59 2000 Joerg Schilling * cdrecord.1 1.50 New Optionen -shorttrack & -noshorttrack Fri Jun 2 21:44:43 2000 Joerg Schilling * defaults.c 1.5 Prevent a buffer overrrun with dev= option Fri Jun 2 21:43:16 2000 Joerg Schilling * auinfo.c 1.5 Check for buffer ovverun Fri Jun 2 00:03:13 2000 Joerg Schilling * drv_mmc.c 1.54 Set Pregapsize to 1 if the drive does not support 0 free(cue) if cuep == NULL Tue May 30 02:46:22 2000 Joerg Schilling * diskid.c 1.25 Restructured Tue May 30 01:06:32 2000 Joerg Schilling * diskid.c 1.24 New manufacturers: "WEALTH FAIR INVESTMENT LIMITE", "General Magnetics Ld", "MPO" Tue May 30 00:59:12 2000 Joerg Schilling * scsitransp.h 1.27 debug Parameter -> odebug Mon May 29 19:07:56 2000 Joerg Schilling * scsi-next.c 1.17 Typo corrected max_scsibus -> scglocal(scgp)->max_scsibus Mon May 29 00:31:18 2000 Joerg Schilling * scsireg.h 1.20 Mode page 2A pw_in_lead_in & side_change new Mon May 29 00:13:25 2000 Joerg Schilling * scsi_cdr.c 1.92 More Page 2A bits for cdrecord -prcap Sun May 28 18:52:11 2000 Joerg Schilling * scsi-vms.c 1.16 scsi_close() now works Sun May 28 18:40:55 2000 Joerg Schilling * cdrecord.1 1.49 -fix hint for CDR-50 & CDR-55 specified Sun May 7 16:52:20 2000 Joerg Schilling * scsi_cdr.c 1.91 * scsilog.c 1.10 * scsi_scan.c 1.8 * auinfo.c 1.4 * cd_misc.c 1.7 * audiosize.c 1.14 * cdr_drv.c 1.20 * fifo.c 1.22 * defaults.c 1.4 * wm_packet.c 1.12 * modes.c 1.14 * cdrecord.c 1.101 * drv_sony.c 1.40 * drv_simul.c 1.15 * drv_philips.c 1.37 * drv_mmc.c 1.53 * drv_jvc.c 1.50 * drv_dvd.c 1.46 * scsierrs.c 2.22 * scsitransp.c 1.50 #include Sun May 7 16:46:39 2000 Joerg Schilling * scsi_cdr.c 1.90 New DVD recognition, to allow Ricoh 9060 Sun May 7 16:11:09 2000 Joerg Schilling * scsihack.c 1.26 Support for new Mac OS X Mon May 1 20:06:37 2000 Joerg Schilling * scsitransp.c 1.49 scsi_maxmdma() cleaned up Thu Apr 27 15:06:42 2000 Joerg Schilling * cdrecord.1 1.48 Examples for cdda2wav Thu Apr 27 14:22:19 2000 Joerg Schilling * drv_mmc.c 1.52 No more error message forSony & long write in progress when Fixating Thu Apr 27 14:17:01 2000 Joerg Schilling * diskid.c 1.23 Better message for illegal ID (CD-RW) all old CD-R's now print ILLEGAL OLD CODE Wed Apr 26 11:50:19 2000 Joerg Schilling * cdrecord.c 1.100 * cdrecord.h 1.60 * scsi_cdr.c 1.89 * drv_jvc.c 1.49 * drv_dvd.c 1.45 scsi_close_tr_session()/scsi_blank() with immed Parameter *************** Release 1.8.1 ******************* Thu Apr 27 14:22:19 2000 Joerg Schilling * drv_mmc.c 1.52 No error message for Sony & long write in progress while fixating Thu Apr 27 14:17:01 2000 Joerg Schilling * diskid.c 1.23 Better printout with illegal ID for CD-RW, all old CD-R's now give ILLEGAL OLD CODE Wed Apr 26 11:50:19 2000 Joerg Schilling * cdrecord.c 1.100 * cdrecord.h 1.60 * scsi_cdr.c 1.89 * drv_jvc.c 1.49 * drv_dvd.c 1.45 scsi_close_tr_session()/scsi_blank() with immed Parameter Mon Apr 24 12:32:14 2000 Joerg Schilling * cdrecord.c 1.99 Version -> 1.8.1 final, exitcode == 0 only if fixating in Dummy Mode fails Sat Apr 22 15:37:05 2000 Joerg Schilling * diskid.c 1.22 New manufacturer "VICTOR COMPANY OF JAPAN, LIMITED", "VIVASTAR AG" Sun Apr 16 17:07:55 2000 Joerg Schilling * cdrecord.1 1.47 BURN-Proof Option for Sanyo Sun Apr 16 17:07:11 2000 Joerg Schilling * drv_mmc.c 1.51 BURN-Proof Support for Sanyo Sun Apr 16 17:06:30 2000 Joerg Schilling * cdrecord.c 1.98 New Option driveropts= better -dao usage Sun Apr 16 03:11:26 2000 Joerg Schilling * scsi_cdr.c 1.88 display BURN-Proof for cdrecord -prcap Sun Apr 16 03:08:58 2000 Joerg Schilling * defaults.c 1.3 * cdrecord.dfl 1.2 driveropts new Sun Apr 16 02:16:29 2000 Joerg Schilling * drv_sony.c 1.39 * cdrecord.h 1.59 * drv_simul.c 1.14 * drv_philips.c 1.36 * drv_jvc.c 1.48 * drv_dvd.c 1.44 open_session() now with cdr_t * Parameter for BURN-Proof Mon Apr 3 21:05:37 2000 Joerg Schilling * scsi-linux-pg.c 1.23 #include for strlen() Sat Apr 1 21:59:19 2000 Joerg Schilling * diskid.c 1.21 New manufaturer: "TAROKO INTERNATIONAL CO.,LTD.", "UNIDISC TECHNOLOGY CO.,LTD", "Hong Kong Digital Technology Co., Ltd.", "VIVA MAGNETICS LIMITED" Sat Mar 11 12:31:09 2000 Joerg Schilling * scsi_cdr.c 1.87 Sanyo CRD-R24S -> Philips CDD 521 Sat Mar 11 12:30:06 2000 Joerg Schilling * drv_mmc.c 1.50 send_opc_mmc() now calls send_opc() and suppresses ILLEGAL_REQUEST Sat Mar 11 12:26:37 2000 Joerg Schilling * cdrecord.1 1.46 WeB address changed Sun Feb 20 21:54:33 2000 Joerg Schilling * cdrecord.h 1.58 * cdrecord.c 1.97 * cdrecord.1 1.45 New Option -waiti for multi session from Pipe from mkisofs Sun Feb 20 20:56:09 2000 Joerg Schilling * cdrecord.c 1.96 scsi_in_progress() Test and usleep(100000) if Long Write in Progress Sun Feb 20 20:54:06 2000 Joerg Schilling * drv_mmc.c 1.49 scsi_in_progress() test for scsi_flush_cache() in fixate, send_cue() -> LOCAL Sun Feb 20 20:52:49 2000 Joerg Schilling * cdrecord.h 1.57 scsi_in_progress() new, send_cue() removed Sun Feb 20 20:52:15 2000 Joerg Schilling * scsi_cdr.c 1.86 scsi_in_progress() new Sat Feb 19 00:38:35 2000 Joerg Schilling * cdrecord.c 1.95 read Sectorsize from read_capacity too, for drivs without Blockdescriptor, dp->cdr_opc() new Sat Feb 19 00:33:54 2000 Joerg Schilling * scsi_cdr.c 1.85 send_opc() new Sat Feb 19 00:24:37 2000 Joerg Schilling * cdrecord.h 1.56 * drv_sony.c 1.38 * drv_simul.c 1.13 * drv_philips.c 1.35 * drv_mmc.c 1.48 * drv_jvc.c 1.47 * drv_dvd.c 1.43 Separate OPC code in driver interface Sun Feb 6 08:27:21 2000 Joerg Schilling * scsi-sgi.c 1.20 * scsi-openserver.c 1.17 * scsi-linux-sg.c 1.41 * scsi-aix.c 1.20 * scsi-bsd-os.c 1.14 * scsi-hpux.c 1.18 * scsi-linux-pg.c 1.22 * scsi-bsd.c 1.27 added missing brackets in scsi_close() to make sure that scsi_close() really closes files Sun Feb 6 08:25:14 2000 Joerg Schilling * scsi-linux-sg.c 1.40 Maxdma now is correcteven if only a prallel port is present *************** Release 1.8 ******************* Fri Jan 28 10:01:48 2000 Joerg Schilling * drv_mmc.c 1.47 * drv_dvd.c 1.42 load_media() with new doexit Parameter Reload now does not make problems with notebook type drives Fri Jan 28 09:51:26 2000 Joerg Schilling * drv_philips.c 1.34 * cdrecord.h 1.55 * cdrecord.c 1.94 load_media() with new doexit Parameter Fri Jan 28 09:50:51 2000 Joerg Schilling * scsi_cdr.c 1.84 wait_unit_ready() does not print error message if scgp->silent >= 1 Wed Jan 26 11:48:08 2000 Joerg Schilling * scsi_scan.c 1.7 Initiator-ID test past havebus() Sun Jan 23 16:39:01 2000 Joerg Schilling * cdrecord.c 1.93 Better error message for open_scsi() Sun Jan 23 16:07:46 2000 Joerg Schilling * scsi-unixware.c 1.9 New code from SCO, -scanbus now works Sun Jan 23 00:44:28 2000 Joerg Schilling * scsihack.c 1.25 scsi-sco.c -> scsi-openserver.c Tue Jan 18 00:02:33 2000 Joerg Schilling * cdrecord.c 1.92 Version -> 1.8, mlockall()/setpri() problems do not cause abort Note to -pad option for audio Files with wrong length #include for SCO Openserver Thu Jan 13 01:32:35 2000 Joerg Schilling * diskid.c 1.20 Problems with m_digitalstor (97:27/01) in table docuented Thu Jan 13 01:11:45 2000 Joerg Schilling * defaults.c 1.2 CDR_DEVICE now superseedes /etc/default/cdrecord Tue Jan 11 01:46:47 2000 Joerg Schilling * scsi-hpux.c 1.17 sprintf(.../dev/rscsi...) now uses hex digits for tgt 0..15 Sat Jan 8 23:42:25 2000 Joerg Schilling * scsi_cdr.c 1.83 scsi_read() now looks for is_atapi to allow mkisofs & ATAPI to do multi-session Fri Jan 7 02:24:28 2000 Joerg Schilling * scsihack.c 1.24 Dummyfunctions fuor new Interface Fri Jan 7 02:22:36 2000 Joerg Schilling * cdr_drv.c 1.19 set_cdrcmds() now calls return() past exit() for lint's sake Wed Dec 29 14:01:03 1999 Joerg Schilling * cdrecord.c 1.91 exargs Strukt new Setting to 2048 bytes/sector earlier for -msinfo new function exscsi() exfifo() -> excdr() Wed Dec 29 02:14:11 1999 Joerg Schilling * cdrecord.h 1.54 * fifo.c 1.21 wait_faio() new Wed Dec 29 00:38:52 1999 Joerg Schilling * diskid.c 1.19 New manufacturer: "Hile Optical Disc Technology Corp." "Friendly CD-Tek Co." "Sound Sound Multi-Media Development Limited" "kdg mediatech AG" Wed Dec 29 00:34:39 1999 Joerg Schilling * cdrecord.1 1.44 better dociumentation for SUID Installation Fri Dec 24 01:59:35 1999 Joerg Schilling * fifo.c 1.20 sp null pointer Problem in fifo_stats() fixed input-buffer -> input buffer Tue Dec 7 01:07:24 1999 Joerg Schilling * cdrecord.1 1.43 added missing .TP Sun Dec 5 13:37:16 1999 Joerg Schilling * fifo.c 1.19 kill_fifo() now kil only if faio_pid > 0 Sat Dec 4 21:36:38 1999 Joerg Schilling * diskid.c 1.18 New manufacturer: EXIMPO & Seantram Technology Inc. Seantram has been guessed before Sat Dec 4 14:15:16 1999 Joerg Schilling * cdrecord.c 1.90 intfifo()/exfifo() new kill FIFO on comerr() and signals Sat Dec 4 14:12:41 1999 Joerg Schilling * drv_dvd.c 1.41 isgui as with drv_mmc.c added Tue Nov 30 14:48:12 1999 Joerg Schilling * scsihack.c 1.23 * scsi-linux-pg.c 1.21 pg.h now locally available Sat Nov 27 21:38:54 1999 Joerg Schilling * scsi-os2.c 1.12 SRB in scsi_send() and scsi_reset() -> static to prevent core dump Sat Nov 20 17:49:38 1999 Joerg Schilling * scsi-os2.c 1.11 scgfiles array removed set_error() new added some ux_errno = EIO wait_post() now calls DosResetEventSem() in any case Sat Nov 20 14:21:09 1999 Joerg Schilling * scsi-os2.c 1.10 DEBUG2/SCANDEBUG code removed Sat Nov 20 07:23:59 1999 Joerg Schilling * diskid.c 1.17 New manufacturer: Customer Pressing Oosterhout Harmonic Hall Optical Disc Ltd. DELPHI TECHNOLOGY INC. Sat Nov 20 06:45:18 1999 Joerg Schilling * cdrecord.c 1.89 Version -> 1.8a32 5 missing set_secsize(.. oldsize) added Sat Nov 20 06:44:02 1999 Joerg Schilling * cdr_drv.c 1.18 Kodak PDC-600 in driver recognition Sat Nov 20 06:43:12 1999 Joerg Schilling * drv_mmc.c 1.46 next_wr_addr() in driver struct for CD-ROM -> cmd_ill() Sat Nov 20 06:41:39 1999 Joerg Schilling * fifo.c 1.18 fixed typo for HAVE_DOSALLOCSHAREDMEM Fri Nov 12 10:00:19 1999 Joerg Schilling * scsitransp.c 1.48 scsi_yes() now global Fri Nov 12 09:59:49 1999 Joerg Schilling * scsitransp.h 1.26 scsi_yes() new Mon Oct 18 02:38:11 1999 Joerg Schilling * cdrecord.c 1.88 always set TAO mode on startup to make checkdsize() working Mon Oct 18 01:34:34 1999 Joerg Schilling * scsilog.c 1.9 * scsi_cdr.c 1.82 i_to_short() -> i_to_2_byte() Mon Oct 18 01:15:21 1999 Joerg Schilling * scsilog.c 1.8 * scsi_cdr.c 1.81 * drv_dvd.c 1.40 * drv_mmc.c 1.45 * drv_philips.c 1.33 * iso9660.h 1.4 a_to_u_short() -> a_to_u_2_byte() Mon Oct 18 01:04:17 1999 Joerg Schilling * isosize.c 1.6 utypes.h wegen intcvt.h Mon Oct 18 00:38:01 1999 Joerg Schilling * scsi_cdr.c 1.80 * drv_sony.c 1.37 * drv_jvc.c 1.46 * drv_dvd.c 1.39 a_to_3_byte() -> a_to_u_3_byte() Mon Oct 18 00:10:18 1999 Joerg Schilling * drv_dvd.c 1.38 * drv_sony.c 1.36 * drv_jvc.c 1.45 * drv_philips.c 1.32 i_to_long() -> i_to_4_byte() Mon Oct 18 00:04:43 1999 Joerg Schilling * scsi_cdr.c 1.79 * isosize.c 1.5 * drv_dvd.c 1.37 * drv_mmc.c 1.44 * drv_jvc.c 1.44 * drv_sony.c 1.35 * drv_philips.c 1.31 * audiosize.c 1.13 * cdrecord.c 1.87 modified to use intcvt.h and a_to_4_byte() Sun Oct 17 23:21:40 1999 Joerg Schilling * iso9660.h 1.3 removed i_to_* and a_to_* macros -> intcvt.h Sun Oct 17 22:51:51 1999 Joerg Schilling * scsireg.h 1.19 struct scsi_capacity modified to use Int32_t Sat Oct 16 13:52:29 1999 Joerg Schilling * scsi_cdr.c 1.78 * drv_mmc.c 1.43 * auinfo.c 1.3 * drv_sony.c 1.34 malloc() casts for K&R C Fri Oct 15 20:28:25 1999 Joerg Schilling * cdrecord.h 1.53 * cdr_drv.c 1.17 * cdrecord.c 1.86 set_cdrmds() if 2. Parameter is NULL returns BOOL for cdrecord to check for dvd driver or not Fri Oct 15 20:19:36 1999 Joerg Schilling * scsi_cdr.c 1.77 Optima Dis Covery 650 CD-R Inquiry recognition new Fri Oct 15 20:17:17 1999 Joerg Schilling * scsi-beos.c 1.9 * scsi-osf.c 1.12 typos removed Thu Oct 7 15:33:17 1999 Joerg Schilling * scsi-bsd-os.c 1.13 * scsi-aix.c 1.19 mising bracket in scsi_open() fixed Fri Sep 17 17:59:18 1999 Joerg Schilling * cdrecord.c 1.85 Version -> 1.8a29 libscg version check #incude for win32 realtime pri Code Fri Sep 17 17:56:57 1999 Joerg Schilling * scsi_cdr.c 1.76 endless lookp in mmc_cap() removed: no medium (wait_unit_ready()) Fri Sep 17 15:48:09 1999 Joerg Schilling * scsitransp.c 1.47 HAVE_SCG #define earlier Fri Sep 17 15:42:39 1999 Joerg Schilling * scsi-linux-pg.c 1.20 duplicates with scsi-linux-sg.c fuer scg__version() removed Fri Sep 17 15:36:55 1999 Joerg Schilling * scsitransp.c 1.46 #ifdef HAVE_SCG for _scg_trans_version[] Fri Sep 17 15:09:54 1999 Joerg Schilling * scsi-wnt.c 1.17 * scsi-vms.c 1.15 * scsi-unixware.c 1.8 * scsi-sgi.c 1.19 * scsi-osf.c 1.11 * scsi-sco.c 1.13 * scsi-os2.c 1.9 * scsi-next.c 1.16 * scsi-linux-sg.c 1.39 * scsi-linux-pg.c 1.19 * scsi-hpux.c 1.16 * scsi-bsd.c 1.26 * scsi-bsd-os.c 1.12 * scsi-beos.c 1.8 * scsi-aix.c 1.18 * scsitransp.c 1.45 * scsitransp.h 1.25 scg_version() new Fri Sep 17 14:55:17 1999 Joerg Schilling * scsihack.c 1.22 Comment changed Tue Sep 14 10:57:29 1999 Joerg Schilling * scsi-linux-sg.c 1.38 scgfile variable in max_dma corrected from scgfile -> scglocal(scgp)->scgfile Fri Sep 10 14:06:19 1999 Joerg Schilling * diskid.c 1.16 Better text for Disk Typ (e.g. Long strategy type) Thu Sep 9 12:30:38 1999 Joerg Schilling * auinfo.c 1.2 isrc_illchar() Prorotype new Wed Sep 8 17:57:45 1999 Joerg Schilling * diskid.c 1.15 New manufacturer: Guann Yinn Co. Ltd. Opti.Me.S. S.p.A. Nacar Media srl Wed Sep 8 12:45:37 1999 Joerg Schilling * scsi-wnt.c 1.16 missing bracket at malloc(amt) Tue Sep 7 17:13:09 1999 Joerg Schilling * scsi-wnt.c 1.15 * scsi-unixware.c 1.7 * scsi-vms.c 1.14 * scsi-sgi.c 1.18 * scsi-sco.c 1.12 * scsi-osf.c 1.10 * scsi-next.c 1.15 * scsi-os2.c 1.8 * scsi-linux-sg.c 1.37 * scsi-linux-pg.c 1.18 * scsi-hpux.c 1.15 * scsi-bsd.c 1.25 * scsi-beos.c 1.7 * scsi-bsd-os.c 1.11 * scsi-aix.c 1.17 * scsitransp.c 1.44 First error messages past scgp->errstr less calls to comerr() Tue Sep 7 17:07:55 1999 Joerg Schilling * scsitransp.h 1.24 errstr & errptr new in SCSI * open_scsi() with errs Parameter Tue Sep 7 16:47:21 1999 Joerg Schilling * cdrecord.c 1.84 Now using new open_scsi() added some calls to flush() Tue Sep 7 16:46:04 1999 Joerg Schilling * cdrecord.1 1.42 1.6 -> 1.8 Tue Sep 7 00:21:08 1999 Joerg Schilling * drv_mmc.c 1.42 * drv_jvc.c 1.43 * drv_dvd.c 1.36 flush() for Blanking new Fri Sep 3 11:57:35 1999 Joerg Schilling * scsi-linux-sg.c 1.36 * scsi-linux-pg.c 1.17 scsi_initiator_id() in scsi-linux-pg.c -> pg_initiator_id() Thu Sep 2 18:57:59 1999 Joerg Schilling * cdrecord.c 1.83 1.8a24 -> 1.8a26 Ricoh DAO Bug (fwa != -150) workaround Realtimepri for Win32 Thu Sep 2 14:42:14 1999 Joerg Schilling * scsi_scan.c 1.6 scsi_initiator_id() new Now prints bus,tgt,lun before selektor Thu Sep 2 13:32:57 1999 Joerg Schilling * scsitransp.h 1.23 * scsi-wnt.c 1.14 * scsi-vms.c 1.13 * scsi-unixware.c 1.6 * scsi-sco.c 1.11 * scsi-sgi.c 1.17 * scsi-osf.c 1.9 * scsi-os2.c 1.7 * scsi-next.c 1.14 * scsi-linux-sg.c 1.35 * scsi-hpux.c 1.14 * scsi-linux-pg.c 1.16 * scsi-bsd.c 1.24 * scsi-bsd-os.c 1.10 * scsi-aix.c 1.16 * scsi-beos.c 1.6 * scsitransp.c 1.43 scsi_initiator_id() new Mon Aug 30 13:36:17 1999 Joerg Schilling * scsitransp.c 1.42 * drv_simul.c 1.12 * fifo.c 1.17 #include libport.h new Sun Aug 29 01:42:10 1999 Joerg Schilling * fifo.c 1.16 shared memory for OS/2 Sun Aug 29 00:52:56 1999 Joerg Schilling * fifo.c 1.15 Typo fixed (\f instead of \n) Tue Aug 10 21:34:03 1999 Joerg Schilling * scsitransp.c 1.41 * scsi-wnt.c 1.13 * scsi-vms.c 1.12 * scsi-unixware.c 1.5 * scsi-sco.c 1.10 * scsi-sgi.c 1.16 * scsi-osf.c 1.8 * scsi-os2.c 1.6 * scsi-next.c 1.13 * scsi-linux-sg.c 1.34 * scsi-linux-pg.c 1.15 * scsi-hpux.c 1.13 * scsi-bsd.c 1.23 * scsi-bsd-os.c 1.9 * scsi-beos.c 1.5 * scsi-aix.c 1.15 Static locale variable removed Test for openbydev scsi_freebuf() new Mon Aug 9 00:39:37 1999 Joerg Schilling * scsitransp.h 1.22 SCSI *->bufbase & scsi_freebuf() new Sat Aug 7 22:24:46 1999 Joerg Schilling * scsitransp.h 1.21 running/curcmdname/local new in SCSI * Sat Aug 7 22:22:36 1999 Joerg Schilling * scsitransp.c 1.40 * scsi-wnt.c 1.12 * scsi-vms.c 1.11 * scsi-unixware.c 1.4 * scsi-sgi.c 1.15 * scsi-sco.c 1.9 * scsi-osf.c 1.7 * scsi-os2.c 1.5 * scsi-next.c 1.12 * scsi-linux-sg.c 1.33 * scsi-linux-pg.c 1.14 * scsi-hpux.c 1.12 * scsi-bsd.c 1.22 * scsi-bsd-os.c 1.8 * scsi-beos.c 1.4 * scsi-aix.c 1.14 scg_maxdma removed scsi_running/scsi_command -> SCSI * struct Sat Aug 7 21:05:51 1999 Joerg Schilling * scsi-vms.c 1.10 scsi_close() new Sun Aug 1 22:08:46 1999 Joerg Schilling * fifo.c 1.14 WRITER_MAXWAIT & READER_MAXWAIT -> 240s for SAO SCSI Timeout usleep() debug code Sun Aug 1 17:14:54 1999 Joerg Schilling * cdrecord.1 1.41 Better documentation for -multi Option (DAO mode) Sun Aug 1 17:05:30 1999 Joerg Schilling * cdrecord.c 1.82 -msinfo now works even if drive is in DAO mode Now corrects trackstart values for second session in DAO Mode Sun Aug 1 16:51:35 1999 Joerg Schilling * drv_sony.c 1.33 * drv_simul.c 1.11 * drv_philips.c 1.30 * drv_mmc.c 1.41 * drv_jvc.c 1.42 * drv_dvd.c 1.35 speedp == 0 allowed if speed should remain as is Sun Aug 1 16:10:40 1999 Joerg Schilling * drv_sony.c 1.32 * drv_simul.c 1.10 * drv_mmc.c 1.40 * drv_jvc.c 1.41 * drv_dvd.c 1.34 recovery_needed()/recover()/reserve_track() References to Philips driver removed Sun Aug 1 16:02:03 1999 Joerg Schilling * drv_philips.c 1.29 * scsi_cdr.c 1.75 * cdr_drv.c 1.16 * cdrecord.h 1.52 Several functions scsi_cdr.c -> drv_philips.c new function cmd_ill() Sun Aug 1 13:25:42 1999 Joerg Schilling * drv_dvd.c 1.33 phys_end in dvd_structure_00 may be 0 for empty session Sun Jul 25 13:52:02 1999 Joerg Schilling * scsitransp.c 1.39 scsi_close() new __scgp removed Sun Jul 25 13:36:47 1999 Joerg Schilling * scsi-wnt.c 1.11 * scsi-unixware.c 1.3 * scsi-sgi.c 1.14 * scsi-osf.c 1.6 * scsi-sco.c 1.8 * scsi-os2.c 1.4 * scsi-next.c 1.11 * scsi-linux-sg.c 1.32 * scsi-linux-pg.c 1.13 * scsi-hpux.c 1.11 * scsi-bsd.c 1.21 * scsi-bsd-os.c 1.7 * scsi-beos.c 1.3 * scsi-aix.c 1.13 scsi_close() new Sun Jul 25 00:50:18 1999 Joerg Schilling * scsitransp.h 1.20 close_scsi() and scsi_smalloc()/scsi_sfree() new Sat Jul 24 22:26:22 1999 Joerg Schilling * scsitransp.h 1.19 scsi_close() new Sat Jul 24 22:25:39 1999 Joerg Schilling * scsi-vms.c 1.9 last changes fro Mr. Heuser Max Timeout corrected Sat Jul 24 22:22:44 1999 Joerg Schilling * scsi-next.c 1.10 Kernel Driver is in undefined state if SCSI Bus is not valid -> bugfix & debug prints Sat Jul 24 20:43:47 1999 Joerg Schilling * drv_mmc.c 1.39 from BCD converson (debug) for Ricoh test Trying to suppress error messages for newer MITSUMI ATAPI drives Sat Jul 24 19:27:06 1999 Joerg Schilling * cdrecord.1 1.40 Better documentation for -pad/padsize= Sat Jul 24 19:25:34 1999 Joerg Schilling * diskid.c 1.14 New manufacturer: OPTROM AUDIO DISTRIBUTORS Acer Media Technology Sat Jul 24 19:23:49 1999 Joerg Schilling * cdrecord.c 1.81 -> 1.8a24 & write_buf() Test Code Sat Jul 24 19:19:22 1999 Joerg Schilling * cdrecord.c 1.80 Check HAVE_SETPRIORITY and HAVE_NICE Sat Jul 24 19:17:30 1999 Joerg Schilling * cdrecord.c 1.79 Version -> 1.8a23 Signalhandler for wait time before burning O_BINARY define for win32 setmode(TDIN, O_BINARY) for win32 track[] Array now MAX_TRACKS+2 Print Drive Buffer size and FIFO size -force Flag to blank problematic CD-RW's set sector size to 2k before burning for Plextor set_speed...() now with speedp Parameter to allow MMC to send back actual values DAO for MMC new Options -atip/-useinfo/-force/-dao/mcn=text/isrc=text/index=list first Test for continuous Drive buffer cap printouts set_secsize() new (for Plextor & DAO) EMX Wildcard expansion for OS/2 Timeout for DAO -> minimal 200s print_toc() \ removed for K&R C print_toc() with CD-Text DosSetPriority() now korrectly doing delta setpregaps() sets values for lead-in/out checktsize() checks for DAO Sun Jul 18 14:39:31 1999 Joerg Schilling * cdrecord.h 1.51 * scsi_cdr.c 1.74 open_scsi() -> libscg Sat Jul 17 15:54:11 1999 Joerg Schilling * scsitransp.c 1.38 MAX DMA for Solaris x86 from 32k -> 56k scsierr() checks for sense[0] != 0 scsi_sense_{key!code!qual} return 0 if scsierr() == FALSE Sat Jul 17 15:37:00 1999 Joerg Schilling * scsitransp.h 1.18 open_scsi() for scsiopen.c new Mon Jun 28 01:11:18 1999 Joerg Schilling * scsi-linux-pg.c 1.12 set CDB to 0 past cdb_len Sun Jun 6 19:41:11 1999 Joerg Schilling * drv_philips.c 1.28 CDR_SWABAUDIO for pioneer_dws114x Sun Jun 6 19:40:29 1999 Joerg Schilling * modes.c 1.13 get_mode_params() now return FALSE if has_mode_page() returns FALSE Sun Jun 6 19:39:02 1999 Joerg Schilling * scsi_cdr.c 1.73 Hack for NT-4.0 ASPI ISE inquiry fake (bug in add_len) workaround for Ricoh NOT_READY key in get Mode page 2A Thu May 13 16:55:13 1999 Joerg Schilling * scsi-wnt.c 1.10 #define for format to avoid hiding messages Now uses dlopen() ha_inquiry() new better paraeters in scsi_open() SRB_HaID/SRB_HaId unified Thu May 13 15:07:36 1999 Joerg Schilling * scsi_cdr.c 1.72 check scsi_open() return code for < 0 Thu May 13 15:00:48 1999 Joerg Schilling * modes.c 1.12 Cast for ANSI C comparison Thu May 13 15:00:07 1999 Joerg Schilling * drv_sony.c 1.31 Cast for ANSI C fixed typo in error texts Thu May 13 14:31:50 1999 Joerg Schilling * drv_jvc.c 1.40 mods for ANSI C comparison Thu May 13 14:31:12 1999 Joerg Schilling * cdrecord.1 1.39 New Options -atip and index= Thu May 13 12:00:58 1999 Joerg Schilling * scsierrs.c 2.21 field_ptr now correctly used for progress printing on NOT_READY Wed May 12 01:42:18 1999 Joerg Schilling * scsi-os2.c 1.3 -scanbus support Wed May 12 01:01:54 1999 Joerg Schilling * drv_philips.c 1.27 * scsi_cdr.c 1.71 * cdr_drv.c 1.15 * scsidefs.h 1.21 DEV_RICOH_RO_1060C new (preliminary) Mon May 3 01:30:22 1999 Joerg Schilling * scsi-wnt.c 1.9 changed names and indented WBOOL definition to distinguish BOOL from Windows.h and BOOL from standard.h busses new compare busno with busses Debug File removed EventStatus as result of WaitForSingleObject() set_error() new for correct error codes scsiabort() new Tue Apr 27 23:11:59 1999 Joerg Schilling * scsi-wnt.c 1.8 Debug File removed Tue Apr 27 21:06:48 1999 Joerg Schilling * scsi-wnt.c 1.7 -scanbus now works file matrix removed check for nuber of SCSI Busses Mon Apr 26 22:37:40 1999 Joerg Schilling * scsi-wnt.c 1.6 Try to implement -scanbus Mon Apr 26 22:36:00 1999 Joerg Schilling * scsi-wnt.c 1.5 sp->u_scb.cmd_scb[0] = s.SRB_Status -> sp->u_scb.cmd_scb[0] = s.SRB_TargStat error code SCG_FATAL -> SCG_RETRYABLE Mon Apr 26 22:35:00 1999 Joerg Schilling * scsi-wnt.c 1.4 Indented II Mon Apr 26 22:34:15 1999 Joerg Schilling * scsi-wnt.c 1.3 Indented Mon Apr 26 22:33:41 1999 Joerg Schilling * scsi-wnt.c 1.2 Better comment Mon Apr 26 22:32:32 1999 Joerg Schilling * scsi-wnt.c 1.1 date and time created 99/04/26 21:32:32 by joerg Sun Apr 25 09:48:05 1999 Joerg Schilling * cdrecord.h 1.50 is_copy()/is_scms() new TI_COPY/TI_SCMS new read_subchannel() new pr_manufacturer()/disk_rcap() with rw/audio Parameters Sun Apr 25 09:46:03 1999 Joerg Schilling * drv_mmc.c 1.38 clear -dummy status by clearin -dummy state COPY & SCMS handling Sat Apr 24 14:10:19 1999 Joerg Schilling * diskid.c 1.13 * drv_mmc.c 1.37 pr_manufacturer()/disk_rcap() now using rw and audio Parameter Sat Apr 24 14:05:48 1999 Joerg Schilling * drv_philips.c 1.26 pr_manufacturer()/disk_rcap() now using rw and audio Parameter Printing of ATIP "restricted" Sat Apr 24 14:04:38 1999 Joerg Schilling * drv_sony.c 1.30 pr_manufacturer()/disk_rcap() now using rw and audio Parameter printf() Format (%l..) Sat Apr 24 14:02:11 1999 Joerg Schilling * scsi_cdr.c 1.70 read_subchannel() new Sat Apr 24 13:03:56 1999 Joerg Schilling * scsihack.c 1.21 scsi-wnt.c new Sun Apr 18 21:04:15 1999 Joerg Schilling * defaults.c 1.1 date and time created 99/04/18 20:04:15 by joerg Sun Apr 18 19:56:45 1999 Joerg Schilling * drv_sony.c 1.29 * drv_simul.c 1.9 * drv_philips.c 1.25 * drv_mmc.c 1.36 * drv_jvc.c 1.39 * cdr_drv.c 1.14 * drv_dvd.c 1.32 * cdrecord.h 1.49 New driver function cdr_send_cue Sun Apr 18 19:28:03 1999 Joerg Schilling * drv_jvc.c 1.38 g6 & g7 test functions Sun Apr 18 18:40:56 1999 Joerg Schilling * cdrecord.h 1.48 index= Option new Sun Apr 18 18:40:54 1999 Joerg Schilling * drv_mmc.c 1.35 index= Option new Sun Apr 18 00:42:59 1999 Joerg Schilling * cdrecord.h 1.47 New Flags F_SAO/F_WRITE/F_PREGAP/F_FORCE isrc in struct track is_tao()/is_pregap() new ds_cdrflags in struct disk_status cdr_buffer_cap in struct cdr_cmd cdr_set_speed_dummy with *speedp - to allow mmc to return value Functions for auinfo.c Sun Apr 18 00:18:30 1999 Joerg Schilling * scsi-linux-sg.c 1.31 MAX_SCG & MAX_TGT -> 16 Debug function for printing buscookies[] and scgfiles[][][] sg_mapbus() now with Bus Parameter and spcial handling for holes in buscookies[] sg_setup() doing range check better handling of Status byte in extended Code for mk2 Interface Sun Apr 18 00:09:52 1999 Joerg Schilling * scsi-linux-pg.c 1.11 Search slot for PP Bus backwards, as buscookies[] may have holes Sat Apr 17 22:12:22 1999 Joerg Schilling * drv_jvc.c 1.37 New Function in Driver table to read Buffer capacity buf_cap_teac(), read_peak_buffer_cap_teac (), buffer_inquiry_teac(), check_buffer_teac() new Sat Apr 17 19:32:41 1999 Joerg Schilling * scsi_scan.c 1.5 Enhancements for 16 SCSI busses and 17 Targets/Bus Sat Apr 17 19:29:25 1999 Joerg Schilling * cdr_drv.c 1.13 buf_dummy() new New Function in Driver table to read Buffer capacity Sat Apr 17 19:28:27 1999 Joerg Schilling * drv_sony.c 1.28 * drv_mmc.c 1.34 * drv_philips.c 1.24 * drv_simul.c 1.8 * drv_dvd.c 1.31 New Function in Driver table to read Buffer capacity Sat Apr 17 19:25:47 1999 Joerg Schilling * drv_sony.c 1.27 Workaround for CDU 620 (can not read lead-in Start time) Sat Apr 17 18:57:36 1999 Joerg Schilling * scsitransp.c 1.37 MAX_SCG & MAX_TGT -> 16 Workaround for /dev/scg if Target > 7 Sat Apr 17 18:55:26 1999 Joerg Schilling * scsi-bsd-os.c 1.6 * scsi-vms.c 1.8 * scsi-unixware.c 1.2 * scsi-sgi.c 1.13 * scsi-sco.c 1.7 * scsi-osf.c 1.5 * scsi-os2.c 1.2 * scsi-next.c 1.9 * scsi-hpux.c 1.10 * scsi-bsd.c 1.20 * scsi-aix.c 1.12 MAX_SCG & MAX_TGT -> 16 Sat Apr 17 18:47:39 1999 Joerg Schilling * scsi-next.c 1.8 scsi_setup() & scsi_havebus() with scgp Pointer (bug) Sat Apr 17 17:09:00 1999 Joerg Schilling * scsitransp.c 1.36 limit SunOS 4.x maxdma to 64k-1 Sat Apr 17 13:14:24 1999 Joerg Schilling * cdrecord.1 1.38 -force flag and -useinfo new Tue Apr 13 01:29:14 1999 Joerg Schilling * diskid.c 1.12 m_seantram Index 28 (typo) -> 83 Tue Apr 13 01:06:45 1999 Joerg Schilling * modes.c 1.11 Test in has_mode_page() if desired page is really available for JVC 2080 FW Bug Fri Apr 9 20:49:08 1999 Joerg Schilling * drv_jvc.c 1.36 speed -> *speedp Parameter in speed_select() Fri Apr 9 01:03:54 1999 Joerg Schilling * scsi_cdr.c 1.69 * drv_dvd.c 1.30 * audiosize.c 1.12 Signed/unsiged comparisons with cast Fri Apr 9 00:46:07 1999 Joerg Schilling * scsilog.c 1.7 cast for comparing unsigned > int Fri Apr 9 00:33:17 1999 Joerg Schilling * scsi_cdr.c 1.68 read_buff_cap() Ulong -> int Fri Apr 9 00:32:35 1999 Joerg Schilling * diskid.c 1.11 New manufacturer: "Woongjin Media corp" "INFODISC Technology Co., Ltd." "UNITECH JAPAN INC." "AMS Technology Inc." Tue Apr 6 22:08:31 1999 Joerg Schilling * drv_mmc.c 1.33 speed -> *speedp Parameter in speed_select() Read write speed Auslesen and set *speedp Test for dsp->ds_cdrflags & RF_WRITE first DAO enhancements Tue Apr 6 22:05:25 1999 Joerg Schilling * scsi_cdr.c 1.67 speed -> *speedp Parameter IN speed_select() read_buffer() WITH mode Parameter scsi_get_speed() new read_buff_cap() prints Data if sp && fp == NULL and avoids division by 0 read_cdtext() new Workaround for Philips CDD-522 cannot do read TOC MSN Tue Apr 6 01:15:52 1999 Joerg Schilling * drv_philips.c 1.23 speed -> *speedp Parameter in speed_select() Test for dsp->ds_cdrflags & RF_WRITE Tue Apr 6 01:13:14 1999 Joerg Schilling * drv_sony.c 1.26 ATIP Support Fri Apr 2 16:06:31 1999 Joerg Schilling * diskid.c 1.10 "Seantram Technology Inc." new (guess) Fri Apr 2 15:50:28 1999 Joerg Schilling * drv_sony.c 1.25 * drv_simul.c 1.7 * drv_dvd.c 1.29 speed -> *speedp Parameter in speed_select() Sun Mar 28 15:31:56 1999 Joerg Schilling * scsimmc.h 1.4 struct mmc_cue new Sun Mar 28 15:29:43 1999 Joerg Schilling * cdrecord.1 1.37 -dao and -audio default for .au & .wav Fri Mar 12 02:05:58 1999 Joerg Schilling * auinfo.c 1.1 date and time created 99/03/12 02:05:58 by joerg Sun Mar 7 22:30:42 1999 Joerg Schilling * fifo.c 1.13 roundup(bufsize, pagesize) to make each Segment page aligned Wed Mar 3 23:45:20 1999 Joerg Schilling * diskid.c 1.9 New manufacturers: vanguard, grandadv, taeil, kingpro, digitalstor Wed Mar 3 22:58:38 1999 Joerg Schilling * diskid.c 1.8 New RCAP Liste Sat Feb 20 00:00:44 1999 Joerg Schilling * scsi_cdr.c 1.66 read_buffer() new timeout for read_toc_philips() -> 240s for TEAC read_master_cue() new send_cue_sheet() new read_buff_cap() new Sun Jan 31 22:37:38 1999 Joerg Schilling * wm_packet.c 1.11 * cdrecord.c 1.78 carriage Return to beginning of Track... Strings to make error message not overwrite position Sun Jan 31 19:50:01 1999 Joerg Schilling * cdrecord.c 1.77 ignore dev= values from /etc/default/cdrecord for -scanbus Sun Jan 31 19:23:53 1999 Joerg Schilling * scsi_cdr.c 1.65 Suport for ACER CR-4020C Sun Jan 31 19:23:05 1999 Joerg Schilling * drv_philips.c 1.22 scgp->inq->ansi_version = 1; -> scgp->inq->data_format = 1; to make Plasmon RF-4100 work again Sun Jan 31 18:55:45 1999 Joerg Schilling * cdrecord.1 1.36 Hint for SVr4 and POSIX Realtime scheduler Sun Jan 31 18:49:06 1999 Joerg Schilling * scsi-bsd.c 1.19 scsi_maxdma() from MAXPHYS -> DFLTPHYS Sat Dec 12 12:36:09 1998 Joerg Schilling * scsi-beos.c 1.2 sccsid[] -> __sccsid[] Sun Dec 6 13:16:25 1998 Joerg Schilling * scsi-beos.c 1.1 date and time created 98/12/06 13:16:25 by joerg Sun Dec 6 12:41:50 1998 Joerg Schilling * scsihack.c 1.20 BeOS new Sun Dec 6 12:41:30 1998 Joerg Schilling * scsi-vms.c 1.7 New Version past phone call with vaxinf@CHCLU.CHEMIE.UNI-KONSTANZ.DE Sun Dec 6 12:10:54 1998 Joerg Schilling * cdrecord.1 1.35 FreeBSD device name bug New address for Mailing List Documentation of /etc/default/cdrecord Sat Dec 5 13:46:27 1998 Joerg Schilling * cdrecord.c 1.76 HAVE_SYS_RESOURCE_H new (BeOS) 1.8a13 -> 1.8a14 cdr_defaults() new Sat Dec 5 13:38:16 1998 Joerg Schilling * cdrecord.h 1.46 default.c/cdr_defaults() new Sun Nov 29 19:40:50 1998 Joerg Schilling * scsi-sco.c 1.6 cleaned up and permission to use /dev/xxx:target,lun Sun Nov 29 19:27:55 1998 Joerg Schilling * scsidefs.h 1.20 fused Sun Nov 29 19:25:54 1998 Joerg Schilling * scgio.h 2.14 Splitted into scgcmd.h and scgio.h Sun Nov 29 19:23:33 1998 Joerg Schilling * scsi-unixware.c 1.1 date and time created 98/11/29 19:23:33 by joerg Sun Nov 29 19:22:45 1998 Joerg Schilling * scsihack.c 1.19 UNIXWARE new Sun Nov 29 19:15:04 1998 Joerg Schilling * cdrecord.c 1.75 scgio.h -> scgcmd.h/scgio.h, scgio.h scgcmd.h scsidefs.h scsireg.h scsitransp.h -> include/scg, 1.8a11 -> 1.8a13 Sun Nov 29 19:14:20 1998 Joerg Schilling * scsierrs.c 2.20 * scsitransp.c 1.35 * cdr_drv.c 1.12 * modes.c 1.10 * scsilog.c 1.6 * wm_packet.c 1.10 * scsi_scan.c 1.4 * scsi_cdr.c 1.64 * audiosize.c 1.11 * drv_sony.c 1.24 * drv_simul.c 1.6 * drv_philips.c 1.21 * drv_mmc.c 1.32 * drv_jvc.c 1.35 * drv_dvd.c 1.28 scgio.h -> scgcmd.h/scgio.h, scgio.h scgcmd.h scsidefs.h scsireg.h scsitransp.h -> include/scg Sun Nov 29 00:39:42 1998 Joerg Schilling * scsi-sco.c 1.5 Correctly return Sense Data, EIO if errno == 0 Sat Nov 28 12:32:00 1998 Joerg Schilling * scsierrs.c 2.19 asc <= 80 -> asc < 80 for invalid sense code Sat Nov 28 00:49:19 1998 Joerg Schilling * scsierrs.c 2.18 Missing NULL as terminator for sd_ccs_error_str[] added Wed Nov 25 22:23:07 1998 Joerg Schilling * scsi-linux-pg.c 1.10 pg_send() Prototyp new Wed Nov 25 22:22:46 1998 Joerg Schilling * scsitransp.c 1.34 HAVE_PARAM_H -> HAVE_SYS_PARAM_H (Typo) Sun Nov 22 15:50:37 1998 Joerg Schilling * cdrecord.c 1.74 1.8a9 -> 1.8a11, DosSetPriority() new Sun Nov 22 15:26:16 1998 Joerg Schilling * isosize.c 1.4 * audiosize.c 1.10 Now using statdefs.h Sat Nov 21 23:41:31 1998 Joerg Schilling * scsitransp.c 1.33 #ifdef HAVE_PARAM_H for VMS Sat Nov 21 21:38:31 1998 Joerg Schilling * scsi_cdr.c 1.63 unsigned int cast for char Parameter in i_to_short() Sat Nov 7 22:21:28 1998 Joerg Schilling * cdrecord.c 1.73 1.8a8 -> 1.8a9 Fri Nov 6 23:49:59 1998 Joerg Schilling * scsi-linux-sg.c 1.30 Typo in scsi_send() header Mon Nov 2 22:22:23 1998 Joerg Schilling * scsi-bsd.c 1.18 Typ bus -> busno for CAM removed Mon Nov 2 14:55:22 1998 Joerg Schilling * scsi-os2.c 1.1 date and time created 98/11/02 14:55:22 by joerg Mon Nov 2 13:24:30 1998 Joerg Schilling * scsihack.c 1.18 Now completely using SCSI *scgp as Function parameter scsi-os2.c new Mon Nov 2 14:27:10 1998 Joerg Schilling * scsi-vms.c 1.6 * scsi-sgi.c 1.12 * scsi-sco.c 1.4 * scsi-osf.c 1.4 * scsi-next.c 1.7 * scsi-linux-sg.c 1.29 * scsi-linux-pg.c 1.9 * scsi-hpux.c 1.9 * scsi-bsd.c 1.17 * scsi-bsd-os.c 1.5 * scsi-aix.c 1.11 * scsierrs.c 2.17 * scsitransp.c 1.32 * scsitransp.h 1.17 * cdrecord.c 1.72 * cdrecord.h 1.45 * cdr_drv.c 1.11 * drv_mmc.c 1.31 * drv_philips.c 1.20 * drv_jvc.c 1.34 * drv_dvd.c 1.27 * drv_simul.c 1.5 * drv_sony.c 1.23 * scsi_cdr.c 1.62 * modes.c 1.9 * scsi_scan.h 1.2 * scsi_scan.c 1.3 * scsilog.c 1.5 * wm_packet.c 1.9 Now completely using SCSI *scgp as Function parameter Thu Oct 29 15:59:52 1998 Joerg Schilling * scsihack.c 1.17 * scsitransp.h 1.16 * scsitransp.c 1.31 * scsi-sgi.c 1.11 * scsi-vms.c 1.5 * scsi-sco.c 1.3 * scsi-osf.c 1.3 * scsi-next.c 1.6 * scsi-linux-pg.c 1.8 * scsi-linux-sg.c 1.28 * scsi-hpux.c 1.8 * scsi-bsd.c 1.16 * scsi-bsd-os.c 1.4 * scsi-aix.c 1.10 Globale Variables removed and replaced by SCSI *scgp Thu Oct 29 15:45:38 1998 Joerg Schilling * scsi-sco.c 1.2 Indented and scsi_isatapi() new Thu Oct 29 15:30:53 1998 Joerg Schilling * scsi-sco.c 1.1 date and time created 98/10/29 15:30:53 by joerg Thu Oct 29 15:21:52 1998 Joerg Schilling * cdrecord.c 1.70 Lowlevel SCSI transport Routines now have scgp Parameter, 1.8a6 -> 1.8a7 Thu Oct 29 15:21:09 1998 Joerg Schilling * scsi_cdr.c 1.61 * drv_sony.c 1.22 * modes.c 1.8 * scsilog.c 1.4 * drv_philips.c 1.19 * drv_mmc.c 1.30 * drv_jvc.c 1.33 * drv_dvd.c 1.26 Lowlevel SCSI transport Routines now have scgp Parameter Wed Oct 28 22:20:25 1998 Joerg Schilling * scsi-aix.c 1.9 dev=device:b,t,l Syntax new Mon Oct 26 03:18:37 1998 Joerg Schilling * diskid.c 1.7 manufacturer_id() new mi_num new in struct disk_man Mon Oct 26 03:17:34 1998 Joerg Schilling * cdrecord.h 1.44 manufacturer_id() new Mon Oct 26 00:27:22 1998 Joerg Schilling * diskid.c 1.6 New manufacturer: Xcitec Inc. Doremi Media Co., Ltd. Matsushita Electric Industrial Co.,Ltd. CDA Datenträger Albrechts GmbH. Sun Oct 25 13:00:22 1998 Joerg Schilling * cdrecord.c 1.71 #ifdef HAVE_SYS_MMAN_H new Sat Oct 24 01:41:22 1998 Joerg Schilling * scsi-vms.c 1.4 * scsi-osf.c 1.2 * scsi-sgi.c 1.10 * scsi-next.c 1.5 * scsi-hpux.c 1.7 * scsi-bsd.c 1.15 * scsi-bsd-os.c 1.3 * scsi-aix.c 1.8 Blind changes for 1st stage of SCSI lib: Globale Variables removed and replaced by SCSI *scgp Sat Oct 24 00:22:01 1998 Joerg Schilling * cdrecord.c 1.69 * scsi_cdr.c 1.60 open_scsi(dev, timeout, verboseopen) -> open_scsi(dev, debug, verboseopen) Fri Oct 23 23:46:23 1998 Joerg Schilling * wm_packet.c 1.8 * scsi_cdr.c 1.59 scsi_settimeout() -> do not divide by 100 Fri Oct 23 15:53:37 1998 Joerg Schilling * cdrecord.c 1.68 XXX scgp->cap->c_bsize = 2048; XXX Hack init !!! Fri Oct 23 03:14:46 1998 Joerg Schilling * scsihack.c 1.16 scsi-sco.c new Fri Oct 23 16:01:44 1998 Joerg Schilling * scsi-linux-sg.c 1.27 * scsi-linux-pg.c 1.7 * scsitransp.c 1.30 * scsitransp.h 1.15 * scsierrs.c 2.16 * scsi_cdr.c 1.58 * scsidefs.h 1.19 * cdrecord.c 1.67 * drv_dvd.c 1.25 * drv_philips.c 1.18 * drv_sony.c 1.21 * drv_jvc.c 1.32 * cdr_drv.c 1.10 * drv_mmc.c 1.29 * modes.c 1.7 * scsi_scan.c 1.2 * scsilog.c 1.3 Globale Variables removed and replaced by SCSI *scgp Thu Oct 22 18:49:06 1998 Joerg Schilling * scsi-next.c 1.4 Now using scsi_open(device, busno, tgt, tlun) Interface Tue Oct 20 18:31:25 1998 Joerg Schilling * scsi_cdr.c 1.57 CDD521/02 (Kodak PCD-200) Sun Oct 18 14:54:35 1998 Joerg Schilling * cdrecord.c 1.66 1.6.1 -> 1.7.1 *************** Release 1.6.1 ******************* Sun Oct 18 14:47:55 1998 Joerg Schilling * cdrecord.c 1.65 O_BINARY for Tracks Restore old sector size on exit() Better handling for lba (512/2048) in read_toc() Sun Oct 18 14:40:35 1998 Joerg Schilling * scsi_cdr.c 1.56 * cdrecord.h 1.43 sense_secsize() new Sat Oct 17 16:39:41 1998 Joerg Schilling * fifo.c 1.12 #ifdef SHM_LOCK to allow compilation of SysV shm on AIX Fri Oct 9 14:21:38 1998 Joerg Schilling * scsi-bsd.c 1.14 sp->ux_errno = EIO; for old Transport Interface Fri Oct 9 22:19:30 1998 Joerg Schilling * modes.c 1.24 * cd_misc.c 1.6 * fifo.c 1.11 * diskid.c 1.5 * port.c 1.8 #include new Fri Oct 9 14:21:38 1998 Joerg Schilling * cd_misc.c 1.5 * wm_packet.c 1.7 * wm_session.c 1.2 * wm_track.c 1.2 #include & #include new Thu Oct 8 15:43:50 1998 Joerg Schilling * cdrecord.h 1.42 u_char -> Uchar Wed Oct 7 18:08:46 1998 Joerg Schilling * cdrecord.c 1.64 1.7a2 -> 1.7, -fix -eject corrected wait_unit_ready(120); after a load Wed Oct 7 18:07:41 1998 Joerg Schilling * scsi_cdr.c 1.55 IMMED hack in close track/session added Wed Oct 7 18:06:02 1998 Joerg Schilling * drv_mmc.c 1.28 new function waitfix_mmc() -dummy error hiding better Wed Oct 7 17:54:02 1998 Joerg Schilling * scsi-linux-pg.c 1.6 EIO on SCG_RETRYABLE Tue Oct 6 12:53:11 1998 Joerg Schilling * scsi-vms.c 1.3 next version from vaxinf@CHCLU.CHEMIE.UNI-KONSTANZ.DE and my remarks Tue Oct 6 12:21:50 1998 Joerg Schilling * scsi-vms.c 1.2 next version from vaxinf@CHCLU.CHEMIE.UNI-KONSTANZ.DE Tue Oct 6 02:09:14 1998 Joerg Schilling * scsi-linux-pg.c 1.5 * scsi-linux-sg.c 1.26 * scsi-bsd-os.c 1.2 New device:@ Syntax Tue Oct 6 02:04:46 1998 Joerg Schilling * scsi_cdr.c 1.54 New device:@ Syntax sscanf() -> scsi_scandev() Tue Oct 6 01:50:13 1998 Joerg Schilling * cdrecord.1 1.34 new dev= Syntax (dev=device:@ / dev=device:@,lun) inserted Tue Oct 6 01:05:29 1998 Joerg Schilling * scsi-bsd.c 1.13 modified to use -lcam & cam_open_btl(busno, tgt, tlun, O_RDWR, NULL); Thu Oct 1 01:15:57 1998 Joerg Schilling * scsi-bsd.c 1.12 Mods for dev=devname:@,l Mon Sep 21 01:24:45 1998 Joerg Schilling * scsi-linux-sg.c 1.25 scsi_settimeout() -> sg_settimeout() Sat Sep 19 21:49:11 1998 Joerg Schilling * scsi-osf.c 1.1 date and time created 98/09/19 20:49:11 by joerg Tue Sep 15 02:55:28 1998 Joerg Schilling * drv_philips.c 1.17 capacity_philips() with Philips CDD-2600 Support new *_attach() now uses cdr_t * Parameter cdr_kodak_pcd600 new Pioneer DW-S114X from open_track_yamaha -> open_track_oldphilips Tue Sep 15 02:39:44 1998 Joerg Schilling * scsi-bsd.c 1.11 #ifndef BSD_CAM -> #ifndef HAVE_CAMLIB_H Tue Sep 15 02:37:58 1998 Joerg Schilling * cdrecord.c 1.63 Now uses: fctldefs.h, strdefs.h SECURITY new 1.7a1 -> 1.7a2 open_scsi() check return value and print error message Blanking time print #ifdef _SC_PRIORITY_SCHEDULING around sysconf() #ifdef PRIO_PROCESS around setpriority() for WNT Tue Sep 15 02:31:16 1998 Joerg Schilling * drv_jvc.c 1.31 Now uses: fctldefs.h, strdefs.h blank_jvc() new Tue Sep 15 02:30:11 1998 Joerg Schilling * drv_sony.c 1.20 Now uses: fctldefs.h, strdefs.h Tue Sep 15 02:22:12 1998 Joerg Schilling * cdrecord.h 1.41 struct index -> struct tindex to allow #define index strchr Tue Sep 15 02:21:24 1998 Joerg Schilling * drv_mmc.c 1.27 Now uses: fctldefs.h, strdefs.h, timdefs.h Sony 928 Support new For drives that don't support read ATIP use data from read_diskinfo Try to handle "early Return" fixating syndrom from Mitsumi drives no error messages when fixating using -dummy Tue Sep 15 02:13:49 1998 Joerg Schilling * scsi_cdr.c 1.53 Now uses: fctldefs.h, strdefs.h Tue Sep 8 01:32:08 1998 Joerg Schilling * scsihack.c 1.15 Conditional compilation for Linux pg driver to support old Linux releases Mon Sep 7 02:30:15 1998 Joerg Schilling * scsi-bsd.c 1.10 Typo in scsi_fileno() fixed Sun Sep 6 18:47:16 1998 Joerg Schilling * scsi-bsd.c 1.9 first FreeBSD CAM Support Sun Sep 6 18:22:13 1998 Joerg Schilling * scsi-bsd.c 1.8 Enhancements for NetBSD & ATAPI Sun Sep 6 01:39:22 1998 Joerg Schilling * cdr_drv.c 1.9 cdr_mmc_sony new Sun Sep 6 00:43:43 1998 Joerg Schilling * drv_simul.c 1.4 * drv_dvd.c 1.24 Now uses: strdefs.h Sat Sep 5 23:23:31 1998 Joerg Schilling * scsitransp.c 1.29 Now uses: timedefs.h fctldefs.h Mon Aug 31 01:50:12 1998 Joerg Schilling * scsi-linux-pg.c 1.4 pgbus init from -1 -> -2 Mon Aug 31 01:39:52 1998 Joerg Schilling * scsi-linux-sg.c 1.24 /dev/sga... to /dev/sgz instead of /dev/sgy now checked return nopen to allow recognition of bad dev= parameters Mon Aug 31 01:38:08 1998 Joerg Schilling * scsi-linux-pg.c 1.3 Debug print for pgbus if scsibus >= 0 ist do nothing if busno is wrong Mon Aug 31 01:03:17 1998 Joerg Schilling * scsi_cdr.c 1.52 write_xg5() new Mon Aug 31 01:02:00 1998 Joerg Schilling * scsi_cdr.c 1.51 open_scsi() now checks dev=devicename:b,t,l read_trackinfo() now don't prints Cannot read TOC Meldung in silent mode Mon Aug 31 00:43:31 1998 Joerg Schilling * scsitransp.c 1.28 scsiprintresult() new Mon Aug 31 00:40:32 1998 Joerg Schilling * scsitransp.h 1.14 scsiprintcdb()/scsiprintwdata()/scsiprintrdata()/scsiprintresult() new Sun Aug 30 12:55:35 1998 Joerg Schilling * drv_dvd.c 1.23 g5_cdbaddr()/g5_cdblen() -> scgio.h Sun Aug 30 12:54:37 1998 Joerg Schilling * scsihack.c 1.14 USE_PG -> USE_PG_ONLY Sun Aug 30 12:54:02 1998 Joerg Schilling * scgio.h 2.13 g0_cdblen()/g5_cdblen() & g5_cdbaddr() new Sun Aug 30 12:53:06 1998 Joerg Schilling * cdrecord.h 1.40 write_xg5() new Sat Aug 29 22:15:37 1998 Joerg Schilling * cd_misc.c 1.4 pr_manufacturer() reference removed from print_min_atip() Sat Aug 29 21:57:01 1998 Joerg Schilling * cdrecord.1 1.33 PP tranport documented, -scanbus doc corrected Sat Aug 29 21:01:59 1998 Joerg Schilling * scsi-linux-pg.c 1.2 #include statt "pg.h" support for integrated parallel Port Adapter & SCSI timeout code corrected DMA overrun now recognized Sat Aug 29 20:48:28 1998 Joerg Schilling * scsi-linux-sg.c 1.23 Support for integrated parallel Port Adapter & SCSI Sat Aug 29 20:22:10 1998 Joerg Schilling * cd_misc.c 1.3 * cdrecord.h 1.39 print_min_atip() new in cd_misc.c Tue Aug 25 20:23:20 1998 Joerg Schilling * scsihack.c 1.13 scsi_isatapi() defined, for default SCSI code Sun Aug 23 13:42:44 1998 Joerg Schilling * scsi-linux-sg.c 1.22 Fix for misaligned integer access in sg_header for Linux/sparc if valloc() DMA Buffer is used Thu Aug 20 10:05:14 1998 Joerg Schilling * scsi-aix.c 1.7 errno == Reference removed Thu Aug 20 01:24:33 1998 Joerg Schilling * cdrecord.1 1.32 dev=devicename:target,lun documented Tue Aug 18 04:41:56 1998 Joerg Schilling * scsihack.c 1.12 scsi-next.c & scsi-vms.c new Mon Aug 17 23:08:36 1998 Joerg Schilling * scsi-vms.c 1.1 date and time created 98/08/17 22:08:36 by joerg Mon Aug 17 22:35:19 1998 Joerg Schilling * scsihack.c 1.11 scsi-linux-pg.c new use with USE_PG Mon Aug 17 22:34:55 1998 Joerg Schilling * scsi-linux-pg.c 1.1 * scsi-bsd-os.c 1.1 date and time created 98/08/17 21:24:24 by joerg Mon Aug 17 22:22:04 1998 Joerg Schilling * scsi-linux-sg.c 1.21 MAX_SCG -> 8 search /dev/sg0... before /dev/sfg... Mon Aug 17 21:47:35 1998 Joerg Schilling * scsi-linux-sg.c 1.20 Support new sg driverinterface scgfile new to use with global ioctl's MAX_DMA_LINUX -> 4k if SG_BIG_BUFF undefined SG_MAX_SENSE -> 16 if not declared SG_GET_BUFSIZE ioctl new scsi_isatapi() new Sun Aug 16 23:47:48 1998 Joerg Schilling * misc.c 1.1 date and time created 98/08/16 22:47:48 by joerg Sun Aug 16 23:47:06 1998 Joerg Schilling * cdrecord.h 1.38 misc.c: timevaldiff() new Sun Aug 16 23:34:35 1998 Joerg Schilling * scsi-bsd.c 1.7 scsi_isatapi() new /dev/scgx may be replaced by dev=/dev/xxx:0,0 Sun Aug 16 23:32:42 1998 Joerg Schilling * scsitransp.h 1.13 * scsitransp.c 1.27 * scsi-sgi.c 1.9 * scsi-aix.c 1.6 * scsi-hpux.c 1.6 scsi_isatapi() new Fri Jul 17 03:44:13 1998 Joerg Schilling * scsihack.c 1.10 BSDI new -> scsi-bsd-os.c Fri Jun 19 19:59:07 1998 Joerg Schilling * scsitransp.h 1.12 * scsitransp.c 1.26 * scsihack.c 1.9 * scsi-sgi.c 1.8 * scsi-hpux.c 1.5 * scsi-bsd.c 1.6 * scsi-aix.c 1.5 * scsi-linux-sg.c 1.19 Use scsi_open(device, busno, tgt, tlun) with parameters Tue Jun 9 01:44:46 1998 Joerg Schilling * drv_dvd.c 1.22 korrekte Indizierung bei tracksize virtual tracklist Sat Jun 6 00:16:40 1998 Joerg Schilling * port.c 1.7 #include -> #include wegen sys/time.h Wed Jun 3 02:20:27 1998 Joerg Schilling * cdrecord.1 1.31 bytes= Option removed Introduced Mailing List Wed Jun 3 02:18:47 1998 Joerg Schilling * drv_dvd.c 1.21 Treshold for printing the Virtual Trackliste corrected Abort if first virt Track is not a multiple of the sectorsize Wed Jun 3 01:35:24 1998 Joerg Schilling * diskid.c 1.4 disk_rcap List new Wed Jun 3 01:04:49 1998 Joerg Schilling * cdrecord.c 1.62 CD -> CD/DVD Wed Jun 3 01:01:53 1998 Joerg Schilling * cdrecord.c 1.61 #if defined(_POSIX_PRIORITY_SCHEDULING) -> #if defined(_POSIX_PRIORITY_SCHEDULING) && !defined(HAVE_SYS_PRIOCNTL_H) bei LOCAL declaration Tue Jun 2 00:41:37 1998 Joerg Schilling * drv_dvd.c 1.20 attach_???() new now implementing the side effects from identify_???() Tue Jun 2 00:41:36 1998 Joerg Schilling * drv_mmc.c 1.26 attach_???() neu mit den Nebeneffekten aus identify_???() Mon Jun 1 23:34:26 1998 Joerg Schilling * scsi_cdr.c 1.50 Cast for malloc(): not every malloc() is void * Mon Jun 1 23:33:21 1998 Joerg Schilling * drv_sony.c 1.19 * drv_jvc.c 1.30 * cdr_drv.c 1.8 * cdrecord.h 1.37 * cdrecord.c 1.60 attach Routine now uses cdr_t * Parameter Mon Jun 1 22:24:42 1998 Joerg Schilling * drv_dvd.c 1.19 * scsilog.c 1.2 Superfluous & in a_to_u_short() removed Sun May 31 21:38:00 1998 Joerg Schilling * scsihack.c 1.8 OSF1 new Sun May 31 01:45:04 1998 Joerg Schilling * scsitransp.c 1.25 void * cast for valloc() return Sun May 31 00:39:54 1998 Joerg Schilling * cdrecord.c 1.59 Casts for tracksize & padsize Sat May 30 23:12:56 1998 Joerg Schilling * drv_simul.c 1.3 Verbose Message for islast Sat May 30 00:35:26 1998 Joerg Schilling * cdrecord.c 1.58 tracksize & padsize -> LLong Fri May 29 00:32:30 1998 Joerg Schilling * cdrecord.c 1.57 astoll() & getllnum() new number() -> LLong Fri May 29 00:05:29 1998 Joerg Schilling * cdrecord.1 1.30 waw in .wav Typo Fri May 29 00:03:32 1998 Joerg Schilling * drv_dvd.c 1.18 Better comment and housekeeping Thu May 28 01:08:06 1998 Joerg Schilling * drv_dvd.c 1.17 next_wr_addr_dvd() now correct with read_rzone_info() Thu May 28 00:02:01 1998 Joerg Schilling * drv_dvd.c 1.16 Verbose level documented set ds_maxblocks from rzone_info rzone_size() new phys size computation corrected Tue May 26 04:16:55 1998 Joerg Schilling * drv_dvd.c 1.15 Speed code removed Tue May 26 04:03:55 1998 Joerg Schilling * drv_dvd.c 1.14 Removed lines that have been commented out Tue May 26 04:01:03 1998 Joerg Schilling * drv_dvd.c 1.13 dvd check in identify_dvd() later Tue May 26 03:58:57 1998 Joerg Schilling * drv_dvd.c 1.12 fcntl.h errno.h sys/file.h removed Tue May 26 03:56:48 1998 Joerg Schilling * drv_dvd.c 1.11 scsiprbytes() with lverbose > 1 multi Track Hack indented Tue May 26 03:49:19 1998 Joerg Schilling * drv_dvd.c 1.10 Superfluous Debugs in SCSI routines removed Tue May 26 00:02:51 1998 Joerg Schilling * cdrecord.c 1.56 checktsize() with Llong for total Tracksize in Bytes checkdsize() now computed the remaining rest capacity Mon May 25 04:40:51 1998 Joerg Schilling * drv_dvd.c 1.9 Computations of the track split code -> long long MAX tracks -> 99 Mon May 25 04:35:54 1998 Joerg Schilling * drv_dvd.c 1.8 close_Xtrack_dvd() code -> fixate_dvd() Mon May 25 04:30:05 1998 Joerg Schilling * drv_dvd.c 1.7 send_dvd_structure() & send_dvd0F() new Mon May 25 03:46:30 1998 Joerg Schilling * drv_dvd.c 1.6 print_laserlog() new print_logpages() new Mon May 25 03:42:16 1998 Joerg Schilling * drv_dvd.c 1.5 przone() new print_dvd00()/print_dvd01()print_dvd04()/print_dvd05()/print_dvd0D()/print_dvd0E()print_dvd0F() new now reads 4096 Bytes DVD structure Mon May 25 03:17:14 1998 Joerg Schilling * drv_dvd.c 1.4 print_dvd_info() new Mon May 25 02:31:56 1998 Joerg Schilling * scsilog.c 1.1 date and time created 98/05/25 01:31:56 by joerg Mon May 25 02:05:22 1998 Joerg Schilling * scsimmc.h 1.3 rzone_info new dvd_structure_XX new Sat May 23 22:41:54 1998 Joerg Schilling * drv_simul.c 1.2 #include unixstd.h new Sat May 23 21:32:13 1998 Joerg Schilling * scsi_cdr.c 1.49 New Mode Page 2A Heuristic (min length 0x14 -> 0x10): ATAPI LITEON only gives 0x12: No Write Speed. Wed May 20 23:49:35 1998 Joerg Schilling * cdrecord.c 1.55 islast bug (|| instead of &&) fixed bytes= Option removed Tue May 19 04:11:02 1998 Joerg Schilling * drv_dvd.c 1.3 struct disk_info & struct track_info -> scsimmc.h scsilog.h new Sat May 16 13:15:21 1998 Joerg Schilling * scsimmc.h 1.2 u_char -> Uchar Sun May 10 00:12:04 1998 Joerg Schilling * scsimmc.h 1.1 date and time created 98/05/09 23:12:04 by joerg Sun May 10 00:04:17 1998 Joerg Schilling * auheader.h 1.2 generic Copyright comment Sun May 10 00:02:27 1998 Joerg Schilling * drv_mmc.c 1.25 Strukturdefinitionen -> scsimmc.h Thu May 7 22:43:07 1998 Joerg Schilling * scsi_cdr.c 1.48 strindex() -> strbeg() vendor_info / prod_ident / prod_revision new because of array index problems Kodak PCD-600 new Thu May 7 21:38:58 1998 Joerg Schilling * cdrecord.h 1.36 getnum() now extern is_mmc() with DVD recognition disk_rcap() new Thu May 7 21:38:13 1998 Joerg Schilling * cdr_drv.c 1.7 DRV_DVD new cdr_kodak_pcd600 / cdr_cdr_simul / cdr_dvd_simul new DEV_PIONEER_DVDR_S101 new DVD recognition in is_mmc() nee Thu May 7 21:15:19 1998 Joerg Schilling * cdrecord.c 1.54 1.6 -> 1.7a1 getnum() LOCAL -> EXPORT test_unit_ready() before load Medium Allow Medium removal if not ready on load_media() Thu May 7 10:43:00 1998 Joerg Schilling * diskid.c 1.3 Vendor list actualalized Wed May 6 02:52:16 1998 Joerg Schilling * cdrecord.1 1.29 simulation driver documented Wed May 6 02:41:33 1998 Joerg Schilling * audiosize.c 1.9 .wav files that are smaller than expected are handled correctly Mon May 4 02:09:55 1998 Joerg Schilling * drv_dvd.c 1.2 Function names *_mmc -> *_dvd ds_maxblock -> ds_maxblocks getdisktype_dvd() now includes more tests write_type -> WT_SAO Hack for virtual track list Sun May 3 19:37:17 1998 Joerg Schilling * scsi_cdr.c 1.47 mode_select_sg0()/mode_sense_sg0() cnt usage corrected mode_sense_sg0() movebytes() count corrected Sat May 2 00:46:07 1998 Joerg Schilling * drv_simul.c 1.1 date and time created 98/05/01 23:46:07 by joerg Fri May 1 19:26:22 1998 Joerg Schilling * scsi_cdr.c 1.46 DEV_PCD_600 new is_mmc() now uses dvdp Arg Fri May 1 19:08:34 1998 Joerg Schilling * scsidefs.h 1.18 PCD_600 new *************** Release 1.6 ******************* Fri Apr 17 12:53:59 1998 Joerg Schilling * scsi_cdr.c 1.45 & before ibuf removed because it is an array Fri Apr 17 12:45:38 1998 Joerg Schilling * scsi_cdr.c 1.44 min/sec/frame -> amin/asec/aframe because of min() Macro Thu Apr 16 01:43:26 1998 Joerg Schilling * cdrecord.1 1.26 -ignsize new web page for cdrecord added Thu Apr 16 00:55:39 1998 Joerg Schilling * diskid.c 1.2 Print if Manufacturer is in none of the tables Thu Apr 16 00:52:13 1998 Joerg Schilling * drv_mmc.c 1.24 ds_maxblock -> ds_maxblocks do get_atip() always, but print if lverbose is set Thu Apr 16 00:32:50 1998 Joerg Schilling * cdrecord.h 1.35 * cdrecord.c 1.53 ds_maxblock -> ds_maxblocks new Option -ignsize Thu Apr 16 00:31:32 1998 Joerg Schilling * drv_jvc.c 1.29 * drv_philips.c 1.16 ds_maxblock -> ds_maxblocks Sun Apr 12 16:14:07 1998 Joerg Schilling * scsi_cdr.c 1.43 Smart & Friendly CD-R4012 (TEAC CDR-55S) new Sun Apr 12 02:15:15 1998 Joerg Schilling * scsitransp.c 1.24 scsiprintcdb()/scsiprintwdata()/scsiprintrdata() new print scsiprintcdb() on errors Sun Apr 12 01:58:26 1998 Joerg Schilling * cdrecord.h 1.34 * cdrecord.c 1.52 Real Blocks new 1.6a14 -> 1.6 Wed Apr 1 03:28:36 1998 Joerg Schilling * cdrecord.c 1.51 checkgui() now has verbose print Wed Apr 1 01:36:59 1998 Joerg Schilling * drv_jvc.c 1.28 lberbose > 1 for all subcode Messages teac_wr_pma()/teac_rd_pma() new JVC Errorcodes new check for cdrecord -fix without Parameter hide Illegal Command errorcode for next_wr_addr_teac() Wed Apr 1 01:29:49 1998 Joerg Schilling * scsitransp.c 1.23 * scsi_cdr.c 1.42 * drv_mmc.c 1.23 GCC Warnings removed: printf format errors Tue Mar 31 20:58:07 1998 Joerg Schilling * cdrecord.c 1.50 ->1.6a14, LOAD & EJECT works for CD-ROM too GUI test on STDERR first Trackno -> track[0] as Hack Tue Mar 31 20:56:43 1998 Joerg Schilling * cdrecord.1 1.25 CREDITS better Documentation for tsize= & TEAC Sun Mar 29 15:31:08 1998 Joerg Schilling * cdrecord.1 1.24 -vv/-VV mods -fix: not for TEAC -load new timeout= Option tsize= description because of tracksize and TEAC nice/SunOS -> nice/others Sun Mar 29 15:26:19 1998 Joerg Schilling * drv_philips.c 1.15 open_session() with tracks & trackp Parameters Philips CDD-521 old/dumb new Pioneer DW-S114X new Sun Mar 29 15:22:29 1998 Joerg Schilling * drv_mmc.c 1.22 open_session() with tracks & trackp Parameters Check for zeroed ATIP Info wait_unit_ready() for ATAPI - sorry not working Sat Mar 28 23:43:07 1998 Joerg Schilling * cdrecord.c 1.49 check_recovery() now uses flags for unload_media() call unload_media() on input buffer, wait error, and for blank media error open_session() now usees tracks & trackp Parameters for Sizecheck Printing of is_swab() with audio fixed Sat Mar 28 23:22:30 1998 Joerg Schilling * drv_jvc.c 1.27 teac_open_session() checks tracksize ( <= 0 is not possible) Sat Mar 28 23:21:08 1998 Joerg Schilling * scsi_cdr.c 1.41 wait_unit_ready() now handles BUSY mode_sense_sg0() movebytes() count handling corrected (amt-4) better (komplete) Inquiry printing with -V JVC XR-W2001 / Plilips CDD521/00 / Traxdata CDR4120 / Pioneer CD-WO DW-S114X / Pinnacle RCD-1000 new Sat Mar 28 23:06:05 1998 Joerg Schilling * scsireg.h 1.18 SCSI Status codes Fri Mar 27 01:04:50 1998 Joerg Schilling * drv_sony.c 1.18 * cdrecord.h 1.33 open_session() with tracks & trackp parameters Thu Mar 26 22:42:29 1998 Joerg Schilling * cdr_drv.c 1.6 Pioneer DW-S 114, old Philips, dumb Philips new Tue Mar 24 21:30:08 1998 Joerg Schilling * cdrecord.h 1.32 is_*() Macros now clearer: != 0 Tue Mar 24 21:29:18 1998 Joerg Schilling * scsidefs.h 1.17 DEV_CDD_521_OLD new Mon Mar 16 00:48:34 1998 Joerg Schilling * drv_dvd.c 1.1 date and time created 98/04/20 00:48:34 by joerg Sat Mar 14 17:49:09 1998 Joerg Schilling * scsi-bsd.c 1.5 MAX_DMA_BSD 64k -> 60k Thu Mar 12 23:48:19 1998 Joerg Schilling * drv_jvc.c 1.26 set ds_maxblock next_wr_addr_jvc() uses read_B0() if track == 0 use trackp[i].trackno for TOC Lead-out Start time now uses frames teac_calibrate() inits lba_addr from read_B0() next_wr_addr_teac() with Parameters Thu Mar 12 23:42:09 1998 Joerg Schilling * cdrecord.c 1.48 use real Track nubmers -v/-V now Inc type Flag print remaining capacity Pregapsize || bug fixed Trackno in struct track wait_unit_ready() new Thu Mar 12 23:35:26 1998 Joerg Schilling * drv_philips.c 1.14 Print computed ATIP only for empty Disk ATIP printout now prints Lead-out start time too compute Disk capacity Thu Mar 12 22:33:50 1998 Joerg Schilling * drv_sony.c 1.17 close_track_sony() -> track = 0 ! mode_sense() -> get_mode_params() Thu Mar 12 22:24:10 1998 Joerg Schilling * cdrecord.h 1.31 Strukt track now includes trackno CDR_DVD new from_bcd()/to_bcd() new wait_unit_ready() new read_B0() new Thu Mar 12 22:20:40 1998 Joerg Schilling * scsi_cdr.c 1.40 unit_ready() now checks for UNIT_ATTENTION wait_unit_ready() new toc struktures char -> Uchar read_tochdr()/read_trackinfo() may have NULL Pointer Args read_B0() new Thu Mar 12 22:12:16 1998 Joerg Schilling * scsitransp.c 1.22 Print data if verbose > 1 Thu Mar 12 01:21:58 1998 Joerg Schilling * cd_misc.c 1.2 from_bcd()/to_bcd() new Tue Mar 10 00:07:50 1998 Joerg Schilling * cdrecord.c 1.47 * drv_mmc.c 1.21 checkgui() & isgui new Mon Mar 9 23:29:02 1998 Joerg Schilling * drv_mmc.c 1.20 Read ATIP non-fatal warnung in fixation with correct lverbose flag Sun Mar 8 15:02:13 1998 Joerg Schilling * scsi_cdr.c 1.39 SAF CD-R2006PRO CD-R2006, JVC R2626 new Sun Mar 8 14:59:31 1998 Joerg Schilling * cdrecord.c 1.46 Default Timeout -> 40s flags int -> long new Option -load Print Lead-out start 90 Min value corrected Sun Mar 8 14:56:53 1998 Joerg Schilling * cdrecord.h 1.30 fsamples()/frames() new Fri Mar 6 01:11:56 1998 Joerg Schilling * scsitransp.c 1.21 print SCSI command names before ABORT Thu Mar 5 01:15:26 1998 Joerg Schilling * scsierrs.c 2.15 referres -> refers Thu Mar 5 01:15:02 1998 Joerg Schilling * scsitransp.h 1.11 * scsitransp.c 1.20 scsi_sense_qual() new Mon Mar 2 22:50:12 1998 Joerg Schilling * drv_mmc.c 1.19 msf_to_lba()/lba_to_msf() -> cd_misc.c len += 2 to correct length for TOC & disk Info failed read ATIP is no fatal error better print_atip() Mon Mar 2 22:45:53 1998 Joerg Schilling * cd_misc.c 1.1 date and time created 98/03/02 22:45:53 by joerg Mon Mar 2 22:39:02 1998 Joerg Schilling * cdrecord.h 1.29 F_LOAD new All Flags sorted msf_to_lba()/lba_to_msf() new Mon Mar 2 22:36:10 1998 Joerg Schilling * drv_philips.c 1.13 philips_getlilo() new print disk manufacturer new Mon Mar 2 21:56:53 1998 Joerg Schilling * scsi_cdr.c 1.38 Pinnacle RCD 4X4, SAF CD-RW226 new Mon Feb 23 22:32:27 1998 Joerg Schilling * scsi_cdr.c 1.37 read_toc_philips() same parameters as read_toc() (ses -> fmt) Mon Feb 23 22:30:57 1998 Joerg Schilling * drv_mmc.c 1.18 msf_to_lba() corrected (+-150 bug) lba_to_msf() new Check for Complete Disk: 0xFF:0xFF/0xFF pr_manufacturer() new with lverbose different Formatting Mon Feb 23 21:54:28 1998 Joerg Schilling * cdrecord.c 1.45 80 Minute limit -> 90 Minutes Mon Feb 23 21:51:56 1998 Joerg Schilling * diskid.c 1.1 date and time created 98/02/23 21:51:56 by joerg Sun Feb 22 23:23:22 1998 Joerg Schilling * fifo.c 1.10 fifo_percent() with Parameter FIFO Bug (duoubling of a segment at end of writing) fixed Sun Feb 22 22:54:46 1998 Joerg Schilling * cdrecord.c 1.44 fifo_percent() with Parameter unit_ready() for UNLOAD removed print Disk capacity Sun Feb 22 22:52:53 1998 Joerg Schilling * wm_packet.c 1.6 fifo_percent() with Parameter Sun Feb 22 22:47:51 1998 Joerg Schilling * cdrecord.h 1.28 fifo_percent() with Parameter msf_t typedef pr_manufacturer() new Sun Feb 15 21:01:03 1998 Joerg Schilling * audiosize.c 1.8 getWavShort() & getWavLong() Definitions removed Tue Feb 10 01:00:48 1998 Joerg Schilling * cdrecord.c 1.43 New option timeout=# Mon Feb 9 12:44:40 1998 Joerg Schilling * scsi-linux-sg.c 1.18 timeout from 1/100 sec -> 1/HZ sec Sun Feb 8 21:56:01 1998 Joerg Schilling * scsi-linux-sg.c 1.17 Missing bracket at read() inserted Sun Feb 8 18:45:19 1998 Joerg Schilling * scsi_cdr.c 1.36 Tayo Yuden CD-WO EW-50 better Inquiry Sun Feb 8 15:52:15 1998 Joerg Schilling * fifo.c 1.9 fifo_percent() returns -1 if buflen == 0 dummy fifo_percent() always -1 Sun Feb 8 15:50:43 1998 Joerg Schilling * wm_packet.c 1.5 * cdrecord.c 1.42 Copyright -> 1998 fs Reference in fifo_percent() removed fifo_percent() in wm_packet new Sun Feb 8 13:54:25 1998 Joerg Schilling * cdrecord.1 1.23 fs= - administrative part .au & .wav description better -swab description Sun Feb 8 13:30:33 1998 Joerg Schilling * scsi-linux-sg.c 1.16 Fix for sendcommand() befor scsi_getbuf() call read() < 0 now handled Sun Feb 8 13:28:38 1998 Joerg Schilling * audiosize.c 1.7 Definitions for WAVE better better WAV recognition from Dave Sat Feb 7 23:20:14 1998 Joerg Schilling * drv_jvc.c 1.25 close_track_teac() fixed only audio uses no run-out blocks Sat Feb 7 23:18:43 1998 Joerg Schilling * cdrecord.c 1.41 rezero_unit() now silent not supported by all drives Sat Feb 7 23:14:03 1998 Joerg Schilling * scsi_cdr.c 1.35 Kodak CDR-240 new Sun Feb 1 23:17:33 1998 Joerg Schilling * fifo.c 1.8 HAVE_SHM -> HAVE_USGSHM was a typo Sun Feb 1 21:20:48 1998 Joerg Schilling * scsi_cdr.c 1.34 DVD enhancements in mmv_getval() & print_capabilities() Sun Feb 1 20:35:06 1998 Joerg Schilling * scsireg.h 1.17 DVD Definitions in Mode Page 2A Sun Feb 1 19:56:10 1998 Joerg Schilling * scsi-linux-sg.c 1.15 scsi_getbuf() hat nun char *ret wegen pointer Aritmetik sizeof() cast comparison to int scsi_send(): superfluous ; before scsi_settimeout() removed Sun Feb 1 19:45:21 1998 Joerg Schilling * cdrecord.c 1.40 filename new in struct track Errorcode and exit() in audio*size() Sun Feb 1 19:44:08 1998 Joerg Schilling * auheader.h 1.1 date and time created 98/02/01 19:44:08 by joerg Sun Feb 1 19:44:00 1998 Joerg Schilling * audiosize.c 1.6 auheader.h new Errorcodes Sun Feb 1 19:43:26 1998 Joerg Schilling * cdrecord.h 1.27 filename new in struct track cd_mode_page_2A *cdr_cdcap new in struct cdr_cmd Sun Feb 1 19:42:28 1998 Joerg Schilling * drv_philips.c 1.12 * drv_sony.c 1.16 * drv_mmc.c 1.17 * drv_jvc.c 1.24 cd_mode_page_2A *cdr_cdcap new in struct cdr_cmd Sun Feb 1 16:03:29 1998 Joerg Schilling * drv_mmc.c 1.16 ATIP Enhanced Sun Feb 1 15:56:31 1998 Joerg Schilling * drv_mmc.c 1.15 mmv_check() -> mmc_cap()/mmc_getval() Handle non-trayload drives warning for dummy/verbose while fixating Sun Feb 1 15:49:17 1998 Joerg Schilling * scsidefs.h 1.16 DEV_MMC_DVD, DEV_PIONEER_DVDR_S101 new Sun Feb 1 15:46:50 1998 Joerg Schilling * scsi_cdr.c 1.33 mmc_getval() & mmv_check() with dvdp DEV_MMC_DVD new Pioneer DVD-R S101, TEAC CD-R55S new allow_atapi() in print_capabilities() heuristic with speed >= 176 according to mmc2 Sun Feb 1 15:46:17 1998 Joerg Schilling * cdrecord.c 1.39 better CD-Recorder warning Sun Feb 1 14:53:02 1998 Joerg Schilling * cdrecord.c 1.38 Honour file sizes better usage() Output .au & .wav Filesize recognition early recognition of "incompatible medium" sched_setscheduler() error code (< 0) is correct Sun Feb 1 14:39:27 1998 Joerg Schilling * cdrecord.h 1.26 mmc_getval() & mmv_check() with dvdp TI_WAV & is_wav() removed Sun Feb 1 14:33:39 1998 Joerg Schilling * audiosize.c 1.5 Complete recognition of a Wavheader (with Hilfe from Heiko) Mon Jan 26 01:56:21 1998 Joerg Schilling * scsi-aix.c 1.4 valloc() re-implemented (not available in AIX libc) scsi sense handling ready Mon Jan 26 01:51:58 1998 Joerg Schilling * scsi_cdr.c 1.32 mmc_cap(), mmc_getval() new Strings for printcap() static for K&R Mon Jan 26 01:07:27 1998 Joerg Schilling * audiosize.c 1.4 Filesize - header for Sun .au Files, data_size is not always correct Sun Jan 25 23:08:00 1998 Joerg Schilling * audiosize.c 1.3 Sun .au Header new Sun Jan 25 22:58:58 1998 Joerg Schilling * cdrecord.h 1.25 TI_NOWAV -> TI_NOAUHDR, is_auname() & ausize() new Sun Jan 25 18:10:47 1998 Joerg Schilling * cdrecord.h 1.24 TI_NOWAV, mmc_cap() & mmg_getval(), is_wavname() new Sun Jan 25 16:16:23 1998 Joerg Schilling * audiosize.c 1.2 is_wavname() new Sun Jan 25 16:02:26 1998 Joerg Schilling * audiosize.c 1.1 date and time created 98/01/25 16:02:26 by joerg Sun Jan 25 13:38:40 1998 Joerg Schilling * drv_jvc.c 1.23 Errortexts for CD-R55S Sat Jan 24 17:52:52 1998 Joerg Schilling * wm_packet.c 1.4 * fifo.c 1.7 Honour file sizes Fri Jan 23 02:08:22 1998 Joerg Schilling * scsi-linux-sg.c 1.14 scsi_initdev() new to allow concurrent cdrecord's Fri Jan 23 02:04:01 1998 Joerg Schilling * drv_jvc.c 1.22 * drv_mmc.c 1.14 * drv_sony.c 1.15 * scsireg.h 1.16 * scgio.h 2.12 Uint for Bitfields -> Ucbit Sun Jan 18 14:25:01 1998 Joerg Schilling * scsitransp.c 1.19 flush() calls to correctly mix stderr/stdout Sun Jan 18 14:23:33 1998 Joerg Schilling * cdrecord.h 1.23 TI_WAV, is_wav(), wavsize() nee Sat Jan 17 22:07:03 1998 Joerg Schilling * cdrecord.1 1.22 * cdrecord.c 1.37 -reset Option new Sat Jan 17 21:53:58 1998 Joerg Schilling * cdrecord.h 1.22 F_RESET, F_PRATIP, F_PRDINFO, SES_UNDEF new Definitios for disk status and session status dstat_t enhanced CDR_NOLOLIMIT & CDR_ALLOC new fifo_percent(), allow_atapi(), mode_sense_??()/mode_select_??() new Sat Jan 17 21:35:54 1998 Joerg Schilling * fifo.c 1.6 undef FIFO if no shared mamory SHM_LOCK for Linux Stat buffer for fifosize removed sp->cont because it is not secure (use diff) fifo_percent() new Sat Jan 17 21:20:57 1998 Joerg Schilling * cdrecord.c 1.36 -reset new fifo_percent() printing for -v Sat Jan 17 21:09:24 1998 Joerg Schilling * cdrecord.1 1.21 Better description of dev= and -scanbus Tue Dec 23 01:26:35 1997 Joerg Schilling * scsi_cdr.c 1.31 Plextor PX-R24CS S&F CD-R2006PLUS Wearns CDR-632P new Tue Dec 23 01:23:34 1997 Joerg Schilling * scsi_cdr.c 1.30 Uint in Bitfields -> Ucbit Thu Dec 11 19:30:31 1997 Joerg Schilling * scsitransp.c 1.18 Print command execution time for each failed (non-silent) command Sun Nov 9 18:33:48 1997 Joerg Schilling * drv_mmc.c 1.13 Remove get Page 0x2A for Matsushita CW-7502 has_mode_page() checks "current" instead of "default" Sat Nov 8 16:11:51 1997 Joerg Schilling * cdrecord.c 1.35 Disk size check -> checkdsize() : new Fri Nov 7 00:02:20 1997 Joerg Schilling * scsi-aix.c 1.3 timeout counts in seconds Fri Nov 7 00:04:11 1997 Joerg Schilling * scsireg.h 1.15 * scgio.h 2.11 * scsi_cdr.c 1.29 * drv_sony.c 1.14 * drv_mmc.c 1.12 * drv_jvc.c 1.21 u_char in Bitfields -> Uint Thu Nov 6 20:27:08 1997 Joerg Schilling * scsihack.c 1.7 Typo __AIX -> defined(_IBMR2) || defined(_AIX) Thu Nov 6 20:26:23 1997 Joerg Schilling * scsi-aix.c 1.2 sccsid[] -> __sccsid[], fd -> f Typo, #include Thu Nov 6 20:22:14 1997 Joerg Schilling * cdrecord.1 1.20 Typo corrected Thu Nov 6 20:19:26 1997 Joerg Schilling * scsitransp.c 1.17 * scsierrs.c 2.14 * scsi_cdr.c 1.28 * scsi.c 1.4 * drv_sony.c 1.13 * drv_philips.c 1.11 * drv_mmc.c 1.11 * drv_jvc.c 1.20 #include for AIX Thu Nov 6 20:18:25 1997 Joerg Schilling * cdrecord.c 1.34 #ifdef RLIMIT_NOFILE fuer AIX Wed Nov 5 18:01:32 1997 Joerg Schilling * cdrecord.1 1.19 Better doc for fs= Wed Nov 5 17:57:50 1997 Joerg Schilling * drv_mmc.c 1.10 msf_to_lba() new, get_diskinfo() new, di_to_dstat() new, getdisktype_mmc() new, additions for Matsushita CW-7502 Wed Nov 5 17:43:41 1997 Joerg Schilling * fifo.c 1.5 switch -> if then else Wed Nov 5 17:15:45 1997 Joerg Schilling * cdrecord.c 1.33 init struct disk_status, better aritmetic for disk size Wed Nov 5 17:14:29 1997 Joerg Schilling * fifo.c 1.4 print FIFO min fill in percent Tue Nov 4 11:20:22 1997 Joerg Schilling * scsi_cdr.c 1.26 return (mode_select_g0(dp, cnt, smp, pf)) was missing in mode_select() Tue Nov 4 10:35:02 1997 Joerg Schilling * scsi-linux-sg.c 1.13 Check for NULL at return of valloc() Tue Nov 4 00:13:35 1997 Joerg Schilling * drv_jvc.c 1.19 New flag CDR_NO_LOLIMIT Sun Nov 2 16:17:10 1997 Joerg Schilling * scsi_cdr.c 1.25 SCSI mode(6/10) conversion for ATAPI, distinguish between S&F 2006PLUS / S&F 2006PLUS Sun Nov 2 14:57:57 1997 Joerg Schilling * scsitransp.c 1.16 Print finish time Sun Nov 2 14:54:50 1997 Joerg Schilling * scgio.h 2.10 i_to_4_byte new Thu Oct 23 19:21:19 1997 Joerg Schilling * scsihack.c 1.6 AIX Support Thu Oct 23 19:20:25 1997 Joerg Schilling * scsi-aix.c 1.1 date and time created 97/10/23 18:20:25 by joerg Thu Oct 23 19:12:02 1997 Joerg Schilling * drv_mmc.c 1.9 Enhancements for packet writing Thu Oct 23 01:35:02 1997 Joerg Schilling * cdrecord.1 1.18 New options -prcap, -packet, pktsize =#, -noclose Wed Oct 22 23:50:44 1997 Joerg Schilling * drv_jvc.c 1.18 * wm_packet.c 1.3 * cdrecord.c 1.32 fflush(stdout) -> flush(), flush() after Fixating... Wed Oct 22 23:49:12 1997 Joerg Schilling * scsi_cdr.c 1.24 scsi_close-session() -> scsi_close_tr_session() Wed Oct 22 23:49:11 1997 Joerg Schilling * cdrecord.h 1.21 scsi_close-session() -> scsi_close_tr_session() Sun Oct 19 15:41:35 1997 Joerg Schilling * scsi_cdr.c 1.23 * cdrecord.c 1.31 Prevent medium removal problems fixed (read TOC) & Matsushita CD-750? Sun Oct 19 15:40:32 1997 Joerg Schilling * scsidefs.h 1.15 Matsushita CW-7501 & CW-7502 Sun Oct 19 02:08:53 1997 Joerg Schilling * drv_sony.c 1.12 * drv_philips.c 1.10 * drv_jvc.c 1.17 * wm_packet.c 1.2 * cdrecord.h 1.20 * cdrecord.c 1.30 next_wr_address() has track_t * added Sun Oct 19 01:37:02 1997 Joerg Schilling * drv_jvc.c 1.16 read_disk_info() -> read_disk_info_teac(), zero pre-gap audio support, opt_power_judge() timeout -> 60 sec Sun Oct 19 01:33:21 1997 Joerg Schilling * scsi_cdr.c 1.22 read_disk_info() new, print_capabilities() new Sun Oct 19 00:40:36 1997 Joerg Schilling * cdrecord.c 1.29 * cdrecord.h 1.19 get_buf() new, -prcap & print_capabilities() new, -packet new, pktsize=# new Sun Oct 19 00:36:32 1997 Joerg Schilling * wm_track.c 1.1 * wm_session.c 1.1 * wm_packet.c 1.1 date and time created 97/10/18 23:36:31 by joerg Sat Oct 18 19:14:05 1997 Joerg Schilling * scsi.c 1.3 stdlib.h -> stdxlib.h, unistd.h -> unixstd.h Sat Oct 18 01:34:19 1997 Joerg Schilling * modes.c 1.3 Ausgabe der Mode Parameter wenn mode_select() nicht klappt & return FALSE **** 1.6a3 *** Sun Oct 12 20:00:21 1997 Joerg Schilling * cdrecord.1 1.17 * cdrecord.c 1.28 New options pregap= defpregap= Sun Oct 12 19:30:45 1997 Joerg Schilling * cdrecord.h 1.18 is_first() & is_last() new Sat Oct 11 18:01:28 1997 Joerg Schilling * cdrecord.c 1.27 islast debug printf deleted Sat Oct 11 17:57:43 1997 Joerg Schilling * scsi_cdr.c 1.21 * drv_sony.c 1.11 * drv_philips.c 1.9 * drv_mmc.c 1.8 * drv_jvc.c 1.15 * cdrecord.h 1.17 * cdrecord.c 1.26 islast for TEAC & no run-out blocks for disksize computing Sat Oct 11 14:54:03 1997 Joerg Schilling * drv_jvc.c 1.14 OLD_CLOSE_TRACK re-aktiviert, clear_subcode() in open_track(), set_limits() in open_track() for audio without run-out, dummy sector -> static to be zeroed Thu Oct 9 14:14:24 1997 Joerg Schilling * drv_jvc.c 1.13 Audio Tracks have no link&run-in Thu Oct 9 02:01:23 1997 Joerg Schilling * drv_jvc.c 1.12 SWABAUDIO Flag new Wed Oct 8 17:24:40 1997 Joerg Schilling * scsi_cdr.c 1.20 * drv_sony.c 1.10 * drv_philips.c 1.8 * drv_mmc.c 1.7 * cdrecord.h 1.16 * cdrecord.c 1.25 Modification of data structures for JVC/TEAC Wed Oct 8 17:23:41 1997 Joerg Schilling * fifo.c 1.3 WRITER_MAXWAIT 20 -> 120 s Wed Oct 8 17:14:04 1997 Joerg Schilling * drv_jvc.c 1.11 Enhancements for audio and multi track disks Wed Oct 8 14:48:06 1997 Joerg Schilling * cdrecord.1 1.16 Better doc for padsize & fs= Mon Oct 6 20:37:39 1997 Joerg Schilling * drv_jvc.c 1.10 Modified to use pad_track() Mon Oct 6 20:32:11 1997 Joerg Schilling * cdrecord.c 1.24 In pad_track(): if (bytesp != 0) check was missing ->coredump Mon Oct 6 20:29:22 1997 Joerg Schilling * scsi_cdr.c 1.19 SMART&FRIENDLY CD-R2006 Sun Oct 5 16:53:45 1997 Joerg Schilling * drv_mmc.c 1.6 verbose printing modified Sun Oct 5 16:53:09 1997 Joerg Schilling * cdrecord.c 1.23 Check for bytesp != 0 in pad_track() Sat Oct 4 01:09:56 1997 Joerg Schilling * cdrecord.c 1.22 realtime raisepri Problem for HP-UX fixed (function present bot not working) Fri Oct 3 21:33:13 1997 Joerg Schilling * scsi_cdr.c 1.18 * drv_sony.c 1.9 * drv_philips.c 1.7 * drv_mmc.c 1.5 * drv_jvc.c 1.9 * cdrecord.h 1.15 * cdrecord.c 1.21 * cdrecord.1 1.15 * cdr_drv.c 1.5 new option blank=type for CD-RW Fri Oct 3 16:23:00 1997 Joerg Schilling * cdrecord.c 1.20 pad_track() new, await_faio() new & init_faio() befor wait loop, always pad to 300 sectors , padsize= option new, DEFAULT_FIFOSIZE new Thu Oct 2 02:02:10 1997 Joerg Schilling * fifo.c 1.2 MIN_BUFFERS -> 3, await_faio() new, kill_faio() new, stdin EOF check, Messages only for debug Thu Oct 2 01:38:39 1997 Joerg Schilling * cdrecord.1 1.14 padsize Option new, nice --18 bug, 's' & 'f' mult for getnum() Thu Oct 2 01:31:28 1997 Joerg Schilling * drv_jvc.c 1.8 sleep()'s added to cure fixating problems ??? Thu Oct 2 01:19:46 1997 Joerg Schilling * cdrecord.h 1.14 DEFAULT_FIFOSIZE, roundup(), tracksize & padsize -> long, pad_track() new, await_fifo() & kill_fifo() new, minutes() cast to int Wed Sep 24 00:02:39 1997 Joerg Schilling * cdrecord.c 1.19 Fifo & tracksize Option Tue Sep 23 23:46:27 1997 Joerg Schilling * scsi-sgi.c 1.7 Bug with resid != 0 fixed Sun Sep 21 23:20:15 1997 Joerg Schilling * cdrecord.1 1.13 fs= Option, tsize= Option, mkisofs | cdrecord with fs= EXAMPLE Sun Sep 21 22:58:34 1997 Joerg Schilling * fifo.c 1.1 date and time created 97/09/21 21:58:34 by joerg Sun Sep 21 22:45:08 1997 Joerg Schilling * cdrecord.h 1.13 faio_get_buf() & fifo_stats() Sun Sep 21 01:12:43 1997 Joerg Schilling * cdrecord.h 1.12 fifo code Wed Sep 17 13:55:57 1997 Joerg Schilling * drv_jvc.c 1.7 Typo in cdr_write_teac() EXPORT -> LOCAL Wed Sep 17 13:55:06 1997 Joerg Schilling * cdrecord.c 1.18 raisepri() has Parameter (n below Max), _POSIX_PRIORITY_SCHEDULING, _POSIX_MEMLOCK *************** Release 1.5 ******************* Mon Sep 15 16:46:16 1997 Joerg Schilling * README 1.9 Anpassungen fuer release 1.5 Wed Sep 10 18:40:49 1997 Joerg Schilling * cdrecord.c 1.17 Print always Copyright except for -msinfo Wed Sep 10 18:12:59 1997 Joerg Schilling * scsi_cdr.c 1.17 Inquiry debug data indented Mode Parameters only for verbose Wed Sep 10 17:57:32 1997 Joerg Schilling * cdrecord.c 1.16 Flags defs von cdrecord.c -> cdrecord.h load_media() new load/unload_madia() global Track verbose output after inquiry Test errorcodes while burning Dummy blocks added for close_track() is not an error -nofix Flag activated Exit code for burning errors: -2 Swabaudio automatic Wed Sep 10 17:43:12 1997 Joerg Schilling * cdrecord.h 1.11 Flag defs from cdrecord.c getdisktype() with cdr_t * load_media() new load/unload_madia() global Wed Sep 10 17:42:13 1997 Joerg Schilling * cdr_drv.c 1.4 * drv_jvc.c 1.6 getdisktype() with cdr_t * Wed Sep 10 17:41:02 1997 Joerg Schilling * drv_philips.c 1.6 philips_getdisktype() new for automatic eject on "Command Sequence Error" Wed Sep 10 16:50:56 1997 Joerg Schilling * cdrecord.1 1.12 Scsibus , typo removed Wed Sep 10 15:10:03 1997 Joerg Schilling * cdrecord.1 1.11 1.4 -> 1.5 Wed Sep 10 15:04:26 1997 Joerg Schilling * drv_sony.c 1.8 new_track_sony() return valoe corrected Wed Sep 10 15:03:36 1997 Joerg Schilling * cdrecord.1 1.10 Changes for cdrecord-1.5 Thu Sep 4 19:26:00 1997 Joerg Schilling * scsi-linux-sg.c 1.12 Use channel on multi channel controlers Thu Sep 4 19:09:10 1997 Joerg Schilling * drv_jvc.c 1.5 * drv_sony.c 1.7 * scsi_cdr.c 1.16 inq.ansi_version -> inq.data_format for all mode_select() calls for Philips CDD-522 (version == 1 , format == 2) Wed Sep 3 02:00:33 1997 Joerg Schilling * scsi-linux-sg.c 1.11 scsi_mapbus() new better timeout handling copy Struct now automatic Variable Sense Data error = SCG_RETRYABLE Mon Sep 1 01:25:16 1997 Joerg Schilling * scsi-sgi.c 1.6 * scsi-linux-sg.c 1.10 * scsi-hpux.c 1.4 * scsi-bsd.c 1.4 Last tuning make all implementations equal Open only one file if possible. Better bound checking Sun Aug 31 23:21:06 1997 Joerg Schilling * scsi-hpux.c 1.3 Array again has 8 Luns havebus tests bounds Sun Aug 31 23:18:35 1997 Joerg Schilling * scsi-sgi.c 1.5 MAX_* introduced, open max 1 lun (for now) Sun Aug 31 20:14:02 1997 Joerg Schilling * scsi-hpux.c 1.2 MAX_LUN now 1 Sun Aug 31 20:10:25 1997 Joerg Schilling * scsi-hpux.c 1.1 date and time created 97/08/31 19:10:25 by joerg Sun Aug 31 18:00:16 1997 Joerg Schilling * scsihack.c 1.5 HP-UX added Tue Aug 26 19:37:15 1997 Joerg Schilling * cdrecord.c 1.15 init dp in main now correctly Tue Aug 26 17:50:20 1997 Joerg Schilling * scsi-sgi.c 1.4 Support complete without using -lds Tue Aug 26 17:47:35 1997 Joerg Schilling * scsi_cdr.c 1.15 scsibus/target/lun now now -1 if bus is scanned to make sure that not ony one target can be opened. Tue Aug 26 17:46:22 1997 Joerg Schilling * cdrecord.c 1.14 test_unit_ready() after select_target() (SCANBUS) Tue Aug 26 01:47:41 1997 Joerg Schilling * scsi-sgi.c 1.3 unused includes removed Mon Aug 25 22:02:35 1997 Joerg Schilling * scgio.h 2.9 * scsitransp.c 1.15 * scsi-sgi.c 1.2 * scsi-linux-sg.c 1.9 * scsi-bsd.c 1.3 errno -> ux_errno in scg_cmd for POSIX multithread Mon Aug 25 21:27:55 1997 Joerg Schilling * scsi-sgi.c 1.1 date and time created 97/08/25 20:27:55 by joerg Mon Aug 25 18:10:12 1997 Joerg Schilling * cdrecord.c 1.13 raisepri() not always done Sun Aug 24 22:58:37 1997 Joerg Schilling * drv_jvc.c 1.4 First pre-aplha makes one data track only Sun Aug 24 17:03:05 1997 Joerg Schilling * cdrecord.c 1.12 New options: driver=name -checkdrive -inq -scanbus -nofix set_trsizes() later get_cdr_cmds() new first simple sizecheck "swap" output from print_data_track() removed Sun Aug 24 16:54:31 1997 Joerg Schilling * cdrecord.h 1.10 struct disk_status new is_unknown_dev() new is_mmc() new mmc_check() new set_cdrcmds() new Sun Aug 24 16:53:09 1997 Joerg Schilling * scsi_cdr.c 1.14 is_unknown_dev() new is_mmc() new mmc_check() new open_scsi() modified for scsi_scan() Device recognition new for CD-R scsi_load() now correct Sun Aug 24 16:22:22 1997 Joerg Schilling * cdrecord.1 1.9 -nofix new driver=name new -checkdrive new -inq new -scanbus new Sense Output uses new form Sun Aug 24 16:19:42 1997 Joerg Schilling * drv_mmc.c 1.4 CDR_SWABAUDIO new cd_mode* pages -> scsireg.h identify_mmc() uses mmc_check() Sun Aug 24 16:18:00 1997 Joerg Schilling * cdr_drv.c 1.3 set_cdrcmds() new get_cdrcmds() enhanced Sun Aug 24 15:47:30 1997 Joerg Schilling * drv_sony.c 1.6 * drv_philips.c 1.5 CDR_SWABAUDIO Flag new Sun Aug 24 14:51:43 1997 Joerg Schilling * scsidefs.h 1.14 CDD-2000 & CDD-2600 new MMC Definitionen new Sun Aug 24 14:18:47 1997 Joerg Schilling * scsireg.h 1.14 CD mode pages 05 & 2A Sun Aug 10 19:29:38 1997 Joerg Schilling * drv_philips.c 1.4 * drv_sony.c 1.5 * drv_mmc.c 1.3 * cdrecord.h 1.9 * cdrecord.c 1.11 cdr_driver -> cdr_drname + cdr_drtext open_track() with track_info * instead of many arguments Sun Aug 10 18:10:14 1997 Joerg Schilling * scsi_cdr.c 1.13 LOAD (A6) command now uses correct SCSI definition Sun Aug 10 17:43:35 1997 Joerg Schilling * scsi-linux-sg.c 1.8 Buffer overflow in sg_rq corrected timeout corrected (semicolon past if) 12 Byte Hack now OK Sun Aug 10 17:42:06 1997 Joerg Schilling * scgio.h 2.8 SCSI g5 command struct now ansi compliant Sun Aug 10 17:40:30 1997 Joerg Schilling * scsihack.c 1.4 SGI include Fri Jul 18 13:41:46 1997 Joerg Schilling * scsi_cdr.c 1.12 read_capacity() new scsi_load_unload() new scsi_set_sped() new write_xg1() new read_toc() for SCSI-3 new read_toc_philips() from old name read_track_info() -> read_track_info_philips() read_track_info() new scsi_close_session() new first_writable_address() with address Pointer read_tochdr() with cdr_t * ???? read_session_offset() with offset Pointer + Version for SCSI-3 is_cdrecorder() removed, Taiyo Yuden new Fri Jul 18 12:35:02 1997 Joerg Schilling * scsi-linux-sg.c 1.7 with new ioctl() SCSI_IOCTL_GET_BUS_NUMBER more SCSI busses Fri Jul 18 02:49:46 1997 Joerg Schilling * cdrecord.1 1.8 -version better -isosize Doku -multi warning removed Fri Jul 18 02:44:11 1997 Joerg Schilling * cdrecord.c 1.10 fix_it now past open_session() next_writable_address() and read_session_offset() now with adress Pointer -version usage() superfluous argument removed with lout Fri Jul 18 02:31:23 1997 Joerg Schilling * cdrecord.h 1.8 * drv_mmc.c 1.2 SCSI-3/mmc first implementation Fri Jul 18 02:25:10 1997 Joerg Schilling * drv_jvc.c 1.3 * drv_philips.c 1.3 * drv_sony.c 1.4 next_writable_address now has adress pointer read_session_offset_philips() extracted Thu Jul 17 18:12:43 1997 Joerg Schilling * scsi-bsd.c 1.2 ifdef for BSD SENSE bug Thu Jul 17 17:43:10 1997 Joerg Schilling * isosize.c 1.3 filedescriptor sense (seek) test. Tue Jul 15 21:27:29 1997 Joerg Schilling * isosize.c 1.2 & before vd.vd_type deleted Tue Jul 15 21:26:57 1997 Joerg Schilling * drv_sony.c 1.3 & before mode deleted Tue Jul 15 21:16:46 1997 Joerg Schilling * cdrecord.c 1.9 version string write_track_data() with startsec parameter cd_recorder/drive recognition now uses cdr_t print_toc() with cdr_t parameter open_session() with multi parameter Progress printing in write_track_data() now uses correct rounding dbtype with -multi corrected read_session_offset() with cdr_t parameter print_toc() prints sector numbers correctly and 'lout' for 0xAA Tue Jul 15 13:34:04 1997 Joerg Schilling * cdr_drv.c 1.2 drive_identify may modify cdr_t struct pointer Yamaha CDR-400 correct with cdr_mmc Tue Jul 15 13:24:49 1997 Joerg Schilling * drv_philips.c 1.2 * drv_jvc.c 1.2 * drv_sony.c 1.2 open_track() with dbtyp arg open_session() with multi arg struct cdr_t driver flags filled in driver type string Tue Jul 8 19:42:42 1997 Joerg Schilling * scsi-linux-sg.c 1.6 /dev/sg0 ... tested too Tue Jul 8 18:00:39 1997 Joerg Schilling * scsi-bsd.c 1.1 date and time created 97/07/08 17:00:39 by joerg Tue Jul 8 17:59:20 1997 Joerg Schilling * scsihack.c 1.3 New Implementation for *BSD Sun Jun 22 19:58:40 1997 Joerg Schilling * scsi_cdr.c 1.11 Smart & Friendly Support *************** Release 1.4 ******************* Sat Mai 21 19:58:42 1997 Joerg Schilling * cdrecord.1 1.7 Updates for release 1.4 Sat Mai 21 18:11:25 1997 Joerg Schilling * scsi.c 1.2 scsireg.h Include Sat Mai 21 00:52:33 1997 Joerg Schilling * drv_sony.c 1.1 date and time created 97/05/20 23:52:33 by joerg Sat Mai 21 00:27:56 1997 Joerg Schilling * drv_philips.c 1.1 date and time created 97/05/20 23:27:56 by joerg Sat Mai 21 00:27:50 1997 Joerg Schilling * drv_mmc.c 1.1 date and time created 97/05/20 23:27:50 by joerg Sat Mai 21 00:27:43 1997 Joerg Schilling * drv_jvc.c 1.1 date and time created 97/05/20 23:27:43 by joerg Sat Mai 21 00:27:14 1997 Joerg Schilling * scsi_cdr.c 1.10 mode_select() uses inq.ansi_version >= 2 Sat Mai 21 00:26:42 1997 Joerg Schilling * cdrecord.h 1.7 attach_unknown() new Sat Mai 21 00:26:05 1997 Joerg Schilling * cdr_drv.c 1.1 date and time created 97/05/20 23:26:05 by joerg Thu Mai 19 23:46:54 1997 Joerg Schilling * cdrecord.c 1.8 Struct track -> cdrecord.h DB_XXX Data block types cdr_cmd Struct as Drive Abstraction Layer -eject Flag checktsize() new CDR_SPEED & CDR_DEVICE Thu Mai 19 16:59:44 1997 Joerg Schilling * cdrecord.h 1.6 struct track from cdrecord.c DB_XXX Data block types cdr_cmd Struct as Drive Abstraction Layer Thu Mai 19 15:42:53 1997 Joerg Schilling * scsi_cdr.c 1.9 Prototypes lokal too scsi_load_unload() -> load_unload_philips() start_stop_unit() now with eject close_track_philips() new recover with track parameter mode_sense() new speed_select splitted inquiry news new drives scsi_cdr_write() Mon Mai 16 15:46:48 1997 Joerg Schilling * config.h 1.1 date and time created 97/05/16 14:46:48 by joerg Mon Mai 16 15:46:48 1997 Joerg Schilling * scsi.c 1.1 date and time created 97/05/16 14:46:48 by joerg Fri May 23 22:09:21 1997 Joerg Schilling * scsitransp.c 1.14 bad 2. Parameter in gettimeofday -> struct timezone * Fri Apr 23 22:08:16 1997 Joerg Schilling * scsierrs.c 2.13 missing %s in Formatstring added Wed Apr 14 00:54:03 1997 Joerg Schilling * scsireg.h 1.13 new scsi device types Wed Apr 14 00:53:28 1997 Joerg Schilling * scsitransp.c 1.13 scsireset() into hack part scsi_setnonstderrs() new, scsierrmsg() chganges new scsi devicetype codes, Solaris x86 dmasize without gethostid() Wed Apr 14 00:46:27 1997 Joerg Schilling * scsitransp.h 1.10 Changes for scsierrs.c enhancements Wed Apr 14 00:45:26 1997 Joerg Schilling * scsierrs.c 2.12 Enhancements for SCSI-2 & SCSI-3 Tue Apr 6 17:15:43 1997 Joerg Schilling * scsidefs.h 1.13 Different order & Yamaha CDR-400, Sony CDU-924, Ricoh RO-1420, Teac CD-R50 new Tue Apr 6 16:36:38 1997 Joerg Schilling * scgio.h 2.7 Enhancements for SCSI-2 & SCSI-3 Tue Apr 6 14:10:35 1997 Joerg Schilling * scsi-linux-sg.c 1.5 CCD-> CCS Typo Tue Apr 6 13:59:16 1997 Joerg Schilling * scsihack.c 1.2 scsireset() -> transport specific part Tue Apr 6 13:59:16 1997 Joerg Schilling * scsi-linux-sg.c 1.4 scsireset() -> transport specific part *************** Release 1.3 ******************* Fri Mar 4 19:48:35 1997 Joerg Schilling * README 1.6 Changes for Release 1.3 Fri Mar 4 18:57:02 1997 Joerg Schilling * cdrecord.1 1.6 release 1.3 Fri Mar 4 18:46:37 1997 Joerg Schilling * cdrecord.1 1.5 Changes for Release 1.3 Fri Mar 4 11:55:28 1997 Joerg Schilling * scsi-linux-sg.c 1.3 scsihack.c & scsi-linux-sg.c splitted Fri Mar 4 11:53:59 1997 Joerg Schilling * scsihack.c 1.1 date and time created 97/03/04 10:53:59 by joerg Fri Mar 4 11:52:42 1997 Joerg Schilling * iso9660.h 1.2 Quick hack for ANSI C Wed Mar 2 17:16:35 1997 Joerg Schilling * scsi_cdr.c 1.8 open_scsi() with verbose arg write_track() & write_track_info() isaudio/preemp -> sectype read_toc() new, read_header() new, read_track_info() new first_writable_addr() now working read_tochdr() new, read_trackinfo() new, read_session_offset() new is_cddrive() new read_scsi() now korrekt with G0_MAXADDR & cnt < 256 HACK XXX scsi_capacity to 2048 bytes Sectorsize initialized for mkisofs-1.10 Wed Mar 2 16:51:24 1997 Joerg Schilling * scsitransp.c 1.12 BAD -> EX_BAD, BOOL scsi_havebus() new scsi_fileno(bus, tgt, lun) new with 3 Parameters, MAX_DMA_SUN386 new Wed Mar 2 16:46:44 1997 Joerg Schilling * scsi-linux-sg.c 1.2 better Kommentar Wed Mar 2 16:35:04 1997 Joerg Schilling * scsitransp.h 1.9 BOOL scsi_havebus() new, scsi_fileno(bus, tgt, lun) new with 3 Parameters Wed Mar 2 16:33:18 1997 Joerg Schilling * scgio.h 2.6 intriduced _SCGIO_H & bei __STDC__ 0xFF000000UL Wed Mar 2 16:14:35 1997 Joerg Schilling * scsidefs.h 1.12 BAD -> EX_BAD Wed Mar 2 16:14:04 1997 Joerg Schilling * port.c 1.6 include fmt.h only if #ifdef FMT Wed Mar 2 16:07:53 1997 Joerg Schilling * scsi-linux-sg.c 1.1 date and time created 97/03/02 15:07:53 by joerg Wed Mar 2 15:49:56 1997 Joerg Schilling * iso9660.h 1.1 date and time created 97/03/02 14:49:56 by joerg Wed Mar 2 15:48:55 1997 Joerg Schilling * isosize.c 1.1 date and time created 97/03/02 14:48:55 by joerg Wed Mar 2 15:40:32 1997 Joerg Schilling * cdrecord.c 1.7 toctname[] * sectname[] new ldebug -> debug, HAVE_MLOCKALL, -msinfo new, -toc new -audio/-mode2/-xa1/-xa2/-cdi new, -isosize new better Check for options, print_msinfo() new, print_toc() new HAVE_SYS_PRIOCNTL_H new Wed Mar 2 15:30:26 1997 Joerg Schilling * cdrecord.h 1.5 BAD -> EX_BAD in standard.h, TOC_* defines, ST_* defines, struct msf several Interface changes for Prototypes Wed Jan 19 00:23:11 1997 Joerg Schilling * cdrecord.c 1.6 Changed to use scsi_buf_size() & scsi_getbuf(), better gcc Kompat. Wed Jan 12 23:11:18 1997 Joerg Schilling * scsitransp.c 1.11 Sbufsize -> long, scsi_maxdma() new Wed Jan 12 22:10:33 1997 Joerg Schilling * scsitransp.h 1.8 Sbufsize -> long Fri Jan 7 21:10:26 1997 Joerg Schilling * port.c 1.5 ANSI C & printf %ld Thu Jan 6 22:45:03 1997 Joerg Schilling * scsitransp.h 1.7 scsi_sense_key() & scsi_sense_code() from fmt.c Thu Jan 6 22:45:02 1997 Joerg Schilling * scsitransp.c 1.10 scsi_sense_key() & scsi_sense_code() from fmt.c Mon Jan 3 14:47:53 1997 Joerg Schilling * scsitransp.h 1.6 scsi_bufsize() & scsi_getbuf() new Mon Jan 3 14:47:52 1997 Joerg Schilling * scsitransp.c 1.9 scsi_bufsize() & scsi_getbuf() new Fri Dec 31 17:16:13 1996 Joerg Schilling * scsireg.h 1.12 Defekt List: length & list_block -> char[] for Byteorder Tue Dec 28 20:51:42 1996 Joerg Schilling * scgio.h 2.5 #error beseitigt for SunOS cc Tue Dec 28 14:28:01 1996 Joerg Schilling * scsitransp.c 1.8 debug -> kdebug Tue Dec 28 14:19:16 1996 Joerg Schilling * scgio.h 2.4 debug -> kdebug Sun Dec 19 16:18:18 1996 Joerg Schilling * scsi_cdr.c 1.7 Mitsumi Sun Dec 19 16:14:12 1996 Joerg Schilling * README 1.5 Performance X86 & Mitsumi Sat Dec 18 12:37:38 1996 Joerg Schilling * scsierrs.c 2.11 param.h, sys/buf.h, sun/dklabel.h, sun/dkio.h eliminated Sat Dec 18 03:26:04 1996 Joerg Schilling * README 1.4 Changes for Release 1.2 Sat Dec 18 03:24:14 1996 Joerg Schilling * cdrecord.1 1.4 Changes for Release 1.2 Sat Dec 18 03:13:41 1996 Joerg Schilling * cdrecord.c 1.5 -swab new LOCAL functions timings, new timeout for fixating countdown timer before Start write_track_info() disabled -pad for audio, pad to 2352 bytes. Sun Dec 12 21:09:24 1996 Joerg Schilling * scsi_cdr.c 1.6 Flush cache & Fixation with big Timeout. Thu Nov 26 10:54:18 1996 Joerg Schilling * scsierrs.c 2.10 New Codes for CDD-2000 & Support for Yamaha CDR-100 Mon Dec 16 16:19:54 1996 J. Schilling * Added -swab option to support Yamaha audio Thanks to (Fred) vecoven@montefiore.ulg.ac.be for the hint. * Added counter for quit time (9 seconds) Wed Dec 12 21:09:24 1996 J. Schilling * Flush cache & Fixation with separate bigger timeout, other timeout reduced to 20sec. Mo Dec 3 13:03:30 1996 J. Schilling * Set sector size on all drive types before writing, * Omwith the write_track_info Mode Select before write_track even for Philips drives (this is currently not needed because we don't support ISRC codes at this time). Tue Nov 26 10:54:18 1996 J. Schilling * New error codes for CDD-2000 & error code support for Yamaha CDR-100 Sun Nov 3 22:58:21 1996 J. Schilling * scsireset() aded to scsitransport.[hc] * Timings for Track and Fixation Fri Oct 4 11:45:13 1996 J. Schilling * Version 1.1 released. Mon Aug 19 22:25:18 1996 J. Schilling * Read access test to allow cdrecord to run savely suid root Sun Aug 18 12:11:20 1996 J. Schilling * bit ordering problems solved Thanks to Gert Poletiek for testing Tue Jun 18 21:38:51 1996 J. Schilling * several changes in scgio.h Sun Jun 16 15:56:35 1996 J. Schilling * Ansi C Protytypes * priocntl added for Solaris Thanks to Anders Lundgren Sun Feb 4 19:14:46 1996 J. Schilling * Initial release 1.0 cdrkit-1.1.11/genisoimage/0000755000372500001440000000000011456674322014425 5ustar steveuserscdrkit-1.1.11/genisoimage/magic0000644000372500001440000000442610471375025015430 0ustar steveusers# # Example magic file for mkhybrid # # The "message" for the offset MUST be 4 characters for the CREATOR # and 4 characters for the TYPE - white space is optional between them. # Any other characters on this line are ignored. Continuation lines (starting # with '>') are also ignored i.e. only the initial offset lines are used. # # The continuation lines are given here, but they do not need to exist. # # James Pearson 20/5/98 # off type test message # GIF 0 string GIF8 8BIM GIFf >4 string 7a \b, version 8%s, >4 string 9a \b, version 8%s, >6 leshort >0 %hd x >8 leshort >0 %hd, #>10 byte &0x80 color mapped, #>10 byte&0x07 =0x00 2 colors #>10 byte&0x07 =0x01 4 colors #>10 byte&0x07 =0x02 8 colors #>10 byte&0x07 =0x03 16 colors #>10 byte&0x07 =0x04 32 colors #>10 byte&0x07 =0x05 64 colors #>10 byte&0x07 =0x06 128 colors #>10 byte&0x07 =0x07 256 colors # JPEG images # 0 ubeshort 0xffd8 8BIM JPEG image data # StuffIt # 0 string SIT! SIT!SIT! # standard unix compress 0 string \037\235 LZIV ZIVU >2 byte&0x80 >0 block compressed >2 byte&0x1f x %d bits # gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver) 0 string \037\213 GNUz ZIVU gzip compressed data >2 byte <8 \b, reserved method, >2 byte 8 \b, deflated, >3 byte &0x01 ASCII, >3 byte &0x02 continuation, >3 byte &0x04 extra field, >3 byte &0x08 original filename, >3 byte &0x10 comment, >3 byte &0x20 encrypted, >4 ledate x last modified: %s, >8 byte 2 max compression, >8 byte 4 max speed, >9 byte =0x00 os: MS-DOS >9 byte =0x01 os: Amiga >9 byte =0x02 os: VMS >9 byte =0x03 os: Unix >9 byte =0x05 os: Atari >9 byte =0x06 os: OS/2 >9 byte =0x07 os: MacOS >9 byte =0x0A os: Tops/20 >9 byte =0x0B os: Win/32 # Postscript 0 string %! ASPSTEXT >2 string PS-Adobe- conforming >>11 string >\0 at level %.3s >>>15 string EPS - type %s >>>15 string Query - type %s >>>15 string ExitServer - type %s # Some PCs have the annoying habit of adding a ^D as a document separator 0 string \004%! ASPS TEXT PostScript document text >3 string PS-Adobe- conforming >>12 string >\0 at level %.3s >>>16 string EPS - type %s >>>16 string Query - type %s >>>16 string ExitServer - type %s cdrkit-1.1.11/genisoimage/match.c0000644000372500001440000001203310536265343015661 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)match.c 1.18 04/05/23 joerg */ /* * 27-Mar-96: Jan-Piet Mens * added 'match' option (-m) to specify regular expressions NOT to be included * in the CD image. * * Re-written 13-Apr-2000 James Pearson * now uses a generic set of routines */ #include #include #include #include #include #include #include #include #include "match.h" struct match { struct match *next; char *name; }; typedef struct match match; static match *mats[MAX_MAT]; static char *mesg[MAX_MAT] = { "excluded", "excluded ISO-9660", "excluded Joliet", "hidden attribute ISO-9660", #ifdef APPLE_HYB "excluded HFS", #endif /* APPLE_HYB */ }; #ifdef SORTING struct sort_match { struct sort_match *next; char *name; int val; }; typedef struct sort_match sort_match; static sort_match *s_mats; int add_sort_match(char *fn, int val) { sort_match *s_mat; s_mat = (sort_match *)malloc(sizeof (sort_match)); if (s_mat == NULL) { #ifdef USE_LIBSCHILY errmsg("Can't allocate memory for sort filename\n"); #else fprintf(stderr, "Can't allocate memory for sort filename\n"); #endif return (0); } if ((s_mat->name = strdup(fn)) == NULL) { #ifdef USE_LIBSCHILY errmsg("Can't allocate memory for sort filename\n"); #else fprintf(stderr, "Can't allocate memory for sort filename\n"); #endif return (0); } /* need to reserve the minimum value for other uses */ if (val == NOT_SORTED) val++; s_mat->val = val; s_mat->next = s_mats; s_mats = s_mat; return (1); } void add_sort_list(char *file) { FILE *fp; char name[4096]; char *p; int val; if ((fp = fopen(file, "r")) == NULL) { #ifdef USE_LIBSCHILY comerr("Can't open sort file list %s\n", file); #else fprintf(stderr, "Can't open hidden/exclude file list %s\n", file); exit(1); #endif } while (fgets(name, sizeof (name), fp) != NULL) { /* * look for the last space or tab character */ if ((p = strrchr(name, ' ')) == NULL) p = strrchr(name, '\t'); else if (strrchr(p, '\t') != NULL) /* Tab after space? */ p = strrchr(p, '\t'); if (p == NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Incorrect sort file format\n\t%s", name); #else fprintf(stderr, "Incorrect sort file format\n\t%s", name); #endif continue; } else { *p = '\0'; val = atoi(++p); } if (!add_sort_match(name, val)) { fclose(fp); return; } } fclose(fp); } int sort_matches(char *fn, int val) { register sort_match *s_mat; for (s_mat = s_mats; s_mat; s_mat = s_mat->next) { if (fnmatch(s_mat->name, fn, FNM_FILE_NAME) != FNM_NOMATCH) { return (s_mat->val); /* found sort value */ } } return (val); /* not found - default sort value */ } void del_sort() { register sort_match * s_mat, *s_mat1; s_mat = s_mats; while (s_mat) { s_mat1 = s_mat->next; free(s_mat->name); free(s_mat); s_mat = s_mat1; } s_mats = 0; } #endif /* SORTING */ int gen_add_match(char *fn, int n) { match *mat; if (n >= MAX_MAT) return (0); mat = (match *)malloc(sizeof (match)); if (mat == NULL) { #ifdef USE_LIBSCHILY errmsg("Can't allocate memory for %s filename\n", mesg[n]); #else fprintf(stderr, "Can't allocate memory for %s filename\n", mesg[n]); #endif return (0); } if ((mat->name = strdup(fn)) == NULL) { #ifdef USE_LIBSCHILY errmsg("Can't allocate memory for %s filename\n", mesg[n]); #else fprintf(stderr, "Can't allocate memory for %s filename\n", mesg[n]); #endif return (0); } mat->next = mats[n]; mats[n] = mat; return (1); } void gen_add_list(char *file, int n) { FILE *fp; char name[4096]; int len; if ((fp = fopen(file, "r")) == NULL) { #ifdef USE_LIBSCHILY comerr("Can't open %s file list %s\n", mesg[n], file); #else fprintf(stderr, "Can't open %s file list %s\n", mesg[n], file); exit(1); #endif } while (fgets(name, sizeof (name), fp) != NULL) { /* * strip of '\n' */ len = strlen(name); if (name[len - 1] == '\n') { name[len - 1] = '\0'; } if (!gen_add_match(name, n)) { fclose(fp); return; } } fclose(fp); } int gen_matches(char *fn, int n) { register match * mat; if (n >= MAX_MAT) return (0); for (mat = mats[n]; mat; mat = mat->next) { if (fnmatch(mat->name, fn, FNM_FILE_NAME) != FNM_NOMATCH) { return (1); /* found -> excluded filename */ } } return (0); /* not found -> not excluded */ } int gen_ishidden(int n) { if (n >= MAX_MAT) return (0); return ((int)(mats[n] != 0)); } void gen_del_match(int n) { register match *mat; register match *mat1; if (n >= MAX_MAT) return; mat = mats[n]; while (mat) { mat1 = mat->next; free(mat->name); free(mat); mat = mat1; } mats[n] = 0; } cdrkit-1.1.11/genisoimage/eltorito.c0000644000372500001440000004640110760743311016427 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)eltorito.c 1.33 05/02/27 joerg */ /* * Program eltorito.c - Handle El Torito specific extensions to iso9660. * * * Written by Michael Fulbright (1996). * * Copyright 1996 RedHat Software, Incorporated * Copyright (c) 1999-2004 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "genisoimage.h" #include #include #include #include "match.h" #include "diskmbr.h" #include "bootinfo.h" #include #undef MIN #define MIN(a, b) (((a) < (b))? (a): (b)) static struct eltorito_validation_entry valid_desc; static struct eltorito_boot_descriptor gboot_desc; static struct disk_master_boot_record disk_mbr; static unsigned int bcat_de_flags; void init_boot_catalog(const char *path); void insert_boot_cat(void); static void get_torito_desc(struct eltorito_boot_descriptor *boot_desc); static void fill_boot_desc(struct eltorito_defaultboot_entry *boot_desc_entry, struct eltorito_boot_entry_info *boot_entry); void get_boot_entry(void); void new_boot_entry(void); static int tvd_write(FILE *outfile); static char *bootcat_path; /* filename of boot catalog */ /* * Make sure any existing boot catalog is excluded */ void init_boot_catalog(const char *path) { #ifdef SORTING struct eltorito_boot_entry_info * cbe; for (cbe = first_boot_entry; cbe != NULL; cbe = cbe->next) { char *p; if (cbe->boot_image == NULL) comerrno(EX_BAD, "Missing boot image name, use -eltorito-boot option.\n"); p = (char *) e_malloc(strlen(cbe->boot_image) + strlen(path) + 2); strcpy(p, path); if (p[strlen(p) - 1] != '/') { strcat(p, "/"); } strcat(p, cbe->boot_image); add_sort_match(p, sort_matches(p, 1)); free(p); } #endif bootcat_path = (char *) e_malloc(strlen(boot_catalog) + strlen(path) + 2); strcpy(bootcat_path, path); if (bootcat_path[strlen(bootcat_path) - 1] != '/') { strcat(bootcat_path, "/"); } strcat(bootcat_path, boot_catalog); /* * we are going to create a virtual catalog file * - so make sure any existing is excluded */ add_match(bootcat_path); /* flag the file as a memory file */ bcat_de_flags = MEMORY_FILE; /* find out if we want to "hide" this file */ if (i_matches(boot_catalog) || i_matches(bootcat_path)) bcat_de_flags |= INHIBIT_ISO9660_ENTRY; if (j_matches(boot_catalog) || j_matches(bootcat_path)) bcat_de_flags |= INHIBIT_JOLIET_ENTRY; }/* init_boot_catalog(... */ /* * Create a boot catalog file in memory - genisoimage already uses this type of * file for the TRANS.TBL files. Therefore the boot catalog is set up in * similar way */ void insert_boot_cat() { struct directory_entry *de; struct directory_entry *s_entry; char *p1; char *p2; char *p3; struct directory *this_dir; struct directory *dir; char *buffer; init_fstatbuf(); buffer = (char *) e_malloc(SECTOR_SIZE); memset(buffer, 0, SECTOR_SIZE); /* * try to find the directory that will contain the boot.cat file * - not very neat, but I can't think of a better way */ p1 = strdup(boot_catalog); /* get dirname (p1) and basename (p2) of boot.cat */ if ((p2 = strrchr(p1, '/')) != NULL) { *p2 = '\0'; p2++; /* find the dirname directory entry */ de = search_tree_file(root, p1); if (!de) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Uh oh, I cant find the boot catalog directory '%s'!\n", p1); #else fprintf(stderr, "Uh oh, I cant find the boot catalog directory '%s'!\n", p1); exit(1); #endif } this_dir = 0; /* get the basename (p3) of the directory */ if ((p3 = strrchr(p1, '/')) != NULL) p3++; else p3 = p1; /* find the correct sub-directory entry */ for (dir = de->filedir->subdir; dir; dir = dir->next) if (!(strcmp(dir->de_name, p3))) this_dir = dir; if (this_dir == 0) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Uh oh, I cant find the boot catalog directory '%s'!\n", p3); #else fprintf(stderr, "Uh oh, I cant find the boot catalog directory '%s'!\n", p3); exit(1); #endif } } else { /* boot.cat is in the root directory */ this_dir = root; p2 = p1; } /* * make a directory entry in memory (using the same set up as for table * entries */ s_entry = (struct directory_entry *) e_malloc(sizeof (struct directory_entry)); memset(s_entry, 0, sizeof (struct directory_entry)); s_entry->next = this_dir->contents; this_dir->contents = s_entry; #ifdef SORTING /* inherit any sort weight from parent directory */ s_entry->sort = this_dir->sort; s_entry->sort += 2; /* see if this entry should have a new weighting */ if (do_sort) { s_entry->sort = sort_matches(bootcat_path, s_entry->sort); } #endif /* SORTING */ s_entry->isorec.flags[0] = ISO_FILE; s_entry->priority = 32768; iso9660_date(s_entry->isorec.date, fstatbuf.st_mtime); s_entry->inode = TABLE_INODE; s_entry->dev = (dev_t) UNCACHED_DEVICE; set_723(s_entry->isorec.volume_sequence_number, volume_sequence_number); set_733((char *) s_entry->isorec.size, SECTOR_SIZE); s_entry->size = SECTOR_SIZE; s_entry->filedir = this_dir; s_entry->name = strdup(p2); iso9660_file_length(p2, s_entry, 0); /* flag file as necessary */ /* * If the current directory is hidden, then hide this entry */ if (this_dir->dir_flags & INHIBIT_ISO9660_ENTRY) bcat_de_flags |= INHIBIT_ISO9660_ENTRY; if (this_dir->dir_flags & INHIBIT_JOLIET_ENTRY) bcat_de_flags |= INHIBIT_JOLIET_ENTRY; s_entry->de_flags = bcat_de_flags; if ((use_XA || use_RockRidge) && !(bcat_de_flags & INHIBIT_ISO9660_ENTRY)) { fstatbuf.st_mode = 0444 | S_IFREG; fstatbuf.st_nlink = 1; generate_xa_rr_attributes("", p2, s_entry, &fstatbuf, &fstatbuf, 0); } /* * memory files are stored at s_entry->table * - but this is also used for each s_entry to generate * TRANS.TBL entries. So if we are generating tables, * store the TRANS.TBL data here for the moment */ if (generate_tables && !(bcat_de_flags & INHIBIT_ISO9660_ENTRY)) { sprintf(buffer, "F\t%s\n", s_entry->name); /* copy the TRANS.TBL entry info and clear the buffer */ s_entry->table = strdup(buffer); memset(buffer, 0, SECTOR_SIZE); /* * store the (empty) file data in the * unused s_entry->whole_name element for the time being * - this will be transferred to s_entry->table after any * TRANS.TBL processing later */ s_entry->whole_name = buffer; } else { /* store the (empty) file data in the s_entry->table element */ s_entry->table = buffer; s_entry->whole_name = NULL; } } static void get_torito_desc(struct eltorito_boot_descriptor *boot_desc) { int checksum; unsigned char *checksum_ptr; struct directory_entry *de2; /* Boot catalog */ int i; int offset; struct eltorito_defaultboot_entry boot_desc_record; memset(boot_desc, 0, sizeof (*boot_desc)); boot_desc->type[0] = 0; memcpy(boot_desc->id, ISO_STANDARD_ID, sizeof (ISO_STANDARD_ID)); boot_desc->version[0] = 1; memcpy(boot_desc->system_id, EL_TORITO_ID, sizeof (EL_TORITO_ID)); /* * search from root of iso fs to find boot catalog * - we already know where the boot catalog is * - we created it above - but lets search for it anyway * - good sanity check! */ de2 = search_tree_file(root, boot_catalog); if (!de2 || !(de2->de_flags & MEMORY_FILE)) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Uh oh, I cant find the boot catalog '%s'!\n", boot_catalog); #else fprintf(stderr, "Uh oh, I cant find the boot catalog '%s'!\n", boot_catalog); exit(1); #endif } set_731(boot_desc->bootcat_ptr, (unsigned int) get_733(de2->isorec.extent)); /* * we have the boot image, so write boot catalog information * Next we write out the primary descriptor for the disc */ memset(&valid_desc, 0, sizeof (valid_desc)); valid_desc.headerid[0] = 1; valid_desc.arch[0] = EL_TORITO_ARCH_x86; /* * we'll shove start of publisher id into id field, * may get truncated but who really reads this stuff! */ if (publisher) memcpy_max(valid_desc.id, publisher, MIN(23, strlen(publisher))); valid_desc.key1[0] = (char) 0x55; valid_desc.key2[0] = (char) 0xAA; /* compute the checksum */ checksum = 0; checksum_ptr = (unsigned char *) &valid_desc; /* Set checksum to 0 before computing checksum */ set_721(valid_desc.cksum, 0); for (i = 0; i < (int)sizeof (valid_desc); i += 2) { checksum += (unsigned int) checksum_ptr[i]; checksum += ((unsigned int) checksum_ptr[i + 1]) * 256; } /* now find out the real checksum */ checksum = -checksum; set_721(valid_desc.cksum, (unsigned int) checksum); /* now write it to the virtual boot catalog */ memcpy(de2->table, &valid_desc, 32); for (current_boot_entry = first_boot_entry, offset = sizeof (valid_desc); current_boot_entry != NULL; current_boot_entry = current_boot_entry->next, offset += sizeof (boot_desc_record)) { if (offset >= SECTOR_SIZE) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Too many El Torito boot entries\n"); #else fprintf(stderr, "Too many El Torito boot entries\n"); exit(1); #endif } fill_boot_desc(&boot_desc_record, current_boot_entry); memcpy(de2->table + offset, &boot_desc_record, sizeof (boot_desc_record)); } }/* get_torito_desc(... */ static void fill_boot_desc(struct eltorito_defaultboot_entry *boot_desc_entry, struct eltorito_boot_entry_info *boot_entry) { struct directory_entry *de; /* Boot file */ int bootmbr; int i; int nsectors; int geosec; if (!boot_desc_entry || !boot_entry) return; /* now adjust boot catalog lets find boot image first */ de = search_tree_file(root, boot_entry->boot_image); if (!de) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Uh oh, I cant find the boot image '%s' !\n", boot_entry->boot_image); #else fprintf(stderr, "Uh oh, I cant find the boot image '%s' !\n", boot_entry->boot_image); exit(1); #endif } /* now make the initial/default entry for boot catalog */ memset(boot_desc_entry, 0, sizeof (*boot_desc_entry)); boot_desc_entry->boot_id[0] = (char) boot_entry->not_bootable ? EL_TORITO_NOT_BOOTABLE : EL_TORITO_BOOTABLE; /* use default BIOS loadpnt */ set_721(boot_desc_entry->loadseg, boot_entry->load_addr); /* * figure out size of boot image in 512-byte sectors. * However, round up to the nearest integral CD (2048-byte) sector. * This is only used for no-emulation booting. */ nsectors = boot_entry->load_size ? boot_entry->load_size : ISO_BLOCKS(de->size) * (SECTOR_SIZE/512); if (verbose > 0) { fprintf(stderr, "Size of boot image is %d sectors -> ", nsectors); } if (boot_entry->hard_disk_boot) { /* sanity test hard disk boot image */ boot_desc_entry->boot_media[0] = EL_TORITO_MEDIA_HD; if (verbose > 0) fprintf(stderr, "Emulating a hard disk\n"); /* read MBR */ bootmbr = open(de->whole_name, O_RDONLY | O_BINARY); if (bootmbr == -1) { #ifdef USE_LIBSCHILY comerr("Error opening boot image '%s' for read.\n", de->whole_name); #else fprintf(stderr, "Error opening boot image '%s' for read.\n", de->whole_name); perror(""); exit(1); #endif } if (read(bootmbr, &disk_mbr, sizeof (disk_mbr)) != sizeof (disk_mbr)) { #ifdef USE_LIBSCHILY comerr("Error reading MBR from boot image '%s'.\n", de->whole_name); #else fprintf(stderr, "Error reading MBR from boot image '%s'.\n", de->whole_name); exit(1); #endif } close(bootmbr); if (la_to_u_2_byte(disk_mbr.magic) != MBR_MAGIC) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Warning: boot image '%s' MBR is not a boot sector.\n", de->whole_name); #else fprintf(stderr, "Warning: boot image '%s' MBR is not a boot sector.\n", de->whole_name); #endif } /* find partition type */ boot_desc_entry->sys_type[0] = PARTITION_UNUSED; for (i = 0; i < PARTITION_COUNT; ++i) { int s_cyl_sec; int e_cyl_sec; s_cyl_sec = la_to_u_2_byte(disk_mbr.partition[i].s_cyl_sec); e_cyl_sec = la_to_u_2_byte(disk_mbr.partition[i].e_cyl_sec); if (disk_mbr.partition[i].type != PARTITION_UNUSED) { if (boot_desc_entry->sys_type[0] != PARTITION_UNUSED) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Boot image '%s' has multiple partitions.\n", de->whole_name); #else fprintf(stderr, "Boot image '%s' has multiple partitions.\n", de->whole_name); exit(1); #endif } boot_desc_entry->sys_type[0] = disk_mbr.partition[i].type; /* a few simple sanity warnings */ if (!boot_entry->not_bootable && disk_mbr.partition[i].status != PARTITION_ACTIVE) { fprintf(stderr, "Warning: partition not marked active.\n"); } if (MBR_CYLINDER(s_cyl_sec) != 0 || disk_mbr.partition[i].s_head != 1 || MBR_SECTOR(s_cyl_sec != 1)) { fprintf(stderr, "Warning: partition does not start at 0/1/1.\n"); } geosec = (MBR_CYLINDER(e_cyl_sec) + 1) * (disk_mbr.partition[i].e_head + 1) * MBR_SECTOR(e_cyl_sec); if (geosec != nsectors) { fprintf(stderr, "Warning: image size does not match geometry (%d)\n", geosec); } #ifdef DEBUG_TORITO fprintf(stderr, "Partition start %u/%u/%u\n", MBR_CYLINDER(s_cyl_sec), disk_mbr.partition[i].s_head, MBR_SECTOR(s_cyl_sec)); fprintf(stderr, "Partition end %u/%u/%u\n", MBR_CYLINDER(e_cyl_sec), disk_mbr.partition[i].e_head, MBR_SECTOR(e_cyl_sec)); #endif } } if (boot_desc_entry->sys_type[0] == PARTITION_UNUSED) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Boot image '%s' has no partitions.\n", de->whole_name); #else fprintf(stderr, "Boot image '%s' has no partitions.\n", de->whole_name); exit(1); #endif } #ifdef DEBUG_TORITO fprintf(stderr, "Partition type %u\n", boot_desc_entry->sys_type[0]); #endif /* load single boot sector, in this case the MBR */ nsectors = 1; } else if (boot_entry->no_emul_boot) { /* * no emulation is a simple image boot of all the sectors * in the boot image */ boot_desc_entry->boot_media[0] = EL_TORITO_MEDIA_NOEMUL; if (verbose > 0) fprintf(stderr, "No emulation\n"); } else { /* choose size of emulated floppy based on boot image size */ if (nsectors == 2880) { boot_desc_entry->boot_media[0] = EL_TORITO_MEDIA_144FLOP; if (verbose > 0) fprintf(stderr, "Emulating a 1440 kB floppy\n"); } else if (nsectors == 5760) { boot_desc_entry->boot_media[0] = EL_TORITO_MEDIA_288FLOP; if (verbose > 0) fprintf(stderr, "Emulating a 2880 kB floppy\n"); } else if (nsectors == 2400) { boot_desc_entry->boot_media[0] = EL_TORITO_MEDIA_12FLOP; if (verbose > 0) fprintf(stderr, "Emulating a 1200 kB floppy\n"); } else { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Error - boot image '%s' has not an allowable size.\n", de->whole_name); #else fprintf(stderr, "Error - boot image '%s' has not an allowable size.\n", de->whole_name); exit(1); #endif } /* load single boot sector for floppies */ nsectors = 1; } /* fill in boot image details */ #ifdef DEBUG_TORITO fprintf(stderr, "Boot %u sectors\n", nsectors); fprintf(stderr, "Extent of boot images is %d\n", get_733(de->isorec.extent)); #endif set_721(boot_desc_entry->nsect, (unsigned int) nsectors); set_731(boot_desc_entry->bootoff, (unsigned int) get_733(de->isorec.extent)); /* If the user has asked for it, patch the boot image */ if (boot_entry->boot_info_table) { int bootimage; unsigned int bi_checksum; unsigned int total_len; static char csum_buffer[SECTOR_SIZE]; int len; struct genisoimage_boot_info bi_table; bootimage = open(de->whole_name, O_RDWR | O_BINARY); if (bootimage == -1) { #ifdef USE_LIBSCHILY comerr( "Error opening boot image file '%s' for update.\n", de->whole_name); #else fprintf(stderr, "Error opening boot image file '%s' for update.\n", de->whole_name); perror(""); exit(1); #endif } /* Compute checksum of boot image, sans 64 bytes */ total_len = 0; bi_checksum = 0; while ((len = read(bootimage, csum_buffer, SECTOR_SIZE)) > 0) { if (total_len & 3) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Odd alignment at non-end-of-file in boot image '%s'.\n", de->whole_name); #else fprintf(stderr, "Odd alignment at non-end-of-file in boot image '%s'.\n", de->whole_name); exit(1); #endif } if (total_len < 64) memset(csum_buffer, 0, 64 - total_len); if (len < SECTOR_SIZE) memset(csum_buffer + len, 0, SECTOR_SIZE-len); for (i = 0; i < SECTOR_SIZE; i += 4) bi_checksum += get_731(&csum_buffer[i]); total_len += len; } if (total_len != de->size) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Boot image file '%s' changed underneath us!\n", de->whole_name); #else fprintf(stderr, "Boot image file '%s' changed underneath us!\n", de->whole_name); exit(1); #endif } /* End of file, set position to byte 8 */ lseek(bootimage, (off_t)8, SEEK_SET); memset(&bi_table, 0, sizeof (bi_table)); /* Is it always safe to assume PVD is at session_start+16? */ set_731(bi_table.bi_pvd, session_start + 16); set_731(bi_table.bi_file, de->starting_block); set_731(bi_table.bi_length, de->size); set_731(bi_table.bi_csum, bi_checksum); write(bootimage, &bi_table, sizeof (bi_table)); /* FIXME: check return value */ close(bootimage); } }/* fill_boot_desc(... */ void get_boot_entry() { if (current_boot_entry) return; current_boot_entry = (struct eltorito_boot_entry_info *) e_malloc(sizeof (struct eltorito_boot_entry_info)); memset(current_boot_entry, 0, sizeof (*current_boot_entry)); if (!first_boot_entry) { first_boot_entry = current_boot_entry; last_boot_entry = current_boot_entry; } else { last_boot_entry->next = current_boot_entry; last_boot_entry = current_boot_entry; } } void new_boot_entry() { current_boot_entry = NULL; } /* * Function to write the EVD for the disc. */ static int tvd_write(FILE *outfile) { /* check the boot image is not NULL */ if (!boot_image) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "No boot image specified.\n"); #else fprintf(stderr, "No boot image specified.\n"); exit(1); #endif } /* Next we write out the boot volume descriptor for the disc */ get_torito_desc(&gboot_desc); jtwrite(&gboot_desc, SECTOR_SIZE, 1, 0, FALSE); xfwrite(&gboot_desc, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; return (0); } struct output_fragment torito_desc = {NULL, oneblock_size, NULL, tvd_write, "Eltorito Volume Descriptor"}; cdrkit-1.1.11/genisoimage/getopt.c0000644000372500001440000005543510536265343016104 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)getopt.c 1.6 03/03/09 joerg */ /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc. This file is part of the libiberty library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, if you link this library with files compiled with a GNU compiler to produce an executable, this does not cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ /* * XXX Never do it this way, it is FSF junk */ #ifndef _NO_PROTO /*#define _NO_PROTO*/ #endif /* * We do this instead: */ #undef getopt #define getopt __nothing__ #ifdef HAVE_CONFIG_H #if defined (emacs) || defined (CONFIG_BROKETS) /* We use instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h (which it would do because it found this file in $srcdir). */ #include #else #include "config.h" #endif #endif #ifndef __STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ /* Many versions of the Linux C library include older, broken versions of these routines, which will break the linker's command-line parsing. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) || defined (__linux__) /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ #include #define __DID_STDLIB__ /* FSF rubbish compensation */ #endif /* GNU C library. */ /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" static void exchange(char **argv); static const char *_getopt_initialize(const char *optstring); /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns EOF, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* XXX 1003.2 says this must be 1 before any call. */ int optind = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return EOF with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ #include #define my_index strchr #else /* Avoid depending on library functions or files whose names are inconsistent. */ char *getenv (); static char *my_index(const char *str, int chr); static char * my_index (const char *str, int chr) { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ #ifndef __STDC__ /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); #endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ #ifndef __DID_STDLIB__ /* FSF rubbish compensation */ /* * This is the clean code using Schily constructs... */ #undef getopt #define getopt __nothing__ #include #endif #ifndef my_index /* * FSF rubbish compensation * If GCC has problems with the system include files, it has to be fixed */ #include #endif #undef getopt /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange (char **argv) { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ static const char * _getopt_initialize (const char *optstring) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind = 1; nextchar = NULL; /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (getenv ("POSIXLY_CORRECT") != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns `EOF'. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) { optarg = NULL; if (optind == 0) optstring = _getopt_initialize (optstring); if (argc == 0) return EOF; if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && (argv[optind][0] != '-' || argv[optind][1] == '\0')) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return EOF; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if ((argv[optind][0] != '-' || argv[optind][1] == '\0')) { if (ordering == REQUIRE_ORDER) return EOF; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if (nameend - nextchar == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, "%s: option `%s' is ambiguous\n", argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, "%s: option `--%s' doesn't allow an argument\n", argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, "%s: option `%c%s' doesn't allow an argument\n", argv[0], argv[optind - 1][0], pfound->name); } nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, "%s: option `%s' requires an argument\n", argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, "%s: unrecognized option `--%s'\n", argv[0], nextchar); else /* +option or -option */ fprintf (stderr, "%s: unrecognized option `%c%s'\n", argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c); } optopt = c; return '?'; } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, "%s: option requires an argument -- %c\n", argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* _LIBC or not __GNU_LIBRARY__. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (int argc, char *argv[]) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == EOF) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ cdrkit-1.1.11/genisoimage/boot-hppa.c0000644000372500001440000001552210760521377016465 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* * Program boot-hppa.c - Handle HPPA boot extensions to iso9660. * * Written by Steve McIntyre June 2004. * * Heavily inspired by palo: * **************************************************************************** * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) Hewlett-Packard (Paul Bame) paul_bame@hp.com * **************************************************************************** * Copyright 2004 Steve McIntyre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "genisoimage.h" #include #include #include #include "match.h" #include "diskmbr.h" #include "bootinfo.h" #include #include "endianconv.h" extern long long alpha_hppa_boot_sector[256]; extern int boot_sector_initialized; int add_boot_hppa_cmdline(char *cmdline); int add_boot_hppa_kernel_32(char *filename); int add_boot_hppa_kernel_64(char *filename); int add_boot_hppa_bootloader(char *filename); int add_boot_hppa_ramdisk(char *filename); static int boot_hppa_write(FILE *outfile); static char *hppa_cmdline = NULL; static char *hppa_kernel_32 = NULL; static char *hppa_kernel_64 = NULL; static char *hppa_bootloader = NULL; static char *hppa_ramdisk = NULL; /* Simple function: store the filename to be used later when we need to find the boot file */ extern int add_boot_hppa_cmdline(char *cmdline) { char *ptr = NULL; hppa_cmdline = strdup(cmdline); ptr = hppa_cmdline; while (*ptr) { if (',' == *ptr) *ptr = ' '; ptr++; } return 0; } /* Simple function: store the filename to be used later when we need to find the boot file */ extern int add_boot_hppa_kernel_32(char *filename) { hppa_kernel_32 = filename; return 0; } /* Simple function: store the filename to be used later when we need to find the boot file */ extern int add_boot_hppa_kernel_64(char *filename) { hppa_kernel_64 = filename; return 0; } /* Simple function: store the filename to be used later when we need to find the boot file */ extern int add_boot_hppa_bootloader(char *filename) { hppa_bootloader = filename; return 0; } /* Simple function: store the filename to be used later when we need to find the boot file */ extern int add_boot_hppa_ramdisk(char *filename) { hppa_ramdisk = filename; return 0; } static void exit_fatal(char *type, char *filename) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Uh oh, I can't find the %s '%s'!\n", type, filename); #else fprintf(stderr, "Uh oh, I can't find the %s '%s'!\n", type, filename); exit(1); #endif } static int boot_hppa_write(FILE *outfile) { struct directory_entry *boot_file; /* Boot file we need to search for */ unsigned long length = 0; unsigned long extent = 0; unsigned char *boot_sector = (unsigned char *) alpha_hppa_boot_sector; int i = 0; if (!boot_sector_initialized) { memset(alpha_hppa_boot_sector, 0, sizeof(alpha_hppa_boot_sector)); boot_sector_initialized = 1; } printf("Address is: %p\n",alpha_hppa_boot_sector); boot_sector[0] = 0x80; /* magic */ boot_sector[1] = 0x00; /* magic */ boot_sector[2] = 'P'; boot_sector[3] = 'A'; boot_sector[4] = 'L'; boot_sector[5] = 'O'; boot_sector[6] = 0x00; boot_sector[7] = 0x04; /* version */ /* Find the dir entry for the 32-bit kernel by walking our file list */ boot_file = search_tree_file(root, hppa_kernel_32); if (!boot_file) exit_fatal("HPPA 32-bit kernel", hppa_kernel_32); extent = 2048 * get_733(boot_file->isorec.extent); length = get_733(boot_file->isorec.size); fprintf(stderr, "Found hppa 32-bit kernel %s: using extent %lu (0x%lX), size %lu (0x%lX)\n", hppa_kernel_32, extent, extent, length, length); write_be32(extent, &boot_sector[8]); write_be32(length, &boot_sector[12]); /* Find the dir entry for the ramdisk by walking our file list */ boot_file = search_tree_file(root, hppa_ramdisk); if (!boot_file) exit_fatal("HPPA ramdisk", hppa_ramdisk); extent = 2048 * get_733(boot_file->isorec.extent); length = get_733(boot_file->isorec.size); fprintf(stderr, "Found hppa ramdisk %s: using extent %lu (0x%lX), size %lu (0x%lX)\n", hppa_ramdisk, extent, extent, length, length); write_be32(extent, &boot_sector[16]); write_be32(length, &boot_sector[20]); /* Now the commandline */ snprintf((char *)&boot_sector[24], 127, "%s", hppa_cmdline); /* Find the dir entry for the 64-bit kernel by walking our file list */ boot_file = search_tree_file(root, hppa_kernel_64); if (!boot_file) exit_fatal("HPPA 64-bit kernel", hppa_kernel_64); extent = 2048 * get_733(boot_file->isorec.extent); length = get_733(boot_file->isorec.size); fprintf(stderr, "Found hppa 64-bit kernel %s: using extent %lu (0x%lX), size %lu (0x%lX)\n", hppa_kernel_64, extent, extent, length, length); write_be32(extent, &boot_sector[232]); write_be32(length, &boot_sector[236]); /* Find the dir entry for the IPL by walking our file list */ boot_file = search_tree_file(root, hppa_bootloader); if (!boot_file) exit_fatal("HPPA bootloader", hppa_bootloader); extent = 2048 * get_733(boot_file->isorec.extent); length = get_733(boot_file->isorec.size); fprintf(stderr, "Found hppa bootloader %s: using extent %lu (0x%lX), size %lu (0x%lX)\n", hppa_bootloader, extent, extent, length, length); write_be32(extent, &boot_sector[240]); write_be32(length, &boot_sector[244]); return 0; } struct output_fragment hppaboot_desc = {NULL, NULL, NULL, boot_hppa_write, "hppa boot block"}; cdrkit-1.1.11/genisoimage/genisoimage.10000644000372500001440000026620211451116647017002 0ustar steveusers'\" t .\" genisoimage.1 -*- nroff -*- To render, first run through tbl .\" Copyright 1993-1998 by Yggdrasil Computing .\" Copyright 1996-1997 by Robert Leslie .\" Copyright 1997-2001 by James Pearson .\" Copyright 1999-2006 by Joerg Schilling .\" Copyright 2002-2003 by Jungshik Shin .\" Copyright 2003 by Jaakko Heinonen .\" Copyright 2006 by the Cdrkit maintainers .\" .TH GENISOIMAGE 1 "13 Dec 2006" .\" ---------------------------------------- .SH NAME genisoimage \- create ISO9660/Joliet/HFS filesystem with optional Rock Ridge attributes .\" ---------------------------------------- .SH SYNOPSIS .B genisoimage .RI [ options ] .RB [ \-o .IR filename ] .IR pathspec " [" "pathspec ..." ] .\" ---------------------------------------- .SH DESCRIPTION .B genisoimage is a pre-mastering program to generate ISO9660/Joliet/HFS hybrid filesystems. .PP .B genisoimage is capable of generating the .B System Use Sharing Protocol records (SUSP) specified by the .BR "Rock Ridge Interchange Protocol" . This is used to further describe the files in the ISO9660 filesystem to a Unix host, and provides information such as long filenames, UID/GID, POSIX permissions, symbolic links, and block and character device files. .PP If Joliet or HFS hybrid command line options are specified, .B genisoimage will create the additional filesystem metadata needed for Joliet or HFS. Otherwise .B genisoimage will generate a pure ISO9660 filesystem. .PP .B genisoimage can generate a .I true (or .IR shared ) HFS hybrid filesystem. The same files are seen as HFS files when accessed from a Macintosh and as ISO9660 files when accessed from other machines. HFS stands for .I Hierarchical File System and is the native filesystem used on Macintosh computers. .PP As an alternative, .B genisoimage can generate the .I Apple Extensions to ISO9660 for each file. These extensions provide each file with CREATOR, TYPE and certain Finder flags when accessed from a Macintosh. See the .B HFS MACINTOSH FILE FORMATS section below. .PP .B genisoimage takes a snapshot of a given directory tree, and generates a binary image which will correspond to an ISO9660 and/or HFS filesystem when written to a block device. .PP Each file written to the ISO9660 filesystem must have a filename in the 8.3 format (up to 8 characters, period, up to 3 characters, all uppercase), even if Rock Ridge is in use. This filename is used on systems that are not able to make use of the Rock Ridge extensions (such as MS-DOS), and each filename in each directory must be different from the other filenames in the same directory. .B genisoimage generally tries to form correct names by forcing the Unix filename to uppercase and truncating as required, but often this yields unsatisfactory results when the truncated names are not all unique. .B genisoimage assigns weightings to each filename, and if two names that are otherwise the same are found, the name with the lower priority is renamed to include a 3-digit number (guaranteed to be unique). For example, the two files .I foo.bar and .I foo.bar.~1~ could be rendered as .I FOO.BAR;1 and .IR FOO000.BAR;1 . .PP When used with various HFS options, .B genisoimage will attempt to recognise files stored in a number of Apple/Unix file formats and will copy the data and resource forks as well as any relevant Finder information. See the .B HFS MACINTOSH FILE FORMATS section below for more about formats .B genisoimage supports. .PP Note that .B genisoimage is not designed to communicate with the writer directly. Most writers have proprietary command sets which vary from one manufacturer to another, and you need a specialized tool to actually burn the disc. .B wodim is one such tool. The latest version of .B wodim is available from .IR http://www.cdrkit.org/ . .PP .B pathspec is the path of the directory tree to be copied into the ISO9660 filesystem. Multiple paths can be specified, and .B genisoimage will merge the files found in all of the specified path components to form the filesystem image. .PP If the option .B \-graft\-points has been specified, it is possible to graft the paths at points other than the root directory, and it is possible to graft files or directories onto the cdrom image with names different than what they have in the source filesystem. This is easiest to illustrate with a couple of examples. Let's start by assuming that a local file .I ../old.lis exists, and you wish to include it in the cdrom image. .IP foo/bar/=../old.lis .PP will include .I old.lis in the cdrom image at .IR /foo/bar/old.lis , while .IP foo/bar/xxx=../old.lis .PP will include .I old.lis in the cdrom image at .IR /foo/bar/xxx . The same sort of syntax can be used with directories as well. .B genisoimage will create any directories required such that the graft points exist on the cdrom image \(em the directories do not need to appear in one of the paths. By default, any directories that are created on the fly like this will have permissions 0555 and appear to be owned by the person running .BR genisoimage . If you wish other permissions or owners of the intermediate directories, see .BR \-uid ", " \-gid ", " \-dir\-mode ", " \-file\-mode " and " \-new\-dir\-mode . .PP .B genisoimage will also run on Windows machines when compiled with Cygnus' cygwin (available from .IR http://www.cygwin.com/ ). Therefore most references in this man page to .I Unix can be replaced with .IR Win32 . .\" ---------------------------------------- .SH OPTIONS .PP Several options can be specified as defaults in a .I .genisoimagerc configuration file, as well as on the command line. If a parameter is specified in both places, the setting from the command line is used. For details on the format and possible locations of this file, see .BR genisoimagerc (5). .TP .BI \-abstract " file" Specifies the abstract filename. There is space for 37 characters. Equivalent to .B ABST in the .I .genisoimagerc file. .TP .BI \-A " application_id" Specifies a text string that will be written into the volume header. This should describe the application that will be on the disc. There is space for 128 characters. Equivalent to .B APPI in the .I .genisoimagerc file. .TP .B \-allow\-limited\-size When processing files larger than 2GiB which cannot be easily represented in ISO9660, add them with a shrunk visible file size to ISO9660 and with the correct visible file size to the UDF system. The result is an inconsistent filesystem and users need to make sure that they really use UDF rather than ISO9660 driver to read a such disk. Implies enabling .BR \-udf. .TP .B \-allow\-leading\-dots .TP .B \-ldots Allow ISO9660 filenames to begin with a period. Usually, a leading dot is replaced with an underscore in order to maintain MS-DOS compatibility. .br This violates the ISO9660 standard, but it happens to work on many systems. Use with caution. .TP .B \-allow\-lowercase This options allows lowercase characters to appear in ISO9660 filenames. .br This violates the ISO9660 standard, but it happens to work on some systems. Use with caution. .TP .B \-allow\-multidot This options allows more than one dot to appear in ISO9660 filenames. A leading dot is not affected by this option, it may be allowed separately using .BR \-allow\-leading\-dots . .br This violates the ISO9660 standard, but it happens to work on many systems. Use with caution. .TP .BI \-biblio " file" Specifies the bibliographic filename. There is space for 37 characters. Equivalent to .B BIBL in the .I .genisoimagerc file. .TP .B \-cache\-inodes .TP .B \-no\-cache\-inodes Enable or disable caching inode and device numbers to find hard links to files. If .B genisoimage finds a hard link (a file with multiple names), the file will also be hard-linked on the CD, so the file contents only appear once. This helps to save space. .B \-cache\-inodes is default on Unix-like operating systems, but .B \-no\-cache\-inodes is default on some other systems such as Cygwin, because it is not safe to assume that inode numbers are unique on those systems. (Some versions of Cygwin create fake inode numbers using a weak hashing algorithm, which may produce duplicates.) If two files have the same inode number but are not hard links to the same file, .B genisoimage \-cache\-inodes will not behave correctly. .B \-no\-cache\-inodes is safe in all situations, but in that case .B genisoimage cannot detect hard links, so the resulting CD image may be larger than necessary. .TP .BI \-alpha\-boot " alpha_boot_image" Specifies the path and filename of the boot image to be used when making an Alpha/SRM bootable CD. The pathname must be relative to the source path specified to .BR genisoimage . .TP .BI \-hppa\-bootloader " hppa_bootloader_image" Specifies the path and filename of the boot image to be used when making an HPPA bootable CD. The pathname must be relative to the source path specified to .BR genisoimage . Other options are required, at the very least a kernel filename and a boot command line. See the .B HPPA NOTES section below for more information. .TP .BI \-hppa\-cmdline " hppa_boot_command_line" Specifies the command line to be passed to the HPPA boot loader when making a bootable CD. Separate the parameters with spaces or commas. More options must be passed to .B genisoimage, at the very least a kernel filename and the boot loader filename. See the .B HPPA NOTES section below for more information. .TP .BI \-hppa\-kernel\-32 " hppa_kernel_32" .TP .BI \-hppa\-kernel\-64 " hppa_kernel_64" Specifies the path and filename of the 32-bit and/or 64-bit kernel images to be used when making an HPPA bootable CD. The pathnames must be relative to the source path specified to .BR genisoimage . Other options are required, at the very least the boot loader filename and the boot command line. See the .B HPPA NOTES section below for more information. .TP .BI \-hppa\-ramdisk " hppa_ramdisk_image" Specifies the path and filename of the ramdisk image to be used when making an HPPA bootable CD. The pathname must be relative to the source path specified to .BR genisoimage . This parameter is optional. Other options are required, at the very least a kernel filename and the boot command line. See the .B HPPA NOTES section below for more information. .TP .BI \-mips\-boot " mips_boot_image" Specifies the path and filename of the boot image to be used when making an SGI/big-endian MIPS bootable CD. The pathname must be relative to the source path specified to .BR genisoimage . This option may be specified several times, to store up to 15 boot images. .TP .BI \-mipsel\-boot " mipsel_boot_image" Specifies the path and filename of the boot image to be used when making an DEC/little-endian MIPS bootable CD. The pathname must be relative to the source path specified to .BR genisoimage . .TP .BI \-B " img_sun4,img_sun4c,img_sun4m,img_sun4d,img_sun4e" .TP .BI \-sparc\-boot " img_sun4,img_sun4c,img_sun4m,img_sun4d,img_sun4e" Specifies a comma-separated list of boot images that are needed to make a bootable CD for SPARC systems. Partition 0 is used for the ISO9660 image, the first image file is mapped to partition 1. The comma-separated list may have up to 7 fields, including empty fields. This option is required to make a bootable CD for Sun SPARC systems. If .B \-B or .B \-sparc\-boot has been specified, the first sector of the resulting image will contain a Sun disk label. This disk label specifies slice 0 for the ISO9660 image and slices 1 to 7 for the boot images that have been specified with this option. Byte offsets 512 to 8191 within each of the additional boot images must contain a primary boot that works for the appropriate SPARC architecture. The rest of each of the images usually contains a UFS filesystem used for the primary kernel boot stage. .IP The implemented boot method is the one found with SunOS 4.x and SunOS 5.x. However, it does not depend on SunOS internals but only on properties of the Open Boot prom, so it should be usable for any OS for SPARC systems. For more information also see the .B NOTES section below. .IP If the special filename .B ... is used, the actual and all following boot partitions are mapped to the previous partition. If .B genisoimage is called with .BI \-G " image " \-B " ..." all boot partitions are mapped to the partition that contains the ISO9660 filesystem image and the generic boot image that is located in the first 16 sectors of the disc is used for all architectures. .TP .BI \-G " generic_boot_image" Specifies the path and filename of the generic boot image to be used when making a generic bootable CD. The boot image will be placed on the first 16 sectors of the CD, before the ISO9660 primary volume descriptor. If this option is used together with .BR \-sparc\-boot , the Sun disk label will overlay the first 512 bytes of the generic boot image. .TP .BI \-b " eltorito_boot_image" Specifies the path and filename of the boot image to be used when making an El Torito bootable CD for x86 PCs. The pathname must be relative to the source path specified to .BR genisoimage . This option is required to make an El Torito bootable CD. The boot image must be exactly 1200 kB, 1440 kB or 2880 kB, and .B genisoimage will use this size when creating the output ISO9660 filesystem. The PC BIOS will use the image to emulate a floppy disk, so the first 512-byte sector should contain PC boot code. This will work, for example, if the boot image is a LILO-based boot floppy. .IP If the boot image is not an image of a floppy, you need to add either .BR \-hard\-disk\-boot " or " \-no\-emul\-boot . If the system should not boot off the emulated disk, use .BR \-no\-boot . .IP If .B \-sort has not been specified, the boot images are sorted with low priority (+2) to the beginning of the medium. If you don't like this, you need to specify a sort weight of 0 for the boot images. .TP .B \-eltorito\-alt\-boot Start with a new set of El Torito boot parameters. Up to 63 El Torito boot entries may be stored on a single CD. .TP .BI \-hard\-disk\-boot Specifies that the boot image used to create El Torito bootable CDs is a hard disk image. The image must begin with a master boot record that contains a single partition. .TP .BI \-no\-emul\-boot Specifies that the boot image used to create El Torito bootable CDs is a "no emulation" image. The system will load and execute this image without performing any disk emulation. .TP .BI \-no\-boot Specifies that the created El Torito CD should be marked as not bootable. The system will provide an emulated drive for the image, but will boot off a standard boot device. .TP .BI \-boot\-load\-seg " segment_address" Specifies the load segment address of the boot image for no-emulation El Torito CDs. .TP .BI \-boot\-load\-size " load_sectors" Specifies the number of "virtual" (512-byte) sectors to load in no-emulation mode. The default is to load the entire boot file. Some BIOSes may have problems if this is not a multiple of 4. .TP .B \-boot\-info\-table Specifies that a 56-byte table with information of the CD-ROM layout will be patched in at offset 8 in the boot file. If this option is given, the boot file is .IR "modified in the source filesystem" , so make a copy of this file if it cannot be easily regenerated! See the .B EL TORITO BOOT INFO TABLE section for a description of this table. .TP .BI \-C " last_sess_start,next_sess_start" This option is needed to create a CD Extra or the image of a second session or a higher-level session for a multisession disc. .B \-C takes two numbers separated by a comma. The first is the first sector in the last session of the disc that should be appended to. The second number is the starting sector number of the new session. The correct numbers may be retrieved by calling .B wodim \-msinfo ... If .B \-C is used in conjunction with .BR \-M , .B genisoimage will create a filesystem image that is intended to be a continuation of the previous session. If .B \-C is used without .BR \-M , .B genisoimage will create a filesystem image that is intended to be used for a second session on a CD Extra. This is a multisession CD that holds audio data in the first session and an ISO9660 filesystem in the second session. .TP .BI \-c " boot_catalog" Specifies the path and filename of the boot catalog, which is required for an El Torito bootable CD. The pathname must be relative to the source path specified to .BR genisoimage . This file will be inserted into the output tree and not created in the source filesystem, so be sure the specified filename does not conflict with an existing file, or it will be excluded. Usually a name like .I boot.catalog is chosen. .IP If .B \-sort has not been specified, the boot catalog sorted with low priority (+1) to the beginning of the medium. If you don't like this, you need to specify a sort weight of 0 for the boot catalog. .TP .B \-check\-oldnames Check all filenames imported from the old session for compliance with the ISO9660 file naming rules. Without this option, only names longer than 31 characters are checked, as these files are a serious violation of the ISO9660 standard. .TP .BI \-check\-session " file" Check all old sessions for compliance with actual .B genisoimage ISO9660 file naming rules. This is a high-level option that combines .B \-M .I file .BR "\-C 0,0 \-check\-oldnames" . For the parameter .IR file , see the description of .BR \-M . .TP .BI \-copyright " file" Specifies copyright information, typically a filename on the disc. There is space for 37 characters. Equivalent to .B COPY in the .I .genisoimagerc file. .TP .B \-d Do not append a period to files that do not have one. .br This violates the ISO9660 standard, but it happens to work on many systems. Use with caution. .TP .B \-D Do not use deep directory relocation, and instead just pack them in the way we see them. .br If ISO9660:1999 has not been selected, this violates the ISO9660 standard, but it happens to work on many systems. Use with caution. .TP .BI \-dir\-mode " mode" Overrides the mode of directories used to create the image to .IR mode , specified as 4 digits of permission bits as in .BR chmod (1). This option automatically enables Rock Ridge extensions. .TP .B \-dvd\-video Generate a DVD-Video compliant UDF filesystem. This is done by sorting the order of the content of the appropriate files and by adding padding between the files if needed. Note that the sorting only works if the DVD-Video filenames include uppercase characters only. .IP Note that in order to get a DVD-Video compliant filesystem image, you need to prepare a DVD-Video compliant directory tree. This requires a directory .B VIDEO_TS (all caps) in the root directory of the resulting DVD, and usually another directory .BR AUDIO_TS . .B VIDEO_TS needs to include all needed files (filenames must be all caps) for a compliant DVD-Video filesystem. .TP .B \-f Follow symbolic links when generating the filesystem. When this option is not in use, symbolic links will be entered using Rock Ridge if enabled, otherwise they will be ignored. .TP .BI \-file\-mode " mode" Overrides the mode of regular files used to create the image to .IR mode , specified as 4 digits of permission bits as in .BR chmod (1). This option automatically enables Rock Ridge extensions. .TP .BI \-gid " gid" Overrides the group ID read from the source files to the value of .IR gid . Specifying this option automatically enables Rock Ridge extensions. .TP .B \-gui Switch the behaviour for a GUI. This currently makes the output more verbose but may have other effects in the future. .TP .B \-graft\-points Allow use of graft points for filenames. If this option is used, all filenames are checked for graft points. The filename is divided at the first unescaped equal sign. All occurrences of `\(rs' and `=' characters must be escaped with `\(rs' if .B \-graft\-points has been specified. .TP .BI \-hide " glob" Hide any files matching .IR glob , a shell wildcard pattern, from being seen in the ISO9660 or Rock Ridge directory. .I glob may match any part of the filename or path. If .I glob matches a directory, the contents of that directory will be hidden. In order to match a directory name, make sure the pathname does not include a trailing `/' character. All the hidden files will still be written to the output CD image file. See also .BR \-hide\-joliet , and .IR README.hide . This option may be used multiple times. .TP .BI \-hide\-list " file" A file containing a list of shell wildcards to be hidden. See .BR \-hide . .TP .BI \-hidden " glob" Add the hidden (existence) ISO9660 directory attribute for files and directories matching .IR glob , a shell wildcard pattern. This attribute will prevent the files from being shown by some MS-DOS and Windows commands. .I glob may match any part of the filename or path. In order to match a directory name, make sure the pathname does not include a trailing `/' character. This option may be used multiple times. .TP .BI \-hidden\-list " file" A file containing a list of shell wildcards to get the hidden attribute. See .BR \-hidden . .TP .BI \-hide\-joliet " glob" Hide files and directories matching .IR glob , a shell wildcard pattern, from being seen in the Joliet directory. .I glob may match any part of the filename or path. If .I glob matches a directory, the contents of that directory will be hidden. In order to match a directory name, make sure the pathname does not include a trailing `/' character. All the hidden files will still be written to the output CD image file. This option is usually used with .BR \-hide . See also .IR README.hide . This option may be used multiple times. .TP .BI \-hide\-joliet\-list " file" A file containing a list of shell wildcards to be hidden from the Joliet tree. See .BR \-hide\-joliet . .TP .B \-hide\-joliet\-trans\-tbl Hide the .I TRANS.TBL files from the Joliet tree. These files usually don't make sense in the Joliet world as they list the real name and the ISO9660 name which may both be different from the Joliet name. .TP .B \-hide\-rr\-moved Rename the directory .I RR_MOVED to .I .rr_moved in the Rock Ridge tree. It seems to be impossible to completely hide the .I RR_MOVED directory from the Rock Ridge tree. This option only makes the visible tree less confusing for people who don't know what this directory is for. If you need to have no .I RR_MOVED directory at all, you should use .BR \-D . Note that if .B \-D has been specified, the resulting filesystem is not ISO9660 level-1 compliant and will not be readable on MS-DOS. See also the .B NOTES section. .TP .BI \-input\-charset " charset" Input charset that defines the characters used in local filenames. To get a list of valid charset names, call .BR "genisoimage \-input\-charset help" . To get a 1:1 mapping, you may use .B default as charset name. The default initial values are .I cp437 on DOS-based systems and .I iso8859-1 on all other systems. See the .B CHARACTER SETS section below for more details. .TP .BI \-output\-charset " charset" Output charset that defines the characters that will be used in Rock Ridge filenames. Defaults to the input charset. See .B CHARACTER SETS section below for more details. .TP .BI \-iso\-level " level" Set the ISO9660 conformance level. Valid numbers are 1 to 4. .IP With level 1, files may only consist of one section and filenames are restricted to 8.3 characters. .IP With level 2, files may only consist of one section. .IP With level 3, no restrictions (other than ISO-9660:1988) do apply. .IP With all ISO9660 levels from 1 to 3, all filenames are restricted to uppercase letters, numbers and underscores (_). Filenames are limited to 31 characters, directory nesting is limited to 8 levels, and pathnames are limited to 255 characters. .IP Level 4 officially does not exist but .B genisoimage maps it to ISO-9660:1999, which is ISO9660 version 2. .IP With level 4, an enhanced volume descriptor with version number and file structure version number set to 2 is emitted. Directory nesting is not limited to 8 levels, there is no need for a file to contain a dot and the dot has no special meaning, filenames do not have version numbers, .\" (f XXX ??? The character used for filling byte positions which are .\" specified to be characters is subject to agreement between the .\" originator and the recipient of the volume), and filenames can be up to 207 characters long, or 197 characters if Rock Ridge is used. .IP When creating Version 2 images, .B genisoimage emits an enhanced volume descriptor, similar but not identical to a primary volume descriptor. Be careful not to use broken software to make ISO9660 images bootable by assuming a second PVD copy and patching this putative PVD copy into an El Torito VD. .TP .B \-J Generate Joliet directory records in addition to regular ISO9660 filenames. This is primarily useful when the discs are to be used on Windows machines. Joliet filenames are specified in Unicode and each path component can be up to 64 Unicode characters long. Note that Joliet is not a standard \(em only Microsoft Windows and Linux systems can read Joliet extensions. For greater portability, consider using both Joliet and Rock Ridge extensions. .TP .B \-joliet\-long Allow Joliet filenames to be up to 103 Unicode characters, instead of 64. This breaks the Joliet specification, but appears to work. Use with caution. .\" The number 103 is derived from: the maximum Directory Record Length .\" (254), minus the length of Directory Record (33), minus CD-ROM XA .\" System Use Extension Information (14), divided by the UTF-16 .\" character size (2). .TP .BI \-jcharset " charset" A combination of .B \-J \-input\-charset .IR charset . See the .B CHARACTER SETS section below for more details. .TP .B \-l Allow full 31-character filenames. Normally the ISO9660 filename will be in an 8.3 format which is compatible with MS-DOS, even though the ISO9660 standard allows filenames of up to 31 characters. If you use this option, the disc may be difficult to use on a MS-DOS system, but will work on most other systems. Use with caution. .TP .B \-L Outdated option; use .B \-allow\-leading\-dots instead. .TP .BI \-jigdo\-jigdo " jigdo_file" Produce a .B jigdo .I .jigdo metadata file as well as the filesystem image. See the .B JIGDO NOTES section below for more information. .TP .BI \-jigdo\-template " template_file" Produce a .B jigdo .I .template file as well as the filesystem image. See the .B JIGDO NOTES section below for more information. .TP .BI \-jigdo\-min\-file\-size " size" Specify the minimum size for a file to be listed in the .I .jigdo file. Default (and minimum allowed) is 1KB. See the .B JIGDO NOTES section below for more information. .TP .BI \-jigdo\-force\-md5 " path" Specify a file pattern where files .I must be contained in the externally-supplied MD5 list as supplied by .BR \-md5\-list . See the .B JIGDO NOTES section below for more information. .TP .BI \-jigdo\-exclude " path" Specify a file pattern where files will not be listed in the .I .jigdo file. See the .B JIGDO NOTES section below for more information. .TP .BI \-jigdo\-map " path" Specify a pattern mapping for the jigdo file (e.g. .IR Debian=/mirror/debian ). See the .B JIGDO NOTES section below for more information. .TP .BI \-md5\-list " md5_file" Specify a file containing the MD5sums, sizes and pathnames of the files to be included in the .I .jigdo file. See the .B JIGDO NOTES section below for more information. .TP .BI \-jigdo\-template\-compress " algorithm Specify a compression algorithm to use for template date. gzip and bzip2 are currently supported, and gzip is the default. See the .B JIGDO NOTES section below for more information. .TP .BI \-log\-file " log_file" Redirect all error, warning and informational messages to .I log_file instead of the standard error. .TP .BI \-m " glob" Exclude files matching .IR glob , a shell wildcard pattern, from being written to CD-ROM. .I glob may match either the filename component or the full pathname. This option may be used multiple times. For example: .sp genisoimage \-o rom \-m \(aq*.o\(aq \-m core \-m foobar .sp would exclude all files ending in `.o', or called .IR core " or " foobar from the image. Note that if you had a directory called .IR foobar , it too (and of course all its descendants) would be excluded. .TP .BI \-exclude\-list " file" A file containing a list of shell wildcards to be excluded. See .BR \-m . .TP .B \-max\-iso9660\-filenames Allow ISO9660 filenames to be up to 37 characters long. This option enables .B \-N as the extra name space is taken from the space reserved for file version numbers. .br This violates the ISO9660 standard, but it happens to work on many systems. Although a conforming application needs to provide a buffer space of at least 37 characters, discs created with this option may cause a buffer overflow in the reading operating system. Use with extreme care. .TP .BI \-M " path" .TP .BI \-M " device" .TP .BI \-dev " device" Specifies path to existing ISO9660 image to be merged. The alternate form takes a SCSI device specifier that uses the same syntax as the .B dev= parameter of .BR wodim . The output of .B genisoimage will be a new session which should get written to the end of the image specified in .BR \-M . Typically this requires multisession capability for the CD recorder used to write the image. This option may only be used in conjunction with .BR \-C . .TP .B \-N Omit version numbers from ISO9660 filenames. .br This violates the ISO9660 standard, but no one really uses the version numbers anyway. Use with caution. .TP .BI \-new\-dir\-mode " mode" Specify the mode, a 4-digit number as used in .BR chmod (1), to use when creating new directories in the filesystem image. The default is 0555. .TP .B \-nobak .TP .B \-no\-bak Exclude backup files files on the ISO9660 filesystem; that is, filenames that contain the characters `~' or `#' or end in .IR .bak . These are typically backup files for Unix text editors. .TP .B \-force\-rr Do not use the automatic Rock Ridge attributes recognition for previous sessions. This can work around problems with images created by, e.g., NERO Burning ROM. .TP .B \-no\-rr Do not use the Rock Ridge attributes from previous sessions. This may help to avoid problems when .B genisoimage finds illegal Rock Ridge signatures on an old session. .TP .B \-no\-split\-symlink\-components Don't split the symlink components, but begin a new Continuation Area (CE) instead. This may waste some space, but the SunOS 4.1.4 cdrom driver has a bug in reading split symlink components. .IP It is questionable whether this option is useful nowadays. .TP .B \-no\-split\-symlink\-fields Don't split the symlink fields, but begin a new Continuation Area (CE) instead. This may waste some space, but the SunOS 4.1.4 and Solaris 2.5.1 cdrom driver have a bug in reading split symlink fields (a `/' can be dropped). .IP It is questionable whether this option is useful nowadays. .TP .BI \-o " filename" Specify the output file for the the ISO9660 filesystem image. This can be a disk file, a tape drive, or it can correspond directly to the device name of the optical disc writer. If not specified, stdout is used. Note that the output can also be a block device for a regular disk partition, in which case the ISO9660 filesystem can be mounted normally to verify that it was generated correctly. .TP .B \-pad Pad the end of the whole image by 150 sectors (300 kB). This option is enabled by default. If used in combination with .BR \-B , padding is inserted between the ISO9660 partition and the boot partitions, such that the first boot partition starts on a sector number that is a multiple of 16. .IP The padding is needed as many operating systems (e.g. Linux) implement read-ahead bugs in their filesystem I/O. These bugs result in read errors on files that are located near the end of a track, particularly if the disc is written in Track At Once mode, or where a CD audio track follows the data track. .\" XXX: Someone should check to see if the Linux readahead bug is .\" XXX: still present, and update this comment accordingly. .TP .B \-no\-pad Do not pad the end by 150 sectors (300 kB) and do not make the the boot partitions start on a multiple of 16 sectors. .TP .BI \-path\-list " file" A file containing a list of .I pathspec directories and filenames to be added to the ISO9660 filesystem. This list of pathspecs are processed after any that appear on the command line. If the argument is .IR \- , the list is read from the standard input. .TP .B \-P Outdated option; use .B \-publisher instead. .TP .BI \-publisher " publisher_id" Specifies a text string that will be written into the volume header. This should describe the publisher of the CD-ROM, usually with a mailing address and phone number. There is space for 128 characters. Equivalent to .B PUBL in the .I .genisoimagerc file. .TP .BI \-p " preparer_id" Specifies a text string that will be written into the volume header. This should describe the preparer of the CD-ROM, usually with a mailing address and phone number. There is space for 128 characters. Equivalent to .B PREP in the .I .genisoimagerc file. .TP .B \-print\-size Print estimated filesystem size in multiples of the sector size (2048 bytes) and exit. This option is needed for Disk At Once mode and with some CD-R drives when piping directly into .BR wodim , cases where .B wodim needs to know the size of the filesystem image in advance. Old versions of .B mkisofs wrote this information (among other information) to .IR stderr . As this turns out to be hard to parse, the number without any other information is now printed on .I stdout too. If you like to write a simple shell script, redirect .I stderr and catch the number from .IR stdout . This may be done with: .sp cdblocks=\` genisoimage \-print\-size \-quiet .\|.\|. \` .br genisoimage .\|.\|. | wodim .\|.\|. tsize=${cdblocks}s \- .TP .B \-quiet This makes .B genisoimage even less verbose. No progress output will be provided. .TP .B \-R Generate SUSP and RR records using the Rock Ridge protocol to further describe the files on the ISO9660 filesystem. .TP .B \-r This is like the \-R option, but file ownership and modes are set to more useful values. The uid and gid are set to zero, because they are usually only useful on the author's system, and not useful to the client. All the file read bits are set true, so that files and directories are globally readable on the client. If any execute bit is set for a file, set all of the execute bits, so that executables are globally executable on the client. If any search bit is set for a directory, set all of the search bits, so that directories are globally searchable on the client. All write bits are cleared, because the filesystem will be mounted read-only in any case. If any of the special mode bits are set, clear them, because file locks are not useful on a read-only filesystem, and set-id bits are not desirable for uid 0 or gid 0. When used on Win32, the execute bit is set on .I all files. This is a result of the lack of file permissions on Win32 and the Cygwin POSIX emulation layer. See also .BR \-uid ", " \-gid , .BR \-dir\-mode ", " \-file\-mode and .BR \-new\-dir\-mode . .TP .B \-relaxed\-filenames Allows ISO9660 filenames to include all 7-bit ASCII characters except lowercase letters. .br This violates the ISO9660 standard, but it happens to work on many systems. Use with caution. .TP .BI \-root " dir" Moves all files and directories into .I dir in the image. This is essentially the same as using .B \-graft\-points and adding .I dir in front of every pathspec, but is easier to use. .I dir may actually be several levels deep. It is created with the same permissions as other graft points. .TP .BI \-old-root " dir" This option is necessary when writing a multisession image and the previous (or even older) session was written with .B -root .IR dir . Using a directory name not found in the previous session causes .B genisoimage to abort with an error. Without this option, .B genisoimage would not be able to find unmodified files and would be forced to write their data into the image once more. .B \-root and .B \-old-root are meant to be used together to do incremental backups. The initial session would e.g. use: .B genisoimage \-root backup_1 .IR dirs . The next incremental backup with .B genisoimage \-root backup_2 \-old-root backup_1 .I dirs would take another snapshot of these directories. The first snapshot would be found in .BR backup_1 , the second one in .BR backup_2 , but only modified or new files need to be written into the second session. Without these options, new files would be added and old ones would be preserved. But old ones would be overwritten if the file was modified. Recovering the files by copying the whole directory back from CD would also restore files that were deleted intentionally. Accessing several older versions of a file requires support by the operating system to choose which sessions are to be mounted. .TP .BI \-sort " sort_file" Sort file locations on the media. Sorting is controlled by a file that contains pairs of filenames and sorting offset weighting. If the weighting is higher, the file will be located closer to the beginning of the media, if the weighting is lower, the file will be located closer to the end of the media. There must be only one space or tabs character between the filename and the weight and the weight must be the last characters on a line. The filename is taken to include all the characters up to, but not including the last space or tab character on a line. This is to allow for space characters to be in, or at the end of a filename. This option does .B not sort the order of the filenames that appear in the ISO9660 directory. It sorts the order in which the file data is written to the CD image, which is useful in order to optimize the data layout on a CD. See .B README.sort for more details. .TP .BI \-sparc\-boot " img_sun4,img_sun4c,img_sun4m,img_sun4d,img_sun4e" See .B \-B above. .TP .BI \-sparc\-label " label" Set the Sun disk label name for the Sun disk label that is created with .BR \-sparc-boot . .TP .B \-split\-output Split the output image into several files of approximately 1 GB each. This helps to create DVD-sized ISO9660 images on operating systems without large file support. .B wodim will concatenate more than one file into a single track if writing to a DVD. To make .B \-split\-output work, .BI \-o " filename" must be specified. The resulting output images will be named: .IR filename_00 ", " filename_01 ", " filename_02 .... .TP .BI \-stream\-media\-size " #" Select streaming operation and set the media size to # sectors. This allows you to pipe the output of the .BR tar (1) program into .B genisoimage and to create an ISO9660 filesystem without the need of an intermediate tar archive file. If this option has been specified, .B genisoimage reads from .I stdin and creates a file with the name .IR STREAM.IMG . The maximum size of the file (with padding) is 200 sectors less than the specified media size. If .B \-no\-pad has been specified, the file size is 50 sectors less than the specified media size. If the file is smaller, .B genisoimage will write padding. This may take awhile. .IP The option .B \-stream\-media\-size creates simple ISO9660 filesystems only and may not used together with multisession or hybrid filesystem options. .TP .BI \-stream\-file\-name " name" Reserved for future use. .TP .BI \-sunx86\-boot " UFS_img,,,AUX1_img" Specifies a comma-separated list of filesystem images that are needed to make a bootable CD for Solaris x86 systems. .IP Note that partition 1 is used for the ISO9660 image and that partition 2 is the whole disk, so partition 1 and 2 may not be used by external partition data. The first image file is mapped to partition 0. There may be empty fields in the comma-separated list, and list entries for partition 1 and 2 must be empty. The maximum number of supported partitions is 8 (although the Solaris x86 partition table could support up to 16 partitions), so it is impossible to specify more than 6 partition images. This option is required to make a bootable CD for Solaris x86 systems. .IP If .B \-sunx86\-boot has been specified, the first sector of the resulting image will contain a PC fdisk label with a Solaris type 0x82 fdisk partition that starts at offset 512 and spans the whole CD. In addition, for the Solaris type 0x82 fdisk partition, there is a SVr4 disk label at offset 1024 in the first sector of the CD. This disk label specifies slice 0 for the first (usually UFS type) filesystem image that is used to boot the PC and slice 1 for the ISO9660 image. Slice 2 spans the whole CD slice 3 .\|.\|. slice 7 may be used for additional filesystem images that have been specified with this option. .IP A Solaris x86 boot CD uses a 1024 byte sized primary boot that uses the .B El-Torito no-emulation boot mode and a secondary generic boot that is in CD sectors 1\|.\|.15. For this reason, both .BI "-b " bootimage " \-no\-emul\-boot" and .BI \-G " genboot" must be specified. .TP .BI \-sunx86\-label " label" Set the SVr4 disk label name for the SVr4 disk label that is created with .BR \-sunx86-boot . .TP .BI \-sysid " ID" Specifies the system ID. There is space for 32 characters. Equivalent to .B SYSI in the .I .genisoimagerc file. .TP .B \-T Generate a file .I TRANS.TBL in each directory on the CD-ROM, which can be used on non-Rock\ Ridge-capable systems to help establish the correct filenames. There is also information present in the file that indicates the major and minor numbers for block and character devices, and each symlink has the name of the link file given. .TP .BI \-table\-name " table_name" Alternative translation table filename (see above). Implies .BR \-T . If you are creating a multisession image you must use the same name as in the previous session. .TP .BI \-ucs\-level " level" Set Unicode conformance level in the Joliet SVD. The default level is 3. It may be set to 1..3 using this option. .TP .B \-udf Include UDF filesystem support in the generated filesystem image. UDF support is currently in alpha status and for this reason, it is not possible to create UDF-only images. UDF data structures are currently coupled to the Joliet structures, so there are many pitfalls with the current implementation. There is no UID/GID support, there is no POSIX permission support, there is no support for symlinks. Note that UDF wastes the space from sector ~20 to sector 256 at the beginning of the disc in addition to the space needed for real UDF data structures. .TP .BI \-uid " uid" Overrides the uid read from the source files to the value of .IR uid . Specifying this option automatically enables Rock Ridge extensions. .TP .B \-use\-fileversion The option .B \-use\-fileversion allows .B genisoimage to use file version numbers from the filesystem. If the option is not specified, .B genisoimage creates a version number of 1 for all files. File versions are strings in the range .I ;1 to .I ;32767 This option is the default on VMS. .TP .B \-U Allows "untranslated" filenames, completely violating the ISO9660 standards described above. Enables the following flags: .B \-d \-l \-N \-allow\-leading\-dots \-relaxed\-filenames .BR "\-allow\-lowercase \-allow\-multidot \-no\-iso\-translate" . Allows more than one `.' character in the filename, as well as mixed-case filenames. This is useful on HP-UX, where the built-in .I cdfs filesystem does not recognize any extensions. Use with extreme caution. .TP .B \-no\-iso\-translate Do not translate the characters `#' and `~' which are invalid for ISO9660 filenames. Although invalid, these characters are often used by Microsoft systems. .br This violates the ISO9660 standard, but it happens to work on many systems. Use with caution. .TP .BI \-V " volid" Specifies the volume ID (volume name or label) to be written into the master block. There is space for 32 characters. Equivalent to .B VOLI in the .I .genisoimagerc file. The volume ID is used as the mount point by the Solaris volume manager and as a label assigned to a disc on various other platforms such as Windows and Apple Mac OS. .TP .BI \-volset " ID" Specifies the volume set ID. There is space for 128 characters. Equivalent to .B VOLS in the .I .genisoimagerc file. .TP .BI \-volset\-size " #" Sets the volume set size to #. The volume set size is the number of CDs that are in a CD volume set. A volume set is a collection of one or more volumes, on which a set of files is recorded. .IP Volume Sets are not intended to be used to create a set numbered CDs that are part of e.g. a Operation System installation set of CDs. Volume Sets are rather used to record a big directory tree that would not fit on a single volume. Each volume of a Volume Set contains a description of all the directories and files that are recorded on the volumes where the sequence numbers are less than, or equal to, the assigned Volume Set Size of the current volume. .IP .B genisoimage currently does not support a .B \-volset\-size that is larger than 1. .IP The option .B \-volset\-size must be specified before .B \-volset\-seqno on each command line. .TP .BI \-volset\-seqno " #" Sets the volume set sequence number to #. The volume set sequence number is the index number of the current CD in a CD set. The option .B \-volset\-size must be specified before .B \-volset\-seqno on each command line. .TP .B \-v Verbose execution. If given twice on the command line, extra debug information will be printed. .TP .BI \-x " glob" Identical to .B \-m .IR glob . .TP .B \-z Generate special .I RRIP records for transparently compressed files. This is only of use and interest for hosts that support transparent decompression, such as Linux 2.4.14 or later. You must specify .BR \-R " or " \-r to enable Rock Ridge, and generate compressed files using the .B mkzftree utility before running .BR genisoimage . Note that transparent compression is a nonstandard Rock Ridge extension. The resulting disks are only transparently readable if used on Linux. On other operating systems you will need to call .B mkzftree by hand to decompress the files. .\" ---------------------------------------- .SH "HFS OPTIONS" .TP .B \-hfs Create an ISO9660/HFS hybrid CD. This option should be used in conjunction with the .BR \-map , .B \-magic and/or the various .I double dash options given below. .TP .B \-apple Create an ISO9660 CD with Apple's extensions. Similar to .BR \-hfs , except that the Apple Extensions to ISO9660 are added instead of creating an HFS hybrid volume. Former .B genisoimage versions did include Rock Ridge attributes by default if .B \-apple was specified. This versions of .B genisoimage does not do this anymore. If you like to have Rock Ridge attributes, you need to specify this separately. .TP .BI \-map " mapping_file" Use the .I mapping_file to set the CREATOR and TYPE information for a file based on the filename's extension. A filename is mapped only if it is not one of the know Apple/Unix file formats. See the .B HFS CREATOR/TYPE section below. .TP .BI \-magic " magic_file" The CREATOR and TYPE information is set by using a file's .I magic number (usually the first few bytes of a file). The .I magic_file is only used if a file is not one of the known Apple/Unix file formats, or the filename extension has not been mapped using .BR \-map . See the .B HFS CREATOR/TYPE section below for more details. .TP .BI \-hfs\-creator " creator" Set the default CREATOR for all files. Must be exactly 4 characters. See the .B HFS CREATOR/TYPE section below for more details. .TP .BI \-hfs\-type " type" Set the default TYPE for all files. Must be exactly 4 characters. See the .B HFS CREATOR/TYPE section below for more details. .TP .B \-probe Search the contents of files for all the known Apple/Unix file formats. See the .B HFS MACINTOSH FILE FORMATS section below for more about these formats. However, the only way to check for .I MacBinary and .I AppleSingle files is to open and read them, so this option may increase processing time. It is better to use one or more .I double dash options given below if the Apple/Unix formats in use are known. .TP .B \-no\-desktop Do not create (empty) Desktop files. New HFS Desktop files will be created when the CD is used on a Macintosh (and stored in the System Folder). By default, empty Desktop files are added to the HFS volume. .TP .B \-mac\-name Use the HFS filename as the starting point for the ISO9660, Joliet and Rock Ridge filenames. See the .B HFS MACINTOSH FILENAMES section below for more information. .TP .BI \-boot\-hfs\-file " driver_file" Installs the .I driver_file that .I may make the CD bootable on a Macintosh. See the .B HFS BOOT DRIVER section below. (Alpha). .TP .B \-part Generate an HFS partition table. By default, no partition table is generated, but some older Macintosh CD-ROM drivers need an HFS partition table on the CD-ROM to be able to recognize a hybrid CD-ROM. .TP .BI \-auto " AutoStart_file" Make the HFS CD use the QuickTime 2.0 Autostart feature to launch an application or document. The given filename must be the name of a document or application located at the top level of the CD. The filename must be less than 12 characters. (Alpha). .TP .BI \-cluster\-size " size" Set the size in bytes of the cluster or allocation units of PC Exchange files. Implies .BR \-\-exchange . See the .B HFS MACINTOSH FILE FORMATS section below. .TP .BI \-hide\-hfs " glob" Hide .IR glob , a shell wildcard pattern, from the HFS volume. The file or directory will still exist in the ISO9660 and/or Joliet directory. .I glob may match any part of the filename. Multiple globs may be excluded. Example: .sp genisoimage \-o rom \-hfs \-hide\-hfs \(aq*.o\(aq \-hide\-hfs foobar .sp would exclude all files ending in `.o' or called .I foobar from the HFS volume. Note that if you had a directory called .IR foobar , it too (and of course all its descendants) would be excluded. The .I glob can also be a path name relative to the source directories given on the command line. Example: .sp genisoimage \-o rom \-hfs \-hide\-hfs src/html src .sp would exclude just the file or directory called .I html from the .I src directory. Any other file or directory called .I html in the tree will not be excluded. Should be used with .B \-hide and/or .BR \-hide\-joliet . In order to match a directory name, make sure the pattern does not include a trailing `/' character. See .I README.hide for more details. .TP .BI \-hide\-hfs\-list " file" Specify a file containing a list of wildcard patterns to be hidden as in .BR \-hide\-hfs . .TP .BI \-hfs\-volid " hfs_volid" Volume name for the HFS partition. This is the name that is assigned to the disc on a Macintosh and replaces the .I volid used with .BR \-V . .TP .B \-icon\-position Use the icon position information, if it exists, from the Apple/Unix file. The icons will appear in the same position as they would on a Macintosh desktop. Folder location and size on screen, its scroll positions, folder View (view as Icons, Small Icons, etc.) are also preserved. .\" This option may become set by default in the future. (Alpha). .TP .BI \-root\-info " file" Set the location, size on screen, scroll positions, folder View etc. for the root folder of an HFS volume. See .I README.rootinfo for more information. (Alpha) .TP .BI \-prep\-boot " file" PReP boot image file. Up to 4 are allowed. See .I README.prep_boot for more information. (Alpha) .TP .BI \-chrp\-boot Add CHRP boot header. .TP .BI \-input\-hfs\-charset " charset" Input charset that defines the characters used in HFS filenames when used with .BR \-mac\-name . The default charset is .I cp10000 (Mac Roman). See the .B CHARACTER SETS and .B HFS MACINTOSH FILENAMES sections below for more details. .TP .BI \-output\-hfs\-charset " charset" Output charset that defines the characters that will be used in the HFS filenames. Defaults to the input charset. See the .B CHARACTER SETS section below for more details. .TP .B \-hfs\-unlock By default, .B genisoimage will create an HFS volume that is locked. This option leaves the volume unlocked so that other applications (e.g. .BR hfsutils ) can modify the volume. See the .B HFS PROBLEMS/LIMITATIONS section below for warnings about using this option. .TP .BI \-hfs\-bless " folder_name" "Bless" the given directory (folder). This is usually the .I System Folder and is used in creating HFS bootable CDs. The name of the directory must be the whole path name as .B genisoimage sees it. E.g., if the given pathspec is .I ./cddata and the required folder is called .IR "System Folder" , the whole path name is .I \(dq/cddata/System Folder\(dq (remember to use quotes if the name contains spaces). .TP .BI \-hfs\-parms " parameters" Override certain parameters used to create the HFS filesystem. Unlikely to be used in normal circumstances. See the .I libhfs_iso/hybrid.h source file for details. .TP .B \-\-cap Look for AUFS CAP Macintosh files. Search for CAP Apple/Unix file formats only. Searching for the other possible Apple/Unix file formats is disabled, unless other .I double dash options are given. .TP .B \-\-netatalk Look for NETATALK Macintosh files .TP .B \-\-double Look for AppleDouble Macintosh files .TP .B \-\-ethershare Look for Helios EtherShare Macintosh files .TP .B \-\-ushare Look for IPT UShare Macintosh files .TP .B \-\-exchange Look for PC Exchange Macintosh files .TP .B \-\-sgi Look for SGI Macintosh files .TP .B \-\-xinet Look for XINET Macintosh files .TP .B \-\-macbin Look for MacBinary Macintosh files .TP .B \-\-single Look for AppleSingle Macintosh files .TP .B \-\-dave Look for Thursby Software Systems DAVE Macintosh files .TP .B \-\-sfm Look for Microsoft's Services for Macintosh files (NT only) (Alpha) .TP .B \-\-osx\-double Look for Mac OS X AppleDouble Macintosh files .TP .B \-\-osx\-hfs Look for Mac OS X HFS Macintosh files .\" ---------------------------------------- .SH "CHARACTER SETS" .B genisoimage processes filenames in a POSIX-compliant way as strings of 8-bit characters. To represent all codings for all languages, 8-bit characters are not sufficient. Unicode or ISO-10646 define character codings that need at least 21 bits to represent all known languages. They may be represented with .IR UTF-32 ", " UTF-16 " or " UTF-8 coding. UTF-32 uses a plain 32-bit coding but seems to be uncommon. UTF-16 is used by Microsoft with Win32 with the disadvantage that 16-bit characters are not compliant with the POSIX filesystem interface. .PP Modern Unix operating systems may use UTF-8 coding for filenames. Each 32-bit character is represented by one or more 8-bit characters. If a character is coded in .I ISO-8859-1 (used in Central Europe and North America) is maps 1:1 to a UTF-32 or UTF-16 coded Unicode character. If a character is coded in .I 7-Bit ASCII (used in USA and other countries with limited character set) is maps 1:1 to a UTF-32, UTF-16 or UTF-8 coded Unicode character. Character codes that cannot be represented as a single byte in UTF-8 (if the value is > 0x7F) use escape sequences that map to more than one 8-bit character. .PP If all operating systems used UTF-8, .B genisoimage would not need to recode characters in filenames. Unfortunately, Apple uses completely nonstandard codings and Microsoft uses a Unicode coding that is not compatible with the POSIX filename interface. .PP For all non-UTF-8-coded operating systems, the actual character that each byte represents depends on the .I character set or .I codepage (the name used by Microsoft) used by the local operating system \(em the characters in a character set will reflect the region or natural language set by the user. .PP Usually character codes 0x00-0x1f are control characters, codes 0x20-0x7f are the 7-bit ASCII characters and (on PCs and Macs) 0x80-0xff are used for other characters. .PP As there are a lot more than 256 characters/symbols in use, only a small subset are represented in a character set. Therefore the same character code may represent a different character in different character sets. So a filename generated, say in central Europe, may not display the same character when viewed on a machine in, say eastern Europe. .PP To make matters more complicated, different operating systems use different character sets for the region or language. For example, the character code for `\('e' (small e with acute accent) may be character code 0x82 on a PC, code 0x8e on a Macintosh, code 0xe9 on a Unix system in western Europe, and code 0x000e9 in Unicode. .PP As long as not all operating systems and applications use the same character set as the basis for filenames, it may be necessary to specify which character set your filenames use in and which character set the filenames should appear on the CD. .PP There are four options to specify the character sets you want to use: .TP .B \-input\-charset Defines the local character set you are using on your host machine. Any character set conversions that take place will use this character set as the starting point. The default input character sets are .I cp437 on MS-DOS-based systems and .I iso8859-1 on all other systems. If .B \-J is given, the Unicode equivalents of the input character set will be used in the Joliet directory. .B \-jcharset is the same as .BR "\-input\-charset \-J" . .TP .B \-output\-charset Defines the character set that will be used with for the Rock Ridge names on the CD. Defaults to the input character set. .TP .B \-input\-hfs\-charset Defines the HFS character set used for HFS filenames decoded from any of the various Apple/Unix file formats. Only useful when used with .BR \-mac\-name . See the .B HFS MACINTOSH FILENAMES for more information. Defaults to .I cp10000 (Mac Roman). .TP .B \-output\-hfs\-charset Defines the HFS character set used to create HFS filenames from the input character set in use. In most cases this will be from the character set given with .BR \-input\-charset . Defaults to the input HFS character set. .PP There are a number of character sets built in to .BR genisoimage . To get a listing, use .BR "\-input\-charset help" . This list doesn't include the charset derived from the current locale, if .B genisoimage is built with .I iconv support. .PP Additional character sets can be read from file for any of the character set options by giving a filename as the argument to the options. The given file will only be read if its name does not match one of the built-in character sets. .PP The format of the character set files is the same as the mapping files available from .IR http://www.unicode.org/Public/MAPPINGS . This format is: .IP Column #1 is the input byte code (in hex as 0xXX) .br Column #2 is the Unicode (in hex as 0xXXXX) .br The rest of the line is ignored. .PP Any blank line, line without two (or more) columns in the above format or comments lines (starting with the # character) are ignored without any warnings. Any missing input code is mapped to Unicode character 0x0000. .PP Note that, while UTF-8 is supported, other Unicode encodings such as UCS-2/UTF-16 and UCS-4/UTF-32 are not, as POSIX operating systems cannot handle them natively. .PP A 1:1 character set mapping can be defined by using the keyword .I default as the argument to any of the character set options. This is the behaviour of old versions of .BR mkisofs . .PP The ISO9660 filenames generated from the input filenames are not converted from the input character set. The ISO9660 character set is a very limited subset of the ASCII characters, so any conversion would be pointless. .PP Any character that .B genisoimage cannot convert will be replaced with a `_' character. .\" ---------------------------------------- .SH "HFS CREATOR/TYPE" A Macintosh file has two properties associated with it which define which application created the file, the .I CREATOR and what data the file contains, the .IR TYPE . Both are (exactly) 4 letter strings. Usually this allows a Macintosh user to double-click on a file and launch the correct application etc. The CREATOR and TYPE of a particular file can be found by using something like ResEdit (or similar) on a Macintosh. .PP The CREATOR and TYPE information is stored in all the various Apple/Unix encoded files. For other files it is possible to base the CREATOR and TYPE on the filename's extension using a .I mapping file (with .BR \-map ) and/or using the .I magic number (usually a .I signature in the first few bytes) of a file (with .BR \-magic ). If both these options are given, their order on the command line is significant. If .B \-map is given first, a filename extension match is attempted before a magic number match. However, if .B \-magic is given first, a magic number match is attempted before a filename extension match. .PP If a mapping or magic file is not used, or no match is found, the default CREATOR and TYPE for all regular files can be set by using entries in the .I .genisoimagerc file or using .B \-hfs\-creator and/or .BR \-hfs\-type , otherwise the default CREATOR and TYPE are .IR Unix " and " TEXT . .PP The format of the .I mapping file is the same .I afpfile format as used by .BR aufs . This file has five columns for the .IR extension , .IR "file translation" , .IR CREATOR , .IR TYPE " and" .IR Comment . Lines starting with the `#' character are comment lines and are ignored. An example file would be like: .PP .TS tab (/); l s s s s l s s s s l l l l l . # Example filename mapping file # # EXTN/XLate/CREATOR/TYPE/Comment \&.tif/Raw/\(aq8BIM\(aq/\(aqTIFF\(aq/\(dqPhotoshop TIFF image\(dq \&.hqx/Ascii/\(aqBnHq\(aq/\(aqTEXT\(aq/\(dqBinHex file\(dq \&.doc/Raw/\(aqMSWD\(aq/\(aqWDBN\(aq/\(dqWord file\(dq \&.mov/Raw/\(aqTVOD\(aq/\(aqMooV\(aq/\(dqQuickTime Movie\(dq */Ascii/\(aqttxt\(aq/\(aqTEXT\(aq/\(dqText file\(dq .TE .PP Where: .IP The first column .I EXTN defines the Unix filename extension to be mapped. The default mapping for any filename extension that doesn't match is defined with the `*' character. .IP The .I Xlate column defines the type of text translation between the Unix and Macintosh file it is ignored by .BR genisoimage , but is kept to be compatible with .BR aufs (1). Although .B genisoimage does not alter the contents of a file, if a binary file has its TYPE set as .IR TEXT ", it " may be read incorrectly on a Macintosh. Therefore a better choice for the default TYPE may be .IR ???? . .IP The .I CREATOR and .I TYPE keywords must be 4 characters long and enclosed in single quotes. .IP The comment field is enclosed in double quotes \(em it is ignored by .BR genisoimage , but is kept to be compatible with .BR aufs . .PP The format of the .I magic file is almost identical to the .BR magic (5) file used by the .BR file (1) command. .PP This file has four tab-separated columns for the .IR "byte offset" , .IR type , .I test and .IR message . Lines starting with the `#' character are comment lines and are ignored. An example file would be like: .PP .TS tab (/); l s s s l s s s l l l l . # Example magic file # # off/type/test/message 0/string/GIF8/8BIM GIFf GIF image 0/beshort/0xffd8/8BIM JPEG image data 0/string/SIT!/SIT! SIT! StuffIt Archive 0/string/\(rs037\(rs235/LZIV ZIVU standard Unix compress 0/string/\(rs037\(rs213/GNUz ZIVU gzip compressed data 0/string/%!/ASPS TEXT Postscript 0/string/\(rs004%!/ASPS TEXT PC Postscript with a ^D to start 4/string/moov/txtt MooV QuickTime movie file (moov) 4/string/mdat/txtt MooV QuickTime movie file (mdat) .TE .PP The format of the file is described in .BR magic (5). The only difference here is that for each entry in the magic file, the .I message for the initial offset must be be 4 characters for the CREATOR followed by 4 characters for the TYPE \(em white space is optional between them. Any other characters on this line are ignored. Continuation lines (starting with a `>') are also ignored, i.e., only the initial offset lines are used. .PP Using .B \-magic may significantly increase processing time as each file has to opened and read to find its magic number. .PP In summary, for all files, the default CREATOR is .I Unix and the default TYPE is .IR TEXT . These can be changed by using entries in the .I .genisoimagerc file or by using .B \-hfs\-creator and/or .BR \-hfs\-type . .PP If the a file is in one of the known Apple/Unix formats (and the format has been selected), the CREATOR and TYPE are taken from the values stored in the Apple/Unix file. .PP Other files can have their CREATOR and TYPE set from their filename extension (with .BR \-map ), or their magic number (with .BR \-magic ). If the default match is used in the .I mapping file, these values override the default CREATOR and TYPE. .PP A full CREATOR/TYPE database can be found at .IR http://www.angelfire.com/il/szekely/ . .\" ---------------------------------------- .SH "HFS MACINTOSH FILE FORMATS" Macintosh files have two parts called the .I Data and .IR "Resource fork" . Either may be empty. Unix (and many other OSs) can only cope with files having one part (or fork). To add to this, Macintosh files have a number of attributes associated with them \(em probably the most important are the TYPE and CREATOR. Again, Unix has no concept of these types of attributes. .PP E.g., a Macintosh file may be a JPEG image where the image is stored in the Data fork and a desktop thumbnail stored in the Resource fork. It is usually the information in the data fork that is useful across platforms. .PP Therefore to store a Macintosh file on a Unix filesystem, a way has to be found to cope with the two forks and the extra attributes (which are referred to as the .IR "Finder info" ). Unfortunately, it seems that every software package that stores Macintosh files on Unix has chosen a completely different storage method. .PP The Apple/Unix formats that .B genisoimage (partially) supports are: .IP "CAP AUFS format" Data fork stored in a file. Resource fork in subdirectory .I .resource with same filename as data fork. Finder info in subdirectory .I .finderinfo with same filename. .IP "AppleDouble/Netatalk" Data fork stored in a file. Resource fork stored in a file with same name prefixed with `%'. Finder info also stored in same `%' file. Netatalk uses the same format, but the resource fork/Finder info stored in subdirectory .I .AppleDouble with same filename as data fork. .IP AppleSingle Data structures similar to above, except both forks and Finder info are stored in one file. .IP "Helios EtherShare" Data fork stored in a file. Resource fork and Finder info together in subdirectory .I .rsrc with same filename as data fork. .IP "IPT UShare" Like the EtherShare format, but the Finder info is stored slightly differently. .IP MacBinary Both forks and Finder info stored in one file. .IP "Apple PC Exchange" Used by Macintoshes to store Apple files on DOS (FAT) disks. Data fork stored in a file. Resource fork in subdirectory .IR resource.frk " (or " RESOURCE.FRK ). Finder info as one record in file .IR finder.dat " (or " FINDER.DAT ). Separate .I finder.dat for each data fork directory. .IP Note: .B genisoimage needs to know the native FAT cluster size of the disk that the PC Exchange files are on (or have been copied from). This size is given by .BR \-cluster\-size . The cluster or allocation size can be found by using the DOS utility .BR chkdsk . .IP May not work with PC Exchange v2.2 or higher files (available with MacOS 8.1). DOS media containing PC Exchange files should be mounted as type .I msdos (not .IR vfat ) when using Linux. .IP SGI/XINET Used by SGI machines when they mount HFS disks. Data fork stored in a file. Resource fork in subdirectory .I .HSResource with same filename. Finder info as one record in file .IR .HSancillary ". Separate " .HSancillary for each data fork directory. .IP "Thursby Software Systems DAVE" Allows Macintoshes to store Apple files on SMB servers. Data fork stored in a file. Resource fork in subdirectory .IR resource.frk . Uses the AppleDouble format to store resource fork. .IP "Services for Macintosh" Format of files stored by NT Servers on NTFS filesystems. Data fork is stored as .IR filename . Resource fork stored as a NTFS stream called .IR filename:AFP_Resource . The Finder info is stored as a NTFS stream called .IR filename:Afp_AfpInfo . NTFS streams are normally invisible to the user. .IP Warning: .B genisoimage only partially supports the SFM format. If an HFS file or folder stored on the NT server contains an illegal NT character in its name, NT converts these characters to .I Private Use Unicode characters. The characters are: \(dq * / < > ? \(rs | and a space or period if it is the last character of the filename, character codes 0x01 to 0x1f (control characters) and Apple's apple logo. .IP Unfortunately, these private Unicode characters are not readable by the .B genisoimage NT executable. Therefore any file or directory name containing these characters will be ignored \(em including the contents of any such directory. .IP "Mac OS X AppleDouble" When HFS/HFS+ files are copied or saved by Mac OS X on to a non-HFS filesystem (e.g. UFS, NFS etc.), the files are stored in AppleDouble format. Data fork stored in a file. Resource fork stored in a file with same name prefixed with `._'. Finder info also stored in same `._' file. .IP "Mac OS X HFS (Alpha)" Not really an Apple/Unix encoding, but actual HFS/HFS+ files on a Mac\ OS\ X system. Data fork stored in a file. Resource fork stored in a pseudo file with the same name with the suffix .IR /rsrc . The Finder info is only available via a Mac OS X library call. .IP See also .IR README.macosx . .IP Only works when used on Mac OS X. .IP If a file is found with a zero length resource fork and empty finderinfo, it is assumed not to have any Apple/Unix encoding \(em therefore a TYPE and CREATOR can be set using other methods. .PP .B genisoimage will attempt to set the CREATOR, TYPE, date and possibly other flags from the finder info. Additionally, if it exists, the Macintosh filename is set from the finder info, otherwise the Macintosh name is based on the Unix filename \(em see the .B HFS MACINTOSH FILENAMES section below. .PP When using .BR \-apple , the TYPE and CREATOR are stored in the optional System Use or .I SUSP field in the ISO9660 Directory Record \(em in much the same way as the Rock Ridge attributes are. In fact to make life easy, the Apple extensions are added at the beginning of the existing Rock Ridge attributes (i.e., to get the Apple extensions you get the Rock Ridge extensions as well). .PP The Apple extensions require the resource fork to be stored as an ISO9660 .I associated file. This is just like any normal file stored in the ISO9660 filesystem except that the associated file flag is set in the Directory Record (bit 2). This file has the same name as the data fork (the file seen by non-Apple machines). Associated files are normally ignored by other OSs .PP When using .BR \-hfs , the TYPE and CREATOR plus other finder info, are stored in a separate HFS directory, not visible on the ISO9660 volume. The HFS directory references the same data and resource fork files described above. .PP In most cases, it is better to use .B \-hfs instead of .BR \-apple , as the latter imposes the limited ISO9660 characters allowed in filenames. However, the Apple extensions do give the advantage that the files are packed on the disk more efficiently and it may be possible to fit more files on a CD. .\" ---------------------------------------- .SH "HFS MACINTOSH FILENAMES" Where possible, the HFS filename that is stored with an Apple/Unix file is used for the HFS part of the CD. However, not all the Apple/Unix encodings store the HFS filename with the finderinfo. In these cases, the Unix filename is used \(em with escaped special characters. Special characters include `/' and characters with codes over 127. .PP AUFS escapes these characters by using `:' followed by the character code as two hex digits. Netatalk and EtherShare have a similar scheme, but uses `%' instead of a `:'. .PP If .B genisoimage cannot find an HFS filename, it uses the Unix name, with any .IR %xx " or " :xx characters .RI ( xx are two hex digits) converted to a single character code. If .I xx are not hex digits ([0-9a-fA-F]), they are left alone \(em although any remaining `:' is converted to `%', as `:' is the HFS directory separator. Care must be taken, as an ordinary Unix file with .I %xx or .I :xx will also be converted. e.g. .PP .TS l l l s l l l s l l . This:2fFile converted to This/File This:File converted to This%File This:t7File converted to This%t7File .TE .PP Although HFS filenames appear to support uppercase and lowercase letters, the filesystem is case-insensitive, i.e., the filenames .IR aBc " and " AbC are the same. If a file is found in a directory with the same HFS name, .B genisoimage will attempt to make a unique name by adding `_' characters to one of the filenames. .PP If an HFS filename exists for a file, .B genisoimage can use this name as the starting point for the ISO9660, Joliet and Rock Ridge filenames using .BR \-mac\-name . Normal Unix files without an HFS name will still use their Unix name. e.g. .PP If a MacBinary (or PC Exchange) file is stored as .I someimage.gif.bin on the Unix filesystem, but contains a HFS file called .IR someimage.gif , this is the name that would appear on the HFS part of the CD. However, as .B genisoimage uses the Unix name as the starting point for the other names, the ISO9660 name generated will probably be .I SOMEIMAG.BIN and the Joliet/Rock Ridge would be .IR someimage.gif.bin . This option will use the HFS filename as the starting point and the ISO9660 name will probably be .I SOMEIMAG.GIF and the Joliet/Rock Ridge would be .IR someimage.gif . .PP .B \-mac\-name will not currently work with .B \-T \(em the Unix name will be used in the .I TRANS.TBL file, not the Macintosh name. .PP The character set used to convert any HFS filename to a Joliet/Rock Ridge filename defaults to .I cp10000 (Mac Roman). The character set used can be specified using .BR \-input\-hfs\-charset . Other built-in HFS character sets are: .I cp10006 (MacGreek), .I cp10007 (MacCyrillic), .I cp10029 (MacLatin2), .I cp10079 (MacIcelandandic) and .I cp10081 (MacTurkish). .PP Note: the character codes used by HFS filenames taken from the various Apple/Unix formats will not be converted as they are assumed to be in the correct Apple character set. Only the Joliet/Rock Ridge names derived from the HFS filenames will be converted. .PP The existing .B genisoimage code will filter out any illegal characters for the ISO9660 and Joliet filenames, but as .B genisoimage expects to be dealing directly with Unix names, it leaves the Rock Ridge names as is. But as `/' is a legal HFS filename character, .B \-mac\-name converts `/' to a `_' in Rock Ridge filenames. .PP If the Apple extensions are used, only the ISO9660 filenames will appear on the Macintosh. However, as the Macintosh ISO9660 drivers can use .I Level 2 filenames, you can use options like .B \-allow\-multidot without problems on a Macintosh \(em still take care over the names, for example .I this.file.name will be converted to .I THIS.FILE i.e. only have one `.', also filename .I abcdefgh will be seen as .I ABCDEFGH but .I abcdefghi will be seen as .I ABCDEFGHI. i.e. with a `.' at the end \(em don't know if this is a Macintosh problem or a .BR genisoimage / mkhybrid problem. All filenames will be in uppercase when viewed on a Macintosh. Of course, DOS/Win3.X machines will not be able to see Level 2 filenames... .\" ---------------------------------------- .SH "HFS CUSTOM VOLUME/FOLDER ICONS" To give a HFS CD a custom icon, make sure the root (top level) folder includes a standard Macintosh volume icon file. To give a volume a custom icon on a Macintosh, an icon has to be pasted over the volume's icon in the "Get Info" box of the volume. This creates an invisible file called .I Icon\(rsr (`\(rsr' is the carriage return character) in the root folder. .P A custom folder icon is very similar \(em an invisible file called .I Icon\(rsr exists in the folder itself. .P Probably the easiest way to create a custom icon that .B genisoimage can use is to format a blank HFS floppy disk on a Mac and paste an icon to its "Get Info" box. If using Linux with the HFS module installed, mount the floppy: .IP mount \-t hfs /dev/fd0 /mnt/floppy .PP The floppy will be mounted as a CAP filesystem by default. Then run .B genisoimage using something like: .IP genisoimage \-\-cap \-o output source_dir /mnt/floppy .PP If you are not using Linux, you can use .B hfsutils to copy the icon file from the floppy. However, care has to be taken, as the icon file contains a control character. For example: .IP hmount /dev/fd0 .br hdir \-a .br hcopy \-m Icon^V^M icon_dir/icon .PP Where `^V^M' is control-V followed by control-M. Then run .B genisoimage by using something like: .IP genisoimage \-\-macbin \-o output source_dir icon_dir .PP The procedure for creating/using custom folder icons is very similar \(em paste an icon to folder's "Get Info" box and transfer the resulting .I Icon\(rsr file to the relevant directory in the .B genisoimage source tree. .PP You may want to hide the icon files from the ISO9660 and Joliet trees. .PP To give a custom icon to a Joliet CD, follow the instructions found at .IR http://www.cdrfaq.org/faq03.html#S3-21-1 . .\" ---------------------------------------- .SH "HFS BOOT DRIVER" It .I may be possible to make the hybrid CD bootable on a Macintosh. .PP A bootable HFS CD requires an Apple CD-ROM (or compatible) driver, a bootable HFS partition and the necessary System, Finder, etc. files. .PP A driver can be obtained from any other Macintosh bootable CD-ROM using the .B apple_driver utility. This file can then be used with .BR \-boot\-hfs\-file . .PP The HFS partition (i.e. the hybrid disk in our case) must contain a suitable System Folder, again from another CD-ROM or disk. .PP For a partition to be bootable, it must have its .I boot block set. The boot block is in the first two blocks of a partition. For a non-bootable partition the boot block is full of zeros. Normally, when a System file is copied to partition on a Macintosh disk, the boot block is filled with a number of required settings \(em unfortunately I don't know the full spec for the boot block, so I'm guessing that the following will work. .PP Therefore, the utility .B apple_driver also extracts the boot block from the first HFS partition it finds on the given CD-ROM and this is used for the HFS partition created by .BR genisoimage . .PP .I Please note: By using a driver from an Apple CD and copying Apple software to your CD, you become liable to obey Apple Computer, Inc. Software License Agreements. .\" ---------------------------------------- .SH "EL TORITO BOOT INFORMATION TABLE" When .B \-boot\-info\-table is given, .B genisoimage will modify the boot file specified by .B \-b by inserting a 56-byte .I boot information table at offset 8 in the file. This modification is done in the source filesystem, so make sure you use a copy if this file is not easily recreated! This file contains pointers which may not be easily or reliably obtained at boot time. .PP The format of this table is as follows; all integers are in section 7.3.1 ("little endian") format. .sp .RS +.2i .ta 1.0i 2.5i 3.5i .nf Offset Name Size Meaning 8 bi_pvd 4 bytes LBA of primary volume descriptor 12 bi_file 4 bytes LBA of boot file 16 bi_length 4 bytes Boot file length in bytes 20 bi_csum 4 bytes 32-bit checksum 24 bi_reserved 40 bytes Reserved .fi .RE .IP The 32-bit checksum is the sum of all the 32-bit words in the boot file starting at byte offset 64. All linear block addresses (LBAs) are given in CD sectors (normally 2048 bytes). .\" ---------------------------------------- .SH "HPPA NOTES" To make a bootable CD for HPPA, at the very least a boot loader file .RB ( \-hppa\-bootloader ), a kernel image file (32-bit, 64-bit, or both, depending on hardware) and a boot command line .RB ( \-hppa\-cmdline ) must be specified. Some systems can boot either a 32- or a 64-bit kernel, and the firmware will choose one if both are present. Optionally, a ramdisk can be used for the root filesystem using .BR \-hppa\-cmdline . .\" ---------------------------------------- .SH "JIGDO NOTES" Jigdo is a tool to help in the distribution of large files like CD and DVD images; see .I http://atterer.org/jigdo/ for more details. Debian CDs and DVD ISO images are published on the web in jigdo format to allow end users to download them more efficiently. .PP To create jigdo and template files alongside the ISO image from .BR genisoimage , you must first generate a list of the files that will be used, in the following format: .sp .RS +.2i .ta 2.0i 2.0i 5.0i .nf MD5sum File size Path 32 chars 12 chars to end of line .fi .RE .IP .PP The MD5sum must be written in standard hexadecimal notation, the file size must list the size of the file in bytes, and the path must list the absolute path to the file. For example: .sp .nf 00006dcd58ff0756c36d2efae21be376 14736 /mirror/debian/file1 000635c69b254a1be8badcec3a8d05c1 211822 /mirror/debian/file2 00083436a3899a09633fc1026ef1e66e 22762 /mirror/debian/file3 .fi .PP Once you have this file, call .B genisoimage with all of your normal command-line parameters. Specify the output filenames for the jigdo and template files using .BR \-jigdo\-jigdo " and " \-jigdo\-template , and pass in the location of your MD5 list with .BR \-md5\-list . .PP If there are files that you do NOT want to be added into the jigdo file (e.g. if they are likely to change often), specify them using \-jigdo\-exclude. If you want to verify some of the files as they are written into the image, specify them using \-jigdo\-force\-md5. If any files don't match, .B genisoimage will then abort. Both of these options take regular expressions as input. It is possible to restrict the set of files that will be used further based on size \(em use the \-jigdo\-min\-file\-size option. .PP Finally, the jigdo code needs to know how to map the files it is given onto a mirror-style configuration. Specify how to map paths using .BR \-jigdo\-map . Using .I Debian=/mirror/debian will cause all paths starting with .I /mirror/debian to be mapped to .I Debian: in the output jigdo file. .\" ---------------------------------------- .SH EXAMPLES .PP To create a vanilla ISO9660 filesystem image in the file .IR cd.iso , where the directory .I cd_dir will become the root directory of the CD, call: .IP % genisoimage \-o cd.iso cd_dir .PP To create a CD with Rock Ridge extensions of the source directory .IR cd_dir : .IP % genisoimage \-o cd.iso \-R cd_dir .PP To create a CD with Rock Ridge extensions of the source directory .I cd_dir where all files have at least read permission and all files are owned by .IR root , call: .IP % genisoimage \-o cd.iso \-r cd_dir .PP To write a tar archive directly to a CD that will later contain a simple ISO9660 filesystem with the tar archive call: .IP % tar cf \- . | genisoimage \-stream\-media\-size 333000 | \(rs .br wodim dev=b,t,l \-dao tsize=333000s \- .PP To create a HFS hybrid CD with the Joliet and Rock Ridge extensions of the source directory .IR cd_dir : .IP % genisoimage \-o cd.iso \-R \-J \-hfs cd_dir .PP To create a HFS hybrid CD from the source directory .I cd_dir that contains Netatalk Apple/Unix files: .IP % genisoimage \-o cd.iso \-\-netatalk cd_dir .PP To create a HFS hybrid CD from the source directory .IR cd_dir , giving all files CREATOR and TYPES based on just their filename extensions listed in the file "mapping".: .IP % genisoimage \-o cd.iso \-map mapping cd_dir .PP To create a CD with the Apple Extensions to ISO9660, from the source directories .I cd_dir and .IR another_dir . Files in all the known Apple/Unix format are decoded and any other files are given CREATOR and TYPE based on their magic number given in the file .IR magic : .IP % genisoimage \-o cd.iso \-apple \-magic magic \-probe \(rs .br cd_dir another_dir .PP The following example puts different files on the CD that all have the name README, but have different contents when seen as a ISO9660/Rock Ridge, Joliet or HFS CD. .PP Current directory contains: .IP % ls \-F .br README.hfs README.joliet README.Unix cd_dir/ .PP The following command puts the contents of the directory .I cd_dir on the CD along with the three README files \(em but only one will be seen from each of the three filesystems: .IP % genisoimage \-o cd.iso \-hfs \-J \-r \-graft\-points \(rs .br \-hide README.hfs \-hide README.joliet \(rs .br \-hide\-joliet README.hfs \-hide\-joliet README.Unix \(rs .br \-hide\-hfs README.joliet \-hide\-hfs README.Unix \(rs .br README=README.hfs README=README.joliet \(rs .br README=README.Unix cd_dir .PP i.e. the file README.hfs will be seen as README on the HFS CD and the other two README files will be hidden. Similarly for the Joliet and ISO9660/Rock Ridge CD. .PP There are probably all sorts of strange results possible with combinations of the hide options ... .\" ---------------------------------------- .SH NOTES .PP .B genisoimage may safely be installed suid root. This may be needed to allow .B genisoimage to read the previous session when creating a multisession image. .PP If .B genisoimage is creating a filesystem image with Rock Ridge attributes and the directory nesting level of the source directory tree is too much for ISO9660, .B genisoimage will do deep directory relocation. This results in a directory called .B RR_MOVED in the root directory of the CD. You cannot avoid this directory. .PP Many boot code options for different platforms are mutualy exclusive because the boot blocks cannot coexist, ie. different platforms share the same data locations in the image. See http://lists.debian.org/debian-cd/2006/12/msg00109.html for details. .\" ---------------------------------------- .SH BUGS .PP Any files that have hard links to files not in the tree being copied to the ISO9660 filesystem will have an incorrect file reference count. .PP Does not check for SUSP record(s) in `.' entry of the root directory to verify the existence of Rock Ridge enhancements. This problem is present when reading old sessions while adding data in multisession mode. .PP Does not properly read relocated directories in multisession mode when adding data. Any relocated deep directory is lost if the new session does not include the deep directory. .\" Repeat by: create first session with deep directory relocation .\" then add new session with a single dir that differs from the .\" old deep path. .PP Does not re-use .I RR_MOVED when doing multisession from .IR TRANS.TBL . .PP Does not create whole_name entry for .I RR_MOVED in multisession mode. .PP There may be other bugs. Please, report them to the maintainers. .\" ---------------------------------------- .SH "HFS PROBLEMS/LIMITATIONS" I have had to make several assumptions on how I expect the modified libhfs routines to work, however there may be situations that either I haven't thought of, or come across when these assumptions fail. Therefore I can't guarantee that .B genisoimage will work as expected (although I haven't had a major problem yet). Most of the HFS features work fine, but some are not fully tested. These are marked as .I Alpha above. .PP Although HFS filenames appear to support uppercase and lowercase letters, the filesystem is case-insensitive, i.e., the filenames .IR aBc " and "AbC are the same. If a file is found in a directory with the same HFS name, .B genisoimage will attempt to make a unique name by adding `_' characters to one of the filenames. .PP HFS file/directory names that share the first 31 characters have `_N' (a decimal number) substituted for the last few characters to generate unique names. .PP Care must be taken when "grafting" Apple/Unix files or directories (see above for the method and syntax involved). It is not possible to use a new name for an Apple/Unix encoded file/directory. e.g. If a Apple/Unix encoded file called .I oldname is to added to the CD, you cannot use the command line: .IP genisoimage \-o output.raw \-hfs \-graft\-points newname=oldname cd_dir .PP .B genisoimage will be unable to decode .IR oldname . However, you can graft Apple/Unix encoded files or directories as long as you do not attempt to give them new names as above. .PP When creating an HFS volume with the multisession options, .B \-M and .BR \-C , only files in the last session will be in the HFS volume. i.e. .B genisoimage cannot .I add existing files from previous sessions to the HFS volume. .PP However, if each session is created with .BR \-part , each session will appear as separate volumes when mounted on a Mac. In this case, it is worth using .BR \-V " or " \-hfs\-volid to give each session a unique volume name, otherwise each "volume" will appear on the Desktop with the same name. .PP Symbolic links (as with all other non-regular files) are not added to the HFS directory. .PP Hybrid volumes may be larger than pure ISO9660 volumes containing the same data. In some cases (e.g. DVD sized volumes) the difference can be significant. As an HFS volume gets bigger, so does the allocation block size (the smallest amount of space a file can occupy). For a 650MB CD, the allocation block is 10kB, for a 4.7GB DVD it will be about 70kB. .PP The maximum number of files in an HFS volume is about 65500 \(em although the real limit will be somewhat less than this. .PP The resulting hybrid volume can be accessed on a Unix machine by using the hfsutils routines. However, no changes can be made to the volume as it is set as .B locked. The option .B \-hfs\-unlock will create an output image that is unlocked \(em however no changes should be made to the contents of the volume (unless you really know what you are doing) as it's not a "real" HFS volume. .PP .B \-mac\-name will not currently work with .B \-T \(em the Unix name will be used in the .I TRANS.TBL file, not the Macintosh name. .PP Although .B genisoimage does not alter the contents of a file, if a binary file has its TYPE set as .IR TEXT ", it " may be read incorrectly on a Macintosh. Therefore a better choice for the default TYPE may be .IR ???? . .PP .B \-mac\-boot\-file may not work at all... .PP May not work with PC Exchange v2.2 or higher files (available with MacOS 8.1). DOS media containing PC Exchange files should be mounted as type .B msdos (not .BR vfat ) when using Linux. .PP The SFM format is only partially supported \(em see .B HFS MACINTOSH FILE FORMATS section above. .PP It is not possible to use .BR \-sparc\-boot " or " \-generic\-boot " with" .BR \-boot\-hfs\-file " or " \-prep\-boot . .PP .B genisoimage should be able to create HFS hybrid images over 4Gb, although this has not been fully tested. .\" ---------------------------------------- .SH "SEE ALSO" .BR genisoimagerc (5), .BR wodim (1), .BR mkzftree (8), .BR magic (5). .\" ---------------------------------------- .SH AUTHORS .B genisoimage is derived from .B mkisofs from the .B cdrtools 2.01.01a08 package from May 2006 (with few updates extracted from cdrtools 2.01.01a24 from March 2007) from .IR http://cdrecord.berlios.de/ , but is now part of the .B cdrkit suite, maintained by Joerg Jaspert, Eduard Bloch, Steve McIntyre, Peter Samuelson, Christian Fromme, Ben Hutchings, and other contributors. The maintainers can be contacted at .IR debburn-devel@lists.alioth.debian.org , or see the .B cdrkit project web site at .IR http://www.cdrkit.org/ . .PP Eric Youngdale wrote the first versions (1993\(en1998) of .BR mkisofs . J\(:org Schilling wrote the SCSI transport library and its interface, and has maintained .B mkisofs since 1999. James Pearson wrote the HFS hybrid code, using .I libhfs by Robert Leslie. Pearson, Schilling, Jungshik Shin and Jaakko Heinonen contributed to the character set conversion code. The .B cdrkit maintainers have maintained .B genisoimage since 2006. .PP .nf Copyright 1993-1998 by Yggdrasil Computing, Inc. Copyright 1996-1997 by Robert Leslie Copyright 1997-2001 by James Pearson Copyright 1999-2006 by J\(:org Schilling Copyright 2007 by J\(:org Schilling (originating few updates) Copyright 2002-2003 by Jungshik Shin Copyright 2003 by Jaakko Heinonen Copyright 2006 by the Cdrkit maintainers .fi .PP If you want to take part in the development of .BR genisoimage , you may join the .B cdrkit developer mailing list by following the instructions on .IR http://alioth.debian.org/mail/?group_id=31006 . The email address of the list is .IR debburn-devel@lists.alioth.debian.org . This is also the address for user support questions. Note that .BR cdrkit " and " cdrtools are not affiliated. .PP .\" ---------------------------------------- .SH ACKNOWLEDGEMENTS UNIX is a registered trademark of The Open Group in the US and other countries. cdrkit-1.1.11/genisoimage/udf.c0000644000372500001440000011024210563167602015343 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)udf.c 1.14 04/04/15 Copyright 2001 J. Schilling */ /* * udf.c - UDF support for genisoimage * * Written by Ben Rudiak-Gould (2001). * * Copyright 2001 J. Schilling. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Some remaining issues: * * - Do not forget to edit joliet.c and remove the VIDEO_TS lines after * we did implement a decent own file name handling for UDF. * * - UDF supports UNIX-style file permissions and uid/gid, but currently * this code just sets them to default values and ignores their Rock * Ridge counterparts. This would be easy to fix. * * - There's no support for symlinks, Mac type/creator, or Mac resource * forks. Hard links and followed symlinks may work, but if so, it's * only by accident. * * - The file system mirrors the Joliet file system, so files excluded * from Joliet will also be excluded from UDF, the -jcharset option * also applies to UDF, file names too long for Joliet will also be * truncated on UDF, and characters not allowed by Joliet will also * be translated on UDF. (Fortunately, Joliet is pretty lenient.) * * - convert_to_unicode is always called with in_nls, not hfs_nls. This * may lead to incorrect name conversion sometimes when using a Mac * filesystem. See joliet.c for an example of what's supposed to be * done. * * - DVD-Video discs are supposed to have Copyright Management Information * in both the ISO and UDF filesystems. This is not implemented in ISO, * and the code to do it in UDF is currently #ifdef'd out. I'm not sure * whether discs without this information are actually DVD-Video * compliant. The Copyright Management Information is described in ECMA * Technical Report TR/71. * * - Most of the space before sector 256 on the disc (~480K) is wasted, * because UDF Bridge requires a pointer block at sector 256. ISO 9660 * structures could be moved below sector 256 if they're small enough, but * this would be ugly to implement since it breaks the output_fragment * abstraction. * * - Each file must have a File Entry, and each File Entry seems to * require its own 2K sector. As a result, there is an overhead of more * than 2K *per file* when using UDF. I couldn't see any way to avoid * this. * * - Read performance would probably be improved by placing the File Entry * for each file just before the file itself, instead of at the beginning * of the disc. But this would not work for DVD-Video files, which have * to be stored contiguously. So there would have to be an override * mechanism to handle this case. I don't know if it's worth the trouble. */ #ifdef UDF #include "config.h" #include "genisoimage.h" #include #include #include "udf.h" #include "udf_fs.h" extern int use_sparcboot; extern struct directory *root; extern time_t begun; static unsigned lba_main_seq; static unsigned lba_main_seq_copy; static unsigned lba_integ_seq; static unsigned lba_udf_partition_start; static unsigned lba_last_file_entry; static unsigned lba_end_anchor_vol_desc; static unsigned num_udf_files; static unsigned num_udf_directories; static unsigned volume_set_id[2]; #define UDF_MAIN_SEQ_LENGTH (16) #define UDF_INTEG_SEQ_LENGTH (2) /* only works for granularity a power of 2! */ #define PAD(val, granularity) (((val)+(granularity)-1)&~((granularity)-1)) #define read_733(field) ((0[field]&255)+(1[field]&255)*256+(2[field]&255)*65536+(3[field]&255)*16777216) /**************** SIZE ****************/ static int set_file_ident_desc(unsigned char *, unsigned, char *, int, unsigned, unsigned); static unsigned directory_size(struct directory *dpnt) { unsigned size_in_bytes; struct directory_entry *de; Uchar dummy_buf[SECTOR_SIZE]; /* parent directory */ size_in_bytes = set_file_ident_desc(dummy_buf, 0, 0, 0, 0, 0); /* directory contents */ for (de = dpnt->jcontents; de; de = de->jnext) { if (!(de->de_flags & INHIBIT_JOLIET_ENTRY)) { char *name = USE_MAC_NAME(de) ? de->hfs_ent->name : de->name; /* skip . and .. */ if (name[0] == '.' && (name[1] == 0 || (name[1] == '.' && name[2] == 0))) continue; size_in_bytes += set_file_ident_desc(dummy_buf, 0, name, 0, 0, 0); } } return (size_in_bytes); } static void assign_udf_directory_addresses(struct directory *dpnt) { if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY)) { dpnt->self->udf_file_entry_sector = last_extent; last_extent += 1 + ISO_BLOCKS(directory_size(dpnt)); ++num_udf_directories; } if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir) { for (dpnt = dpnt->subdir; dpnt; dpnt = dpnt->next) { assign_udf_directory_addresses(dpnt); } } } static void assign_udf_file_entry_addresses(struct directory *dpnt) { if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY)) { struct directory_entry *de; for (de = dpnt->jcontents; de; de = de->jnext) { if (!(de->de_flags & RELOCATED_DIRECTORY) && !(de->isorec.flags[0] & ISO_DIRECTORY)) { de->udf_file_entry_sector = last_extent++; ++num_udf_files; } } } if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir) { for (dpnt = dpnt->subdir; dpnt; dpnt = dpnt->next) { assign_udf_file_entry_addresses(dpnt); } } } /****************************/ static int udf_vol_recognition_area_size(int starting_extent) { last_extent = starting_extent+3; return (0); } static int udf_main_seq_size(int starting_extent) { lba_main_seq = starting_extent; last_extent = starting_extent + UDF_MAIN_SEQ_LENGTH; return (0); } static int udf_main_seq_copy_size(int starting_extent) { lba_main_seq_copy = starting_extent; last_extent = starting_extent + UDF_MAIN_SEQ_LENGTH; return (0); } static int udf_integ_seq_size(int starting_extent) { lba_integ_seq = starting_extent; last_extent = starting_extent + UDF_INTEG_SEQ_LENGTH; return (0); } static int udf_end_anchor_vol_desc_size(int starting_extent) { lba_end_anchor_vol_desc = starting_extent; last_extent = starting_extent+1; return (0); } static int udf_file_set_desc_size(int starting_extent) { lba_udf_partition_start = starting_extent; last_extent = starting_extent+2; return (0); } static int udf_dirtree_size(int starting_extent) { num_udf_directories = 0; assign_udf_directory_addresses(root); return (0); } static int udf_file_entries_size(int starting_extent) { num_udf_files = 0; assign_udf_file_entry_addresses(root); lba_last_file_entry = last_extent-1; return (0); } static int udf_pad_to_sector_32_size(int starting_extent) { if (last_extent < session_start+32) last_extent = session_start+32; return (0); } static int udf_pad_to_sector_256_size(int starting_extent) { if (last_extent < session_start+256) last_extent = session_start+256; return (0); } static int udf_padend_avdp_size(int starting_extent) { lba_end_anchor_vol_desc = starting_extent; /* add at least 16 and at most 31 sectors, ending at a mult. of 16 */ last_extent = (starting_extent+31) & ~15; if (!use_sparcboot) last_extent = starting_extent + 150; return (0); } extern int oneblock_size(int); /**************** WRITE ****************/ static unsigned crc_ccitt(unsigned char *buf, unsigned len) { const unsigned poly = 0x11021; static unsigned short lookup[256]; unsigned int r; unsigned int i; if (lookup[1] == 0) { unsigned int j, k; for (j = 0; j < 256; ++j) { unsigned int temp = j << 8; for (k = 0; k < 8; ++k) { unsigned int hibit = temp & 32768; temp <<= 1; if (hibit) temp ^= poly; } lookup[j] = temp; } } r = 0; for (i = 0; i < len; ++i) { r = (r << 8) ^ lookup[((r >> 8) ^ buf[i]) & 255]; } return (r & 65535); } #define set8(dst, src) do { *(dst) = (src); } while (0) static void set16(udf_Uint16 *dst, unsigned int src) { dst->l = (char)(src); dst->h = (char)(src>>8); } static void set32(udf_Uint32 *dst, unsigned src) { dst->l = (char)(src); dst->ml = (char)(src>>8); dst->mh = (char)(src>>16); dst->h = (char)(src>>24); } static void set64(udf_Uint64 *dst, uint64_t src) { set32(&dst->l, src); set32(&dst->h, src>>32); } static int set_ostaunicode(unsigned char *dst, int dst_size, char *src) { unsigned char buf[1024]; int i; int expanded_length; expanded_length = joliet_strlen(src, in_nls); if (expanded_length > 1024) expanded_length = 1024; if (expanded_length > (dst_size-1)*2) expanded_length = (dst_size-1)*2; convert_to_unicode(buf, expanded_length, src, in_nls); dst[0] = 8; /* use 8-bit representation by default */ for (i = 0; i < (expanded_length>>1); ++i) { dst[i + 1] = buf[i*2+1]; if (buf[i*2] != 0) { /* * There's a Unicode character with value >=256. * Use 16-bit representation instead. */ int length_to_copy = (dst_size-1) & ~1; if (length_to_copy > expanded_length) length_to_copy = expanded_length; dst[0] = 16; memcpy(dst+1, buf, length_to_copy); return (length_to_copy + 1); } } return ((expanded_length>>1) + 1); } static void set_extent(udf_extent_ad *ext, unsigned lba, unsigned length_bytes) { set32(&ext->extent_length, length_bytes); set32(&ext->extent_location, lba); } static void set_dstring(udf_dstring *dst, char *src, int n) { dst[n-1] = set_ostaunicode((Uchar *)dst, n-1, src); } static void set_charspec(udf_charspec *dst) { /*set8(&dst->character_set_type, 0);*/ memcpy(dst->character_set_info, "OSTA Compressed Unicode", 23); } static void set_impl_ident(udf_EntityID *ent) { strcpy((char *)ent->ident, "*genisoimage"); } static void set_tag(udf_tag *t, unsigned tid, unsigned lba, int crc_length) { unsigned char checksum; int i; set16(&t->tag_ident, tid); set16(&t->desc_version, 2); set16(&t->desc_crc, crc_ccitt((unsigned char *)t+16, crc_length-16)); set16(&t->desc_crc_length, crc_length-16); set32(&t->tag_location, lba); set8(&t->tag_checksum, 0); checksum = 0; for (i = 0; i < 16; ++i) checksum += ((unsigned char *)t)[i]; set8(&t->tag_checksum, checksum); } static void set_timestamp_from_iso_date(udf_timestamp *ts, const char *iso_date_raw) { struct { unsigned char years_since_1900; unsigned char month, day; unsigned char hour, minute, second; signed char offset_from_gmt; } *iso_date = (void *)iso_date_raw; set16(&ts->type_and_time_zone, 4096 + ((iso_date->offset_from_gmt * 15) & 4095)); set16(&ts->year, 1900 + iso_date->years_since_1900); set8(&ts->month, iso_date->month); set8(&ts->day, iso_date->day); set8(&ts->hour, iso_date->hour); set8(&ts->minute, iso_date->minute); set8(&ts->second, iso_date->second); /*set8(&ts->centiseconds, 0);*/ /*set8(&ts->hundreds_of_microseconds, 0);*/ /*set8(&ts->microseconds, 0);*/ } static void set_timestamp_from_time_t(udf_timestamp *ts, time_t t) { char iso_date[7]; iso9660_date(iso_date, t); set_timestamp_from_iso_date(ts, iso_date); } static void set_anchor_volume_desc_pointer(unsigned char *buf, unsigned lba) { udf_anchor_volume_desc_ptr *avdp = (udf_anchor_volume_desc_ptr *)buf; set_extent(&avdp->main_volume_desc_seq_extent, lba_main_seq, SECTOR_SIZE*UDF_MAIN_SEQ_LENGTH); set_extent(&avdp->reserve_volume_desc_seq_extent, lba_main_seq_copy, SECTOR_SIZE*UDF_MAIN_SEQ_LENGTH); set_tag(&avdp->desc_tag, UDF_TAGID_ANCHOR_VOLUME_DESC_PTR, lba, 512); } static void set_primary_vol_desc(unsigned char *buf, unsigned lba) { char temp[17]; udf_primary_volume_desc *pvd = (udf_primary_volume_desc *)buf; /*set32(&pvd->volume_desc_seq_number, 0);*/ /*set32(&pvd->primary_volume_desc_number, 0);*/ set_dstring(pvd->volume_ident, volume_id, sizeof (pvd->volume_ident)); set16(&pvd->volume_seq_number, 1); set16(&pvd->maximum_volume_seq_number, 1); set16(&pvd->interchange_level, 2); set16(&pvd->maximum_interchange_level, 2); set32(&pvd->character_set_list, 1); set32(&pvd->maximum_character_set_list, 1); sprintf(temp, "%08X%08X", volume_set_id[0], volume_set_id[1]); set_dstring(pvd->volume_set_ident, temp, sizeof (pvd->volume_set_ident)); set_charspec(&pvd->desc_character_set); set_charspec(&pvd->explanatory_character_set); /*pvd->volume_abstract;*/ /*pvd->volume_copyright_notice;*/ /*pvd->application_ident;*/ set_timestamp_from_time_t(&pvd->recording_date_and_time, begun); set_impl_ident(&pvd->impl_ident); set_tag(&pvd->desc_tag, UDF_TAGID_PRIMARY_VOLUME_DESC, lba, 512); } static void set_impl_use_vol_desc(unsigned char *buf, unsigned lba) { udf_impl_use_volume_desc *iuvd = (udf_impl_use_volume_desc *)buf; set32(&iuvd->volume_desc_seq_number, 1); strcpy((char *)iuvd->impl_ident.ident, "*UDF LV Info"); iuvd->impl_ident.ident_suffix[0] = 2; iuvd->impl_ident.ident_suffix[1] = 1; set_charspec(&iuvd->impl_use.lvi_charset); set_dstring(iuvd->impl_use.logical_volume_ident, volume_id, sizeof (iuvd->impl_use.logical_volume_ident)); /*set_dstring(iuvd->impl_use.lv_info1, "", sizeof (iuvd->impl_use.lv_info1));*/ /*set_dstring(iuvd->impl_use.lv_info2, "", sizeof (iuvd->impl_use.lv_info2));*/ /*set_dstring(iuvd->impl_use.lv_info3, "", sizeof (iuvd->impl_use.lv_info3));*/ set_impl_ident(&iuvd->impl_use.impl_id); set_tag(&iuvd->desc_tag, UDF_TAGID_IMPL_USE_VOLUME_DESC, lba, 512); } static void set_partition_desc(unsigned char *buf, unsigned lba) { udf_partition_desc *pd = (udf_partition_desc *)buf; set32(&pd->volume_desc_seq_number, 2); set16(&pd->partition_flags, UDF_PARTITION_FLAG_ALLOCATED); /*set16(&pd->partition_number, 0);*/ set8(&pd->partition_contents.flags, UDF_ENTITYID_FLAG_PROTECTED); /*???*/ strcpy((char *)pd->partition_contents.ident, "+NSR02"); set32(&pd->access_type, UDF_ACCESSTYPE_READONLY); set32(&pd->partition_starting_location, lba_udf_partition_start); set32(&pd->partition_length, lba_end_anchor_vol_desc - lba_udf_partition_start); set_impl_ident(&pd->impl_ident); set_tag(&pd->desc_tag, UDF_TAGID_PARTITION_DESC, lba, 512); } static void set_domain_ident(udf_EntityID *ent) { strcpy((char *)ent->ident, "*OSTA UDF Compliant"); memcpy(ent->ident_suffix, "\002\001\003", 3); } static void set_logical_vol_desc(unsigned char *buf, unsigned lba) { udf_logical_volume_desc *lvd = (udf_logical_volume_desc *)buf; set32(&lvd->volume_desc_seq_number, 3); set_charspec(&lvd->desc_character_set); set_dstring(lvd->logical_volume_ident, volume_id, sizeof (lvd->logical_volume_ident)); set32(&lvd->logical_block_size, SECTOR_SIZE); set_domain_ident(&lvd->domain_ident); set32(&lvd->logical_volume_contents_use.extent_length, 2*SECTOR_SIZE); /*set32(&lvd->logical_volume_contents_use.extent_location.logical_block_number, 0);*/ /*set16(&lvd->logical_volume_contents_use.extent_location.partition_reference_number, 0);*/ set32(&lvd->map_table_length, 6); set32(&lvd->number_of_partition_maps, 1); set_impl_ident(&lvd->impl_ident); set_extent(&lvd->integrity_seq_extent, lba_integ_seq, SECTOR_SIZE*UDF_INTEG_SEQ_LENGTH); set8(&lvd->partition_map[0].partition_map_type, UDF_PARTITION_MAP_TYPE_1); set8(&lvd->partition_map[0].partition_map_length, 6); set16(&lvd->partition_map[0].volume_seq_number, 1); /*set16(&lvd->partition_map[0].partition_number, 0);*/ set_tag(&lvd->desc_tag, UDF_TAGID_LOGICAL_VOLUME_DESC, lba, 446); } static void set_unallocated_space_desc(unsigned char *buf, unsigned lba) { udf_unallocated_space_desc *usd = (udf_unallocated_space_desc *)buf; set32(&usd->volume_desc_seq_number, 4); /*set32(&usd->number_of_allocation_descs, 0);*/ set_tag(&usd->desc_tag, UDF_TAGID_UNALLOCATED_SPACE_DESC, lba, 24); } static void set_terminating_desc(unsigned char *buf, unsigned lba) { udf_terminating_desc *td = (udf_terminating_desc *)buf; set_tag(&td->desc_tag, UDF_TAGID_TERMINATING_DESC, lba, 512); } static void set_logical_vol_integrity_desc(unsigned char *buf, unsigned lba) { udf_logical_volume_integrity_desc *lvid = (udf_logical_volume_integrity_desc *)buf; set_timestamp_from_time_t(&lvid->recording_date, begun); set32(&lvid->integrity_type, UDF_INTEGRITY_TYPE_CLOSE); /*lvid->next_integrity_extent;*/ set64(&lvid->logical_volume_contents_use.unique_id, lba_last_file_entry+1); set32(&lvid->number_of_partitions, 1); set32(&lvid->length_of_impl_use, 46); /*set32(&lvid->free_space_table, 0);*/ set32(&lvid->size_table, lba_end_anchor_vol_desc - lba_udf_partition_start); set_impl_ident(&lvid->impl_use.impl_id); set32(&lvid->impl_use.number_of_files, num_udf_files); set32(&lvid->impl_use.number_of_directories, num_udf_directories); set16(&lvid->impl_use.minimum_udf_read_revision, 0x102); set16(&lvid->impl_use.minimum_udf_write_revision, 0x102); set16(&lvid->impl_use.maximum_udf_write_revision, 0x102); set_tag(&lvid->desc_tag, UDF_TAGID_LOGICAL_VOLUME_INTEGRITY_DESC, lba, 88+46); } static void set_file_set_desc(unsigned char *buf, unsigned rba) { udf_file_set_desc *fsd = (udf_file_set_desc *)buf; set_timestamp_from_time_t(&fsd->recording_date_and_time, begun); set16(&fsd->interchange_level, 3); set16(&fsd->maximum_interchange_level, 3); set32(&fsd->character_set_list, 1); set32(&fsd->maximum_character_set_list, 1); /*set32(&fsd->file_set_number, 0);*/ /*set32(&fsd->file_set_desc_number, 0);*/ set_charspec(&fsd->logical_volume_ident_character_set); set_dstring(fsd->logical_volume_ident, volume_id, sizeof (fsd->logical_volume_ident)); set_charspec(&fsd->file_set_character_set); set_dstring(fsd->file_set_ident, volume_id, sizeof (fsd->file_set_ident)); /*fsd->copyright_file_ident;*/ /*fsd->abstract_file_ident;*/ set32(&fsd->root_directory_icb.extent_length, SECTOR_SIZE); set32(&fsd->root_directory_icb.extent_location.logical_block_number, root->self->udf_file_entry_sector - lba_udf_partition_start); set_domain_ident(&fsd->domain_ident); /*fsd->next_extent;*/ set_tag(&fsd->desc_tag, UDF_TAGID_FILE_SET_DESC, rba, 512); } static int set_file_ident_desc(unsigned char *buf, unsigned rba, char *name, int is_directory, unsigned file_entry_rba, unsigned unique_id) { udf_file_ident_desc *fid = (udf_file_ident_desc *)buf; int length_of_file_ident, length, padded_length; set16(&fid->file_version_number, 1); set8(&fid->file_characteristics, (is_directory ? UDF_FILE_CHARACTERISTIC_DIRECTORY : 0) + (name == 0) * UDF_FILE_CHARACTERISTIC_PARENT); set32(&fid->icb.extent_length, SECTOR_SIZE); set32(&fid->icb.extent_location.logical_block_number, file_entry_rba); set16(&fid->icb.extent_location.partition_reference_number, 0); set32(&fid->icb.impl_use.unique_id, unique_id); set16(&fid->length_of_impl_use, 0); if (name) { length_of_file_ident = set_ostaunicode((Uchar *)fid->file_ident, 512, name); } else { length_of_file_ident = 0; } set8(&fid->length_of_file_ident, length_of_file_ident); length = 38 + length_of_file_ident; padded_length = PAD(length, 4); while (length < padded_length) { buf[length++] = 0; } set_tag(&fid->desc_tag, UDF_TAGID_FILE_IDENT_DESC, rba, length); return (length); } static void set_file_entry(unsigned char *buf, unsigned rba, unsigned file_rba, uint64_t length, const char *iso_date, int is_directory, unsigned link_count, unsigned unique_id) { udf_short_ad *allocation_desc; unsigned chunk; udf_file_entry *fe = (udf_file_entry *)buf; /*set32(&fe->icb_tag.prior_recorded_number_of_direct_entries, 0);*/ set16(&fe->icb_tag.strategy_type, 4); /*set16(&fe->icb_tag.strategy_parameter, 0);*/ set16(&fe->icb_tag.maximum_number_of_entries, 1); set8(&fe->icb_tag.file_type, is_directory ? UDF_ICBTAG_FILETYPE_DIRECTORY : UDF_ICBTAG_FILETYPE_BYTESEQ); /*fe->icb_tag.parent_icb_location;*/ set16(&fe->icb_tag.flags, UDF_ICBTAG_FLAG_NONRELOCATABLE | UDF_ICBTAG_FLAG_ARCHIVE | UDF_ICBTAG_FLAG_CONTIGUOUS); if (rationalize_uid) set32(&fe->uid, uid_to_use); else set32(&fe->uid, -1); if (rationalize_gid) set32(&fe->gid, gid_to_use); else set32(&fe->gid, -1); if (is_directory) { set32(&fe->permissions, UDF_FILEENTRY_PERMISSION_OR | UDF_FILEENTRY_PERMISSION_OX | UDF_FILEENTRY_PERMISSION_GR | UDF_FILEENTRY_PERMISSION_GX | UDF_FILEENTRY_PERMISSION_UR | UDF_FILEENTRY_PERMISSION_UX); } else { set32(&fe->permissions, UDF_FILEENTRY_PERMISSION_OR | UDF_FILEENTRY_PERMISSION_GR | UDF_FILEENTRY_PERMISSION_UR); } set16(&fe->file_link_count, link_count); /*fe->record_format;*/ /*fe->record_display_attributes;*/ /*fe->record_length;*/ set64(&fe->info_length, length); set64(&fe->logical_blocks_recorded, ISO_BLOCKS(length)); if (iso_date) { set_timestamp_from_iso_date(&fe->access_time, iso_date); fe->modification_time = fe->access_time; fe->attribute_time = fe->access_time; } set32(&fe->checkpoint, 1); /*fe->ext_attribute_icb;*/ set_impl_ident(&fe->impl_ident); set64(&fe->unique_id, unique_id); /* * Extended attributes that may (?) be required for DVD-Video * compliance */ #if 0 set32(&fe->length_of_ext_attributes, 24+52+56); set32(&fe->ext_attribute_header.impl_attributes_location, 24); set32(&fe->ext_attribute_header.application_attributes_location, 24+52+56); set_tag(&fe->ext_attribute_header.desc_tag, UDF_TAGID_EXT_ATTRIBUTE_HEADER_DESC, rba, 24 /*???*/); set32(&fe->ext_attribute_free_ea_space.attribute_type, SECTOR_SIZE); set8(&fe->ext_attribute_free_ea_space.attribute_subtype, 1); set32(&fe->ext_attribute_free_ea_space.attribute_length, 52); set32(&fe->ext_attribute_free_ea_space.impl_use_length, 4); strcpy((char *)fe->ext_attribute_free_ea_space.impl_ident.ident, "*UDF FreeAppEASpace"); set32(&fe->ext_attribute_dvd_cgms_info.attribute_type, SECTOR_SIZE); set8(&fe->ext_attribute_dvd_cgms_info.attribute_subtype, 1); set32(&fe->ext_attribute_dvd_cgms_info.attribute_length, 56); set32(&fe->ext_attribute_dvd_cgms_info.impl_use_length, 8); strcpy((char *)fe->ext_attribute_free_ea_space.impl_ident.ident, "*UDF DVD CGMS Info"); fe->ext_attribute_free_ea_space.impl_ident.ident_suffix[0] = 2; fe->ext_attribute_free_ea_space.impl_ident.ident_suffix[1] = 1; #else /*set32(&fe->length_of_ext_attributes, 0);*/ #endif allocation_desc = &fe->allocation_desc; /* * Only a file size less than 1GB can be expressed by a single * AllocationDescriptor. When the size of a file is larger than 1GB, * 2 or more AllocationDescriptors should be used. We don't know * whether a singl 8-byte AllocationDescriptor should be written or no * one should be written if the size of a file is 0 byte. - FIXME. * * XXX We get called with buf[2048]. This allows a max. file size of * XXX 234 GB. With more we would cause a buffer overflow. * XXX We need to check whether UDF would allow files > 234 GB. */ for (; length > 0; length -= chunk) { chunk = (length > 0x3ffff800) ? 0x3ffff800 : length; set32(&allocation_desc->extent_length, chunk); set32(&allocation_desc->extent_position, file_rba); file_rba += chunk >> 11; allocation_desc++; } set32(&fe->length_of_allocation_descs, (unsigned char *) allocation_desc - (unsigned char *) &fe->allocation_desc); set_tag(&fe->desc_tag, UDF_TAGID_FILE_ENTRY, rba, (unsigned char *) allocation_desc - buf); } static unsigned directory_link_count(struct directory *dpnt) { /* * The link count is equal to 1 (for the parent) plus the * number of subdirectories. */ unsigned link_count = 1; struct directory_entry *de; /* count relocated subdirectories */ for (de = dpnt->jcontents; de; de = de->jnext) { if ((de->de_flags & (INHIBIT_JOLIET_ENTRY | RELOCATED_DIRECTORY)) == RELOCATED_DIRECTORY) { link_count++; } } /* count ordinary subdirectories */ for (dpnt = dpnt->subdir; dpnt; dpnt = dpnt->next) { if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY)) { link_count++; } } return (link_count); } static void write_one_udf_directory(struct directory *dpnt, FILE *outfile) { unsigned size_in_bytes, padded_size_in_bytes; struct directory_entry *de; unsigned ident_size; unsigned base_sector; struct directory *parent; Uchar buf[SECTOR_SIZE]; memset(buf, 0, SECTOR_SIZE); set_file_entry( buf, last_extent_written - lba_udf_partition_start, last_extent_written+1 - lba_udf_partition_start, directory_size(dpnt), dpnt->self->isorec.date, 1, /* is_directory */ directory_link_count(dpnt), (dpnt == root) ? 0 : dpnt->self->udf_file_entry_sector); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; base_sector = last_extent_written - lba_udf_partition_start; /* parent directory */ parent = dpnt->parent; if (parent == reloc_dir) { parent = dpnt->self->parent_rec->filedir; } ident_size = set_file_ident_desc( buf, base_sector, 0, 1, parent->self->udf_file_entry_sector - lba_udf_partition_start, (parent == root) ? 0 : parent->self->udf_file_entry_sector); jtwrite(buf, ident_size, 1, 0, FALSE); xfwrite(buf, ident_size, 1, outfile, 0, FALSE); size_in_bytes = ident_size; /* directory contents */ for (de = dpnt->jcontents; de; de = de->jnext) { char *name; struct directory_entry *de1; if (de->de_flags & INHIBIT_JOLIET_ENTRY) continue; name = USE_MAC_NAME(de) ? de->hfs_ent->name : de->name; /* skip . and .. */ if (name[0] == '.' && (name[1] == 0 || (name[1] == '.' && name[2] == 0))) continue; /* look in RR_MOVED for relocated directories */ de1 = de; if (de->de_flags & RELOCATED_DIRECTORY) { for (de1 = reloc_dir->contents; de1; de1 = de1->next) { if (de1->parent_rec == de) { break; } } if (!de1) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Unable to locate relocated directory\n"); #else fprintf(stderr, "Unable to locate relocated directory\n"); exit(1); #endif } } ident_size = set_file_ident_desc( buf, base_sector + (size_in_bytes / SECTOR_SIZE), name, !!(de1->isorec.flags[0] & ISO_DIRECTORY), de1->udf_file_entry_sector - lba_udf_partition_start, de1->udf_file_entry_sector); jtwrite(buf, ident_size, 1, 0, FALSE); xfwrite(buf, ident_size, 1, outfile, 0, FALSE); size_in_bytes += ident_size; } padded_size_in_bytes = PAD(size_in_bytes, SECTOR_SIZE); if (size_in_bytes < padded_size_in_bytes) { memset(buf, 0, padded_size_in_bytes - size_in_bytes); jtwrite(buf, padded_size_in_bytes - size_in_bytes, 1, 0, FALSE); xfwrite(buf, padded_size_in_bytes - size_in_bytes, 1, outfile, 0, FALSE); } last_extent_written += padded_size_in_bytes / SECTOR_SIZE; } static void write_udf_directories(struct directory *dpnt, FILE *outfile) { if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY)) { write_one_udf_directory(dpnt, outfile); } if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir) { for (dpnt = dpnt->subdir; dpnt; dpnt = dpnt->next) { write_udf_directories(dpnt, outfile); } } } static void write_udf_file_entries(struct directory *dpnt, FILE *outfile) { Uchar buf[SECTOR_SIZE]; memset(buf, 0, SECTOR_SIZE); if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY)) { struct directory_entry *de; for (de = dpnt->jcontents; de; de = de->jnext) { if (!(de->de_flags & RELOCATED_DIRECTORY) && !(de->isorec.flags[0] & ISO_DIRECTORY)) { memset(buf, 0, 512); set_file_entry( buf, (last_extent_written++) - lba_udf_partition_start, read_733(de->isorec.extent) - lba_udf_partition_start, de->realsize, de->isorec.date, 0, /* is_directory */ 1, /* link_count */ de->udf_file_entry_sector); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, outfile, 0, FALSE); } } } if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir) { for (dpnt = dpnt->subdir; dpnt; dpnt = dpnt->next) { write_udf_file_entries(dpnt, outfile); } } } /****************************/ static int udf_vol_recognition_area_write(FILE *out) { static const char *identifiers[3] = { "BEA01", "NSR02", "TEA01" }; int i; char buf[SECTOR_SIZE]; udf_volume_recognition_desc *vsd = (udf_volume_recognition_desc *)buf; memset(buf, 0, sizeof (buf)); /*set8(&vsd->structure_type, 0);*/ set8(&vsd->structure_version, 1); for (i = 0; i < 3; ++i) { memcpy(vsd->standard_identifier, identifiers[i], 5); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); } last_extent_written += 3; return (0); } static int udf_main_seq_write(FILE *out) { Uchar buf[SECTOR_SIZE]; int i; /* * volume_set_id needs to be set to a (64-bit) "unique" number. * This will have to do for now. */ volume_set_id[0] = begun; volume_set_id[1] = (unsigned)clock(); /* XXX Maybe non-portable */ memset(buf, 0, sizeof (buf)); set_primary_vol_desc(buf, last_extent_written++); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); memset(buf, 0, sizeof (buf)); set_impl_use_vol_desc(buf, last_extent_written++); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); memset(buf, 0, sizeof (buf)); set_partition_desc(buf, last_extent_written++); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); memset(buf, 0, sizeof (buf)); set_logical_vol_desc(buf, last_extent_written++); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); memset(buf, 0, sizeof (buf)); set_unallocated_space_desc(buf, last_extent_written++); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); memset(buf, 0, sizeof (buf)); set_terminating_desc(buf, last_extent_written++); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); memset(buf, 0, sizeof (buf)); for (i = 6; i < UDF_MAIN_SEQ_LENGTH; ++i) { jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); last_extent_written++; } return (0); } static int udf_integ_seq_write(FILE *out) { Uchar buf[SECTOR_SIZE*UDF_INTEG_SEQ_LENGTH]; memset(buf, 0, sizeof (buf)); set_logical_vol_integrity_desc(buf+0*SECTOR_SIZE, last_extent_written++); set_terminating_desc(buf+1*SECTOR_SIZE, last_extent_written++); jtwrite(buf, SECTOR_SIZE, UDF_INTEG_SEQ_LENGTH, 0, FALSE); xfwrite(buf, SECTOR_SIZE, UDF_INTEG_SEQ_LENGTH, out, 0, FALSE); return (0); } static int udf_anchor_vol_desc_write(FILE *out) { Uchar buf[SECTOR_SIZE]; memset(buf, 0, sizeof (buf)); set_anchor_volume_desc_pointer(buf, last_extent_written++); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); return (0); } static int udf_file_set_desc_write(FILE *out) { Uchar buf[SECTOR_SIZE*2]; memset(buf, 0, sizeof (buf)); set_file_set_desc(buf+0*SECTOR_SIZE, (last_extent_written++) - lba_udf_partition_start); set_terminating_desc(buf+1*SECTOR_SIZE, (last_extent_written++) - lba_udf_partition_start); jtwrite(buf, SECTOR_SIZE, 2, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 2, out, 0, FALSE); return (0); } static int udf_dirtree_write(FILE *out) { write_udf_directories(root, out); return (0); } static int udf_file_entries_write(FILE *out) { write_udf_file_entries(root, out); return (0); } static int pad_to(unsigned last_extent_to_write, FILE *out) { char buf[SECTOR_SIZE]; memset(buf, 0, sizeof (buf)); while (last_extent_written < last_extent_to_write) { jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); ++last_extent_written; } return (0); } static int udf_pad_to_sector_32_write(FILE *out) { return (pad_to(session_start+32, out)); } static int udf_pad_to_sector_256_write(FILE *out) { return (pad_to(session_start+256, out)); } static int udf_padend_avdp_write(FILE *out) { Uchar buf[SECTOR_SIZE]; unsigned last_extent_to_write = (last_extent_written+31) & ~15; if (!use_sparcboot) last_extent_to_write = last_extent_written + 150; memset(buf, 0, sizeof (buf)); while (last_extent_written < last_extent_to_write) { set_anchor_volume_desc_pointer(buf, last_extent_written++); jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, out, 0, FALSE); } return (0); } struct output_fragment udf_vol_recognition_area_frag = { NULL, udf_vol_recognition_area_size, NULL, udf_vol_recognition_area_write, "UDF volume recognition area" }; struct output_fragment udf_main_seq_frag = { NULL, udf_main_seq_size, NULL, udf_main_seq_write, "UDF main seq" }; struct output_fragment udf_main_seq_copy_frag = { NULL, udf_main_seq_copy_size, NULL, udf_main_seq_write, "UDF second seq" }; struct output_fragment udf_integ_seq_frag = { NULL, udf_integ_seq_size, NULL, udf_integ_seq_write, "UDF integ seq" }; struct output_fragment udf_anchor_vol_desc_frag = { NULL, oneblock_size, NULL, udf_anchor_vol_desc_write, "UDF Anchor volume" }; struct output_fragment udf_file_set_desc_frag = { NULL, udf_file_set_desc_size, NULL, udf_file_set_desc_write, "UDF file set" }; struct output_fragment udf_dirtree_frag = { NULL, udf_dirtree_size, NULL, udf_dirtree_write, "UDF directory tree" }; struct output_fragment udf_file_entries_frag = { NULL, udf_file_entries_size, NULL, udf_file_entries_write, "UDF file entries" }; struct output_fragment udf_end_anchor_vol_desc_frag = { NULL, udf_end_anchor_vol_desc_size, NULL, udf_anchor_vol_desc_write, "UDF Anchor end volume" }; struct output_fragment udf_pad_to_sector_32_frag = { NULL, udf_pad_to_sector_32_size, NULL, udf_pad_to_sector_32_write, "UDF pad to sector 32" }; struct output_fragment udf_pad_to_sector_256_frag = { NULL, udf_pad_to_sector_256_size, NULL, udf_pad_to_sector_256_write, "UDF pad to sector 256" }; struct output_fragment udf_padend_avdp_frag = { NULL, udf_padend_avdp_size, NULL, udf_padend_avdp_write, "UDF Pad end" }; /* * This function assigns weights as follows: * * /VIDEO_TS/VIDEO_TS.IFO 11199 * /VIDEO_TS/VIDEO_TS.VOB 11198 * /VIDEO_TS/VIDEO_TS.BUP 11188 * /VIDEO_TS/VTS_01_0.IFO 11187 * /VIDEO_TS/VTS_01_0.VOB 11186 * : : * /VIDEO_TS/VTS_01_9.VOB 11177 * /VIDEO_TS/VTS_01_0.BUP 11176 * : : * /VIDEO_TS/VTS_99_0.BUP 10000 * * This ensures that DVD-Video files are laid out properly on the disc. * The same thing is done for AUDIO_TS files, except in the 20000 range * instead of the 10000 range. * * Question: what about JACKET_P files? * * Answer: At least as far as I know :) * JACKET_P files are still images (single frame mpeg video .i.e mp2 * format). The DVD Jacket pictures will be displayed on the TV screen * when the player is in a stop/resume mode. * The location is not dependent on IFO information and the only must * as far as I know is that they are in upper case (both dir and files). * This sparce information makes me conclude that they don't need any * weight. This obviously needs to be tested. */ int assign_dvd_weights(char *name, struct directory *this_dir, int val) { int ts_number; int segment; int audio; if (name[0] != 'A' && name[0] != 'V') return (val); if (memcmp(name, "VIDEO_TS", 8) == 0) { ts_number = 0; audio = 0; } else if (memcmp(name, "VTS_", 4) == 0) { ts_number = 1; audio = 0; } else if (memcmp(name, "AUDIO_TS", 8) == 0) { ts_number = 0; audio = 1; } else if (memcmp(name, "ATS_", 4) == 0) { ts_number = 1; audio = 1; } else { return (val); } if (this_dir->parent != root || strcmp(this_dir->de_name, "VIDEO_TS") != 0) return (val); if (ts_number == 0) { segment = 0; } else { if (name[4] >= '0' && name[4] <= '9' && name[5] >= '0' && name[5] <= '9' && name[6] == '_' && name[7] >= '0' && name[7] <= '9') { ts_number = name[4] * 10 + name[5] - ('0' * 11); segment = name[7] - '0'; } else { return (val); } } if (strcmp(name+8, audio ? ".AOB" : ".VOB") == 0) { return (audio * 10000 - ts_number * 12 - segment + 11198); } else if (strcmp(name+8, ".IFO") == 0) { return (audio * 10000 - ts_number * 12 + 11199); } else if (strcmp(name+8, ".BUP") == 0) { return (audio * 10000 - ts_number * 12 + 11188); } else { return (val); } } #endif /* UDF */ cdrkit-1.1.11/genisoimage/sha256.h0000644000372500001440000000432711201646002015572 0ustar steveusers/* Declaration of functions and data types used for SHA256 sum computing library functions. Copyright (C) 2007 Free Software Foundation, Inc. Copied here from the GNU C Library version 2.7 on the 10 May 2009 by Steve McIntyre <93sam@debian.org>. This code was under GPL v2.1 in glibc, and that license gives us the option to use and distribute the code under the terms of the GPL v2 instead. I'm taking that option. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _SHA256_H #define _SHA256_H 1 #include #include #include /* Structure to save state of computation between the single steps. */ struct sha256_ctx { uint32_t H[8]; uint32_t total[2]; uint32_t buflen; char buffer[128] __attribute__ ((__aligned__ (__alignof__ (uint32_t)))); }; /* Initialize structure containing state of computation. (FIPS 180-2: 5.3.2) */ extern void sha256_init_ctx (struct sha256_ctx *ctx) __THROW; /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is NOT required that LEN is a multiple of 64. */ extern void sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx) __THROW; /* Process the remaining bytes in the buffer and put result from CTX in first 32 bytes following RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf) __THROW; #endif /* sha256.h */ cdrkit-1.1.11/genisoimage/mactypes.h0000644000372500001440000000410010477233650016413 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)mactypes.h 1.3 04/03/01 joerg */ #ifndef _MACTYPES_H #define _MACTYPES_H /* * Various types of HFS files stored on Unix systems */ #define TYPE_NONE 0 /* Unknown file type (ordinary Unix file) */ #define TYPE_CAP 1 /* AUFS CAP */ #define TYPE_NETA 2 /* Netatalk */ #define TYPE_DBL 3 /* AppleDouble */ #define TYPE_ESH 4 /* Helios EtherShare */ #define TYPE_FEU 5 /* PC Exchange (Upper case) */ #define TYPE_FEL 6 /* PC Exchange (Lower case) */ #define TYPE_SGI 7 /* SGI */ #define TYPE_MBIN 8 /* MacBinary */ #define TYPE_SGL 9 /* AppleSingle */ #define TYPE_DAVE 10 /* DAVE (AppleDouble type) */ #define TYPE_SFM 11 /* NTFS Services for Macintosh */ #define TYPE_XDBL 12 /* MacOS X AppleDouble */ #define TYPE_XHFS 13 /* MacOS X HFS */ /* * above encoded in a bit map */ #define DO_NONE (1 << TYPE_NONE) #define DO_CAP (1 << TYPE_CAP) #define DO_NETA (1 << TYPE_NETA) #define DO_DBL (1 << TYPE_DBL) #define DO_ESH (1 << TYPE_ESH) #define DO_FEU (1 << TYPE_FEU) #define DO_FEL (1 << TYPE_FEL) #define DO_SGI (1 << TYPE_SGI) #define DO_MBIN (1 << TYPE_MBIN) #define DO_SGL (1 << TYPE_SGL) #define DO_DAVE (1 << TYPE_DAVE) #define DO_SFM (1 << TYPE_SFM) #define DO_XDBL (1 << TYPE_XDBL) #define DO_XHFS (1 << TYPE_XHFS) /* * flags describing how the data/rsrc/info files are stored * in the whole file name */ #define INSERT 0x0 /* rsrc/info is inserted in name (default) */ #define PROBE 0x1 /* need to probe file for type */ #define NOPEND 0x2 /* info data in one file for all files */ #define APPEND 0x4 /* rsrc/info appended to file name */ #define NORSRC 0x8 /* rsrc for file may not exist */ #define NOINFO 0x10 /* info file dosen't exist */ #endif /* _MACTYPES_H */ cdrkit-1.1.11/genisoimage/joliet.c0000644000372500001440000011144211016345111016041 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)joliet.c 1.38 05/05/01 joerg */ /* * File joliet.c - handle Win95/WinNT long file/unicode extensions for iso9660. * * Copyright 1997 Eric Youngdale. * APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 22/2/2000 * Copyright (c) 1999,2000,2001 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * Joliet extensions for ISO9660. These are spottily documented by * Microsoft. In their infinite stupidity, they completely ignored * the possibility of using an SUSP record with the long filename * in it, and instead wrote out a duplicate directory tree with the * long filenames in it. * * I am not sure why they did this. One reason is that they get the path * tables with the long filenames in them. * * There are two basic principles to Joliet, and the non-Unicode variant * known as Romeo. Long filenames seem to be the main one, and the second * is that the character set and a few other things is substantially relaxed. * * The SVD is identical to the PVD, except: * * Id is 2, not 1 (indicates SVD). * escape_sequences contains UCS-2 indicator (levels 1, 2 or 3). * The root directory record points to a different extent (with different * size). * There are different path tables for the two sets of directory trees. * * The Unicode level is coded in the SVD as follows: * * Standard Level ASCII escape code * UCS-2 Level-1 %/@ * UCS-2 Level-2 %/C * UCS-2 Level-3 %/E * * The following fields are recorded in Unicode: * system_id * volume_id * volume_set_id * publisher_id * preparer_id * application_id * copyright_file_id * abstract_file_id * bibliographic_file_id * * Unicode strings are always encoded in big-endian format. * * In a directory record, everything is the same as with iso9660, except * that the name is recorded in unicode. The name length is specified in * total bytes, not in number of unicode characters. * * The character set used for the names is different with UCS - the * restrictions are that the following are not allowed: * * Characters (00)(00) through (00)(1f) (control chars) * (00)(2a) '*' * (00)(2f) '/' * (00)(3a) ':' * (00)(3b) ';' * (00)(3f) '?' * (00)(5c) '\' */ #include #include "genisoimage.h" #include #include #include #include /* For UNICODE translation */ #include #include #ifdef USE_ICONV #include #include #endif static Uint jpath_table_index; static struct directory **jpathlist; static int next_jpath_index = 1; static int jsort_goof; static char ucs_codes[] = { '\0', /* UCS-level 0 is illegal */ '@', /* UCS-level 1 */ 'C', /* UCS-level 2 */ 'E', /* UCS-level 3 */ }; #ifdef UDF #ifdef USE_ICONV size_t #else void #endif convert_to_unicode(unsigned char *buffer, int size, char *source, struct unls_table *inls); int joliet_strlen(const char *string, struct unls_table *inls); #else #ifdef USE_ICONV static size_t #else static void #endif convert_to_unicode(unsigned char *buffer, int size, char *source, struct unls_table *inls); static int joliet_strlen(const char *string, struct nls_table *inls); #endif static void get_joliet_vol_desc(struct iso_primary_descriptor *jvol_desc); static void assign_joliet_directory_addresses(struct directory *node); static void build_jpathlist(struct directory *node); static int joliet_compare_paths(void const *r, void const *l); static int generate_joliet_path_tables(void); static void generate_one_joliet_directory(struct directory *dpnt, FILE *outfile); static int joliet_sort_n_finish(struct directory *this_dir); static int joliet_compare_dirs(const void *rr, const void *ll); static int joliet_sort_directory(struct directory_entry **sort_dir); int joliet_sort_tree(struct directory *node); static void generate_joliet_directories(struct directory *node, FILE *outfile); static int jpathtab_write(FILE *outfile); static int jdirtree_size(int starting_extent); static int jroot_gen(void); static int jdirtree_write(FILE *outfile); static int jvd_write(FILE *outfile); static int jpathtab_size(int starting_extent); /* * conv_charset: convert to/from charsets via Unicode. * * Any unknown character is set to '_' * */ unsigned char conv_charset(unsigned char c, struct unls_table *inls, struct unls_table *onls) { unsigned char uh; unsigned char ul; unsigned char uc; unsigned char *up; /* if we have a null mapping, just return the input character */ if (inls == onls) return (c); #ifdef USE_ICONV if(inls->unls_cs2uni == NULL || onls->unls_uni2cs == NULL) { /* * This shouldn't be reached */ static BOOL iconv_warned = FALSE; if(!iconv_warned) { fprintf(stderr, "Warning: Iconv conversion not supported in conv_charset.\n"); iconv_warned = TRUE; } return (c); } #endif /* get high and low UNICODE bytes */ uh = inls->unls_cs2uni[c].unls_high; ul = inls->unls_cs2uni[c].unls_low; /* get the backconverted page from the output charset */ up = onls->unls_uni2cs[uh]; /* if the page exists, get the backconverted character */ if (up == NULL) uc = '\0'; else uc = up[ul]; /* return the backconverted, if it's not NULL */ return (uc ? uc : '_'); } /* * Function: convert_to_unicode * * Purpose: Perform a unicode conversion on a text string * using the supplied input character set. * * Notes: */ #ifdef USE_ICONV # if UDF size_t # else static size_t # endif #else # if UDF void # else static void # endif #endif convert_to_unicode(unsigned char *buffer, int size, char *source, struct unls_table *inls) { unsigned char *tmpbuf; int i; int j; unsigned char uh, ul, uc, *up; /* * If we get a NULL pointer for the source, it means we have an * inplace copy, and we need to make a temporary working copy first. */ if (source == NULL) { tmpbuf = (Uchar *) e_malloc(size+1); memcpy(tmpbuf, buffer, size); tmpbuf[size] = 0; } else { tmpbuf = (Uchar *) source; } #ifdef USE_ICONV if (inls->iconv_d && inls->unls_cs2uni==NULL && inls->unls_uni2cs==NULL) { char *inptr = (char *)tmpbuf; char *outptr = (char *)buffer; size_t inleft = strlen((char *)tmpbuf); size_t inlen = inleft; size_t outleft = size; iconv(inls->iconv_d, NULL, NULL, NULL, NULL); if(iconv(inls->iconv_d, &inptr, &inleft, &outptr, &outleft) == (size_t)-1 && errno == EILSEQ) { fprintf(stderr, "Incorrectly encoded string (%s) " "encountered.\nPossibly creating an invalid " "Joliet extension. Aborting.\n", source); exit(1); } for (i = 0; (i + 1) < size - outleft; i += 2) { /* Size may be odd!!!*/ if (buffer[i]=='\0') { switch (buffer[i+1]) { /* Invalid characters for Joliet */ case '*': case '/': case ':': case ';': case '?': case '\\': buffer[i+1]='_'; default: if (buffer[i+1] == 0x7f || buffer[i+1] < 0x20) buffer[i+1]='_'; } } } if (size & 1) { /* beautification */ buffer[size - 1] = 0; } if (source == NULL) { free(tmpbuf); } return (inlen - inleft); } #endif /* * Now start copying characters. If the size was specified to be 0, * then assume the input was 0 terminated. */ j = 0; for (i = 0; (i + 1) < size; i += 2, j++) { /* Size may be odd! */ /* * JS integrated from: Achim_Kaiser@t-online.de * SGE modified according to Linux kernel source * Let all valid unicode characters pass * through (according to charset). Others are set to '_' . */ uc = tmpbuf[j]; /* temporary copy */ if (uc != '\0') { /* must be converted */ uh = inls->unls_cs2uni[uc].unls_high; /* convert forward: */ /* hibyte... */ ul = inls->unls_cs2uni[uc].unls_low; /* ...lobyte */ up = inls->unls_uni2cs[uh]; /* convert backward: */ /* page... */ if (up == NULL) uc = '\0'; /* wrong unicode page */ else uc = up[ul]; /* backconverted character */ if (uc != tmpbuf[j]) uc = '\0'; /* should be identical */ if (uc <= 0x1f || uc == 0x7f) uc = '\0'; /* control char */ switch (uc) { /* test special characters */ case '*': case '/': case ':': case ';': case '?': case '\\': case '\0': /* illegal char mark */ /* * Even Joliet has some standards as to what is * allowed in a pathname. Pretty tame in * comparison to what DOS restricts you to. */ uc = '_'; } } buffer[i] = inls->unls_cs2uni[uc].unls_high; /* final UNICODE */ /* conversion */ buffer[i + 1] = inls->unls_cs2uni[uc].unls_low; } if (size & 1) { /* beautification */ buffer[size - 1] = 0; } if (source == NULL) { free(tmpbuf); } #ifdef USE_ICONV return j; #endif } /* * Function: joliet_strlen * * Purpose: Return length in bytes of string after conversion to unicode. * * Notes: This is provided mainly as a convenience so that when more * intelligent Unicode conversion for either Multibyte or 8-bit * codes is available that we can easily adapt. */ #ifdef UDF int #else static int #endif joliet_strlen(const char *string, struct unls_table *inls) { int rtn; #ifdef USE_ICONV if (inls->iconv_d && inls->unls_cs2uni==NULL && inls->unls_uni2cs==NULL) { /* * we const-cast since we're sure iconv won't change * the string itself */ char *string_ptr = (char *)string; size_t string_len = strlen(string); /* * iconv has no way of finding out the required size * in the target */ char *tmp, *tmp_ptr; /* we assume that the maximum length is 2 * jlen */ size_t tmp_len = (size_t)jlen * 2 + 1; tmp = e_malloc(tmp_len); tmp_ptr = tmp; iconv(inls->iconv_d, NULL, NULL, NULL, NULL); iconv(inls->iconv_d, &string_ptr, &string_len, &tmp_ptr, &tmp_len); /* * iconv advanced the tmp pointer with as many chars * as it has written to it, so we add up the delta */ rtn = (tmp_ptr - tmp); free(tmp); } else { rtn = strlen(string) << 1; } #else rtn = strlen(string) << 1; #endif /* * We do clamp the maximum length of a Joliet string to be the * maximum path size. This helps to ensure that we don't completely * bolix things up with very long paths. The Joliet specs say that * the maximum length is 128 bytes, or 64 unicode characters. */ if (rtn > 2*jlen) { rtn = 2*jlen; } return (rtn); } /* * Function: get_joliet_vol_desc * * Purpose: generate a Joliet compatible volume desc. * * Notes: Assume that we have the non-joliet vol desc * already present in the buffer. Just modifiy the * appropriate fields. */ static void get_joliet_vol_desc(struct iso_primary_descriptor *jvol_desc) { jvol_desc->type[0] = ISO_VD_SUPPLEMENTARY; jvol_desc->version[0] = 1; jvol_desc->file_structure_version[0] = 1; /* * For now, always do Unicode level 3. * I don't really know what 1 and 2 are - perhaps a more limited * Unicode set. * FIXME(eric) - how does Romeo fit in here? */ sprintf(jvol_desc->escape_sequences, "%%/%c", ucs_codes[ucs_level]); /* Until we have Unicode path tables, leave these unset. */ set_733((char *) jvol_desc->path_table_size, jpath_table_size); set_731(jvol_desc->type_l_path_table, jpath_table[0]); set_731(jvol_desc->opt_type_l_path_table, jpath_table[1]); set_732(jvol_desc->type_m_path_table, jpath_table[2]); set_732(jvol_desc->opt_type_m_path_table, jpath_table[3]); /* Set this one up. */ memcpy(jvol_desc->root_directory_record, &jroot_record, offsetof(struct iso_directory_record, name[0]) + 1); /* * Finally, we have a bunch of strings to convert to Unicode. * FIXME(eric) - I don't know how to do this in general, * so we will just be really lazy and do a char -> short conversion. * We probably will want to filter any characters >= 0x80. */ convert_to_unicode((Uchar *) jvol_desc->system_id, sizeof (jvol_desc->system_id), NULL, in_nls); convert_to_unicode((Uchar *) jvol_desc->volume_id, sizeof (jvol_desc->volume_id), NULL, in_nls); convert_to_unicode((Uchar *) jvol_desc->volume_set_id, sizeof (jvol_desc->volume_set_id), NULL, in_nls); convert_to_unicode((Uchar *) jvol_desc->publisher_id, sizeof (jvol_desc->publisher_id), NULL, in_nls); convert_to_unicode((Uchar *) jvol_desc->preparer_id, sizeof (jvol_desc->preparer_id), NULL, in_nls); convert_to_unicode((Uchar *) jvol_desc->application_id, sizeof (jvol_desc->application_id), NULL, in_nls); convert_to_unicode((Uchar *) jvol_desc->copyright_file_id, sizeof (jvol_desc->copyright_file_id), NULL, in_nls); convert_to_unicode((Uchar *) jvol_desc->abstract_file_id, sizeof (jvol_desc->abstract_file_id), NULL, in_nls); convert_to_unicode((Uchar *) jvol_desc->bibliographic_file_id, sizeof (jvol_desc->bibliographic_file_id), NULL, in_nls); } static void assign_joliet_directory_addresses(struct directory *node) { int dir_size; struct directory *dpnt; dpnt = node; while (dpnt) { if ((dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) == 0) { /* * If we already have an extent for this * (i.e. it came from a multisession disc), then * don't reassign a new extent. */ dpnt->jpath_index = next_jpath_index++; if (dpnt->jextent == 0) { dpnt->jextent = last_extent; dir_size = ISO_BLOCKS(dpnt->jsize); last_extent += dir_size; } } /* skip if hidden - but not for the rr_moved dir */ if (dpnt->subdir && (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir)) { assign_joliet_directory_addresses(dpnt->subdir); } dpnt = dpnt->next; } } static void build_jpathlist(struct directory *node) { struct directory *dpnt; dpnt = node; while (dpnt) { if ((dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) == 0) { jpathlist[dpnt->jpath_index] = dpnt; } if (dpnt->subdir) build_jpathlist(dpnt->subdir); dpnt = dpnt->next; } }/* build_jpathlist(... */ static int joliet_compare_paths(void const *r, void const *l) { struct directory const *ll = *(struct directory * const *) l; struct directory const *rr = *(struct directory * const *) r; int rparent, lparent; char *rpnt, *lpnt; unsigned char rtmp[2], ltmp[2]; struct unls_table *rinls, *linls; /* make sure root directory is first */ if (rr == root) return (-1); if (ll == root) return (1); rparent = rr->parent->jpath_index; lparent = ll->parent->jpath_index; if (rr->parent == reloc_dir) { rparent = rr->self->parent_rec->filedir->jpath_index; } if (ll->parent == reloc_dir) { lparent = ll->self->parent_rec->filedir->jpath_index; } if (rparent < lparent) { return (-1); } if (rparent > lparent) { return (1); } #ifdef APPLE_HYB /* * we may be using the HFS name - so select the correct input * charset */ if (USE_MAC_NAME(rr->self)) { rpnt = rr->self->hfs_ent->name; rinls = hfs_inls; } else { rpnt = rr->self->name; rinls = in_nls; } if (USE_MAC_NAME(ll->self)) { lpnt = ll->self->hfs_ent->name; linls = hfs_inls; } else { lpnt = ll->self->name; linls = in_nls; } #else rpnt = rr->self->name; lpnt = ll->self->name; linls = rinls = in_nls; #endif /* APPLE_HYB */ /* compare the Unicode names */ while (*rpnt && *lpnt) { #ifdef USE_ICONV size_t ri, li; ri = convert_to_unicode(rtmp, 2, rpnt, rinls); li = convert_to_unicode(ltmp, 2, lpnt, linls); rpnt += ri; lpnt += li; if(!ri && !li) return (0); else if(ri && !li) return (1); else if(!ri && li) return (-1); #else convert_to_unicode(rtmp, 2, rpnt, rinls); convert_to_unicode(ltmp, 2, lpnt, linls); #endif if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp)) return (-1); if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp)) return (1); #ifndef USE_ICONV rpnt++; lpnt++; #endif } if (*rpnt) return (1); if (*lpnt) return (-1); return (0); }/* compare_paths(... */ static int generate_joliet_path_tables() { struct directory_entry *de; struct directory *dpnt; int fix; int j; int namelen; char *npnt; char *npnt1; int tablesize; /* First allocate memory for the tables and initialize the memory */ tablesize = jpath_blocks << 11; jpath_table_m = (char *) e_malloc(tablesize); jpath_table_l = (char *) e_malloc(tablesize); memset(jpath_table_l, 0, tablesize); memset(jpath_table_m, 0, tablesize); /* Now start filling in the path tables. Start with root directory */ jpath_table_index = 0; jpathlist = (struct directory **) e_malloc(sizeof (struct directory *) * next_jpath_index); memset(jpathlist, 0, sizeof (struct directory *) * next_jpath_index); build_jpathlist(root); do { fix = 0; #ifdef PROTOTYPES qsort(&jpathlist[1], next_jpath_index - 1, sizeof (struct directory *), (int (*) (const void *, const void *)) joliet_compare_paths); #else qsort(&jpathlist[1], next_jpath_index - 1, sizeof (struct directory *), joliet_compare_paths); #endif for (j = 1; j < next_jpath_index; j++) { if (jpathlist[j]->jpath_index != j) { jpathlist[j]->jpath_index = j; fix++; } } } while (fix); for (j = 1; j < next_jpath_index; j++) { dpnt = jpathlist[j]; if (!dpnt) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Entry %d not in path tables\n", j); #else fprintf(stderr, "Entry %d not in path tables\n", j); exit(1); #endif } npnt = dpnt->de_name; npnt1 = strrchr(npnt, PATH_SEPARATOR); if (npnt1) { npnt = npnt1 + 1; } de = dpnt->self; if (!de) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Fatal Joliet goof - directory has amnesia\n"); #else fprintf(stderr, "Fatal Joliet goof - directory has amnesia\n"); exit(1); #endif } #ifdef APPLE_HYB if (USE_MAC_NAME(de)) namelen = joliet_strlen(de->hfs_ent->name, hfs_inls); else #endif /* APPLE_HYB */ namelen = joliet_strlen(de->name, in_nls); if (dpnt == root) { jpath_table_l[jpath_table_index] = 1; jpath_table_m[jpath_table_index] = 1; } else { jpath_table_l[jpath_table_index] = namelen; jpath_table_m[jpath_table_index] = namelen; } jpath_table_index += 2; set_731(jpath_table_l + jpath_table_index, dpnt->jextent); set_732(jpath_table_m + jpath_table_index, dpnt->jextent); jpath_table_index += 4; if (dpnt->parent->jpath_index > 0xffff) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Unable to generate sane path tables - too many directories (%d)\n", dpnt->parent->jpath_index); #else fprintf(stderr, "Unable to generate sane path tables - too many directories (%d)\n", dpnt->parent->jpath_index); exit(1); #endif } if (dpnt->parent != reloc_dir) { set_721(jpath_table_l + jpath_table_index, dpnt->parent->jpath_index); set_722(jpath_table_m + jpath_table_index, dpnt->parent->jpath_index); } else { set_721(jpath_table_l + jpath_table_index, dpnt->self->parent_rec->filedir->jpath_index); set_722(jpath_table_m + jpath_table_index, dpnt->self->parent_rec->filedir->jpath_index); } jpath_table_index += 2; /* * The root directory is still represented in non-unicode * fashion. */ if (dpnt == root) { jpath_table_l[jpath_table_index] = 0; jpath_table_m[jpath_table_index] = 0; jpath_table_index++; } else { #ifdef APPLE_HYB if (USE_MAC_NAME(de)) { convert_to_unicode((Uchar *) jpath_table_l + jpath_table_index, namelen, de->hfs_ent->name, hfs_inls); convert_to_unicode((Uchar *) jpath_table_m + jpath_table_index, namelen, de->hfs_ent->name, hfs_inls); } else { #endif /* APPLE_HYB */ convert_to_unicode((Uchar *) jpath_table_l + jpath_table_index, namelen, de->name, in_nls); convert_to_unicode((Uchar *) jpath_table_m + jpath_table_index, namelen, de->name, in_nls); #ifdef APPLE_HYB } #endif /* APPLE_HYB */ jpath_table_index += namelen; } if (jpath_table_index & 1) { jpath_table_index++; /* For odd lengths we pad */ } } free(jpathlist); if (jpath_table_index != jpath_table_size) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Joliet path table lengths do not match %d expected: %d\n", jpath_table_index, jpath_table_size); #else fprintf(stderr, "Joliet path table lengths do not match %d expected: %d\n", jpath_table_index, jpath_table_size); #endif } return (0); }/* generate_path_tables(... */ static void generate_one_joliet_directory(struct directory *dpnt, FILE *outfile) { unsigned int dir_index; char *directory_buffer; int new_reclen; struct directory_entry *s_entry; struct directory_entry *s_entry1; struct iso_directory_record jrec; unsigned int total_size; int cvt_len; struct directory *finddir; total_size = ISO_ROUND_UP(dpnt->jsize); directory_buffer = (char *) e_malloc(total_size); memset(directory_buffer, 0, total_size); dir_index = 0; s_entry = dpnt->jcontents; while (s_entry) { if (s_entry->de_flags & INHIBIT_JOLIET_ENTRY) { s_entry = s_entry->jnext; continue; } /* * If this entry was a directory that was relocated, * we have a bit of trouble here. We need to dig out the real * thing and put it back here. In the Joliet tree, there is * no relocated rock ridge, as there are no depth limits to a * directory tree. */ if ((s_entry->de_flags & RELOCATED_DIRECTORY) != 0) { for (s_entry1 = reloc_dir->contents; s_entry1; s_entry1 = s_entry1->next) { if (s_entry1->parent_rec == s_entry) { break; } } if (s_entry1 == NULL) { /* We got trouble. */ #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Unable to locate relocated directory\n"); #else fprintf(stderr, "Unable to locate relocated directory\n"); exit(1); #endif } } else { s_entry1 = s_entry; } /* * We do not allow directory entries to cross sector * boundaries. Simply pad, and then start the next entry at * the next sector */ new_reclen = s_entry1->jreclen; if ((dir_index & (SECTOR_SIZE - 1)) + new_reclen >= SECTOR_SIZE) { dir_index = ISO_ROUND_UP(dir_index); } memcpy(&jrec, &s_entry1->isorec, offsetof(struct iso_directory_record, name[0])); #ifdef APPLE_HYB /* Use the HFS name if it exists */ if (USE_MAC_NAME(s_entry1)) cvt_len = joliet_strlen(s_entry1->hfs_ent->name, hfs_inls); else #endif /* APPLE_HYB */ cvt_len = joliet_strlen(s_entry1->name, in_nls); /* * Fix the record length * - this was the non-Joliet version we were seeing. */ jrec.name_len[0] = cvt_len; jrec.length[0] = s_entry1->jreclen; /* * If this is a directory, * fix the correct size and extent number. */ if ((jrec.flags[0] & ISO_DIRECTORY) != 0) { if (strcmp(s_entry1->name, ".") == 0) { jrec.name_len[0] = 1; set_733((char *) jrec.extent, dpnt->jextent); set_733((char *) jrec.size, ISO_ROUND_UP(dpnt->jsize)); } else if (strcmp(s_entry1->name, "..") == 0) { jrec.name_len[0] = 1; if (dpnt->parent == reloc_dir) { set_733((char *)jrec.extent, dpnt->self->parent_rec->filedir->jextent); set_733((char *)jrec.size, ISO_ROUND_UP(dpnt->self->parent_rec->filedir->jsize)); } else { set_733((char *)jrec.extent, dpnt->parent->jextent); set_733((char *)jrec.size, ISO_ROUND_UP(dpnt->parent->jsize)); } } else { if ((s_entry->de_flags & RELOCATED_DIRECTORY) != 0) { finddir = reloc_dir->subdir; } else { finddir = dpnt->subdir; } while (1 == 1) { if (finddir->self == s_entry1) break; finddir = finddir->next; if (!finddir) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Fatal goof - unable to find directory location\n"); #else fprintf(stderr, "Fatal goof - unable to find directory location\n"); exit(1); #endif } } set_733((char *)jrec.extent, finddir->jextent); set_733((char *)jrec.size, ISO_ROUND_UP(finddir->jsize)); } } memcpy(directory_buffer + dir_index, &jrec, offsetof(struct iso_directory_record, name[0])); dir_index += offsetof(struct iso_directory_record, name[0]); /* * Finally dump the Unicode version of the filename. * Note - . and .. are the same as with non-Joliet discs. */ if ((jrec.flags[0] & ISO_DIRECTORY) != 0 && strcmp(s_entry1->name, ".") == 0) { directory_buffer[dir_index++] = 0; } else if ((jrec.flags[0] & ISO_DIRECTORY) != 0 && strcmp(s_entry1->name, "..") == 0) { directory_buffer[dir_index++] = 1; } else { #ifdef APPLE_HYB if (USE_MAC_NAME(s_entry1)) { /* Use the HFS name if it exists */ convert_to_unicode( (Uchar *) directory_buffer+dir_index, cvt_len, s_entry1->hfs_ent->name, hfs_inls); } else #endif /* APPLE_HYB */ { convert_to_unicode( (Uchar *) directory_buffer+dir_index, cvt_len, s_entry1->name, in_nls); } dir_index += cvt_len; } if (dir_index & 1) { directory_buffer[dir_index++] = 0; } s_entry = s_entry->jnext; } if (dpnt->jsize != dir_index) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Unexpected joliet directory length %d expected: %d '%s'\n", dpnt->jsize, dir_index, dpnt->de_name); #else fprintf(stderr, "Unexpected joliet directory length %d expected: %d '%s'\n", dpnt->jsize, dir_index, dpnt->de_name); #endif } jtwrite(directory_buffer, total_size, 1, 0, FALSE); xfwrite(directory_buffer, total_size, 1, outfile, 0, FALSE); last_extent_written += total_size >> 11; free(directory_buffer); }/* generate_one_joliet_directory(... */ static int joliet_sort_n_finish(struct directory *this_dir) { struct directory_entry *s_entry; int status = 0; /* * don't want to skip this directory if it's the reloc_dir * at the moment */ if (this_dir != reloc_dir && this_dir->dir_flags & INHIBIT_JOLIET_ENTRY) { return (0); } for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { /* skip hidden entries */ if ((s_entry->de_flags & INHIBIT_JOLIET_ENTRY) != 0) { continue; } /* * First update the path table sizes for directories. * * Finally, set the length of the directory entry if Joliet is * used. The name is longer, but no Rock Ridge is ever used * here, so depending upon the options the entry size might * turn out to be about the same. The Unicode name is always * a multiple of 2 bytes, so we always add 1 to make it an * even number. */ if (s_entry->isorec.flags[0] & ISO_DIRECTORY) { if (strcmp(s_entry->name, ".") != 0 && strcmp(s_entry->name, "..") != 0) { #ifdef APPLE_HYB if (USE_MAC_NAME(s_entry)) /* Use the HFS name if it exists */ jpath_table_size += joliet_strlen(s_entry->hfs_ent->name, hfs_inls) + offsetof(struct iso_path_table, name[0]); else #endif /* APPLE_HYB */ jpath_table_size += joliet_strlen(s_entry->name, in_nls) + offsetof(struct iso_path_table, name[0]); if (jpath_table_size & 1) { jpath_table_size++; } } else { if (this_dir == root && strlen(s_entry->name) == 1) { jpath_table_size += 1 + offsetof(struct iso_path_table, name[0]); if (jpath_table_size & 1) jpath_table_size++; } } } if (strcmp(s_entry->name, ".") != 0 && strcmp(s_entry->name, "..") != 0) { #ifdef APPLE_HYB if (USE_MAC_NAME(s_entry)) /* Use the HFS name if it exists */ s_entry->jreclen = offsetof(struct iso_directory_record, name[0]) + joliet_strlen(s_entry->hfs_ent->name, hfs_inls) + 1; else #endif /* APPLE_HYB */ s_entry->jreclen = offsetof(struct iso_directory_record, name[0]) + joliet_strlen(s_entry->name, in_nls) + 1; } else { /* * Special - for '.' and '..' we generate the same * records we did for non-Joliet discs. */ s_entry->jreclen = offsetof(struct iso_directory_record, name[0]) + 1; } } if ((this_dir->dir_flags & INHIBIT_JOLIET_ENTRY) != 0) { return (0); } this_dir->jcontents = this_dir->contents; status = joliet_sort_directory(&this_dir->jcontents); /* * Now go through the directory and figure out how large this one will * be. Do not split a directory entry across a sector boundary */ s_entry = this_dir->jcontents; /* * XXX Is it ok to comment this out? */ /*XXX JS this_dir->ce_bytes = 0;*/ for (s_entry = this_dir->jcontents; s_entry; s_entry = s_entry->jnext) { int jreclen; if ((s_entry->de_flags & INHIBIT_JOLIET_ENTRY) != 0) { continue; } jreclen = s_entry->jreclen; if ((this_dir->jsize & (SECTOR_SIZE - 1)) + jreclen >= SECTOR_SIZE) { this_dir->jsize = ISO_ROUND_UP(this_dir->jsize); } this_dir->jsize += jreclen; } return (status); } /* * Similar to the iso9660 case, * except here we perform a full sort based upon the * regular name of the file, not the 8.3 version. */ static int joliet_compare_dirs(const void *rr, const void *ll) { char *rpnt, *lpnt; struct directory_entry **r, **l; unsigned char rtmp[2], ltmp[2]; struct unls_table *linls, *rinls; r = (struct directory_entry **) rr; l = (struct directory_entry **) ll; #ifdef APPLE_HYB /* * we may be using the HFS name - so select the correct input * charset */ if (USE_MAC_NAME(*r)) { rpnt = (*r)->hfs_ent->name; rinls = hfs_inls; } else { rpnt = (*r)->name; rinls = in_nls; } if (USE_MAC_NAME(*l)) { lpnt = (*l)->hfs_ent->name; linls = hfs_inls; } else { lpnt = (*l)->name; linls = in_nls; } #else rpnt = (*r)->name; lpnt = (*l)->name; rinls = linls = in_nls; #endif /* APPLE_HYB */ /* * If the entries are the same, this is an error. * Joliet specs allow for a maximum of 64 characters. */ if (strncmp(rpnt, lpnt, jlen) == 0) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Error: %s and %s have the same Joliet name\n", (*r)->whole_name, (*l)->whole_name); #else fprintf(stderr, "Error: %s and %s have the same Joliet name\n", (*r)->whole_name, (*l)->whole_name); #endif jsort_goof++; } /* * Put the '.' and '..' entries on the head of the sorted list. * For normal ASCII, this always happens to be the case, but out of * band characters cause this not to be the case sometimes. */ if (strcmp(rpnt, ".") == 0) return (-1); if (strcmp(lpnt, ".") == 0) return (1); if (strcmp(rpnt, "..") == 0) return (-1); if (strcmp(lpnt, "..") == 0) return (1); #ifdef DVD_VIDEO /* * There're rumors claiming that some players assume VIDEO_TS.IFO * to be the first file in VIDEO_TS/ catalog. Well, it's basically * the only file a player has to actually look for, as the whole * video content can be "rolled down" from this file alone. * */ /* * XXX This code has to be moved from the Joliet implementation * XXX to the UDF implementation if we implement decent UDF support * XXX with a separate name space for the UDF file tree. */ if (dvd_video) { if (strcmp(rpnt, "VIDEO_TS.IFO") == 0) return (-1); if (strcmp(lpnt, "VIDEO_TS.IFO") == 0) return (1); } #endif while (*rpnt && *lpnt) { #ifdef USE_ICONV size_t ri, li; #endif if (*rpnt == ';' && *lpnt != ';') return (-1); if (*rpnt != ';' && *lpnt == ';') return (1); if (*rpnt == ';' && *lpnt == ';') return (0); /* * Extensions are not special here. * Don't treat the dot as something that must be bumped to * the start of the list. */ #if 0 if (*rpnt == '.' && *lpnt != '.') return (-1); if (*rpnt != '.' && *lpnt == '.') return (1); #endif #ifdef USE_ICONV ri = convert_to_unicode(rtmp, 2, rpnt, rinls); li = convert_to_unicode(ltmp, 2, lpnt, linls); rpnt += ri; lpnt += li; if(!ri && !li) return (0); else if(ri && !li) return (1); else if(!ri && li) return (-1); #else convert_to_unicode(rtmp, 2, rpnt, rinls); convert_to_unicode(ltmp, 2, lpnt, linls); #endif if (a_to_u_2_byte(rtmp) < a_to_u_2_byte(ltmp)) return (-1); if (a_to_u_2_byte(rtmp) > a_to_u_2_byte(ltmp)) return (1); #ifndef USE_ICONV rpnt++; lpnt++; #endif } if (*rpnt) return (1); if (*lpnt) return (-1); return (0); } /* * Function: sort_directory * * Purpose: Sort the directory in the appropriate ISO9660 * order. * * Notes: Returns 0 if OK, returns > 0 if an error occurred. */ static int joliet_sort_directory(struct directory_entry **sort_dir) { int dcount = 0; int i; struct directory_entry *s_entry; struct directory_entry **sortlist; s_entry = *sort_dir; while (s_entry) { /* skip hidden entries */ if (!(s_entry->de_flags & INHIBIT_JOLIET_ENTRY)) dcount++; s_entry = s_entry->next; } /* OK, now we know how many there are. Build a vector for sorting. */ sortlist = (struct directory_entry **) e_malloc(sizeof (struct directory_entry *) * dcount); dcount = 0; s_entry = *sort_dir; while (s_entry) { /* skip hidden entries */ if (!(s_entry->de_flags & INHIBIT_JOLIET_ENTRY)) { sortlist[dcount] = s_entry; dcount++; } s_entry = s_entry->next; } jsort_goof = 0; #ifdef PROTOTYPES qsort(sortlist, dcount, sizeof (struct directory_entry *), (int (*) (const void *, const void *)) joliet_compare_dirs); #else qsort(sortlist, dcount, sizeof (struct directory_entry *), joliet_compare_dirs); #endif /* Now reassemble the linked list in the proper sorted order */ for (i = 0; i < dcount - 1; i++) { sortlist[i]->jnext = sortlist[i + 1]; } sortlist[dcount - 1]->jnext = NULL; *sort_dir = sortlist[0]; free(sortlist); return (jsort_goof); } int joliet_sort_tree(struct directory *node) { struct directory *dpnt; int ret = 0; dpnt = node; while (dpnt) { ret = joliet_sort_n_finish(dpnt); if (ret) { break; } if (dpnt->subdir) ret = joliet_sort_tree(dpnt->subdir); if (ret) { break; } dpnt = dpnt->next; } return (ret); } static void generate_joliet_directories(struct directory *node, FILE *outfile) { struct directory *dpnt; dpnt = node; while (dpnt) { if ((dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) == 0) { /* * In theory we should never reuse a directory, so this * doesn't make much sense. */ if (dpnt->jextent > session_start) { generate_one_joliet_directory(dpnt, outfile); } } /* skip if hidden - but not for the rr_moved dir */ if (dpnt->subdir && (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir)) { generate_joliet_directories(dpnt->subdir, outfile); } dpnt = dpnt->next; } } /* * Function to write the EVD for the disc. */ static int jpathtab_write(FILE *outfile) { /* Next we write the path tables */ jtwrite(jpath_table_l, jpath_blocks << 11, 1, 0, FALSE); xfwrite(jpath_table_l, jpath_blocks << 11, 1, outfile, 0, FALSE); last_extent_written += jpath_blocks; jtwrite(jpath_table_m, jpath_blocks << 11, 1, 0, FALSE); xfwrite(jpath_table_m, jpath_blocks << 11, 1, outfile, 0, FALSE); last_extent_written += jpath_blocks; free(jpath_table_l); free(jpath_table_m); jpath_table_l = NULL; jpath_table_m = NULL; return (0); } static int jdirtree_size(int starting_extent) { assign_joliet_directory_addresses(root); return (0); } static int jroot_gen() { jroot_record.length[0] = 1 + offsetof(struct iso_directory_record, name[0]); jroot_record.ext_attr_length[0] = 0; set_733((char *) jroot_record.extent, root->jextent); set_733((char *) jroot_record.size, ISO_ROUND_UP(root->jsize)); iso9660_date(jroot_record.date, root_statbuf.st_mtime); jroot_record.flags[0] = ISO_DIRECTORY; jroot_record.file_unit_size[0] = 0; jroot_record.interleave[0] = 0; set_723(jroot_record.volume_sequence_number, volume_sequence_number); jroot_record.name_len[0] = 1; return (0); } static int jdirtree_write(FILE *outfile) { generate_joliet_directories(root, outfile); return (0); } /* * Function to write the EVD for the disc. */ static int jvd_write(FILE *outfile) { struct iso_primary_descriptor jvol_desc; /* Next we write out the boot volume descriptor for the disc */ jvol_desc = vol_desc; get_joliet_vol_desc(&jvol_desc); jtwrite(&jvol_desc, SECTOR_SIZE, 1, 0, FALSE); xfwrite(&jvol_desc, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; return (0); } /* * Functions to describe padding block at the start of the disc. */ static int jpathtab_size(int starting_extent) { jpath_table[0] = starting_extent; jpath_table[1] = 0; jpath_table[2] = jpath_table[0] + jpath_blocks; jpath_table[3] = 0; last_extent += 2 * jpath_blocks; return (0); } struct output_fragment joliet_desc = {NULL, oneblock_size, jroot_gen, jvd_write, "Joliet Volume Descriptor" }; struct output_fragment jpathtable_desc = {NULL, jpathtab_size, generate_joliet_path_tables, jpathtab_write, "Joliet path table" }; struct output_fragment jdirtree_desc = {NULL, jdirtree_size, NULL, jdirtree_write, "Joliet directory tree" }; cdrkit-1.1.11/genisoimage/hash.c0000644000372500001440000002236510576062671015524 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)hash.c 1.18 04/06/18 joerg */ /* @(#)hash.c 1.23 06/10/04 joerg */ /* * File hash.c - generate hash tables for iso9660 filesystem. * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999,2000-2006 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 23/2/2000 */ /* * From jb@danware.dk: * * Cygwin fakes inodes by hashing file info, actual collisions observed! * This is documented in the cygwin source, look at winsup/cygwin/path.cc * and search for the word 'Hash'. On NT, cygwin ORs together the * high and low 32 bits of the 64 bit genuine inode, look at fhandler.cc. * * Note: Other operating systems which support the FAT filesystem may * have the same problem because FAT does not use the inode * concept. For NTFS, genuine inode numbers exist, but they are * 64 bits and available only through an open file handle. * * The solution is the new options -no-cache-inodes/-cache-inodes that * allow to disable the genisoimage inode cache. */ #include #include "genisoimage.h" #include #define NR_HASH (16*1024) #define HASH_FN(DEV, INO) ((DEV + INO + (INO >> 8) + (INO << 16)) % NR_HASH) static struct file_hash *hash_table[NR_HASH]; void add_hash(struct directory_entry *spnt); struct file_hash *find_hash(dev_t dev, ino_t inode); void flush_hash(void); void add_directory_hash(dev_t dev, ino_t inode); struct file_hash *find_directory_hash(dev_t dev, ino_t inode); static unsigned int name_hash(const char *name); void add_file_hash(struct directory_entry *de); struct directory_entry *find_file_hash(char *name); static BOOL isoname_endsok(char *name); int delete_file_hash(struct directory_entry *de); void flush_file_hash(void); void add_hash(struct directory_entry *spnt) { struct file_hash *s_hash; unsigned int hash_number; if (spnt->size == 0 || spnt->starting_block == 0) if (spnt->size != 0 && spnt->starting_block == 0) { comerrno(EX_BAD, "Non zero-length file '%s' assigned zero extent.\n", spnt->name); }; if (!cache_inodes) return; if (spnt->dev == UNCACHED_DEVICE && (spnt->inode == TABLE_INODE || spnt->inode == UNCACHED_INODE)) { return; } hash_number = HASH_FN((unsigned int) spnt->dev, (unsigned int) spnt->inode); #if 0 if (verbose > 1) fprintf(stderr, "%s ", spnt->name); #endif s_hash = (struct file_hash *) e_malloc(sizeof (struct file_hash)); s_hash->next = hash_table[hash_number]; s_hash->inode = spnt->inode; s_hash->dev = spnt->dev; s_hash->nlink = 0; s_hash->starting_block = spnt->starting_block; s_hash->size = spnt->size; #ifdef SORTING s_hash->de = spnt; #endif /* SORTING */ hash_table[hash_number] = s_hash; } struct file_hash * find_hash(dev_t dev, ino_t inode) { unsigned int hash_number; struct file_hash *spnt; if (!cache_inodes) return (NULL); if (dev == UNCACHED_DEVICE && (inode == TABLE_INODE || inode == UNCACHED_INODE)) return (NULL); hash_number = HASH_FN((unsigned int) dev, (unsigned int) inode); spnt = hash_table[hash_number]; while (spnt) { if (spnt->inode == inode && spnt->dev == dev) return (spnt); spnt = spnt->next; }; return (NULL); } /* * based on flush_file_hash() below - needed as we want to re-use the * file hash table. */ void flush_hash() { struct file_hash *fh; struct file_hash *fh1; int i; for (i = 0; i < NR_HASH; i++) { fh = hash_table[i]; while (fh) { fh1 = fh->next; free(fh); fh = fh1; } hash_table[i] = NULL; } } static struct file_hash *directory_hash_table[NR_HASH]; void add_directory_hash(dev_t dev, ino_t inode) { struct file_hash *s_hash; unsigned int hash_number; if (!cache_inodes) return; if (dev == UNCACHED_DEVICE && (inode == TABLE_INODE || inode == UNCACHED_INODE)) return; hash_number = HASH_FN((unsigned int) dev, (unsigned int) inode); s_hash = (struct file_hash *) e_malloc(sizeof (struct file_hash)); s_hash->next = directory_hash_table[hash_number]; s_hash->inode = inode; s_hash->dev = dev; s_hash->nlink = 0; directory_hash_table[hash_number] = s_hash; } struct file_hash * find_directory_hash(dev_t dev, ino_t inode) { unsigned int hash_number; struct file_hash *spnt; if (!cache_inodes) return (NULL); if (dev == UNCACHED_DEVICE && (inode == TABLE_INODE || inode == UNCACHED_INODE)) return (NULL); hash_number = HASH_FN((unsigned int) dev, (unsigned int) inode); spnt = directory_hash_table[hash_number]; while (spnt) { if (spnt->inode == inode && spnt->dev == dev) return (spnt); spnt = spnt->next; }; return (NULL); } struct name_hash { struct name_hash *next; struct directory_entry *de; int sum; }; #define NR_NAME_HASH (256*1024) static struct name_hash *name_hash_table[NR_NAME_HASH] = {0, }; /* * Find the hash bucket for this name. */ static unsigned int name_hash(const char *name) { unsigned int hash = 0; const char *p; p = name; while (*p) { /* * Don't hash the iso9660 version number. * This way we can detect duplicates in cases where we have * directories (i.e. foo) and non-directories (i.e. foo;1). */ if (*p == ';') { break; } hash = (hash << 15) + (hash << 3) + (hash >> 3) + (*p++ & 0xFF); } return (hash % NR_NAME_HASH); } void add_file_hash(struct directory_entry *de) { struct name_hash *new; int hash; Uchar *p; int sum = 0; new = (struct name_hash *) e_malloc(sizeof (struct name_hash)); new->de = de; new->next = NULL; for (p = (Uchar *)de->isorec.name; *p; p++) { if (*p == ';') break; sum += *p & 0xFF; } new->sum = sum; hash = name_hash(de->isorec.name); /* Now insert into the hash table */ new->next = name_hash_table[hash]; name_hash_table[hash] = new; } struct directory_entry * find_file_hash(register char *name) { register char *p1; register char *p2; register struct name_hash *nh; register int sum = 0; if (debug > 1) fprintf(stderr, "find_hash('%s')\n", name); for (p1 = name; *p1; p1++) { if (*p1 == ';') break; sum += *p1 & 0xFF; } for (nh = name_hash_table[name_hash(name)]; nh; nh = nh->next) { if (nh->sum != sum) continue; p1 = name; p2 = nh->de->isorec.name; if (debug > 1) fprintf(stderr, "Checking name '%s' isorec.name '%s'\n", p1, p2); /* Look for end of string, or a mismatch. */ while (1 == 1) { if ((*p1 == '\0' || *p1 == ';') || (*p2 == '\0' || *p2 == ';') || (*p1 != *p2)) { break; } p1++; p2++; } if (!isoname_endsok(p1) || !isoname_endsok(p2)) { if (debug > 1) { if (!isoname_endsok(p1)) fprintf(stderr, "'%s' does NOT END OK\n", p1); if (!isoname_endsok(p2)) fprintf(stderr, "'%s' does NOT END OK\n", p2); } /* * If one file does not end with a valid version number * and the other name ends here, we found a miss match. */ if (*p1 == '\0' || *p2 == '\0') continue; if (*p1 == ';' && *p2 == ';') { p1++; p2++; continue; } } /* * If we are at the end of both strings, then we have a match. */ if ((*p1 == '\0' || *p1 == ';') && (*p2 == '\0' || *p2 == ';')) { return (nh->de); } } return (NULL); } /* * The macro 'eo' is just an idea on how one might speed up isoname_endsok() */ #define eo(p) (((p)[0] == '\0') || \ ((p)[0] == ';' && (p)[1] == '1' && (p)[2] == '\0') || \ isoname_endsok(p)) static BOOL isoname_endsok(char *name) { int i; char *p; if (*name == '\0') return (TRUE); if (*name != ';') return (FALSE); for (p = ++name, i = 0; *p && i < 5; p++, i++) { if (*p < '0' || *p > '9') return (FALSE); } i = atoi(name); if (i < 1 || i > 32767) return (FALSE); return (TRUE); } int delete_file_hash(struct directory_entry *de) { struct name_hash *nh; struct name_hash *prev; int hash; prev = NULL; hash = name_hash(de->isorec.name); for (nh = name_hash_table[hash]; nh; nh = nh->next) { if (nh->de == de) break; prev = nh; } if (!nh) return (1); if (!prev) name_hash_table[hash] = nh->next; else prev->next = nh->next; free(nh); return (0); } void flush_file_hash() { struct name_hash *nh; struct name_hash *nh1; int i; for (i = 0; i < NR_NAME_HASH; i++) { nh = name_hash_table[i]; while (nh) { nh1 = nh->next; free(nh); nh = nh1; } name_hash_table[i] = NULL; } } cdrkit-1.1.11/genisoimage/apple_driver.80000644000372500001440000000415110531416235017161 0ustar steveusers'\" te .\" To print, first run through tbl .TH APPLE_DRIVER 8 "18 May 1998" "Version 1.0" .SH NAME apple_driver \- extract Macintosh partition label, maps and boot driver .SH SYNOPSIS .B apple_driver CDROM_device > HFS_driver_file .SH DESCRIPTION .I Apple_driver extracts the information from an Apple (or compatible) CD-ROM required for the .I \-hfs-boot-file option to .IR mkhybrid (1). .PP The .I CDROM_device is the device name used by the CD-ROM (e.g. /dev/cdrom). .PP The format of the HFS driver file is: .PP .TS l l . HFS CD Label Block 512 bytes Driver Partition Map (for 2048 byte blocks) 512 bytes Driver Partition Map (for 512 byte blocks) 512 bytes Empty 512 bytes Driver Partition N x 2048 bytes HFS Partition Boot Block 1024 bytes .TE .PP The Perl script .I hdisk.pl can be used to give a listing of what's on a Mac CD. hdisk.pl is part of hfsutils. .SH NOTE By using a driver from an Apple CD and copying Apple software to your CD, you become liable to obey Apple Computer, Inc. Software License Agreements. .SH SEE\ ALSO .IR mkhybrid (1) .SH PROGRAMMER James Pearson (j.pearson@ge.ucl.ac.uk) 18/5/98 .PP The driver code (both extracting the driver and creating partitions etc. is based on code from .I genisoimage 1.05 PLUS by Andy Polyakov (see http://fy.chalmers.se/~appro/genisoimage_plus.html) .PP This manpage describes the program implementation of .B apple_driver as shipped by the cdrkit distribution. See .B http://alioth.debian.org/projects/debburn/ for details. It is a spinof from the original program distributed by the cdrtools project. However, the cdrtools developers are not involved in the development of this spinoff and therefore shall not be made responsible for any problem caused by it. Do not try to get support for this program by contacting the original authors. .PP If you have support questions, send them to .PP .B debburn-devel@lists.alioth.debian.org .br .PP If you have definitely found a bug, send a mail to this list or to .PP .B submit@bugs.debian.org .br .PP writing at least a short description into the Subject and "Package: cdrkit" into the first line of the mail body. cdrkit-1.1.11/genisoimage/apple.h0000644000372500001440000002616210513514665015702 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)apple.h 1.7 04/03/02 joerg, Copyright 1997, 1998, 1999, 2000 James Pearson */ /* * Copyright (c) 1997, 1998, 1999, 2000 James Pearson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * apple.h: cut down macfile.h from CAP distribution */ #ifndef _APPLE_H #define _APPLE_H #include "mactypes.h" #ifndef O_BINARY #define O_BINARY 0 #endif /* O_BINARY */ #ifdef _WIN32_TEST #undef UNICODE #include #endif /* _WIN32 */ #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a):(b)) #endif /* MIN */ #define CT_SIZE 4 /* Size of type/creator */ #define NUMMAP 512 /* initial number of maps */ #define BLANK " " /* blank type/creator */ #define DEFMATCH "*" /* default mapping extension */ typedef struct { char *extn; /* filename extension */ int elen; /* length of extension */ char type[CT_SIZE+1]; /* extension type */ char creator[CT_SIZE+1]; /* extension creator */ unsigned short fdflags; /* finder flags */ } afpmap; /* from "data.h" - libhfs routines */ unsigned long d_toutime(unsigned long); unsigned long d_dtoutime(long); long d_getl(unsigned char *); short d_getw(unsigned char *); /* for libfile routines */ int init_magic(char *); char * get_magic_match(const char *); typedef unsigned char byte; typedef unsigned char word[2]; typedef unsigned char dword[4]; #define INFOLEN 32 /* Finder info is 32 bytes */ typedef struct { /* base finder information */ char fdType[4]; /* File type [4] */ char fdCreator[4]; /* File creator [8] */ word fdFlags; /* Finder flags [10] */ word fdLocation[2]; /* File's location [14] */ word fdFldr; /* File's window [16] */ /* extended finder information */ word fdIconID; /* Icon ID [18] */ word fdUnused[3]; /* Unused [24] */ byte fdScript; /* Script system used [25] */ byte fdXFlags; /* Reserved [26] */ word fdComment; /* Comment ID [28] */ dword fdPutAway; /* Home directory ID [32] */ } Finfo; typedef struct { /* base finder information */ word frRect[4]; /* Folder's rectangle [8] */ word frFlags; /* Finder flags [10] */ word frLocation[2]; /* Folder's location [14] */ word frView; /* Folder's view [16] */ /* extended finder information */ word frScroll[2]; /* Folder's scroll position [20] */ dword frOpenChain; /* ID's of open folders [24] */ byte frScript; /* Script system used [25] */ byte frXFlags; /* Reserved [26] */ word frComment; /* Comment ID [28] */ dword frPutAway; /* Home directory ID [32] */ } Dinfo; /****** TYPE_CAP ******/ /* * taken from the CAP distribution: * macfile.h - header file with Macintosh file definitions * * AppleTalk package for UNIX (4.2 BSD). * * Copyright (c) 1986, 1987, 1988 by The Trustees of Columbia University in the * City of New York. * * Edit History: * * Sept 1987 Created by Charlie * */ #ifndef USE_MAC_DATES #define USE_MAC_DATES #endif /* USE_MAC_DATES */ #define MAXCLEN 199 /* max size of a comment string */ #define FINFOLEN 32 /* Finder info is 32 bytes */ #define MAXMACFLEN 31 /* max Mac file name length */ typedef struct { byte finderinfo[INFOLEN]; /* Finder info */ word fi_attr; /* attributes */ #define FI_MAGIC1 255 byte fi_magic1; /* was: length of comment */ #define FI_VERSION 0x10 /* version major 1, minor 0 */ /* if we have more than 8 versions wer're */ /* doiong something wrong anyway */ byte fi_version; /* version number */ #define FI_MAGIC 0xda byte fi_magic; /* magic word check */ byte fi_bitmap; /* bitmap of included info */ #define FI_BM_SHORTFILENAME 0x1 /* is this included? */ #define FI_BM_MACINTOSHFILENAME 0x2 /* is this included? */ byte fi_shortfilename[12+1]; /* possible short file name */ byte fi_macfilename[32+1]; /* possible macintosh file name */ byte fi_comln; /* comment length */ byte fi_comnt[MAXCLEN+1]; /* comment string */ #ifdef USE_MAC_DATES byte fi_datemagic; /* sanity check */ #define FI_MDATE 0x01 /* mtime & utime are valid */ #define FI_CDATE 0x02 /* ctime is valid */ byte fi_datevalid; /* validity flags */ byte fi_ctime[4]; /* mac file create time */ byte fi_mtime[4]; /* mac file modify time */ byte fi_utime[4]; /* (real) time mtime was set */ #endif /* USE_MAC_DATES */ } FileInfo; /* Atribute flags */ #define FI_ATTR_SETCLEAR 0x8000 /* set-clear attributes */ #define FI_ATTR_READONLY 0x20 /* file is read-only */ #define FI_ATTR_ROPEN 0x10 /* resource fork in use */ #define FI_ATTR_DOPEN 0x80 /* data fork in use */ #define FI_ATTR_MUSER 0x2 /* multi-user */ #define FI_ATTR_INVISIBLE 0x1 /* invisible */ /**** MAC STUFF *****/ /* Flags */ #define FNDR_fOnDesk 0x1 #define FNDR_fHasBundle 0x2000 #define FNDR_fInvisible 0x4000 /* locations */ #define FNDR_fTrash -3 /* File in Trash */ #define FNDR_fDesktop -2 /* File on desktop */ #define FNDR_fDisk 0 /* File in disk window */ /****** TYPE_ESHARE ******/ /* * Information supplied by Jens-Uwe Mager (jum@helios.de) */ #define ES_VERSION 0x0102 #define ES_MAGIC 0x3681093 #define ES_INFOLEN 32 #define ES_INFO_SIZE 512 typedef struct { dword magic; dword serno; /* written only, never read */ word version; word attr; /* invisible... */ word openMax; /* max number of opens */ word filler0; dword backupCleared; /* time backup bit cleared */ dword id; /* dir/file id */ dword createTime; /* unix format */ dword backupTime; /* unix format */ byte finderinfo[INFOLEN]; /* Finder info */ } es_FileInfo; /****** TYPE_USHARE ******/ /* * similar to the EtherShare layout, but the finder info stuff is different * info provided by: Phil Sylvester */ typedef struct { byte finderinfo[INFOLEN]; /* Finder info */ dword btime; /* mac file backup time [36]*/ byte unknown2[4]; /* ignore [40] */ dword ctime; /* mac file create time [44]*/ byte unknown3[8]; /* ignore [52] */ dword mtime; /* mac file modify time [56]*/ byte unknown4[456]; /* ignore [512] */ } us_FileInfo; /****** TYPE_DOUBLE, TYPE_SINGLE ******/ /* * Taken from cvt2cap (c) May 1988, Paul Campbell */ typedef struct { dword id; dword offset; dword length; } a_entry; typedef struct { dword magic; dword version; char home[16]; word nentries; a_entry entries[1]; } a_hdr; #define A_HDR_SIZE 26 #define A_ENTRY_SIZE sizeof (a_entry) #define A_VERSION1 0x00010000 #define A_VERSION2 0x00020000 #define APPLE_SINGLE 0x00051600 #define APPLE_DOUBLE 0x00051607 #define ID_DATA 1 #define ID_RESOURCE 2 #define ID_NAME 3 #define ID_FILEI 7 /* v1 */ #define ID_FILEDATESI 8 /* v2 */ #define ID_FINDER 9 #define A_DATE 16 /****** TYPE_MACBIN ******/ /* * taken from capit.c by Nigel Perry, np@doc.ic.ac.uk which is adapted * from unmacbin by John M. Sellens, jmsellens@watdragon.uwaterloo.ca */ #define MB_NAMELEN 63 /* maximum legal Mac file name length */ #define MB_SIZE 128 /* * Format of a bin file: * A bin file is composed of 128 byte blocks. The first block is the * info_header (see below). Then comes the data fork, null padded to fill the * last block. Then comes the resource fork, padded to fill the last block. A * proposal to follow with the text of the Get Info box has not been implemented, * to the best of my knowledge. Version, zero1 and zero2 are what the receiving * program looks at to determine if a MacBinary transfer is being initiated. */ typedef struct { /* info file header (128 bytes). Unfortunately, these */ /* longs don't align to word boundaries */ byte version; /* there is only a version 0 at this time */ byte nlen; /* Length of filename. */ byte name[MB_NAMELEN]; /* Filename */ byte type[4]; /* File type. */ byte auth[4]; /* File creator. */ byte flags; /* file flags: LkIvBnSyBzByChIt */ byte zero1; /* Locked, Invisible,Bundle, System */ /* Bozo, Busy, Changed, Init */ byte icon_vert[2]; /* Vertical icon position within window */ byte icon_horiz[2]; /* Horizontal icon postion in window */ byte window_id[2]; /* Window or folder ID. */ byte protect; /* = 1 for protected file, 0 otherwise */ byte zero2; byte dflen[4]; /* Data Fork length (bytes) - most sig. */ byte rflen[4]; /* Resource Fork length byte first */ byte cdate[4]; /* File's creation date. */ byte mdate[4]; /* File's "last modified" date. */ byte ilen[2]; /* GetInfo message length */ byte flags2; /* Finder flags, bits 0-7 */ byte unused[14]; byte packlen[4]; /* length of total files when unpacked */ byte headlen[2]; /* length of secondary header */ byte uploadvers; /* Version of MacBinary II that the uploading program is written for */ byte readvers; /* Minimum MacBinary II version needed to read this file */ byte crc[2]; /* CRC of the previous 124 bytes */ byte padding[2]; /* two trailing unused bytes */ } mb_info; /****** TYPE_FE ******/ /* Information provided by Mark Weinstein */ typedef struct { byte nlen; byte name[31]; byte finderinfo[INFOLEN]; /* Finder info */ byte cdate[4]; byte mdate[4]; byte bdate[4]; byte fileid[4]; byte sname[8]; byte ext[3]; byte pad; } fe_info; #define FE_SIZE 92 /****** TYPE_SGI ******/ typedef struct { byte unknown1[8]; byte finderinfo[INFOLEN]; /* Finder info */ byte unknown2[214]; byte name[32]; byte unknown3[14]; } sgi_info; #define SGI_SIZE 300 /****** TYPE_SFM ******/ /* * Information provided by Lou Rieger taken from * an email from Eddie Bowers */ typedef struct { byte afpi_Signature[4]; /* Must be 0x00504641 */ byte afpi_Version[4]; /* Must be 0x00010000 */ byte afpi_Reserved1[4]; byte afpi_BackupTime[4]; /* Backup time for the file/dir */ byte finderinfo[INFOLEN]; /* Finder info */ byte afpi_ProDosInfo[6]; /* ProDos Info */ byte afpi_Reserved2[6]; } sfm_info; #define SFM_MAGIC 0x00504641 #define SFM_VERSION 0x00010000 /****** TYPE_DHFS ******/ #ifdef IS_MACOS_X /* * Code ideas from 'hfstar' by Marcel Weiher marcel@metaobject.com, * another GNU hfstar by Torres Vedras paulotex@yahoo.com and * hfspax by Howard Oakley howard@quercus.demon.co.uk */ #include typedef struct { unsigned long info_length; struct timespec ctime; struct timespec mtime; byte info[32]; } attrinfo; #endif /* IS_MACOS_X */ #endif /* _APPLE_H */ cdrkit-1.1.11/genisoimage/jte.h0000644000372500001440000000204511202672414015346 0ustar steveusers/* * jte.c * * Copyright (c) 2004-2006 Steve McIntyre * * Prototypes and declarations for JTE * * GNU GPL v2 */ extern char *jtemplate_out; extern char *jjigdo_out; extern char *jmd5_list; extern FILE *jthelper; extern FILE *jtjigdo; extern FILE *jttemplate; extern int jte_min_size; extern int checksum_algo_iso; extern int checksum_algo_tmpl; extern void write_jt_header(FILE *template_file, FILE *jigdo_file); extern void write_jt_footer(void); extern void jtwrite(void *buffer, int size, int count, int submode, BOOL islast); extern void write_jt_match_record(char *filename, char *mirror_name, int sector_size, off_t size, unsigned char md5[16]); extern int list_file_in_jigdo(char *filename, off_t size, char **realname, unsigned char md5[16]); extern int jte_add_exclude(char *pattern); extern int jte_add_include(char *pattern); extern int jte_add_mapping(char *arg); typedef enum _jtc_e { JTE_TEMP_GZIP = 0, JTE_TEMP_BZIP2 } jtc_t; extern jtc_t jte_template_compression; #define MIN_JIGDO_FILE_SIZE 1024 cdrkit-1.1.11/genisoimage/iso9660.h0000644000372500001440000003165210531416235015712 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)iso9660.h 1.19 04/03/02 joerg */ /* * Header file iso9660.h - assorted structure definitions and typecasts. * specific to iso9660 filesystem. * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999,2000-2004 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _ISOFS_FS_H #define _ISOFS_FS_H /* * The isofs filesystem constants/structures */ /* This part borrowed from the bsd386 isofs */ #define ISODCL(from, to) (to - from + 1) struct iso_volume_descriptor { char type [ISODCL(1, 1)]; /* 711 */ char id [ISODCL(2, 6)]; char version [ISODCL(7, 7)]; char data [ISODCL(8, 2048)]; }; /* volume descriptor types */ #define ISO_VD_PRIMARY 1 #define ISO_VD_SUPPLEMENTARY 2 /* Used by Joliet */ #define ISO_VD_END 255 #define ISO_STANDARD_ID "CD001" #define EL_TORITO_ID "EL TORITO SPECIFICATION" #define EL_TORITO_ARCH_x86 0 #define EL_TORITO_ARCH_PPC 1 #define EL_TORITO_ARCH_MAC 2 #define EL_TORITO_BOOTABLE 0x88 #define EL_TORITO_NOT_BOOTABLE 0 #define EL_TORITO_MEDIA_NOEMUL 0 #define EL_TORITO_MEDIA_12FLOP 1 #define EL_TORITO_MEDIA_144FLOP 2 #define EL_TORITO_MEDIA_288FLOP 3 #define EL_TORITO_MEDIA_HD 4 struct iso_primary_descriptor { char type [ISODCL(1, 1)]; /* 711 */ char id [ISODCL(2, 6)]; char version [ISODCL(7, 7)]; /* 711 */ char unused1 [ISODCL(8, 8)]; char system_id [ISODCL(9, 40)]; /* achars */ char volume_id [ISODCL(41, 72)]; /* dchars */ char unused2 [ISODCL(73, 80)]; char volume_space_size [ISODCL(81, 88)]; /* 733 */ char escape_sequences [ISODCL(89, 120)]; char volume_set_size [ISODCL(121, 124)]; /* 723 */ char volume_sequence_number [ISODCL(125, 128)]; /* 723 */ char logical_block_size [ISODCL(129, 132)]; /* 723 */ char path_table_size [ISODCL(133, 140)]; /* 733 */ char type_l_path_table [ISODCL(141, 144)]; /* 731 */ char opt_type_l_path_table [ISODCL(145, 148)]; /* 731 */ char type_m_path_table [ISODCL(149, 152)]; /* 732 */ char opt_type_m_path_table [ISODCL(153, 156)]; /* 732 */ char root_directory_record [ISODCL(157, 190)]; /* 9.1 */ char volume_set_id [ISODCL(191, 318)]; /* dchars */ char publisher_id [ISODCL(319, 446)]; /* achars */ char preparer_id [ISODCL(447, 574)]; /* achars */ char application_id [ISODCL(575, 702)]; /* achars */ char copyright_file_id [ISODCL(703, 739)]; /* 7.5 dchars */ char abstract_file_id [ISODCL(740, 776)]; /* 7.5 dchars */ char bibliographic_file_id [ISODCL(777, 813)]; /* 7.5 dchars */ char creation_date [ISODCL(814, 830)]; /* 8.4.26.1 */ char modification_date [ISODCL(831, 847)]; /* 8.4.26.1 */ char expiration_date [ISODCL(848, 864)]; /* 8.4.26.1 */ char effective_date [ISODCL(865, 881)]; /* 8.4.26.1 */ char file_structure_version [ISODCL(882, 882)]; /* 711 */ char unused4 [ISODCL(883, 883)]; char application_data [ISODCL(884, 1395)]; char unused5 [ISODCL(1396, 2048)]; }; /* * Supplementary or enhanced volume descriptor */ struct iso_enhanced_descriptor { char type [ISODCL(1, 1)]; /* 711 */ char id [ISODCL(2, 6)]; char version [ISODCL(7, 7)]; /* 711 */ char flags [ISODCL(8, 8)]; char system_id [ISODCL(9, 40)]; /* achars */ char volume_id [ISODCL(41, 72)]; /* dchars */ char unused2 [ISODCL(73, 80)]; char volume_space_size [ISODCL(81, 88)]; /* 733 */ char escape_sequences [ISODCL(89, 120)]; char volume_set_size [ISODCL(121, 124)]; /* 723 */ char volume_sequence_number [ISODCL(125, 128)]; /* 723 */ char logical_block_size [ISODCL(129, 132)]; /* 723 */ char path_table_size [ISODCL(133, 140)]; /* 733 */ char type_l_path_table [ISODCL(141, 144)]; /* 731 */ char opt_type_l_path_table [ISODCL(145, 148)]; /* 731 */ char type_m_path_table [ISODCL(149, 152)]; /* 732 */ char opt_type_m_path_table [ISODCL(153, 156)]; /* 732 */ char root_directory_record [ISODCL(157, 190)]; /* 9.1 */ char volume_set_id [ISODCL(191, 318)]; /* dchars */ char publisher_id [ISODCL(319, 446)]; /* achars */ char preparer_id [ISODCL(447, 574)]; /* achars */ char application_id [ISODCL(575, 702)]; /* achars */ char copyright_file_id [ISODCL(703, 739)]; /* 7.5 dchars */ char abstract_file_id [ISODCL(740, 776)]; /* 7.5 dchars */ char bibliographic_file_id [ISODCL(777, 813)]; /* 7.5 dchars */ char creation_date [ISODCL(814, 830)]; /* 8.4.26.1 */ char modification_date [ISODCL(831, 847)]; /* 8.4.26.1 */ char expiration_date [ISODCL(848, 864)]; /* 8.4.26.1 */ char effective_date [ISODCL(865, 881)]; /* 8.4.26.1 */ char file_structure_version [ISODCL(882, 882)]; /* 711 */ char unused4 [ISODCL(883, 883)]; char application_data [ISODCL(884, 1395)]; char unused5 [ISODCL(1396, 2048)]; }; /* El Torito Boot Record Volume Descriptor */ struct eltorito_boot_descriptor { char type [ISODCL(1, 1)]; /* 711 */ char id [ISODCL(2, 6)]; char version [ISODCL(7, 7)]; /* 711 */ char system_id [ISODCL(8, 39)]; char unused2 [ISODCL(40, 71)]; char bootcat_ptr [ISODCL(72, 75)]; char unused5 [ISODCL(76, 2048)]; }; /* Validation entry for El Torito */ struct eltorito_validation_entry { char headerid [ISODCL(1, 1)]; /* 711 */ char arch [ISODCL(2, 2)]; char pad1 [ISODCL(3, 4)]; /* 711 */ char id [ISODCL(5, 28)]; /* CD devel/man*/ char cksum [ISODCL(29, 30)]; char key1 [ISODCL(31, 31)]; char key2 [ISODCL(32, 32)]; }; /* El Torito initial/default entry in boot catalog */ struct eltorito_defaultboot_entry { char boot_id [ISODCL(1, 1)]; /* 711 */ char boot_media [ISODCL(2, 2)]; char loadseg [ISODCL(3, 4)]; /* 711 */ char sys_type [ISODCL(5, 5)]; char pad1 [ISODCL(6, 6)]; char nsect [ISODCL(7, 8)]; char bootoff [ISODCL(9, 12)]; char pad2 [ISODCL(13, 32)]; }; /* * XXX JS: The next two structures have odd lengths! * Some compilers (e.g. on Sun3/mc68020) padd the structures to even length. * For this reason, we cannot use sizeof (struct iso_path_table) or * sizeof (struct iso_directory_record) to compute on disk sizes. * Instead, we use offsetof(..., name) and add the name size. * See genisoimage.h */ /* We use this to help us look up the parent inode numbers. */ struct iso_path_table { unsigned char name_len[2]; /* 721 */ char extent[4]; /* 731 */ char parent[2]; /* 721 */ char name[1]; }; /* * A ISO filename is: "abcde.eee;1" -> '.' ';' * * The maximum needed string length is: * 30 chars (filename + ext) * + 2 chars ('.' + ';') * + strlen("32767") * + null byte * ================================ * = 38 chars * * We currently do not support CD-ROM-XA entension records, but we must honor * the needed space for ISO-9660:1999 (Version 2). * * XXX If we ever will start to support XA records, we will need to take care * XXX that the the maximum ISO-9660 name length will be reduced by another * XXX 14 bytes resulting in a new total of 179 Bytes. */ #define LEN_ISONAME 31 #define MAX_ISONAME_V1 37 #define MAX_ISONAME_V2 207 /* 254 - 33 - 14 (XA Record) */ #define MAX_ISONAME_V2_RR 193 /* 254 - 33 - 28 (CE Record) */ #define MAX_ISONAME_V2_RR_XA 179 /* 254 - 33 - 14 - 28 */ #define MAX_ISONAME MAX_ISONAME_V2 /* Used for array space defs */ #define MAX_ISODIR 254 /* Must be even and <= 255 */ struct iso_directory_record { unsigned char length [ISODCL(1, 1)]; /* 711 */ char ext_attr_length [ISODCL(2, 2)]; /* 711 */ char extent [ISODCL(3, 10)]; /* 733 */ char size [ISODCL(11, 18)]; /* 733 */ char date [ISODCL(19, 25)]; /* 7 by 711 */ char flags [ISODCL(26, 26)]; char file_unit_size [ISODCL(27, 27)]; /* 711 */ char interleave [ISODCL(28, 28)]; /* 711 */ char volume_sequence_number [ISODCL(29, 32)]; /* 723 */ unsigned char name_len [ISODCL(33, 33)]; /* 711 */ char name [MAX_ISONAME+1]; /* Not really, but we need something here */ }; /* * Iso directory flags. */ #define ISO_FILE 0 /* Not really a flag... */ #define ISO_EXISTENCE 1 /* Do not make existence known (hidden) */ #define ISO_DIRECTORY 2 /* This file is a directory */ #define ISO_ASSOCIATED 4 /* This file is an assiciated file */ #define ISO_RECORD 8 /* Record format in extended attr. != 0 */ #define ISO_PROTECTION 16 /* No read/execute perm. in ext. attr. */ #define ISO_DRESERVED1 32 /* Reserved bit 5 */ #define ISO_DRESERVED2 64 /* Reserved bit 6 */ #define ISO_MULTIEXTENT 128 /* Not final entry of a mult. ext. file */ struct iso_ext_attr_record { char owner [ISODCL(1, 4)]; /* 723 */ char group [ISODCL(5, 8)]; /* 723 */ char permissions [ISODCL(9, 10)]; /* 16 bits */ char creation_date [ISODCL(11, 27)]; /* 8.4.26.1 */ char modification_date [ISODCL(28, 44)]; /* 8.4.26.1 */ char expiration_date [ISODCL(45, 61)]; /* 8.4.26.1 */ char effective_date [ISODCL(62, 78)]; /* 8.4.26.1 */ char record_format [ISODCL(79, 79)]; /* 711 */ char record_attributes [ISODCL(80, 80)]; /* 711 */ char record_length [ISODCL(81, 84)]; /* 723 */ char system_id [ISODCL(85, 116)]; /* achars */ char system_use [ISODCL(117, 180)]; char ext_attr_version [ISODCL(181, 181)]; /* 711 */ char esc_seq_len [ISODCL(182, 182)]; /* 711 */ char reserved [ISODCL(183, 246)]; /* for future use */ char appl_use_len [ISODCL(247, 250)]; /* 723 */ char appl_use[1]; /* really more */ /* char esc_seq[]; escape sequences recorded after appl_use */ }; /* * Iso extended attribute permissions. */ #define ISO_GS_READ 0x0001 /* System Group Read */ #define ISO_BIT_1 0x0002 #define ISO_GS_EXEC 0x0004 /* System Group Execute */ #define ISO_BIT_3 0x0008 #define ISO_O_READ 0x0010 /* Owner Read */ #define ISO_BIT_5 0x0020 #define ISO_O_EXEC 0x0040 /* Owner Exexute */ #define ISO_BIT_7 0x0080 #define ISO_G_READ 0x0100 /* Group Read */ #define ISO_BIT_9 0x0200 #define ISO_G_EXEC 0x0400 /* Group Execute */ #define ISO_BIT_11 0x0800 #define ISO_W_READ 0x1000 /* World (other) Read */ #define ISO_BIT_13 0x2000 #define ISO_W_EXEC 0x4000 /* World (other) Execute */ #define ISO_BIT_15 0x8000 #define ISO_MB_ONE (ISO_BIT_1|ISO_BIT_3|ISO_BIT_5|ISO_BIT_7| \ ISO_BIT_9|ISO_BIT_11|ISO_BIT_13|ISO_BIT_15) /* * Extended Attributes record according to Yellow Book. */ struct iso_xa_dir_record { char group_id [ISODCL(1, 2)]; char user_id [ISODCL(3, 4)]; char attributes [ISODCL(5, 6)]; char signature [ISODCL(7, 8)]; char file_number [ISODCL(9, 9)]; char reserved [ISODCL(10, 14)]; }; /* * Definitions for XA attributes */ #define XA_O_READ 0x0001 /* Owner Read */ #define XA_O_RES 0x0002 /* Owner Reserved (write ?) */ #define XA_O_EXEC 0x0004 /* Owner Execute */ #define XA_O_RES2 0x0008 /* Owner Reserved */ #define XA_G_READ 0x0010 /* Group Read */ #define XA_G_RES 0x0020 /* Group Reserved (write ?) */ #define XA_G_EXEC 0x0040 /* Group Execute */ #define XA_G_RES2 0x0080 /* Group Reserved */ #define XA_W_READ 0x0100 /* World Read */ #define XA_W_RES 0x0200 /* World Reserved (write ?) */ #define XA_W_EXEC 0x0400 /* World Execute */ #define XA_FORM1 0x0800 /* File contains Form 1 sector */ #define XA_FORM2 0x1000 /* File contains Form 2 sector */ #define XA_INTERLEAVED 0x2000 /* File contains interleaved sectors */ #define XA_CDDA 0x4000 /* File contains audio data */ #define XA_DIR 0x8000 /* This is a directory */ /* * Definitions for CD-ROM XA-Mode-2-form-1/2 sector sub-headers */ struct xa_subhdr { Uchar file_number; /* Identifies file for block */ Uchar channel_number; /* Playback channel selection */ Uchar sub_mode; /* See bit definitions below */ Uchar coding; /* Coding information */ }; /* * Sub mode bit definitions */ #define XA_SUBH_EOR 0x01 /* End-Of-Record */ #define XA_SUBH_VIDEO 0x02 /* Video Block */ #define XA_SUBH_AUDIO 0x04 /* Audio Block (not CD-DA) */ #define XA_SUBH_DATA 0x08 /* Data Block */ #define XA_SUBH_TRIGGER 0x10 /* Trigger Block */ #define XA_SUBH_FORM2 0x20 /* 0 == Form1, 1 == Form2 */ #define XA_SUBH_REALTIME 0x40 /* Real Time Block */ #define XA_SUBH_EOF 0x80 /* End-Of-File */ #endif /* _ISOFS_FS_H */ cdrkit-1.1.11/genisoimage/scsi.h0000644000372500001440000000256710513514665015545 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)scsi.h 1.1 04/05/27 Copyright 1997-2004 J. Schilling */ /* * Copyright (c) 1997-2004 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SCSI_H #define _SCSI_H #ifdef USE_SCG extern int readsecs(int startsecno, void *buffer, int sectorcount); extern int scsidev_open(char *path); extern int scsidev_close(void); #endif #endif /* _SCSI_H */ cdrkit-1.1.11/genisoimage/checksum.h0000644000372500001440000000475711202672414016402 0ustar steveusers/* * checksum.h * * Copyright (c) 2008- Steve McIntyre * * Definitions and prototypes for a generic checksum interface, used * in JTE. Inspired heavily by the interface to the MD5 code we're * using already. * * GNU GPL v2 */ enum checksum_types { CHECK_MD5 = 0, CHECK_SHA1, CHECK_SHA256, CHECK_SHA512, NUM_CHECKSUMS }; #define CHECK_MD5_USED (1 << CHECK_MD5) #define CHECK_SHA1_USED (1 << CHECK_SHA1) #define CHECK_SHA256_USED (1 << CHECK_SHA256) #define CHECK_SHA512_USED (1 << CHECK_SHA512) #define CHECK_ALL_USED 0xFFFFFFFF typedef void checksum_context_t; struct checksum_info { char *name; char *prog; int digest_size; }; /* Ask the library for information about a particular checksum * algorithm. Returns a pointer to internal memory - DO NOT * MODIFY/FREE! */ struct checksum_info *checksum_information(enum checksum_types which); /* Allocate / initialise a context for the chosen checksums. OR * together the desired checksums as the parameter */ checksum_context_t *checksum_init_context(int checksums, const char *owner); /* Cleanup and free a context when it's finished with */ void checksum_free_context(checksum_context_t *context); /* Pass a new buffer full of data through the checksum code */ void checksum_update(checksum_context_t *context, unsigned char const *buf, unsigned int len); /* Finish the current set of checksums */ void checksum_final(checksum_context_t *context); /* Extract a particular algorithm's checksum once checksum_final() has * been called. Use the details in checksum_information() above first * to see how big the digest will be. Only valid once checksum_final() * has been called, otherwise the digest returned will be all * zeroes. */ void checksum_copy(checksum_context_t *context, enum checksum_types which, unsigned char *digest); /* Helper function: return a pointer to a string containing the ASCII * hexadecimal dump of a checksum. Only valid once checksum_final() * has been called, otherwise will return NULL */ const char * checksum_hex(checksum_context_t *context, enum checksum_types which); extern int parse_checksum_algo(char *arg, int *algo); cdrkit-1.1.11/genisoimage/endianconv.h0000644000372500001440000000204110537101764016711 0ustar steveusers/* * endian_conv.h * * Copyright (c) 2004-2006 Steve McIntyre * * Simple helper routines for marshalling data - prototypes * * GNU GPL v2 */ void write_be64(unsigned long long in, unsigned char *out); unsigned long long read_be64(unsigned char *in); void write_le64(unsigned long long in, unsigned char *out); unsigned long long read_le64(unsigned char *in); void write_le48(unsigned long long in, unsigned char *out); unsigned long long read_le48(unsigned char *in); void write_be32(unsigned long in, unsigned char *out); unsigned long read_be32(unsigned char *in); void write_le32(unsigned long in, unsigned char *out); unsigned long read_le32(unsigned char *in); void write_be16(unsigned short in, unsigned char *out); unsigned short read_be16(unsigned char *in); void write_le16(unsigned short in, unsigned char *out); unsigned short read_le16(unsigned char *in); cdrkit-1.1.11/genisoimage/mac_label.c0000644000372500001440000003225311016363001016452 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)mac_label.c 1.9 04/03/05 joerg, Copyright 1997, 1998, 1999, 2000 James Pearson */ /* * Copyright (c) 1997, 1998, 1999, 2000 James Pearson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * mac_label.c: generate Mactintosh partition maps and label * * Taken from "mkisofs 1.05 PLUS" by Andy Polyakov * (see http://fy.chalmers.se/~appro/mkisofs_plus.html for details) * * The format of the HFS driver file: * * HFS CD Label Block 512 bytes * Driver Partition Map (for 2048 byte blocks) 512 bytes * Driver Partition Map (for 512 byte blocks) 512 bytes * Empty 512 bytes * Driver Partition N x 2048 bytes * HFS Partition Boot Block 1024 bytes * * File of the above format can be extracted from a CD using * apple_driver.c * * James Pearson 16/5/98 */ /* PREP_BOOT Troy Benjegerdes 2/4/99 */ #include #include "genisoimage.h" #include "mac_label.h" #include "apple.h" #ifdef PREP_BOOT void gen_prepboot_label(unsigned char *ml); #endif /* PREP_BOOT */ int gen_mac_label(defer * mac_boot); int autostart(void); #ifdef PREP_BOOT void gen_prepboot_label(unsigned char *ml) { struct directory_entry *de; int i = 0; int block; int size; MacLabel *mac_label = (MacLabel *) ml; if (verbose > 1) { fprintf(stderr, "Creating %d PReP boot partition(s)\n", use_prep_boot + use_chrp_boot); } mac_label->fdiskMagic[0] = fdiskMagic0; mac_label->fdiskMagic[1] = fdiskMagic1; if (use_chrp_boot) { fprintf(stderr, "CHRP boot partition 1\n"); mac_label->image[i].boot = 0x80; mac_label->image[i].CHSstart[0] = 0xff; mac_label->image[i].CHSstart[1] = 0xff; mac_label->image[i].CHSstart[2] = 0xff; mac_label->image[i].type = chrpPartType; /* 0x96 */ mac_label->image[i].CHSend[0] = 0xff; mac_label->image[i].CHSend[1] = 0xff; mac_label->image[i].CHSend[2] = 0xff; mac_label->image[i].startSect[0] = 0; mac_label->image[i].startSect[1] = 0; mac_label->image[i].startSect[2] = 0; mac_label->image[i].startSect[3] = 0; size = (last_extent - session_start) * 2048 / 512; mac_label->image[i].size[0] = size & 0xff; mac_label->image[i].size[1] = (size >> 8) & 0xff; mac_label->image[i].size[2] = (size >> 16) & 0xff; mac_label->image[i].size[3] = (size >> 24) & 0xff; i++; } for (; i < use_prep_boot + use_chrp_boot; i++) { de = search_tree_file(root, prep_boot_image[i - use_chrp_boot]); if (!de) { fprintf(stderr, "Uh oh, I cant find the boot image \"%s\"!\n", prep_boot_image[i - use_chrp_boot]); exit(1); } /* get size and block in 512-byte blocks */ block = get_733(de->isorec.extent) * 2048 / 512; size = get_733(de->isorec.size) / 512 + 1; fprintf(stderr, "PReP boot partition %d is \"%s\"\n", i + 1, prep_boot_image[i - use_chrp_boot]); mac_label->image[i].boot = 0x80; mac_label->image[i].CHSstart[0] = 0xff; mac_label->image[i].CHSstart[1] = 0xff; mac_label->image[i].CHSstart[2] = 0xff; mac_label->image[i].type = prepPartType; /* 0x41 */ mac_label->image[i].CHSend[0] = 0xff; mac_label->image[i].CHSend[1] = 0xff; mac_label->image[i].CHSend[2] = 0xff; /* deal with endianess */ mac_label->image[i].startSect[0] = block & 0xff; mac_label->image[i].startSect[1] = (block >> 8) & 0xff; mac_label->image[i].startSect[2] = (block >> 16) & 0xff; mac_label->image[i].startSect[3] = (block >> 24) & 0xff; mac_label->image[i].size[0] = size & 0xff; mac_label->image[i].size[1] = (size >> 8) & 0xff; mac_label->image[i].size[2] = (size >> 16) & 0xff; mac_label->image[i].size[3] = (size >> 24) & 0xff; } for (; i < 4; i++) { mac_label->image[i].CHSstart[0] = 0xff; mac_label->image[i].CHSstart[1] = 0xff; mac_label->image[i].CHSstart[2] = 0xff; mac_label->image[i].CHSend[0] = 0xff; mac_label->image[i].CHSend[1] = 0xff; mac_label->image[i].CHSend[2] = 0xff; } } #endif /* PREP_BOOT */ int gen_mac_label(defer *mac_boot) { FILE *fp; MacLabel *mac_label; MacPart *mac_part; char *buffer = (char *) hce->hfs_map; int block_size; int have_hfs_boot = 0; char tmp[SECTOR_SIZE]; struct stat stat_buf; mac_partition_table mpm[2]; int mpc = 0; int i; /* If we have a boot file, then open and check it */ if (mac_boot->name) { if (stat(mac_boot->name, &stat_buf) < 0) { sprintf(hce->error, "unable to stat HFS boot file %s", mac_boot->name); return (-1); } if ((fp = fopen(mac_boot->name, "rb")) == NULL) { sprintf(hce->error, "unable to open HFS boot file %s", mac_boot->name); return (-1); } if (fread(tmp, 1, SECTOR_SIZE, fp) != SECTOR_SIZE) { sprintf(hce->error, "unable to read HFS boot file %s", mac_boot->name); return (-1); } /* check we have a bootable partition */ mac_part = (MacPart *) (tmp + HFS_BLOCKSZ); if (!(IS_MAC_PART(mac_part) && strncmp((char *) mac_part->pmPartType, pmPartType_2, 12) == 0)) { sprintf(hce->error, "%s is not a HFS boot file", mac_boot->name); return (-1); } /* check we have a boot block as well - last 2 blocks of file */ if (fseek(fp, (off_t)-2 * HFS_BLOCKSZ, SEEK_END) != 0) { sprintf(hce->error, "unable to seek HFS boot file %s", mac_boot->name); return (-1); } /* overwrite (empty) boot block for our HFS volume */ if (fread(hce->hfs_hdr, 2, HFS_BLOCKSZ, fp) != HFS_BLOCKSZ) { sprintf(hce->error, "unable to read HFS boot block %s", mac_boot->name); return (-1); } fclose(fp); /* check boot block is valid */ if (d_getw((unsigned char *) hce->hfs_hdr) != HFS_BB_SIGWORD) { sprintf(hce->error, "%s does not contain a valid boot block", mac_boot->name); return (-1); } /* * collect info about boot file for later user * - skip over the bootfile header */ mac_boot->size = stat_buf.st_size - SECTOR_SIZE - 2*HFS_BLOCKSZ; mac_boot->off = SECTOR_SIZE; mac_boot->pad = 0; /* * get size in SECTOR_SIZE blocks * - shouldn't need to round up */ mpm[mpc].size = ISO_BLOCKS(mac_boot->size); mpm[mpc].ntype = PM2; mpm[mpc].type = (char *) mac_part->pmPartType; mpm[mpc].start = mac_boot->extent = last_extent; mpm[mpc].name = 0; /* flag that we have a boot file */ have_hfs_boot++; /* add boot file size to the total size */ last_extent += mpm[mpc].size; hfs_extra += mpm[mpc].size; mpc++; } /* set info about our hybrid volume */ mpm[mpc].ntype = PM4; mpm[mpc].type = pmPartType_4; mpm[mpc].start = hce->hfs_map_size / HFS_BLK_CONV; mpm[mpc].size = last_extent - mpm[mpc].start - ISO_BLOCKS(mac_boot->size); mpm[mpc].name = volume_id; mpc++; if (verbose > 1) fprintf(stderr, "Creating HFS Label %s %s\n", mac_boot->name ? "with boot file" : "", mac_boot->name ? mac_boot->name : ""); /* for a bootable CD, block size is SECTOR_SIZE */ block_size = have_hfs_boot ? SECTOR_SIZE : HFS_BLOCKSZ; /* create the CD label */ mac_label = (MacLabel *) buffer; mac_label->sbSig[0] = 'E'; mac_label->sbSig[1] = 'R'; set_722((char *) mac_label->sbBlkSize, block_size); set_732((char *) mac_label->sbBlkCount, last_extent * (SECTOR_SIZE / block_size)); set_722((char *) mac_label->sbDevType, 1); set_722((char *) mac_label->sbDevId, 1); /* create the partition map entry */ mac_part = (MacPart *) (buffer + block_size); mac_part->pmSig[0] = 'P'; mac_part->pmSig[1] = 'M'; set_732((char *) mac_part->pmMapBlkCnt, mpc + 1); set_732((char *) mac_part->pmPyPartStart, 1); set_732((char *) mac_part->pmPartBlkCnt, mpc + 1); strncpy((char *) mac_part->pmPartName, "Apple", sizeof (mac_part->pmPartName)); strncpy((char *) mac_part->pmPartType, "Apple_partition_map", sizeof (mac_part->pmPartType)); set_732((char *) mac_part->pmLgDataStart, 0); set_732((char *) mac_part->pmDataCnt, mpc + 1); set_732((char *) mac_part->pmPartStatus, PM_STAT_DEFAULT); /* create partition map entries for our partitions */ for (i = 0; i < mpc; i++) { mac_part = (MacPart *) (buffer + (i + 2) * block_size); if (mpm[i].ntype == PM2) { /* get driver label and patch it */ memcpy((char *) mac_label, tmp, HFS_BLOCKSZ); set_732((char *) mac_label->sbBlkCount, last_extent * (SECTOR_SIZE / block_size)); set_732((char *) mac_label->ddBlock, (mpm[i].start) * (SECTOR_SIZE / block_size)); memcpy((char *) mac_part, tmp + HFS_BLOCKSZ, HFS_BLOCKSZ); set_732((char *) mac_part->pmMapBlkCnt, mpc + 1); set_732((char *) mac_part->pmPyPartStart, (mpm[i].start) * (SECTOR_SIZE / block_size)); } else { mac_part->pmSig[0] = 'P'; mac_part->pmSig[1] = 'M'; set_732((char *) mac_part->pmMapBlkCnt, mpc + 1); set_732((char *) mac_part->pmPyPartStart, mpm[i].start * (SECTOR_SIZE / HFS_BLOCKSZ)); set_732((char *) mac_part->pmPartBlkCnt, mpm[i].size * (SECTOR_SIZE / HFS_BLOCKSZ)); strncpy((char *) mac_part->pmPartName, mpm[i].name, sizeof (mac_part->pmPartName)); strncpy((char *) mac_part->pmPartType, mpm[i].type, sizeof (mac_part->pmPartType)); set_732((char *) mac_part->pmLgDataStart, 0); set_732((char *) mac_part->pmDataCnt, mpm[i].size * (SECTOR_SIZE / HFS_BLOCKSZ)); set_732((char *) mac_part->pmPartStatus, PM_STAT_DEFAULT); } } if (have_hfs_boot) { /* generate 512 partition table as well */ mac_part = (MacPart *) (buffer + HFS_BLOCKSZ); if (mpc < 3) { /* don't have to interleave with 2048 table */ mac_part->pmSig[0] = 'P'; mac_part->pmSig[1] = 'M'; set_732((char *) mac_part->pmMapBlkCnt, mpc + 1); set_732((char *) mac_part->pmPyPartStart, 1); set_732((char *) mac_part->pmPartBlkCnt, mpc + 1); strncpy((char *) mac_part->pmPartName, "Apple", sizeof (mac_part->pmPartName)); strncpy((char *) mac_part->pmPartType, "Apple_partition_map", sizeof (mac_part->pmPartType)); set_732((char *) mac_part->pmLgDataStart, 0); set_732((char *) mac_part->pmDataCnt, mpc + 1); set_732((char *) mac_part->pmPartStatus, PM_STAT_DEFAULT); mac_part++; /* +HFS_BLOCKSZ */ } for (i = 0; i < mpc; i++, mac_part++) { if (mac_part == (MacPart *) (buffer + SECTOR_SIZE)) mac_part++; /* jump over 2048 partition */ /* entry */ if (mpm[i].ntype == PM2) { memcpy((char *) mac_part, tmp + HFS_BLOCKSZ * 2, HFS_BLOCKSZ); if (!IS_MAC_PART(mac_part)) { mac_part--; continue; } set_732((char *) mac_part->pmMapBlkCnt, mpc+1); set_732((char *) mac_part->pmPyPartStart, mpm[i].start * (SECTOR_SIZE / HFS_BLOCKSZ)); } else { mac_part->pmSig[0] = 'P'; mac_part->pmSig[1] = 'M'; set_732((char *) mac_part->pmMapBlkCnt, mpc+1); set_732((char *) mac_part->pmPyPartStart, mpm[i].start * (SECTOR_SIZE / HFS_BLOCKSZ)); set_732((char *) mac_part->pmPartBlkCnt, mpm[i].size * (SECTOR_SIZE / HFS_BLOCKSZ)); strncpy((char *) mac_part->pmPartName, mpm[i].name, sizeof (mac_part->pmPartName)); strncpy((char *) mac_part->pmPartType, mpm[i].type, sizeof (mac_part->pmPartType)); set_732((char *) mac_part->pmLgDataStart, 0); set_732((char *) mac_part->pmDataCnt, mpm[i].size * (SECTOR_SIZE / HFS_BLOCKSZ)); set_732((char *) mac_part->pmPartStatus, PM_STAT_DEFAULT); } } } return (0); } /* * autostart: make the HFS CD use the QuickTime 2.0 Autostart feature. * * based on information from Eric Eisenhart and * http://developer.apple.com/qa/qtpc/qtpc12.html and * http://developer.apple.com/dev/techsupport/develop/issue26/macqa.html * * The name of the AutoStart file is stored in the area allocated for * the Clipboard name. This area begins 106 bytes into the sector of * block 0, with the first four bytes at that offset containing the * hex value 0x006A7068. This value indicates that an AutoStart * filename follows. After this 4-byte tag, 12 bytes remain, starting * at offset 110. In these 12 bytes, the name of the AutoStart file is * stored as a Pascal string, giving you up to 11 characters to identify * the file. The file must reside in the root directory of the HFS * volume or partition. */ int autostart() { int len; int i; if ((len = strlen(autoname)) > 11) return (-1); hce->hfs_hdr[106] = 0x00; hce->hfs_hdr[107] = 0x6A; hce->hfs_hdr[108] = 0x70; hce->hfs_hdr[109] = 0x68; hce->hfs_hdr[110] = len; for (i = 0; i < len; i++) hce->hfs_hdr[111 + i] = autoname[i]; return (0); } cdrkit-1.1.11/genisoimage/match.h0000644000372500001440000000527410513514665015676 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)match.h 1.9 04/05/23 joerg */ /* * 27th March 1996. Added by Jan-Piet Mens for matching regular expressions * in paths. * */ #include "fnmatch.h" #ifdef SORTING #include #define NOT_SORTED INT_MIN #ifdef MAX /* May be defined in param.h */ #undef MAX #endif #define MAX(A, B) (A) > (B) ? (A) : (B) #endif #define EXCLUDE 0 /* Exclude file completely */ #define I_HIDE 1 /* ISO9660/Rock Ridge hide */ #define J_HIDE 2 /* Joliet hide */ #define H_HIDE 3 /* ISO9660 hidden bit set */ #ifdef APPLE_HYB #define HFS_HIDE 4 /* HFS hide */ #define MAX_MAT 5 #else #define MAX_MAT 4 #endif /* APPLE_HYB */ extern int gen_add_match(char *fn, int n); extern int gen_matches(char *fn, int n); extern void gen_add_list(char *fn, int n); extern int gen_ishidden(int n); extern void gen_del_match(int n); #ifdef SORTING extern int add_sort_match(char *fn, int val); extern void add_sort_list(char *fn); extern int sort_matches(char *fn, int val); extern void del_sort(void); #endif /* SORTING */ /* * The following are for compatiblity with the separate routines - the * main code should be changed to call the generic routines directly */ /* filenames to be excluded */ #define add_match(FN) gen_add_match((FN), EXCLUDE) #define add_list(FN) gen_add_list((FN), EXCLUDE) #define matches(FN) gen_matches((FN), EXCLUDE) /* ISO9660/Rock Ridge filenames to be hidden */ #define i_add_match(FN) gen_add_match((FN), I_HIDE) #define i_add_list(FN) gen_add_list((FN), I_HIDE) #define i_matches(FN) gen_matches((FN), I_HIDE) #define i_ishidden() gen_ishidden(I_HIDE) /* Joliet filenames to be hidden */ #define j_add_match(FN) gen_add_match((FN), J_HIDE) #define j_add_list(FN) gen_add_list((FN), J_HIDE) #define j_matches(FN) gen_matches((FN), J_HIDE) #define j_ishidden() gen_ishidden(J_HIDE) /* ISO9660 "hidden" files */ #define h_add_match(FN) gen_add_match((FN), H_HIDE) #define h_add_list(FN) gen_add_list((FN), H_HIDE) #define h_matches(FN) gen_matches((FN), H_HIDE) #define h_ishidden() gen_ishidden(H_HIDE) #ifdef APPLE_HYB /* HFS filenames to be hidden */ #define hfs_add_match(FN) gen_add_match((FN), HFS_HIDE) #define hfs_add_list(FN) gen_add_list((FN), HFS_HIDE) #define hfs_matches(FN) gen_matches((FN), HFS_HIDE) #define hfs_ishidden() gen_ishidden(HFS_HIDE) #endif /* APPLE_HYB */ cdrkit-1.1.11/genisoimage/getopt.h0000644000372500001440000001156710477233650016107 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)getopt.h 1.3 03/03/06 eric */ /* Declarations for getopt. Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETOPT_H #define _GETOPT_H 1 #ifndef _MCONFIG_H #include #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns EOF, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { /*#if __STDC__*/ #ifdef PROTOTYPES const char *name; #else char *name; #endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 /*#if __STDC__*/ #ifdef PROTOTYPES #if defined(__GNU_LIBRARY__) /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); #else /* not __GNU_LIBRARY__ */ extern int getopt (); #endif /* not __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind, int long_only); #else /* not __STDC__ */ extern int getopt (); extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); #endif /* not __STDC__ */ #ifdef __cplusplus } #endif #endif /* _GETOPT_H */ cdrkit-1.1.11/genisoimage/fnmatch.c0000644000372500001440000001350610536265343016213 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fnmatch.c 1.4 02/02/10 eric */ /* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "fnmatch.h" #ifndef __STDC__ #define const #endif #ifndef FNM_FILE_NAME #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ #endif #ifndef FNM_LEADING_DIR #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ #endif #ifndef FNM_CASEFOLD #define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ #endif #include #if defined (STDC_HEADERS) || !defined (isascii) #define ISASCII(c) 1 #else #define ISASCII(c) isascii(c) #endif #define ISUPPER(c) (ISASCII (c) && isupper (c)) /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) #if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS) extern int errno; #endif /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ int fnmatch (const char *pattern, const char *string, int flags) { register const char *p = pattern, *n = string; register char c; /* Note that this evalutes C many times. */ #define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) while ((c = *p++) != '\0') { c = FOLD ((Uchar)c); switch (c) { case '?': if (*n == '\0') return FNM_NOMATCH; else if ((flags & FNM_FILE_NAME) && *n == '/') return FNM_NOMATCH; else if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; break; case '\\': if (!(flags & FNM_NOESCAPE)) { c = *p++; c = FOLD ((Uchar )c); } if (FOLD ((Uchar )*n) != c) return FNM_NOMATCH; break; case '*': if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; for (c = *p++; c == '?' || c == '*'; c = *p++, ++n) if (((flags & FNM_FILE_NAME) && *n == '/') || (c == '?' && *n == '\0')) return FNM_NOMATCH; if (c == '\0') return 0; { char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; c1 = FOLD ((Uchar )c1); for (--p; *n != '\0'; ++n) if ((c == '[' || FOLD ((Uchar )*n) == c1) && fnmatch (p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; } case '[': { /* Nonzero if the sense of the character class is inverted. */ register int not; if (*n == '\0') return FNM_NOMATCH; if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; not = (*p == '!' || *p == '^'); if (not) ++p; c = *p++; for (;;) { register char cstart = c, cend = c; if (!(flags & FNM_NOESCAPE) && c == '\\') cstart = cend = *p++; cstart = cend = FOLD ((Uchar)cstart); if (c == '\0') /* [ (unterminated) loses. */ return FNM_NOMATCH; c = *p++; c = FOLD ((Uchar)c); if ((flags & FNM_FILE_NAME) && c == '/') /* [/] can never match. */ return FNM_NOMATCH; if (c == '-' && *p != ']') { cend = *p++; if (!(flags & FNM_NOESCAPE) && cend == '\\') cend = *p++; if (cend == '\0') return FNM_NOMATCH; cend = FOLD ((Uchar)cend); c = *p++; } if ((Uchar)FOLD((Uchar)*n) >= (Uchar)cstart && (Uchar)FOLD((Uchar)*n) <= (Uchar)cend) goto matched; if (c == ']') break; } if (!not) return FNM_NOMATCH; break; matched:; /* Skip the rest of the [...] that already matched. */ while (c != ']') { if (c == '\0') /* [... (unterminated) loses. */ return FNM_NOMATCH; c = *p++; if (!(flags & FNM_NOESCAPE) && c == '\\') /* XXX 1003.2d11 is unclear if this is right. */ ++p; } if (not) return FNM_NOMATCH; } break; default: if (c != FOLD ((Uchar)*n)) return FNM_NOMATCH; } ++n; } if (*n == '\0') return 0; if ((flags & FNM_LEADING_DIR) && *n == '/') /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ return 0; return FNM_NOMATCH; } #endif /* _LIBC or not __GNU_LIBRARY__. */ cdrkit-1.1.11/genisoimage/udf_fs.h0000644000372500001440000003511510531416235016037 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)udf_fs.h 1.2 04/03/01 Copyright 2001-2004 J. Schilling */ /* * udf_fs.h - UDF structure definitions for genisoimage * * Written by Ben Rudiak-Gould (2001). * * Copyright 2001-2004 J. Schilling. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _UDF_FS_H #define _UDF_FS_H /* * Abbreviations: * * ad allocation descriptor * desc descriptor * ext extended * ident identifier * impl implementation * info information * ptr pointer * seq sequence */ typedef char udf_Uint8; typedef char udf_dchar; typedef char udf_dstring; typedef char udf_byte; typedef char udf_zerobyte; /* Is this safe? Are there compilers so perverse as to pad these structs? */ typedef struct udf_Uint16_ { char l; char h; } udf_Uint16; typedef struct udf_Uint32_ { char l; char ml; char mh; char h; } udf_Uint32; typedef struct udf_Uint64_ { udf_Uint32 l; udf_Uint32 h; } udf_Uint64; typedef struct udf_tag_ { /* ECMA-167 3/7.2 */ /* 0*/ udf_Uint16 tag_ident; /* 2*/ udf_Uint16 desc_version; /* 4*/ udf_Uint8 tag_checksum; /* 5*/ udf_zerobyte reserved; /* 6*/ udf_Uint16 tag_serial_number; /* 8*/ udf_Uint16 desc_crc; /*10*/ udf_Uint16 desc_crc_length; /*12*/ udf_Uint32 tag_location; /*16*/ } udf_tag; #define UDF_TAGID_PRIMARY_VOLUME_DESC 1 #define UDF_TAGID_ANCHOR_VOLUME_DESC_PTR 2 #define UDF_TAGID_IMPL_USE_VOLUME_DESC 4 #define UDF_TAGID_PARTITION_DESC 5 #define UDF_TAGID_LOGICAL_VOLUME_DESC 6 #define UDF_TAGID_UNALLOCATED_SPACE_DESC 7 #define UDF_TAGID_TERMINATING_DESC 8 #define UDF_TAGID_LOGICAL_VOLUME_INTEGRITY_DESC 9 #define UDF_TAGID_FILE_SET_DESC 256 #define UDF_TAGID_FILE_IDENT_DESC 257 #define UDF_TAGID_FILE_ENTRY 261 #define UDF_TAGID_EXT_ATTRIBUTE_HEADER_DESC 262 typedef struct udf_extent_ad_ { /* ECMA-167 3/7.1 */ /*0*/ udf_Uint32 extent_length; /*4*/ udf_Uint32 extent_location; /*8*/ } udf_extent_ad; typedef struct udf_charspec_ { /* ECMA-167 1/7.2.1 */ /* 0*/ udf_Uint8 character_set_type; /* 1*/ udf_byte character_set_info[63]; /*64*/ } udf_charspec; typedef struct udf_EntityID_ { /* ECMA-167 1/7.4 */ /* 0*/ udf_Uint8 flags; /* 1*/ udf_byte ident[23]; /*24*/ udf_byte ident_suffix[8]; /*32*/ } udf_EntityID; #define UDF_ENTITYID_FLAG_PROTECTED 2 /* ECMA-167 1/7.4.1 */ typedef struct udf_lb_addr_ { /* ECMA-167 4/7.1 */ /*0*/ udf_Uint32 logical_block_number; /*4*/ udf_Uint16 partition_reference_number; /*6*/ } udf_lb_addr; typedef struct udf_short_ad_ { /* ECMA-167 4/14.14.1 */ /*0*/ udf_Uint32 extent_length; /*4*/ udf_Uint32 extent_position; /*8*/ } udf_short_ad; typedef struct udf_long_ad_impl_use_field_ { /* UDF 2.01 2.3.4.3 */ /*0*/ udf_Uint16 flags; /*2*/ udf_Uint32 unique_id; /*6*/ } udf_long_ad_impl_use_field; typedef struct udf_long_ad_ { /* ECMA-167 4/14.14.2 */ /* 0*/ udf_Uint32 extent_length; /* 4*/ udf_lb_addr extent_location; /*10*/ udf_long_ad_impl_use_field impl_use; /*16*/ } udf_long_ad; typedef struct udf_timestamp_ { /* TR/71 1.5.4 */ /* 0*/ udf_Uint16 type_and_time_zone; /* 2*/ udf_Uint16 year; /* 4*/ udf_Uint8 month; /* 5*/ udf_Uint8 day; /* 6*/ udf_Uint8 hour; /* 7*/ udf_Uint8 minute; /* 8*/ udf_Uint8 second; /* 9*/ udf_Uint8 centiseconds; /*10*/ udf_Uint8 hundreds_of_microseconds; /*11*/ udf_Uint8 microseconds; /*12*/ } udf_timestamp; typedef struct udf_volume_recognition_desc_ { /* TR/71 2.4.{1,2,3} */ udf_Uint8 structure_type; udf_byte standard_identifier[5]; udf_Uint8 structure_version; udf_zerobyte structure_data[2041]; } udf_volume_recognition_desc; typedef struct udf_anchor_volume_desc_ptr_ { /* TR/71 2.5.1 */ /* 0*/ udf_tag desc_tag; /* 16*/ udf_extent_ad main_volume_desc_seq_extent; /* 24*/ udf_extent_ad reserve_volume_desc_seq_extent; /* 32*/ udf_zerobyte reserved[480]; /*512*/ } udf_anchor_volume_desc_ptr; typedef struct udf_primary_volume_desc_ { /* TR/71 2.6.1 */ /* 0*/ udf_tag desc_tag; /* 16*/ udf_Uint32 volume_desc_seq_number; /* 20*/ udf_Uint32 primary_volume_desc_number; /* 24*/ udf_dstring volume_ident[32]; /* 56*/ udf_Uint16 volume_seq_number; /* 58*/ udf_Uint16 maximum_volume_seq_number; /* 60*/ udf_Uint16 interchange_level; /* 62*/ udf_Uint16 maximum_interchange_level; /* 64*/ udf_Uint32 character_set_list; /* 68*/ udf_Uint32 maximum_character_set_list; /* 72*/ udf_dstring volume_set_ident[128]; /*200*/ udf_charspec desc_character_set; /*264*/ udf_charspec explanatory_character_set; /*328*/ udf_extent_ad volume_abstract; /*336*/ udf_extent_ad volume_copyright_notice; /*344*/ udf_EntityID application_ident; /*376*/ udf_timestamp recording_date_and_time; /*388*/ udf_EntityID impl_ident; /*420*/ udf_byte impl_use[64]; /*484*/ udf_Uint32 predecessor_volume_desc_seq_location; /*488*/ udf_Uint16 flags; /*490*/ udf_zerobyte reserved[22]; /*512*/ } udf_primary_volume_desc; typedef struct udf_impl_use_volume_desc_impl_use_field_ { /* TR/71 2.6.3 */ /* 0*/ udf_charspec lvi_charset; /* 64*/ udf_dstring logical_volume_ident[128]; /*192*/ udf_dstring lv_info1[36]; /*228*/ udf_dstring lv_info2[36]; /*264*/ udf_dstring lv_info3[36]; /*300*/ udf_EntityID impl_id; /*332*/ udf_byte impl_use[128]; /*460*/ } udf_impl_use_volume_desc_impl_use_field; typedef struct udf_impl_use_volume_desc_ { /* TR/71 2.6.2 */ /* 0*/ udf_tag desc_tag; /* 16*/ udf_Uint32 volume_desc_seq_number; /* 20*/ udf_EntityID impl_ident; /* 52*/ udf_impl_use_volume_desc_impl_use_field impl_use; /*512*/ } udf_impl_use_volume_desc; typedef struct udf_partition_desc_ { /* TR/71 2.6.4 */ /* 0*/ udf_tag desc_tag; /* 16*/ udf_Uint32 volume_desc_seq_number; /* 20*/ udf_Uint16 partition_flags; /* 22*/ udf_Uint16 partition_number; /* 24*/ udf_EntityID partition_contents; /* 56*/ udf_byte partition_contents_use[128]; /*184*/ udf_Uint32 access_type; /*188*/ udf_Uint32 partition_starting_location; /*192*/ udf_Uint32 partition_length; /*196*/ udf_EntityID impl_ident; /*228*/ udf_byte impl_use[128]; /*356*/ udf_zerobyte reserved[156]; /*512*/ } udf_partition_desc; #define UDF_PARTITION_FLAG_ALLOCATED 1 /* ECMA-167 3/10.5.3 */ #define UDF_ACCESSTYPE_READONLY 1 /* ECMA-167 3/10.5.7 */ typedef struct udf_type_1_partition_map_ { /* TR/71 2.6.8 */ /*0*/ udf_Uint8 partition_map_type; /*1*/ udf_Uint8 partition_map_length; /*2*/ udf_Uint16 volume_seq_number; /*4*/ udf_Uint16 partition_number; /*6*/ } udf_type_1_partition_map; #define UDF_PARTITION_MAP_TYPE_1 1 typedef struct udf_logical_volume_desc_ { /* TR/71 2.6.7 */ /* 0*/ udf_tag desc_tag; /* 16*/ udf_Uint32 volume_desc_seq_number; /* 20*/ udf_charspec desc_character_set; /* 84*/ udf_dstring logical_volume_ident[128]; /*212*/ udf_Uint32 logical_block_size; /*216*/ udf_EntityID domain_ident; /*248*/ udf_long_ad logical_volume_contents_use; /*264*/ udf_Uint32 map_table_length; /*268*/ udf_Uint32 number_of_partition_maps; /*272*/ udf_EntityID impl_ident; /*304*/ udf_byte impl_use[128]; /*432*/ udf_extent_ad integrity_seq_extent; /*440*/ udf_type_1_partition_map partition_map[1]; /*446*/ } udf_logical_volume_desc; typedef struct udf_unallocated_space_desc_ { /* TR/71 2.6.9 */ /* 0*/ udf_tag desc_tag; /*16*/ udf_Uint32 volume_desc_seq_number; /*20*/ udf_Uint32 number_of_allocation_descs; /*24*/ /*udf_extent_ad allocation_descs[0];*/ } udf_unallocated_space_desc; typedef struct udf_terminating_desc_ { /* TR/71 2.6.10 */ /* 0*/ udf_tag desc_tag; /* 16*/ udf_zerobyte reserved[496]; /*512*/ } udf_terminating_desc; typedef struct udf_logical_volume_integrity_desc_impl_use_field_ { /* TR/71 2.7.3 */ /* 0*/ udf_EntityID impl_id; /*32*/ udf_Uint32 number_of_files; /*36*/ udf_Uint32 number_of_directories; /*40*/ udf_Uint16 minimum_udf_read_revision; /*42*/ udf_Uint16 minimum_udf_write_revision; /*44*/ udf_Uint16 maximum_udf_write_revision; /*46*/ /*udf_byte impl_use[0];*/ } udf_logical_volume_integrity_desc_impl_use_field; typedef struct udf_logical_volume_integrity_desc_contents_use_field_ { /* TR/71 2.7.2 */ udf_Uint64 unique_id; udf_zerobyte reserved[24]; } udf_logical_volume_integrity_desc_contents_use_field; typedef struct udf_logical_volume_integrity_desc_ { /* TR/71 2.7.1 */ /* 0*/ udf_tag desc_tag; /*16*/ udf_timestamp recording_date; /*28*/ udf_Uint32 integrity_type; /*32*/ udf_extent_ad next_integrity_extent; /*40*/ udf_logical_volume_integrity_desc_contents_use_field logical_volume_contents_use; /*72*/ udf_Uint32 number_of_partitions; /*76*/ udf_Uint32 length_of_impl_use; /*80*/ udf_Uint32 free_space_table; /*84*/ udf_Uint32 size_table; /*88*/ udf_logical_volume_integrity_desc_impl_use_field impl_use; } udf_logical_volume_integrity_desc; #define UDF_INTEGRITY_TYPE_CLOSE 1 /* ECMA-167 3/10.10.3 */ typedef struct udf_file_set_desc_ { /* TR/71 3.3.1 */ /* 0*/ udf_tag desc_tag; /*16*/ udf_timestamp recording_date_and_time; /*28*/ udf_Uint16 interchange_level; /*30*/ udf_Uint16 maximum_interchange_level; /*32*/ udf_Uint32 character_set_list; /*36*/ udf_Uint32 maximum_character_set_list; /*40*/ udf_Uint32 file_set_number; /*44*/ udf_Uint32 file_set_desc_number; /*48*/ udf_charspec logical_volume_ident_character_set; /*112*/ udf_dstring logical_volume_ident[128]; /*240*/ udf_charspec file_set_character_set; /*304*/ udf_dstring file_set_ident[32]; /*336*/ udf_dstring copyright_file_ident[32]; /*368*/ udf_dstring abstract_file_ident[32]; /*400*/ udf_long_ad root_directory_icb; /*416*/ udf_EntityID domain_ident; /*448*/ udf_long_ad next_extent; /*464*/ udf_zerobyte reserved[48]; /*512*/ } udf_file_set_desc; typedef struct udf_file_ident_desc_ { /* TR/71 3.4.1 */ /* 0*/ udf_tag desc_tag; /*16*/ udf_Uint16 file_version_number; /*18*/ udf_Uint8 file_characteristics; /*19*/ udf_Uint8 length_of_file_ident; /*20*/ udf_long_ad icb; /*36*/ udf_Uint16 length_of_impl_use; /*38*/ /*udf_EntityID impl_use;*/ /*38*/ udf_dchar file_ident[1]; /*udf_zerobyte padding[0/1/2/3];*/ } udf_file_ident_desc; #define UDF_FILE_CHARACTERISTIC_HIDDEN 1 /* ECMA-167 4/14.4.3 */ #define UDF_FILE_CHARACTERISTIC_DIRECTORY 2 #define UDF_FILE_CHARACTERISTIC_DELETED 4 #define UDF_FILE_CHARACTERISTIC_PARENT 8 typedef struct udf_icbtag_ { /* TR/71 3.5.2 */ /* 0*/ udf_Uint32 prior_recorded_number_of_direct_entries; /* 4*/ udf_Uint16 strategy_type; /* 6*/ udf_Uint16 strategy_parameter; /* 8*/ udf_Uint16 maximum_number_of_entries; /*10*/ udf_zerobyte reserved; /*11*/ udf_Uint8 file_type; /*12*/ udf_lb_addr parent_icb_location; /*18*/ udf_Uint16 flags; /*20*/ } udf_icbtag; #define UDF_ICBTAG_FILETYPE_DIRECTORY 4 /* ECMA-167 4/14.6.6 */ #define UDF_ICBTAG_FILETYPE_BYTESEQ 5 #define UDF_ICBTAG_FLAG_MASK_AD_TYPE 7 /* TR/71 3.5.3 */ #define UDF_ICBTAG_FLAG_SHORT_AD 0 #define UDF_ICBTAG_FLAG_DIRECTORY_SORT 8 #define UDF_ICBTAG_FLAG_NONRELOCATABLE 16 #define UDF_ICBTAG_FLAG_ARCHIVE 32 #define UDF_ICBTAG_FLAG_SETUID 64 #define UDF_ICBTAG_FLAG_SETGID 128 #define UDF_ICBTAG_FLAG_STICKY 256 #define UDF_ICBTAG_FLAG_CONTIGUOUS 512 #define UDF_ICBTAG_FLAG_SYSTEM 1024 #define UDF_ICBTAG_FLAG_TRANSFORMED 2048 #define UDF_ICBTAG_FLAG_MULTI_VERSIONS 4096 typedef struct udf_ext_attribute_header_desc_ { /* TR/71 3.6.1 */ /* 0*/ udf_tag desc_tag; /*16*/ udf_Uint32 impl_attributes_location; /*20*/ udf_Uint32 application_attributes_location; /*24*/ } udf_ext_attribute_header_desc; typedef struct udf_ext_attribute_free_ea_space_ { /* TR/71 3.6.{2,3} */ /* 0*/ udf_Uint32 attribute_type; /* = 2048 */ /* 4*/ udf_Uint8 attribute_subtype; /* = 1 */ /* 5*/ udf_zerobyte reserved[3]; /* 8*/ udf_Uint32 attribute_length; /* = 52 */ /*12*/ udf_Uint32 impl_use_length; /* = 4 */ /*16*/ udf_EntityID impl_ident; /* "*UDF FreeEASpace" */ /*48*/ udf_Uint16 header_checksum; /*50*/ udf_Uint16 free_ea_space; /* = 0 */ /*52*/ } udf_ext_attribute_free_ea_space; typedef struct udf_ext_attribute_dvd_cgms_info_ { /* TR/71 3.6.{2,4} */ /* 0*/ udf_Uint32 attribute_type; /* = 2048 */ /* 4*/ udf_Uint8 attribute_subtype; /* = 1 */ /* 5*/ udf_zerobyte reserved[3]; /* 8*/ udf_Uint32 attribute_length; /* = 56 */ /*12*/ udf_Uint32 impl_use_length; /* = 8 */ /*16*/ udf_EntityID impl_ident; /* "*UDF DVD CGMS Info" */ /*48*/ udf_Uint16 header_checksum; /*50*/ udf_byte cgms_info; /*51*/ udf_Uint8 data_structure_type; /*52*/ udf_byte protection_system_info[4]; /*56*/ } udf_ext_attribute_dvd_cgms_info; #define UDF_CGMSINFO_NO_COPIES 48 /* TR/71 3.6.4 */ #define UDF_CGMSINFO_ONE_GENERATION 32 #define UDF_CGMSINFO_UNLIMITED_COPIES 0 #define UDF_CGMSINFO_FLAG_COPYRIGHTED_MATERIAL 128 typedef struct udf_file_entry_ { /* TR/71 3.5.1 */ /* 0*/ udf_tag desc_tag; /*16*/ udf_icbtag icb_tag; /*36*/ udf_Uint32 uid; /*40*/ udf_Uint32 gid; /*44*/ udf_Uint32 permissions; /*48*/ udf_Uint16 file_link_count; /*50*/ udf_Uint8 record_format; /*51*/ udf_Uint8 record_display_attributes; /*52*/ udf_Uint32 record_length; /*56*/ udf_Uint64 info_length; /*64*/ udf_Uint64 logical_blocks_recorded; /*72*/ udf_timestamp access_time; /*84*/ udf_timestamp modification_time; /*96*/ udf_timestamp attribute_time; /*108*/ udf_Uint32 checkpoint; /*112*/ udf_long_ad ext_attribute_icb; /*128*/ udf_EntityID impl_ident; /*160*/ udf_Uint64 unique_id; /*168*/ udf_Uint32 length_of_ext_attributes; /*172*/ udf_Uint32 length_of_allocation_descs; #if 0 /*176*/ udf_ext_attribute_header_desc ext_attribute_header; /*200*/ udf_ext_attribute_free_ea_space ext_attribute_free_ea_space; /*252*/ udf_ext_attribute_dvd_cgms_info ext_attribute_dvd_cgms_info; /*308*/ udf_short_ad allocation_desc; /*316*/ #else /*176*/ udf_short_ad allocation_desc; /*184*/ #endif } udf_file_entry; /* * (U,G,O) = (owner, group, other) * (X,R) = (execute, read) * * There are Write, Change Attribute and Delete permissions also, * but it is not permitted to set them on DVD Read-Only media. */ #define UDF_FILEENTRY_PERMISSION_OX 1 /* TR/71 3.5.4 */ #define UDF_FILEENTRY_PERMISSION_OR 4 #define UDF_FILEENTRY_PERMISSION_GX 32 #define UDF_FILEENTRY_PERMISSION_GR 128 #define UDF_FILEENTRY_PERMISSION_UX 1024 #define UDF_FILEENTRY_PERMISSION_UR 4096 #endif /* _UDF_FS_H */ cdrkit-1.1.11/genisoimage/sha512.c0000644000372500001440000002543611264421657015604 0ustar steveusers/* Functions to compute SHA512 message digest of files or memory blocks. according to the definition of SHA512 in FIPS 180-2. Copyright (C) 2007 Free Software Foundation, Inc. Copied here from the GNU C Library version 2.7 on the 10 May 2009 by Steve McIntyre <93sam@debian.org>. This code was under LGPL v2.1 in glibc, and that license gives us the option to use and distribute the code under the terms of the GPL v2 instead. I'm taking that option. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Ulrich Drepper , 2007. */ #include #include #include #include #include "sha512.h" #if __BYTE_ORDER == __LITTLE_ENDIAN # ifdef _LIBC # include # define SWAP(n) bswap_64 (n) # else # define SWAP(n) \ (((n) << 56) \ | (((n) & 0xff00) << 40) \ | (((n) & 0xff0000) << 24) \ | (((n) & 0xff000000) << 8) \ | (((n) >> 8) & 0xff000000) \ | (((n) >> 24) & 0xff0000) \ | (((n) >> 40) & 0xff00) \ | ((n) >> 56)) # endif #else # define SWAP(n) (n) #endif /* This array contains the bytes used to pad the buffer to the next 64-byte boundary. (FIPS 180-2:5.1.2) */ static const unsigned char fillbuf[128] = { 0x80, 0 /* , 0, 0, ... */ }; /* Constants for SHA512 from FIPS 180-2:4.2.3. */ static const uint64_t K[80] = { UINT64_C (0x428a2f98d728ae22), UINT64_C (0x7137449123ef65cd), UINT64_C (0xb5c0fbcfec4d3b2f), UINT64_C (0xe9b5dba58189dbbc), UINT64_C (0x3956c25bf348b538), UINT64_C (0x59f111f1b605d019), UINT64_C (0x923f82a4af194f9b), UINT64_C (0xab1c5ed5da6d8118), UINT64_C (0xd807aa98a3030242), UINT64_C (0x12835b0145706fbe), UINT64_C (0x243185be4ee4b28c), UINT64_C (0x550c7dc3d5ffb4e2), UINT64_C (0x72be5d74f27b896f), UINT64_C (0x80deb1fe3b1696b1), UINT64_C (0x9bdc06a725c71235), UINT64_C (0xc19bf174cf692694), UINT64_C (0xe49b69c19ef14ad2), UINT64_C (0xefbe4786384f25e3), UINT64_C (0x0fc19dc68b8cd5b5), UINT64_C (0x240ca1cc77ac9c65), UINT64_C (0x2de92c6f592b0275), UINT64_C (0x4a7484aa6ea6e483), UINT64_C (0x5cb0a9dcbd41fbd4), UINT64_C (0x76f988da831153b5), UINT64_C (0x983e5152ee66dfab), UINT64_C (0xa831c66d2db43210), UINT64_C (0xb00327c898fb213f), UINT64_C (0xbf597fc7beef0ee4), UINT64_C (0xc6e00bf33da88fc2), UINT64_C (0xd5a79147930aa725), UINT64_C (0x06ca6351e003826f), UINT64_C (0x142929670a0e6e70), UINT64_C (0x27b70a8546d22ffc), UINT64_C (0x2e1b21385c26c926), UINT64_C (0x4d2c6dfc5ac42aed), UINT64_C (0x53380d139d95b3df), UINT64_C (0x650a73548baf63de), UINT64_C (0x766a0abb3c77b2a8), UINT64_C (0x81c2c92e47edaee6), UINT64_C (0x92722c851482353b), UINT64_C (0xa2bfe8a14cf10364), UINT64_C (0xa81a664bbc423001), UINT64_C (0xc24b8b70d0f89791), UINT64_C (0xc76c51a30654be30), UINT64_C (0xd192e819d6ef5218), UINT64_C (0xd69906245565a910), UINT64_C (0xf40e35855771202a), UINT64_C (0x106aa07032bbd1b8), UINT64_C (0x19a4c116b8d2d0c8), UINT64_C (0x1e376c085141ab53), UINT64_C (0x2748774cdf8eeb99), UINT64_C (0x34b0bcb5e19b48a8), UINT64_C (0x391c0cb3c5c95a63), UINT64_C (0x4ed8aa4ae3418acb), UINT64_C (0x5b9cca4f7763e373), UINT64_C (0x682e6ff3d6b2b8a3), UINT64_C (0x748f82ee5defb2fc), UINT64_C (0x78a5636f43172f60), UINT64_C (0x84c87814a1f0ab72), UINT64_C (0x8cc702081a6439ec), UINT64_C (0x90befffa23631e28), UINT64_C (0xa4506cebde82bde9), UINT64_C (0xbef9a3f7b2c67915), UINT64_C (0xc67178f2e372532b), UINT64_C (0xca273eceea26619c), UINT64_C (0xd186b8c721c0c207), UINT64_C (0xeada7dd6cde0eb1e), UINT64_C (0xf57d4f7fee6ed178), UINT64_C (0x06f067aa72176fba), UINT64_C (0x0a637dc5a2c898a6), UINT64_C (0x113f9804bef90dae), UINT64_C (0x1b710b35131c471b), UINT64_C (0x28db77f523047d84), UINT64_C (0x32caab7b40c72493), UINT64_C (0x3c9ebe0a15c9bebc), UINT64_C (0x431d67c49c100d4c), UINT64_C (0x4cc5d4becb3e42b6), UINT64_C (0x597f299cfc657e2a), UINT64_C (0x5fcb6fab3ad6faec), UINT64_C (0x6c44198c4a475817) }; /* Process LEN bytes of BUFFER, accumulating context into CTX. It is assumed that LEN % 128 == 0. */ static void sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx) { const uint64_t *words = buffer; size_t nwords = len / sizeof (uint64_t); uint64_t a = ctx->H[0]; uint64_t b = ctx->H[1]; uint64_t c = ctx->H[2]; uint64_t d = ctx->H[3]; uint64_t e = ctx->H[4]; uint64_t f = ctx->H[5]; uint64_t g = ctx->H[6]; uint64_t h = ctx->H[7]; /* First increment the byte count. FIPS 180-2 specifies the possible length of the file up to 2^128 bits. Here we only compute the number of bytes. Do a double word increment. */ ctx->total[0] += len; if (ctx->total[0] < len) ++ctx->total[1]; /* Process all bytes in the buffer with 128 bytes in each round of the loop. */ while (nwords > 0) { uint64_t W[80]; uint64_t a_save = a; uint64_t b_save = b; uint64_t c_save = c; uint64_t d_save = d; uint64_t e_save = e; uint64_t f_save = f; uint64_t g_save = g; uint64_t h_save = h; unsigned int t; /* Operators defined in FIPS 180-2:4.1.2. */ #define Ch(x, y, z) ((x & y) ^ (~x & z)) #define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) #define S0(x) (CYCLIC (x, 28) ^ CYCLIC (x, 34) ^ CYCLIC (x, 39)) #define S1(x) (CYCLIC (x, 14) ^ CYCLIC (x, 18) ^ CYCLIC (x, 41)) #define R0(x) (CYCLIC (x, 1) ^ CYCLIC (x, 8) ^ (x >> 7)) #define R1(x) (CYCLIC (x, 19) ^ CYCLIC (x, 61) ^ (x >> 6)) /* It is unfortunate that C does not provide an operator for cyclic rotation. Hope the C compiler is smart enough. */ #define CYCLIC(w, s) ((w >> s) | (w << (64 - s))) /* Compute the message schedule according to FIPS 180-2:6.3.2 step 2. */ for (t = 0; t < 16; ++t) { W[t] = SWAP (*words); ++words; } for (t = 16; t < 80; ++t) W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16]; /* The actual computation according to FIPS 180-2:6.3.2 step 3. */ for (t = 0; t < 80; ++t) { uint64_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t]; uint64_t T2 = S0 (a) + Maj (a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; } /* Add the starting values of the context according to FIPS 180-2:6.3.2 step 4. */ a += a_save; b += b_save; c += c_save; d += d_save; e += e_save; f += f_save; g += g_save; h += h_save; /* Prepare for the next round. */ nwords -= 16; } /* Put checksum in context given as argument. */ ctx->H[0] = a; ctx->H[1] = b; ctx->H[2] = c; ctx->H[3] = d; ctx->H[4] = e; ctx->H[5] = f; ctx->H[6] = g; ctx->H[7] = h; } /* Initialize structure containing state of computation. (FIPS 180-2:5.3.3) */ void sha512_init_ctx (ctx) struct sha512_ctx *ctx; { ctx->H[0] = UINT64_C (0x6a09e667f3bcc908); ctx->H[1] = UINT64_C (0xbb67ae8584caa73b); ctx->H[2] = UINT64_C (0x3c6ef372fe94f82b); ctx->H[3] = UINT64_C (0xa54ff53a5f1d36f1); ctx->H[4] = UINT64_C (0x510e527fade682d1); ctx->H[5] = UINT64_C (0x9b05688c2b3e6c1f); ctx->H[6] = UINT64_C (0x1f83d9abfb41bd6b); ctx->H[7] = UINT64_C (0x5be0cd19137e2179); ctx->total[0] = ctx->total[1] = 0; ctx->buflen = 0; } /* Process the remaining bytes in the internal buffer and the usual prolog according to the standard and write the result to RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * sha512_finish_ctx (ctx, resbuf) struct sha512_ctx *ctx; void *resbuf; { /* Take yet unprocessed bytes into account. */ uint64_t bytes = ctx->buflen; size_t pad; unsigned int i; /* Now count remaining bytes. */ ctx->total[0] += bytes; if (ctx->total[0] < bytes) ++ctx->total[1]; pad = bytes >= 112 ? 128 + 112 - bytes : 112 - bytes; memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 128-bit file length in *bits* at the end of the buffer. */ *(uint64_t *) &ctx->buffer[bytes + pad + 8] = SWAP (ctx->total[0] << 3); *(uint64_t *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 61)); /* Process last bytes. */ sha512_process_block (ctx->buffer, bytes + pad + 16, ctx); /* Put result from CTX in first 64 bytes following RESBUF. */ for (i = 0; i < 8; ++i) ((uint64_t *) resbuf)[i] = SWAP (ctx->H[i]); return resbuf; } void sha512_process_bytes (buffer, len, ctx) const void *buffer; size_t len; struct sha512_ctx *ctx; { /* When we already have some bits in our internal buffer concatenate both inputs first. */ if (ctx->buflen != 0) { size_t left_over = ctx->buflen; size_t add = 256 - left_over > len ? len : 256 - left_over; memcpy (&ctx->buffer[left_over], buffer, add); ctx->buflen += add; if (ctx->buflen > 128) { sha512_process_block (ctx->buffer, ctx->buflen & ~127, ctx); ctx->buflen &= 127; /* The regions in the following copy operation cannot overlap. */ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~127], ctx->buflen); } buffer = (const char *) buffer + add; len -= add; } /* Process available complete blocks. */ if (len >= 128) { #if !_STRING_ARCH_unaligned /* To check alignment gcc has an appropriate operator. Other compilers don't. */ # if __GNUC__ >= 2 # define UNALIGNED_P(p) (((uintptr_t) p) % __alignof__ (uint64_t) != 0) # else # define UNALIGNED_P(p) (((uintptr_t) p) % sizeof (uint64_t) != 0) # endif if (UNALIGNED_P (buffer)) while (len > 128) { sha512_process_block (memcpy (ctx->buffer, buffer, 128), 128, ctx); buffer = (const char *) buffer + 128; len -= 128; } else #endif { sha512_process_block (buffer, len & ~127, ctx); buffer = (const char *) buffer + (len & ~127); len &= 127; } } /* Move remaining bytes into internal buffer. */ if (len > 0) { size_t left_over = ctx->buflen; memcpy (&ctx->buffer[left_over], buffer, len); left_over += len; if (left_over >= 128) { sha512_process_block (ctx->buffer, 128, ctx); left_over -= 128; memcpy (ctx->buffer, &ctx->buffer[128], left_over); } ctx->buflen = left_over; } } cdrkit-1.1.11/genisoimage/jte.c0000644000372500001440000007042511451116647015357 0ustar steveusers/* * jte.c * * Copyright (c) 2004-2006 Steve McIntyre * * Implementation of the Jigdo Template Engine - make jigdo files * directly when making ISO images * * GNU GPL v2 */ #include #include "genisoimage.h" #include #include #include #include #include #ifdef SORTING #include "match.h" #endif /* SORTING */ #include #include #ifdef DVD_VIDEO #include "dvd_reader.h" #include "dvd_file.h" #include "ifo_read.h" #include "endianconv.h" #include "checksum.h" #endif #ifdef APPLE_HYB #include #endif #ifdef VMS #include "vms.h" #endif /* Different types used in building our state list below */ #define JTET_FILE_MATCH 1 #define JTET_NOMATCH 2 #define JTE_VER_MAJOR 0x0001 #define JTE_VER_MINOR 0x0013 #define JTE_NAME "JTE" #define JTE_COMMENT "JTE at http://www.einval.com/~steve/software/JTE/ ; jigdo at http://atterer.org/jigdo/" #define JIGDO_TEMPLATE_VERSION "1.1" /* Simple list to hold the results of -jigdo-exclude and -jigdo-force-match command line options. Seems easiest to do this using regexps. */ struct path_match { regex_t match_pattern; char *match_rule; struct path_match *next; }; /* List of mappings e.g. Debian=/mirror/debian */ struct path_mapping { char *from; char *to; struct path_mapping *next; }; FILE *jtjigdo = NULL; /* File handle used throughout for the jigdo file */ FILE *jttemplate = NULL; /* File handle used throughout for the template file */ char *jjigdo_out = NULL; /* Output name for jigdo .jigdo file; NULL means don't do it */ char *jtemplate_out = NULL; /* Output name for jigdo template file; NULL means don't do it */ char *jmd5_list = NULL; /* Name of file to use for MD5 checking */ int jte_min_size = MIN_JIGDO_FILE_SIZE; jtc_t jte_template_compression = JTE_TEMP_GZIP; struct path_match *exclude_list = NULL; struct path_match *include_list = NULL; struct path_mapping *map_list = NULL; unsigned long long template_size = 0; unsigned long long image_size = 0; int checksum_algo_iso = (CHECK_MD5_USED | \ CHECK_SHA1_USED | \ CHECK_SHA256_USED | \ CHECK_SHA512_USED); int checksum_algo_tmpl = CHECK_MD5_USED; static checksum_context_t *iso_context = NULL; static checksum_context_t *template_context = NULL; /* List of files that we've seen, ready to write into the template and jigdo files */ typedef struct _file_entry { unsigned char md5[16]; off_t file_length; unsigned long long rsyncsum; char *filename; } file_entry_t; typedef struct _unmatched_entry { off_t uncompressed_length; } unmatched_entry_t; typedef struct _entry { int entry_type; /* JTET_TYPE as above */ struct _entry *next; union { file_entry_t file; unmatched_entry_t chunk; } data; } entry_t; typedef struct _jigdo_file_entry { unsigned char type; unsigned char fileLen[6]; unsigned char fileRsync[8]; unsigned char fileMD5[16]; } jigdo_file_entry_t; typedef struct _jigdo_chunk_entry { unsigned char type; unsigned char skipLen[6]; } jigdo_chunk_entry_t; typedef struct _jigdo_image_entry { unsigned char type; unsigned char imageLen[6]; unsigned char imageMD5[16]; unsigned char blockLen[4]; } jigdo_image_entry_t; typedef struct _md5_list_entry { struct _md5_list_entry *next; unsigned char MD5[16]; unsigned long long size; char *filename; } md5_list_entry_t; entry_t *entry_list = NULL; entry_t *entry_last = NULL; FILE *t_file = NULL; FILE *j_file = NULL; int num_matches = 0; int num_chunks = 0; md5_list_entry_t *md5_list = NULL; md5_list_entry_t *md5_last = NULL; /* Grab the file component from a full path */ static char *file_base_name(char *path) { char *endptr = path; char *ptr = path; while (*ptr != '\0') { if ('/' == *ptr) endptr = ++ptr; else ++ptr; } return endptr; } /* Build the list of exclusion regexps */ extern int jte_add_exclude(char *pattern) { struct path_match *new = NULL; new = malloc(sizeof *new); if (!new) return ENOMEM; regcomp(&new->match_pattern, pattern, REG_NEWLINE); new->match_rule = pattern; /* Order on the exclude list doesn't matter! */ new->next = exclude_list; exclude_list = new; return 0; } /* Check if the file should be excluded because of a filename match. 1 means exclude, 0 means not */ static int check_exclude_by_name(char *filename, char **matched) { struct path_match *ptr = exclude_list; regmatch_t pmatch[1]; int i = 0; while (ptr) { if (!regexec(&ptr->match_pattern, filename, 1, pmatch, 0)) { *matched = ptr->match_rule; return 1; } ptr = ptr->next; } /* Not matched, so return 0 */ return 0; } /* Build the list of required inclusion regexps */ extern int jte_add_include(char *pattern) { struct path_match *new = NULL; new = malloc(sizeof *new); if (!new) return ENOMEM; regcomp(&new->match_pattern, pattern, REG_NEWLINE); new->match_rule = pattern; /* Order on the include list doesn't matter! */ new->next = include_list; include_list = new; return 0; } /* Check if a file has to be MD5-matched to be valid. If we get called here, we've failed to match any of the MD5 entries we were given. If the path to the filename matches one of the paths in our list, clearly it must have been corrupted. Abort with an error. */ static void check_md5_file_match(char *filename) { struct path_match *ptr = include_list; regmatch_t pmatch[1]; int i = 0; while (ptr) { if (!regexec(&ptr->match_pattern, filename, 1, pmatch, 0)) { #ifdef USE_LIBSCHILY comerr("File %s should have matched an MD5 entry, but didn't! (Rule '%s')\n", filename, ptr->match_rule); #else fprintf(stderr, "File %s should have matched an MD5 entry, but didn't! (Rule '%s')\n", filename, ptr->match_rule); exit(1); #endif } ptr = ptr->next; } } /* Should we list a file separately in the jigdo output, or should we just dump it into the template file as binary data? Three things cases to look for here: 1. Small files are better simply folded in, as they take less space that way. 2. Files in /doc (for example) may change in the archive all the time and it's better to not have to fetch snapshot copies if we can avoid it. 3. Files living in specified paths *must* match an entry in the md5-list, or they must have been corrupted. If we find a corrupt file, bail out with an error. */ extern int list_file_in_jigdo(char *filename, off_t size, char **realname, unsigned char md5[16]) { char *matched_rule; md5_list_entry_t *entry = md5_list; int md5sum_done = 0; if (!jtemplate_out) return 0; memset(md5, 0, sizeof(md5)); /* Cheaper to check file size first */ if (size < jte_min_size) { if (verbose > 1) fprintf(stderr, "Jigdo-ignoring file %s; it's too small\n", filename); return 0; } /* Now check the excluded list by name */ if (check_exclude_by_name(filename, &matched_rule)) { if (verbose > 1) fprintf(stderr, "Jigdo-ignoring file %s; it's covered in the exclude list by \"%s\"\n", filename, matched_rule); return 0; } /* Check to see if the file is in our md5 list. Check three things: 1. the size 2. the filename 3. (only if the first 2 match) the md5sum If we get a match for all three, include the file and return the full path to the file that we have gleaned from the mirror. */ while (entry) { if (size == entry->size) { if (!strcmp(file_base_name(filename), file_base_name(entry->filename))) { if (!md5sum_done) { calculate_md5sum(filename, size, md5); md5sum_done = 1; } if (!memcmp(md5, entry->MD5, sizeof(entry->MD5))) { *realname = entry->filename; return 1; } } } entry = entry->next; } /* We haven't found an entry in our MD5 list to match this * file. If we should have done, complain and bail out. */ check_md5_file_match(filename); return 0; } /* Add a mapping of pathnames (e.g. Debian=/mirror/debian). We should be passed TO=FROM here */ extern int jte_add_mapping(char *arg) { int error = 0; struct path_mapping *new = NULL; struct path_mapping *entry = NULL; char *p = arg; char *from = NULL; char *to = NULL; /* Find the "=" in the string passed. Set it to NULL and we can use the string in-place */ while (*p) { if ('=' == *p) { *p = 0; p++; to = arg; from = p; } p++; } if (!from || !strlen(from) || !to || !strlen(to)) return EINVAL; new = malloc(sizeof(*new)); if (!new) return ENOMEM; new->from = from; new->to = to; new->next = NULL; if (verbose > 0) fprintf(stderr, "Adding mapping from %s to %s for the jigdo file\n", from, to); if (!map_list) map_list = new; else { /* Order is important; add to the end of the list */ entry = map_list; while (NULL != entry->next) entry = entry->next; entry->next = new; } return 0; } /* Check if the filename should be remapped; if so map it, otherwise return the original name. */ static char *remap_filename(char *filename) { char *new_name = filename; struct path_mapping *entry = map_list; while (entry) { if (!strncmp(filename, entry->from, strlen(entry->from))) { new_name = calloc(1, 2 + strlen(filename) + strlen(entry->to) - strlen(entry->from)); if (!new_name) { fprintf(stderr, "Failed to malloc new filename; abort!\n"); exit(1); } sprintf(new_name, "%s:%s", entry->to, &filename[strlen(entry->from)]); return new_name; } entry = entry->next; } /* No mapping in effect */ return strdup(filename); } /* Write data to the template file and update the MD5 sum */ static size_t template_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) { checksum_update(template_context, ptr, size * nmemb); template_size += (unsigned long long)size * nmemb; return fwrite(ptr, size, nmemb, stream); } /* Create a new template file and initialise it */ static void write_template_header() { char buf[2048]; int i = 0; char *p = buf; memset(buf, 0, sizeof(buf)); template_context = checksum_init_context(checksum_algo_tmpl, "template"); if (!template_context) { #ifdef USE_LIBSCHILY comerr("cannot allocate template checksum contexts\n"); #else fprintf(stderr, "cannot allocate template checksum contexts\n"); exit(1); #endif } i += sprintf(p, "JigsawDownload template %s %s/%d.%d \r\n", JIGDO_TEMPLATE_VERSION, JTE_NAME, JTE_VER_MAJOR, JTE_VER_MINOR); p = &buf[i]; i += sprintf(p, "%s \r\n", JTE_COMMENT); p = &buf[i]; i += sprintf(p, "\r\n"); template_fwrite(buf, i, 1, t_file); } /* Read the MD5 list and build a list in memory for us to use later */ static void add_md5_entry(unsigned char *md5, unsigned long long size, char *filename) { int error = 0; md5_list_entry_t *new = NULL; new = calloc(1, sizeof(md5_list_entry_t)); memcpy(new->MD5, md5, sizeof(new->MD5)); new->size = size; new->filename = strdup(filename); /* Add to the end of the list */ if (NULL == md5_last) { md5_last = new; md5_list = new; } else { md5_last->next = new; md5_last = new; } } /* Parse a 12-digit decimal number */ static unsigned long long parse_number(unsigned char in[12]) { unsigned long long size = 0; int i = 0; for (i = 0; i < 12; i++) { size *= 10; if (isdigit(in[i])) size += (in[i] - '0'); } return size; } /* Read the MD5 list and build a list in memory for us to use later MD5 list format: <---MD5---> <--Size--> <--Filename--> 32 12 remaining */ static void parse_md5_list(void) { FILE *md5_file = NULL; unsigned char buf[1024]; unsigned char md5[16]; char *filename = NULL; unsigned char *numbuf = NULL; int num_files = 0; unsigned long long size = 0; md5_file = fopen(jmd5_list, "rb"); if (!md5_file) { #ifdef USE_LIBSCHILY comerr("cannot read from MD5 list file '%s'\n", jmd5_list); #else fprintf(stderr, "cannot read from MD5 list file '%s'\n", jmd5_list); exit(1); #endif } memset(buf, 0, sizeof(buf)); while (fgets((char *)buf, sizeof(buf), md5_file)) { numbuf = &buf[34]; filename = (char *)&buf[48]; /* Lose the trailing \n from the fgets() call */ if (buf[strlen((char *)buf)-1] == '\n') buf[strlen((char *)buf)-1] = 0; if (mk_MD5Parse(buf, md5)) { #ifdef USE_LIBSCHILY comerr("cannot parse MD5 file '%s'\n", jmd5_list); #else fprintf(stderr, "cannot parse MD5 file '%s'\n", jmd5_list); exit(1); #endif } size = parse_number(numbuf); add_md5_entry(md5, size, filename); memset(buf, 0, sizeof(buf)); num_files++; } if (verbose > 0) fprintf(stderr, "parse_md5_list: added MD5 checksums for %d files\n", num_files); fclose(md5_file); } /* Initialise state and start the jigdo template file */ void write_jt_header(FILE *template_file, FILE *jigdo_file) { t_file = template_file; j_file = jigdo_file; /* Start checksum work for the image */ iso_context = checksum_init_context(checksum_algo_iso, "iso"); if (!iso_context) { #ifdef USE_LIBSCHILY comerr("cannot allocate iso checksum contexts\n"); #else fprintf(stderr, "cannot allocate iso checksum contexts\n"); exit(1); #endif } /* Start the template file */ write_template_header(); /* Load up the MD5 list if we've been given one */ if (jmd5_list) parse_md5_list(); } /* Compress and flush out a buffer full of template data */ static void flush_gzip_chunk(void *buffer, off_t size) { z_stream c_stream; /* compression stream */ unsigned char comp_size_out[6]; unsigned char uncomp_size_out[6]; off_t compressed_size_out = 0; int err = 0; unsigned char *comp_buf = NULL; c_stream.zalloc = NULL; c_stream.zfree = NULL; c_stream.opaque = NULL; err = deflateInit(&c_stream, Z_BEST_COMPRESSION); comp_buf = malloc(2 * size); /* Worst case */ c_stream.next_out = comp_buf; c_stream.avail_out = 2 * size; c_stream.next_in = buffer; c_stream.avail_in = size; err = deflate(&c_stream, Z_NO_FLUSH); err = deflate(&c_stream, Z_FINISH); compressed_size_out = c_stream.total_out + 16; err = deflateEnd(&c_stream); template_fwrite("DATA", 4, 1, t_file); write_le48(compressed_size_out, &comp_size_out[0]); template_fwrite(comp_size_out, sizeof(comp_size_out), 1, t_file); write_le48(size, &uncomp_size_out[0]); template_fwrite(uncomp_size_out, sizeof(uncomp_size_out), 1, t_file); template_fwrite(comp_buf, c_stream.total_out, 1, t_file); free(comp_buf); } /* Compress and flush out a buffer full of template data */ static void flush_bz2_chunk(void *buffer, off_t size) { bz_stream c_stream; /* compression stream */ unsigned char comp_size_out[6]; unsigned char uncomp_size_out[6]; off_t compressed_size_out = 0; int err = 0; unsigned char *comp_buf = NULL; c_stream.bzalloc = NULL; c_stream.bzfree = NULL; c_stream.opaque = NULL; err = BZ2_bzCompressInit(&c_stream, 9, 0, 0); comp_buf = malloc(2 * size); /* Worst case */ c_stream.next_out = comp_buf; c_stream.avail_out = 2 * size; c_stream.next_in = buffer; c_stream.avail_in = size; err = BZ2_bzCompress(&c_stream, BZ_FINISH); compressed_size_out = c_stream.total_out_lo32 + 16; err = BZ2_bzCompressEnd(&c_stream); template_fwrite("BZIP", 4, 1, t_file); write_le48(compressed_size_out, &comp_size_out[0]); template_fwrite(comp_size_out, sizeof(comp_size_out), 1, t_file); write_le48(size, &uncomp_size_out[0]); template_fwrite(uncomp_size_out, sizeof(uncomp_size_out), 1, t_file); template_fwrite(comp_buf, c_stream.total_out_lo32, 1, t_file); free(comp_buf); } static void flush_compressed_chunk(void *buffer, off_t size) { if (jte_template_compression == JTE_TEMP_BZIP2) flush_bz2_chunk(buffer, size); else flush_gzip_chunk(buffer, size); } /* Append to an existing data buffer, and compress/flush it if necessary */ static void write_compressed_chunk(unsigned char *buffer, size_t size) { static unsigned char *uncomp_buf = NULL; static size_t uncomp_size = 0; static size_t uncomp_buf_used = 0; if (!uncomp_buf) { if (jte_template_compression == JTE_TEMP_BZIP2) uncomp_size = 900 * 1024; else uncomp_size = 1024 * 1024; uncomp_buf = malloc(uncomp_size); if (!uncomp_buf) { #ifdef USE_LIBSCHILY comerr("failed to allocate %d bytes for template compression buffer\n", uncomp_size); #else fprintf(stderr, "failed to allocate %d bytes for template compression buffer\n", uncomp_size); exit(1); #endif } } if ((uncomp_buf_used + size) > uncomp_size) { flush_compressed_chunk(uncomp_buf, uncomp_buf_used); uncomp_buf_used = 0; } if (!size) /* Signal a flush before we start writing the DESC entry */ { flush_compressed_chunk(uncomp_buf, uncomp_buf_used); return; } if (!uncomp_buf_used) memset(uncomp_buf, 0, uncomp_size); while (size > uncomp_size) { flush_compressed_chunk(buffer, uncomp_size); buffer += uncomp_size; size -= uncomp_size; } memcpy(&uncomp_buf[uncomp_buf_used], buffer, size); uncomp_buf_used += size; } /* Loop through the list of DESC entries that we've built up and append them to the template file */ static void write_template_desc_entries(off_t image_len) { entry_t *entry = entry_list; off_t desc_len = 0; unsigned char out_len[6]; jigdo_image_entry_t jimage; desc_len = 16 /* DESC + length twice */ + (sizeof(jigdo_file_entry_t) * num_matches) + (sizeof(jigdo_chunk_entry_t) * num_chunks) + sizeof(jigdo_image_entry_t); write_le48(desc_len, &out_len[0]); write_compressed_chunk(NULL, 0); template_fwrite("DESC", 4, 1, t_file); template_fwrite(out_len, sizeof(out_len), 1, t_file); while (entry) { switch (entry->entry_type) { case JTET_FILE_MATCH: { jigdo_file_entry_t jfile; jfile.type = 6; /* Matched file */ write_le48(entry->data.file.file_length, &jfile.fileLen[0]); write_le64(entry->data.file.rsyncsum, &jfile.fileRsync[0]); memcpy(jfile.fileMD5, entry->data.file.md5, sizeof(jfile.fileMD5)); template_fwrite(&jfile, sizeof(jfile), 1, t_file); break; } case JTET_NOMATCH: { jigdo_chunk_entry_t jchunk; jchunk.type = 2; /* Raw data, compressed */ write_le48(entry->data.chunk.uncompressed_length, &jchunk.skipLen[0]); template_fwrite(&jchunk, sizeof(jchunk), 1, t_file); break; } } entry = entry->next; } jimage.type = 5; write_le48(image_len, &jimage.imageLen[0]); checksum_copy(iso_context, CHECK_MD5, &jimage.imageMD5[0]); write_le32(MIN_JIGDO_FILE_SIZE, &jimage.blockLen[0]); template_fwrite(&jimage, sizeof(jimage), 1, t_file); template_fwrite(out_len, sizeof(out_len), 1, t_file); } /* Dump a buffer in jigdo-style "base64" */ static char *base64_dump(unsigned char *buf, size_t buf_size) { const char *b64_enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; int value = 0; unsigned int i; int bits = 0; static char output_buffer[2048]; char *p = output_buffer; memset(output_buffer, 0, sizeof(output_buffer)); if (buf_size >= (sizeof(output_buffer) * 6/8)) { fprintf(stderr, "base64_dump: Buffer too small!\n"); exit(1); } for (i = 0; i < buf_size ; i++) { value = (value << 8) | buf[i]; bits += 2; p += sprintf(p, "%c", b64_enc[(value >> bits) & 63U]); if (bits >= 6) { bits -= 6; p += sprintf(p, "%c", b64_enc[(value >> bits) & 63U]); } } if (bits > 0) { value <<= 6 - bits; p += sprintf(p, "%c", b64_enc[value & 63U]); } return output_buffer; } /* Write the .jigdo file to match the .template we've just finished. */ static void write_jigdo_file(void) { unsigned char template_md5sum[16]; entry_t *entry = entry_list; struct path_mapping *map = map_list; int i = 0; struct checksum_info *info = NULL; checksum_final(template_context); checksum_copy(template_context, CHECK_MD5, &template_md5sum[0]); fprintf(j_file, "# JigsawDownload\n"); fprintf(j_file, "# See for details about jigdo\n"); fprintf(j_file, "# See for details about JTE\n\n"); fprintf(j_file, "[Jigdo]\n"); fprintf(j_file, "Version=%s\n", JIGDO_TEMPLATE_VERSION); fprintf(j_file, "Generator=%s/%d.%d\n\n", JTE_NAME, JTE_VER_MAJOR, JTE_VER_MINOR); fprintf(j_file, "[Image]\n"); fprintf(j_file, "Filename=%s\n", file_base_name(outfile)); fprintf(j_file, "Template=http://localhost/%s\n", jtemplate_out); fprintf(j_file, "Template-MD5Sum=%s \n", base64_dump(&template_md5sum[0], sizeof(template_md5sum))); for (i = 0; i < NUM_CHECKSUMS; i++) { if (checksum_algo_tmpl & (1 << i)) { info = checksum_information(i); fprintf(j_file, "# Template Hex %sSum %s\n", info->name, checksum_hex(template_context, i)); } } fprintf(j_file, "# Template size %lld bytes\n", template_size); for (i = 0; i < NUM_CHECKSUMS; i++) { if (checksum_algo_iso & (1 << i)) { info = checksum_information(i); fprintf(j_file, "# Image Hex %sSum %s\n", info->name, checksum_hex(iso_context, i)); } } fprintf(j_file, "# Image size %lld bytes\n\n", image_size); fprintf(j_file, "[Parts]\n"); while (entry) { if (JTET_FILE_MATCH == entry->entry_type) { char *new_name = remap_filename(entry->data.file.filename); fprintf(j_file, "%s=%s\n", base64_dump(&entry->data.file.md5[0], sizeof(entry->data.file.md5)), new_name); free(new_name); } entry = entry->next; } fprintf(j_file, "\n[Servers]\n"); fflush(j_file); } /* Finish and flush state; for now: 1. Dump the DESC blocks and the footer information in the jigdo template file 2. Write the jigdo .jigdo file containing file pointers */ void write_jt_footer(void) { /* Finish calculating the image's checksum */ checksum_final(iso_context); /* And calculate the image size */ image_size = (unsigned long long)SECTOR_SIZE * last_extent_written; write_template_desc_entries(image_size); write_jigdo_file(); } /* Add a raw data entry to the list of extents; no file to match */ static void add_unmatched_entry(int uncompressed_length) { entry_t *new_entry = NULL; /* Can we extend a previous non-match entry? */ if (entry_last && (JTET_NOMATCH == entry_last->entry_type)) { entry_last->data.chunk.uncompressed_length += uncompressed_length; return; } new_entry = calloc(1, sizeof(entry_t)); new_entry->entry_type = JTET_NOMATCH; new_entry->next = NULL; new_entry->data.chunk.uncompressed_length = uncompressed_length; /* Add to the end of the list */ if (NULL == entry_last) { entry_last = new_entry; entry_list = new_entry; } else { entry_last->next = new_entry; entry_last = new_entry; } num_chunks++; } /* Add a file match entry to the list of extents */ static void add_file_entry(char *filename, off_t size, unsigned char *md5, unsigned long long rsyncsum) { entry_t *new_entry = NULL; new_entry = calloc(1, sizeof(entry_t)); new_entry->entry_type = JTET_FILE_MATCH; new_entry->next = NULL; memcpy(new_entry->data.file.md5, md5, sizeof(new_entry->data.file.md5)); new_entry->data.file.file_length = size; new_entry->data.file.rsyncsum = rsyncsum; new_entry->data.file.filename = strdup(filename); /* Add to the end of the list */ if (NULL == entry_last) { entry_last = new_entry; entry_list = new_entry; } else { entry_last->next = new_entry; entry_last = new_entry; } num_matches++; } /* Cope with an unmatched block in the .iso file: 1. Write a compressed data chunk in the jigdo template file 2. Add an entry in our list of unmatched chunks for later */ void jtwrite(buffer, size, count, submode, islast) void *buffer; int size; int count; int submode; BOOL islast; { #ifdef JTWRITE_DEBUG if (count != 1 || (size % 2048) != 0) error("Count: %d, size: %d\n", count, size); #endif if (!jtemplate_out) return; /* Update the global image checksum */ checksum_update(iso_context, buffer, size * count); // mk_MD5Update(&iso_context, buffer, size*count); /* Write a compressed version of the data to the template file, and add a reference on the state list so we can write that later. */ write_compressed_chunk(buffer, size*count); add_unmatched_entry(size*count); } /* Cope with a file entry in the .iso file: 1. Read the file for the image's md5 checksum 2. Add an entry in our list of files to be written into the .jigdo later */ void write_jt_match_record(char *filename, char *mirror_name, int sector_size, off_t size, unsigned char md5[16]) { unsigned long long tmp_size = 0; char buf[32768]; off_t remain = size; FILE *infile = NULL; int use = 0; unsigned long long rsync64_sum = 0; int first_block = 1; memset(buf, 0, sizeof(buf)); if ((infile = fopen(filename, "rb")) == NULL) { #ifdef USE_LIBSCHILY comerr("cannot open '%s'\n", filename); #else #ifndef HAVE_STRERROR fprintf(stderr, "cannot open '%s': (%d)\n", filename, errno); #else fprintf(stderr, "cannot open '%s': %s\n", filename, strerror(errno)); #endif exit(1); #endif } while (remain > 0) { use = remain; if (remain > sizeof(buf)) use = sizeof(buf); if (fread(buf, 1, use, infile) == 0) { #ifdef USE_LIBSCHILY comerr("cannot read from '%s'\n", filename); #else fprintf(stderr, "cannot read from '%s'\n", filename); exit(1); #endif } if (first_block) rsync64_sum = rsync64(buf, MIN_JIGDO_FILE_SIZE); checksum_update(iso_context, buf, use); // mk_MD5Update(&iso_context, buf, use); remain -= use; first_block = 0; } fclose(infile); /* Update the image checksum with any necessary padding data */ if (size % sector_size) { int pad_size = sector_size - (size % sector_size); memset(buf, 0, pad_size); checksum_update(iso_context, buf, pad_size); // mk_MD5Update(&iso_context, buf, pad_size); } add_file_entry(mirror_name, size, &md5[0], rsync64_sum); if (size % sector_size) { int pad_size = sector_size - (size % sector_size); write_compressed_chunk(buf, pad_size); add_unmatched_entry(pad_size); } } cdrkit-1.1.11/genisoimage/genisoimagerc.50000644000372500001440000000763010540215347017324 0ustar steveusers.\" genisoimagerc.5 -*- nroff -*- .\" Derived from genisoimage.1 .\" Copyright 1993-1998 by Yggdrasil Computing .\" Copyright 1996-1997 by Robert Leslie .\" Copyright 1997-2001 by James Pearson .\" Copyright 1999-2006 by Joerg Schilling .\" Copyright 2002-2003 by Jungshik Shin .\" Copyright 2003 by Jaakko Heinonen .\" Copyright 2006 by the Cdrkit maintainers .\" .TH GENISOIMAGERC 5 "13 Dec 2006" .\" ---------------------------------------- .SH NAME genisoimagerc \- startup configuration file for genisoimage .SH DESCRIPTION .BR genisoimage (1) searches for a configuration file in several places; it uses the first one it is able to open. First, if the .B GENISOIMAGERC environment variable is set, its value is used as the filename; likewise for the .B MKISOFSRC environment variable. Next, .B genisoimage looks for files named .IR .genisoimagerc " or " .mkisofsrc , first in the current working directory, then in the user's home directory. Next, it looks for .IR /etc/genisoimagerc . Finally, it looks for a .I .genisoimagerc in the same directory as .B genisoimage itself is stored. .PP The .I .genisoimagerc file contains lines of the form .IP .BI TAG= value .PP where .B TAG is one of the settings defined below. The case of the tag is not significant. All settings have command-line equivalents; if the command-line parameter is specified, it takes priority over the configuration file. .PP Blank lines and lines beginning with `#' are ignored. .\" ---------------------------------------- .SH "CONFIGURATION SETTINGS" .IP ABST The abstract information, typically the name of a file on the disc containing an abstract. There is space for 37 characters. Equivalent to the .B \-abstract command-line option. .IP APPI The application identifier should describe the application that will be on the disc. There is space for 128 characters. Equivalent to the .B \-A command-line option. .IP BIBL The bibliographic information, often the name of a file on the disc containing a bibliography. There is space for 37 characters. Equivalent to the .B \-biblio command-line option. .IP COPY The copyright information, typically the name of a file on the disc containing the copyright notice. There is space for 37 characters. Equivalent to the .B \-copyright command-line option. .IP HFS_TYPE The default .B TYPE for Macintosh files. Must be exactly 4 characters. Equivalent to the .B \-hfs\-type command-line option. The default value is .IR TEXT . .IP HFS_CREATOR The default .B CREATOR for Macintosh files. Must be exactly 4 characters. Equivalent to the .B \-hfs\-creator command-line option. The default value is .IR Unix . .IP PREP This should describe the preparer of the CD-ROM, usually with a mailing address and phone number. There is space for 128 characters. Equivalent to the .B \-p command-line option. .IP PUBL This should describe the publisher of the CD-ROM, usually with a mailing address and phone number. There is space for 128 characters. Equivalent to the .B \-publisher command-line option. .IP SYSI The System Identifier. There is space for 32 characters. Equivalent to the .B \-sysid command-line option. .IP VOLI The Volume Identifier. There is space for 32 characters. Equivalent to the .B \-V command-line option. .IP VOLS The Volume Set Name. There is space for 128 characters. Equivalent to the .B \-volset command-line option. .PP .B genisoimage can also be configured at compile time with defaults for many of these fields. See the file .IR defaults.h . .\" ---------------------------------------- .SH EXAMPLES The following file .IP .nf COPY=src/COPYING SYSI=Multics 75 .fi .PP is equivalent to the .B genisoimage command-line parameters .IP .I "\-copyright src/COPYING \-sysid \(dqMultics 75\(dq" .\" ---------------------------------------- .SH "SEE ALSO" .BR genisoimage (1). .\" ---------------------------------------- .SH AUTHORS See the .BR genisoimage (1) manual page for credits for the .B genisoimage program and documentation. cdrkit-1.1.11/genisoimage/mapping0000644000372500001440000000052110471375025015773 0ustar steveusers# Example filename mapping file # # EXTN XLate CREATOR TYPE Comment .tif Raw '8BIM' 'TIFF' "Photoshop TIFF image" .hqx Ascii 'BnHq' 'TEXT' "BinHex file" .doc Raw 'MSWD' 'WDBN' "Word file" .mov Raw 'TVOD' 'MooV' "QuickTime Movie" * Ascii 'ttxt' 'TEXT' "Text file" cdrkit-1.1.11/genisoimage/vms.c0000644000372500001440000001404110536265343015373 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)vms.c 1.9 04/03/04 joerg */ /* * File vms.c - assorted bletcherous hacks for VMS. * * Written by Eric Youngdale (1993). * */ #include #ifdef VMS #define opendir fake_opendir #include "genisoimage.h" #undef opendir #include #include #include static struct RAB *rab; /* used for external mailfiles */ static int rms_status; static error_exit(char *text) { fprintf(stderr, "%s\n", text); exit(33); } char *strrchr(const char *, char); int VMS_stat(char *path, struct stat * spnt) { char *spath; char sbuffer[255]; char *pnt, *ppnt; char *pnt1; ppnt = strrchr(path, ']'); if (ppnt) ppnt++; else ppnt = path; spath = path; if (strcmp(ppnt, ".") == 0 || strcmp(ppnt, "..") == 0) { strcpy(sbuffer, path); /* Find end of actual name */ pnt = strrchr(sbuffer, ']'); if (!pnt) return (0); pnt1 = pnt; while (*pnt1 != '[' && *pnt1 != '.') pnt1--; if (*pnt1 != '[' && strcmp(ppnt, "..") == 0) { pnt1--; while (*pnt1 != '[' && *pnt1 != '.') pnt1--; }; if (*pnt1 == '.') { *pnt1 = ']'; pnt = pnt1; while (*pnt != '.' && *pnt != ']') pnt++; *pnt++ = ']'; while (*pnt != '.' && *pnt != ']') pnt++; *pnt = 0; strcat(sbuffer, ".DIR;1"); }; if (*pnt1 == '[') { pnt1++; *pnt1 = 0; strcat(pnt1, "000000]"); pnt1 = strrchr(path, '[') + 1; pnt = sbuffer + strlen(sbuffer); while (*pnt1 && *pnt1 != '.' && *pnt1 != ']') *pnt++ = *pnt1++; *pnt = 0; strcat(sbuffer, ".DIR;1"); }; spath = sbuffer; }; return (stat_filter(spath, spnt)); } static int dircontext[32] = {0, }; static char *searchpath[32]; static struct direct d_entry[32]; int optind = 0; char *optarg; int getopt(int argc, char *argv[], char *flags) { char *pnt; char c; optind++; if (*argv[optind] != '-') return (EOF); optarg = 0; c = *(argv[optind] + 1); pnt = (char *) strchr(flags, c); if (!pnt) return (c); /* Not found */ if (pnt[1] == ':') { optind++; optarg = argv[optind]; }; return (c); } void vms_path_fixup(char *name) { char *pnt1; pnt1 = name + strlen(name) - 6; /* First strip the .DIR;1 */ if (strcmp(pnt1, ".DIR;1") == 0) *pnt1 = 0; pnt1 = (char *) strrchr(name, ']'); if (pnt1) { if (pnt1[1] == 0) return; *pnt1 = '.'; strcat(name, "]"); return; }; pnt1 = (char *) strrchr(name, '>'); if (pnt1) { if (pnt1[1] == 0) return; *pnt1 = '.'; strcat(name, ">"); return; }; } int opendir(char *path) { int i; for (i = 1; i < 32; i++) { if (dircontext[i] == 0) { dircontext[i] = -1; searchpath[i] = (char *) e_malloc(strlen(path) + 6); strcpy(searchpath[i], path); vms_path_fixup(searchpath[i]); strcat(searchpath[i], "*.*.*"); return (i); }; }; exit(0); } struct direct * readdir(int context) { int i; char cresult[100]; char *pnt; int status; $DESCRIPTOR(dpath, searchpath[context]); $DESCRIPTOR(result, cresult); if (dircontext[context] == -1) { dircontext[context] = -2; strcpy(d_entry[context].d_name, "."); return (&d_entry[context]); }; if (dircontext[context] == -2) { dircontext[context] = -3; strcpy(d_entry[context].d_name, ".."); return (&d_entry[context]); }; if (dircontext[context] == -3) dircontext[context] = 0; dpath.dsc$w_length = strlen(searchpath[context]); lib$find_file(&dpath, &result, &dircontext[context], 0, 0, &status, 0); if (status == SS$_NOMOREFILES) return (0); /* Now trim trailing spaces from the name */ i = result.dsc$w_length - 1; while (i && cresult[i] == ' ') i--; cresult[i + 1] = 0; /* Now locate the actual portion of the file we want */ pnt = (char *) strrchr(cresult, ']'); if (pnt) pnt++; else pnt = cresult; strcpy(d_entry[context].d_name, pnt); return (&d_entry[context]); } void closedir(int context) { lib$find_file_end(&dircontext[context]); free(searchpath[context]); searchpath[context] = (char *) 0; dircontext[context] = 0; } static open_file(char *fn) { /* * this routine initializes a rab and fab required to get the * correct definition of the external data file used by mail */ struct FAB *fab; rab = (struct RAB *) e_malloc(sizeof (struct RAB)); fab = (struct FAB *) e_malloc(sizeof (struct FAB)); *rab = cc$rms_rab; /* initialize RAB */ rab->rab$l_fab = fab; *fab = cc$rms_fab; /* initialize FAB */ fab->fab$l_fna = fn; fab->fab$b_fns = strlen(fn); fab->fab$w_mrs = 512; fab->fab$b_fac = FAB$M_BIO | FAB$M_GET; fab->fab$b_org = FAB$C_SEQ; fab->fab$b_rfm = FAB$C_FIX; fab->fab$l_xab = (char *) 0; rms_status = sys$open(rab->rab$l_fab); if (rms_status != RMS$_NORMAL && rms_status != RMS$_CREATED) error_exit("$OPEN"); rms_status = sys$connect(rab); if (rms_status != RMS$_NORMAL) error_exit("$CONNECT"); return (1); } static close_file(struct RAB * prab) { rms_status = sys$close(prab->rab$l_fab); free(prab->rab$l_fab); free(prab); if (rms_status != RMS$_NORMAL) error_exit("$CLOSE"); } #define NSECT 16 extern unsigned int last_extent_written; int vms_write_one_file(char *filename, off_t size, FILE * outfile) { int status, i; char buffer[SECTOR_SIZE * NSECT]; int count; int use; off_t remain; open_file(filename); remain = size; while (remain > 0) { use = (remain > SECTOR_SIZE * NSECT - 1 ? NSECT * SECTOR_SIZE : remain); use = ROUND_UP(use); /* Round up to nearest sector boundary */ memset(buffer, 0, use); rab->rab$l_ubf = buffer; rab->rab$w_usz = sizeof (buffer); status = sys$read(rab); fwrite(buffer, 1, use, outfile); last_extent_written += use / SECTOR_SIZE; if ((last_extent_written % 1000) < use / SECTOR_SIZE) fprintf(stderr, "%d..", last_extent_written); remain -= use; }; close_file(rab); } #endif cdrkit-1.1.11/genisoimage/md5.h0000644000372500001440000000261210476554276015272 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* See md5.c for explanation and copyright information. */ #ifndef MD5_H #define MD5_H /* Unlike previous versions of this code, uint32 need not be exactly 32 bits, merely 32 bits or more. Choosing a data type which is 32 bits instead of 64 is not important; speed is considerably more important. ANSI guarantees that "unsigned long" will be big enough, and always using it seems to have few disadvantages. */ typedef unsigned long mk_uint32; struct mk_MD5Context { mk_uint32 buf[4]; mk_uint32 bits[2]; unsigned char in[64]; }; void mk_MD5Init (struct mk_MD5Context *context); void mk_MD5Update (struct mk_MD5Context *context, unsigned char const *buf, unsigned len); void mk_MD5Final (unsigned char digest[16], struct mk_MD5Context *context); void mk_MD5Transform (mk_uint32 buf[4], const unsigned char in[64]); int mk_MD5Parse(unsigned char in[33], unsigned char out[16]); int calculate_md5sum(char *filename, unsigned long long size, unsigned char out[16]); #endif /* !MD5_H */ cdrkit-1.1.11/genisoimage/endian.c0000644000372500001440000001112310537101764016017 0ustar steveusers/* * endian.c * * Copyright (c) 2004-2006 Steve McIntyre * * Simple helper routines for marshalling data * * GNU GPL v2 */ #include #include "endianconv.h" /* Write a 64-bit quantity out into memory in BIG ENDIAN order */ void write_be64(unsigned long long in, unsigned char *out) { out[0] = (in >> 56) & 0xFF; out[1] = (in >> 48) & 0xFF; out[2] = (in >> 40) & 0xFF; out[3] = (in >> 32) & 0xFF; out[4] = (in >> 24) & 0xFF; out[5] = (in >> 16) & 0xFF; out[6] = (in >> 8) & 0xFF; out[7] = in & 0xFF; } /* Read in a 64-bit BIG ENDIAN quantity */ unsigned long long read_be64(unsigned char *in) { unsigned long long result = 0; result |= (unsigned long long)in[0] << 56; result |= (unsigned long long)in[1] << 48; result |= (unsigned long long)in[2] << 40; result |= (unsigned long long)in[3] << 32; result |= (unsigned long long)in[4] << 24; result |= (unsigned long long)in[5] << 16; result |= (unsigned long long)in[6] << 8; result |= (unsigned long long)in[7]; return result; } /* Write a 64-bit quantity out into memory in LITTLE ENDIAN order */ void write_le64(unsigned long long in, unsigned char *out) { out[0] = in & 0xFF; out[1] = (in >> 8) & 0xFF; out[2] = (in >> 16) & 0xFF; out[3] = (in >> 24) & 0xFF; out[4] = (in >> 32) & 0xFF; out[5] = (in >> 40) & 0xFF; out[6] = (in >> 48) & 0xFF; out[7] = (in >> 56) & 0xFF; } /* Read in a 64-bit LITTLE ENDIAN quantity */ unsigned long long read_le64(unsigned char *in) { unsigned long long result = 0; result |= (unsigned long long)in[0]; result |= (unsigned long long)in[1] << 8; result |= (unsigned long long)in[2] << 16; result |= (unsigned long long)in[3] << 24; result |= (unsigned long long)in[4] << 32; result |= (unsigned long long)in[5] << 40; result |= (unsigned long long)in[6] << 48; result |= (unsigned long long)in[7] << 56; return result; } /* Write a 48-bit quantity out into memory in LITTLE ENDIAN order */ void write_le48(unsigned long long in, unsigned char *out) { out[0] = in & 0xFF; out[1] = (in >> 8) & 0xFF; out[2] = (in >> 16) & 0xFF; out[3] = (in >> 24) & 0xFF; out[4] = (in >> 32) & 0xFF; out[5] = (in >> 40) & 0xFF; } /* Read in a 48-bit LITTLE ENDIAN quantity */ unsigned long long read_le48(unsigned char *in) { unsigned long long result = 0; result |= (unsigned long long)in[0]; result |= (unsigned long long)in[1] << 8; result |= (unsigned long long)in[2] << 16; result |= (unsigned long long)in[3] << 24; result |= (unsigned long long)in[4] << 32; result |= (unsigned long long)in[5] << 40; return result; } /* Write a 32-bit quantity out into memory in BIG ENDIAN order */ void write_be32(unsigned long in, unsigned char *out) { out[0] = (in >> 24) & 0xFF; out[1] = (in >> 16) & 0xFF; out[2] = (in >> 8) & 0xFF; out[3] = in & 0xFF; } /* Read in a 32-bit BIG ENDIAN quantity */ unsigned long read_be32(unsigned char *in) { unsigned long result = 0; result |= (unsigned long)in[0] << 24; result |= (unsigned long)in[1] << 16; result |= (unsigned long)in[2] << 8; result |= (unsigned long)in[3]; return result; } /* Write a 32-bit quantity out into memory in LITTLE ENDIAN order */ void write_le32(unsigned long in, unsigned char *out) { out[0] = in & 0xFF; out[1] = (in >> 8) & 0xFF; out[2] = (in >> 16) & 0xFF; out[3] = (in >> 24) & 0xFF; } /* Read in a 32-bit LITTLE ENDIAN quantity */ unsigned long read_le32(unsigned char *in) { unsigned long result = 0; result |= (unsigned long)in[0]; result |= (unsigned long)in[1] << 8; result |= (unsigned long)in[2] << 16; result |= (unsigned long)in[3] << 24; return result; } /* Write a 16-bit quantity out into memory in BIG ENDIAN order */ void write_be16(unsigned short in, unsigned char *out) { out[0] = (in >> 8) & 0xFF; out[1] = in & 0xFF; } /* Read in a 16-bit BIG ENDIAN quantity */ unsigned short read_be16(unsigned char *in) { unsigned short result = 0; result |= (unsigned short)in[0] << 8; result |= (unsigned short)in[1]; return result; } /* Write a 16-bit quantity out into memory in LITTLE ENDIAN order */ void write_le16(unsigned short in, unsigned char *out) { out[0] = in & 0xFF; out[1] = in & 0xFF >> 8; } /* Read in a 16-bit LITTLE ENDIAN quantity */ unsigned short read_le16(unsigned char *in) { unsigned short result = 0; result |= (unsigned short)in[0]; result |= (unsigned short)in[1] << 8; return result; } cdrkit-1.1.11/genisoimage/mkhybrid.80000644000372500001440000000006010531416235016311 0ustar steveusers.so man8/genisoimage.8 .\" %Z%%M% %I% %E% joerg cdrkit-1.1.11/genisoimage/TODO0000644000372500001440000000442110471375025015110 0ustar steveusers/* @(#)TODO 1.6 03/04/27 joerg */ 1) Finish multiple paths. Update nlink count on directories if it is different than what stat returned. Save the nlink count that we store in the rock ridge attributes so know when we don't have to adjust it. Andy Polyakov Well, it was rather hard to get it wrong... But the answer is "yes" if you have to hear this very word. And while we're discussing this code. A *cosmetic* *suggestion*. Consider modifying two lines above the "if(is_directory)" as following: set32(&fe->uid,0); set32(&fe->gid,0); or to any other small number. Problem is that with -1 as now 'ls -l' results in wider output which is rather annoying (it has to print 4294967295 twice while it formats for 8 chars). Cheers. A. /*--------------------------------------------------------------------------*/ Option to modify Volume id, ... in PVD after the image has been created? /*--------------------------------------------------------------------------*/ http://www.y-adagio.com/public/standards/iso_cdromr/tocont.htm Annex B has: Changes from ISO 9660:1988 to this International Standard: a) The Volume Descriptor Version is changed to indicate the new structure; Version number 2 indicated the new specification. b) The File Structure Version is changed to indicate the new structure; Version number 2 indicated the new specification. c) The limitation in the Depth of Hierarchy is lifted; The levels in the hierarchy can exceed eight. d) The File Identifier is not separated to components; The SEPARATORS are not specified. A complex file name can be expressed. e) The File Identifier does not have File Version Numbers; File with and without Version Numbers should not exist in the same directory. f) The character used for filling byte positions which are specified to be characters is subject to agreement between the originator and the recipient of the volume; g) The length of File Identifier is limited to 207; Long file name can be expressed. h) The length of a Directory Identifier is limited to 207; Long directory name can be expressed. /*--------------------------------------------------------------------------*/ Extent # auch als off_t statt int Wenn HFS, dann max File size == 2 GB? cdrkit-1.1.11/genisoimage/config.h0000644000372500001440000000234210477233650016041 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)config.h 1.1 97/05/16 Copyright 1997 J. Schilling */ /* * Adaption for mconfig.h from make file system. * * Copyright (c) 1997 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include cdrkit-1.1.11/genisoimage/vms.h0000644000372500001440000000146210531416235015374 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)vms.h 1.3 04/03/01 eric */ /* * Header file genisoimage.h - assorted structure definitions and typecasts. * * Written by Eric Youngdale (1993). */ #ifdef VMS #define stat(X, Y) VMS_stat(X, Y) #define lstat VMS_stat /* gmtime not available under VMS - make it look like we are in Greenwich */ #define gmtime localtime extern int vms_write_one_file(char *filename, off_t size, FILE * outfile); #endif cdrkit-1.1.11/genisoimage/defaults.h0000644000372500001440000000620710607413610016376 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)defaults.h 1.19 06/01/30 joerg */ /* * Header file defaults.h - assorted default values for character strings in * the volume descriptor. * * Copyright (c) 1999-2004 J. Schilling */ #define PREPARER_DEFAULT NULL #define PUBLISHER_DEFAULT NULL /* * Define me when it's needed again #ifndef APPID_DEFAULT #ifdef APPLE_HYB #define APPID_DEFAULT "MKISOFS ISO 9660/HFS FILESYSTEM BUILDER (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING" #else #define APPID_DEFAULT "MKISOFS ISO 9660 FILESYSTEM BUILDER (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING" #endif / * APPLE_HYB * / #endif */ #define COPYRIGHT_DEFAULT NULL #define BIBLIO_DEFAULT NULL #define ABSTRACT_DEFAULT NULL #define VOLSET_ID_DEFAULT NULL #define VOLUME_ID_DEFAULT "CDROM" #define BOOT_CATALOG_DEFAULT "boot.catalog" #define BOOT_IMAGE_DEFAULT NULL #define SILO_BOOT_IMAGE_DEFAULT "boot/second.b" #define SILO_BOOTBLOCK_DEFAULT "boot/cd.b" #define SILO_CONF_FILE_DEFAULT "/etc/silo.conf" #ifdef APPLE_HYB #define APPLE_TYPE_DEFAULT "TEXT" #define APPLE_CREATOR_DEFAULT "unix" #endif /* APPLE_HYB */ #ifdef __QNX__ #define SYSTEM_ID_DEFAULT "QNX" #endif #ifdef __osf__ #define SYSTEM_ID_DEFAULT "OSF" #endif #ifdef __sun #ifdef __SVR4 #define SYSTEM_ID_DEFAULT "Solaris" #else #define SYSTEM_ID_DEFAULT "SunOS" #endif #endif #ifdef __hpux #define SYSTEM_ID_DEFAULT "HP-UX" #endif #ifdef __sgi #define SYSTEM_ID_DEFAULT "SGI" #endif #if defined(_IBMR2) || defined(_AIX) #define SYSTEM_ID_DEFAULT "AIX" #endif #if defined(_WIN) || defined(__CYGWIN32__) || defined(__CYGWIN__) #define SYSTEM_ID_DEFAULT "Win32" #endif /* _WIN */ #ifdef __EMX__ #define SYSTEM_ID_DEFAULT "OS/2" #endif #ifdef __FreeBSD__ #define SYSTEM_ID_DEFAULT "FreeBSD" #endif #ifdef __DragonFly__ #define SYSTEM_ID_DEFAULT "DragonFly" #endif #ifdef __NetBSD__ #define SYSTEM_ID_DEFAULT "NetBSD" #endif #ifdef __OpenBSD__ #define SYSTEM_ID_DEFAULT "OpenBSD" #endif #ifdef __bsdi__ #define SYSTEM_ID_DEFAULT "BSD/OS" #endif #ifdef __NeXT__ #define SYSTEM_ID_DEFAULT "NeXT" #endif #if defined(__NeXT__) && defined(__TARGET_OSNAME) && __TARGET_OSNAME == rhapsody #undef SYSTEM_ID_DEFAULT #define SYSTEM_ID_DEFAULT "Rhapsody" #endif #if defined(__APPLE__) && defined(__MACH__) #undef SYSTEM_ID_DEFAULT #define SYSTEM_ID_DEFAULT "Mac OS X" #endif #ifdef __BEOS__ #define SYSTEM_ID_DEFAULT "BeOS" #endif #ifdef __OS2 #define SYSTEM_ID_DEFAULT "OS/2" #endif #ifdef VMS #define SYSTEM_ID_DEFAULT "VMS" #endif #ifdef OPENSERVER #define SYSTEM_ID_DEFAULT "SCO-OPENSERVER" #endif #ifdef UNIXWARE #define SYSTEM_ID_DEFAULT "SCO-UNIXWARE" #endif #ifdef linux #define SYSTEM_ID_DEFAULT "LINUX" #endif #ifdef __DJGPP__ #define SYSTEM_ID_DEFAULT "DOS" #endif #ifndef SYSTEM_ID_DEFAULT #define SYSTEM_ID_DEFAULT "UNIX" #endif cdrkit-1.1.11/genisoimage/ifo_read.h0000644000372500001440000000477410531416235016350 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)ifo_read.h 1.2 04/03/02 joerg */ #ifndef _IFO_READ_H #define _IFO_READ_H /* * Copyright (C) 2000, 2001, 2002 Björn Englund , * Håkan Hjort * (I only did the cut down no other contribs) * Jörg Schilling * (making the code portable) * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * NOTE: This is a cut down version of libdvdread for genisoimage, due * to portability issues with the current libdvdread according to * the maintainer of genisoimage. * This cut down version only reads from a harddisk file structure * and it only implements the functions necessary inorder to make * genisoimage produce valid DVD-Video images. * DON'T USE THIS LIBRARY IN ANY OTHER PROGRAM GET THE REAL * LIBDVDREAD INSTEAD */ #include "ifo_types.h" #include "dvd_reader.h" #ifdef __cplusplus extern "C" { #endif /* * handle = ifoOpen(dvd, title); * * Opens an IFO and reads a tiny fraction of the data for the IFO file * corresponding to the given title set. If title 0 is given, the video * manager IFO file is read. * Returns a handle to a tiny parsed fraction of a IFO strcuture */ extern ifo_handle_t *ifoOpen(dvd_reader_t *, int); /* * ifoClose(ifofile); * Cleans up the IFO information. This will free all data allocated. */ extern void ifoClose(ifo_handle_t *); #ifdef __cplusplus }; #endif #endif /* _IFO_READ_H */ cdrkit-1.1.11/genisoimage/sha256.c0000644000372500001440000002126311264421657015603 0ustar steveusers/* Functions to compute SHA256 message digest of files or memory blocks. according to the definition of SHA256 in FIPS 180-2. Copyright (C) 2007 Free Software Foundation, Inc. Copied here from the GNU C Library version 2.7 on the 10 May 2009 by Steve McIntyre <93sam@debian.org>. This code was under LGPL v2.1 in glibc, and that license gives us the option to use and distribute the code under the terms of the GPL v2 instead. I'm taking that option. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Ulrich Drepper , 2007. */ #include #include #include #include #include "sha256.h" #if __BYTE_ORDER == __LITTLE_ENDIAN # ifdef _LIBC # include # define SWAP(n) bswap_32 (n) # else # define SWAP(n) \ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) # endif #else # define SWAP(n) (n) #endif /* This array contains the bytes used to pad the buffer to the next 64-byte boundary. (FIPS 180-2:5.1.1) */ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; /* Constants for SHA256 from FIPS 180-2:4.2.2. */ static const uint32_t K[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 }; /* Process LEN bytes of BUFFER, accumulating context into CTX. It is assumed that LEN % 64 == 0. */ static void sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx) { const uint32_t *words = buffer; size_t nwords = len / sizeof (uint32_t); uint32_t a = ctx->H[0]; uint32_t b = ctx->H[1]; uint32_t c = ctx->H[2]; uint32_t d = ctx->H[3]; uint32_t e = ctx->H[4]; uint32_t f = ctx->H[5]; uint32_t g = ctx->H[6]; uint32_t h = ctx->H[7]; /* First increment the byte count. FIPS 180-2 specifies the possible length of the file up to 2^64 bits. Here we only compute the number of bytes. Do a double word increment. */ ctx->total[0] += len; if (ctx->total[0] < len) ++ctx->total[1]; /* Process all bytes in the buffer with 64 bytes in each round of the loop. */ while (nwords > 0) { uint32_t W[64]; uint32_t a_save = a; uint32_t b_save = b; uint32_t c_save = c; uint32_t d_save = d; uint32_t e_save = e; uint32_t f_save = f; uint32_t g_save = g; uint32_t h_save = h; unsigned int t; /* Operators defined in FIPS 180-2:4.1.2. */ #define Ch(x, y, z) ((x & y) ^ (~x & z)) #define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) #define S0(x) (CYCLIC (x, 2) ^ CYCLIC (x, 13) ^ CYCLIC (x, 22)) #define S1(x) (CYCLIC (x, 6) ^ CYCLIC (x, 11) ^ CYCLIC (x, 25)) #define R0(x) (CYCLIC (x, 7) ^ CYCLIC (x, 18) ^ (x >> 3)) #define R1(x) (CYCLIC (x, 17) ^ CYCLIC (x, 19) ^ (x >> 10)) /* It is unfortunate that C does not provide an operator for cyclic rotation. Hope the C compiler is smart enough. */ #define CYCLIC(w, s) ((w >> s) | (w << (32 - s))) /* Compute the message schedule according to FIPS 180-2:6.2.2 step 2. */ for (t = 0; t < 16; ++t) { W[t] = SWAP (*words); ++words; } for (t = 16; t < 64; ++t) W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16]; /* The actual computation according to FIPS 180-2:6.2.2 step 3. */ for (t = 0; t < 64; ++t) { uint32_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t]; uint32_t T2 = S0 (a) + Maj (a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; } /* Add the starting values of the context according to FIPS 180-2:6.2.2 step 4. */ a += a_save; b += b_save; c += c_save; d += d_save; e += e_save; f += f_save; g += g_save; h += h_save; /* Prepare for the next round. */ nwords -= 16; } /* Put checksum in context given as argument. */ ctx->H[0] = a; ctx->H[1] = b; ctx->H[2] = c; ctx->H[3] = d; ctx->H[4] = e; ctx->H[5] = f; ctx->H[6] = g; ctx->H[7] = h; } /* Initialize structure containing state of computation. (FIPS 180-2:5.3.2) */ void sha256_init_ctx (ctx) struct sha256_ctx *ctx; { ctx->H[0] = 0x6a09e667; ctx->H[1] = 0xbb67ae85; ctx->H[2] = 0x3c6ef372; ctx->H[3] = 0xa54ff53a; ctx->H[4] = 0x510e527f; ctx->H[5] = 0x9b05688c; ctx->H[6] = 0x1f83d9ab; ctx->H[7] = 0x5be0cd19; ctx->total[0] = ctx->total[1] = 0; ctx->buflen = 0; } /* Process the remaining bytes in the internal buffer and the usual prolog according to the standard and write the result to RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * sha256_finish_ctx (ctx, resbuf) struct sha256_ctx *ctx; void *resbuf; { /* Take yet unprocessed bytes into account. */ uint32_t bytes = ctx->buflen; size_t pad; unsigned int i; /* Now count remaining bytes. */ ctx->total[0] += bytes; if (ctx->total[0] < bytes) ++ctx->total[1]; pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ *(uint32_t *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3); *(uint32_t *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); /* Process last bytes. */ sha256_process_block (ctx->buffer, bytes + pad + 8, ctx); /* Put result from CTX in first 32 bytes following RESBUF. */ for (i = 0; i < 8; ++i) ((uint32_t *) resbuf)[i] = SWAP (ctx->H[i]); return resbuf; } void sha256_process_bytes (buffer, len, ctx) const void *buffer; size_t len; struct sha256_ctx *ctx; { /* When we already have some bits in our internal buffer concatenate both inputs first. */ if (ctx->buflen != 0) { size_t left_over = ctx->buflen; size_t add = 128 - left_over > len ? len : 128 - left_over; memcpy (&ctx->buffer[left_over], buffer, add); ctx->buflen += add; if (ctx->buflen > 64) { sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx); ctx->buflen &= 63; /* The regions in the following copy operation cannot overlap. */ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], ctx->buflen); } buffer = (const char *) buffer + add; len -= add; } /* Process available complete blocks. */ if (len >= 64) { #if !_STRING_ARCH_unaligned /* To check alignment gcc has an appropriate operator. Other compilers don't. */ # if __GNUC__ >= 2 # define UNALIGNED_P(p) (((uintptr_t) p) % __alignof__ (uint32_t) != 0) # else # define UNALIGNED_P(p) (((uintptr_t) p) % sizeof (uint32_t) != 0) # endif if (UNALIGNED_P (buffer)) while (len > 64) { sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); buffer = (const char *) buffer + 64; len -= 64; } else #endif { sha256_process_block (buffer, len & ~63, ctx); buffer = (const char *) buffer + (len & ~63); len &= 63; } } /* Move remaining bytes into internal buffer. */ if (len > 0) { size_t left_over = ctx->buflen; memcpy (&ctx->buffer[left_over], buffer, len); left_over += len; if (left_over >= 64) { sha256_process_block (ctx->buffer, 64, ctx); left_over -= 64; memcpy (ctx->buffer, &ctx->buffer[64], left_over); } ctx->buflen = left_over; } } cdrkit-1.1.11/genisoimage/dvd_file.c0000644000372500001440000005137710536265343016357 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)dvd_file.c 1.3 04/03/04 joerg */ /* * DVD_VIDEO code * Copyright (c) 2002 Olaf Beck - olaf_sc@yahoo.com * Jörg Schilling * (making the code portable) */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef DVD_VIDEO #include #include "genisoimage.h" #include #include "dvd_reader.h" #include "dvd_file.h" #include "ifo_read.h" static void bsort(int sector[], int title[], int size); static void uniq(int sector[], int title[], int title_sets_array[], int sector_sets_array[], int titles); static void DVDFreeFileSetArrays(int *sector, int *title, int *title_sets_array, int *sector_sets_array); void DVDFreeFileSet(title_set_info_t *title_set_info); title_set_info_t *DVDGetFileSet(char *dvd); int DVDGetFilePad(title_set_info_t *title_set_info, char *name); static void bsort(int sector[], int title[], int size) { int temp_title; int temp_sector; int i; int j; /* this is not bubble sort, this is primitive selection sort. Replace with * bubble sort later, maybe bidirectional, aka Coctail Sort */ for (i = 0; i < size; i++) { for (j = 0; j < size; j++) { if (sector[i] < sector[j]) { temp_sector = sector[i]; temp_title = title[i]; sector[i] = sector[j]; title[i] = title[j]; sector[j] = temp_sector; title[j] = temp_title; } } } } static void uniq(int sector[], int title[], int title_sets_array[], int sector_sets_array[], int titles) { int i; int j; for (i = 0, j = 0; j < titles; ) { if (sector[j] != sector[j+1]) { title_sets_array[i] = title[j]; sector_sets_array[i] = sector[j]; #ifdef DEBUG fprintf(stderr, "Sector offset is %d\n", sector_sets_array[i]); #endif i++; j++; } else { do { if (j < titles) j++; } while (sector[j] == sector[j+1]); } } } static void DVDFreeFileSetArrays(int *sector, int *title, int *title_sets_array, int *sector_sets_array) { free(sector); free(title); free(title_sets_array); free(sector_sets_array); } void DVDFreeFileSet(title_set_info_t *title_set_info) { free(title_set_info->title_set); free(title_set_info); } title_set_info_t * DVDGetFileSet(char *dvd) { /* * TODO Fix close of files if * we error out * We also assume that all * DVD files are of valid * size i.e. file%2048 == 0 */ /* title interation */ int title_sets; int titles; int counter; int i; /* DVD file structures */ dvd_reader_t * _dvd = NULL; ifo_handle_t * vmg_ifo = NULL; ifo_handle_t * vts_ifo = NULL; dvd_file_t * vmg_vob_file = NULL; dvd_file_t * vmg_ifo_file = NULL; dvd_file_t * vts_ifo_file = NULL; dvd_file_t * vts_menu_file = NULL; dvd_file_t * vts_title_file = NULL; /* The sizes it self of each file */ int ifo; int bup; int menu_vob; int title_vob; /* Arrays keeping the title - filset relationship */ int * sector; int * title; int * title_sets_array; int * sector_sets_array; /* DVD Video files */ struct stat fileinfo; char temppoint[PATH_MAX + 1]; /* The Title Set Info struct*/ title_set_info_t * title_set_info; /* Temporary mount point - to be used later */ char mountpoint[PATH_MAX + 1]; strncpy(mountpoint, dvd, sizeof (mountpoint)); mountpoint[sizeof (mountpoint)-1] = '\0'; _dvd = DVDOpen(dvd); if (!_dvd) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Can't open device '%s'\n", dvd); #else fprintf(stderr, "Can't open device\n"); #endif return (0); } vmg_ifo = ifoOpen(_dvd, 0); if (!vmg_ifo) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Can't open VMG info for '%s'.\n", dvd); #else fprintf(stderr, "Can't open VMG info.\n"); #endif return (0); } /* Check mount point */ snprintf(temppoint, sizeof (temppoint), "%s/VIDEO_TS/VIDEO_TS.IFO", mountpoint); if (stat(temppoint, &fileinfo) < 0) { /* If we can't stat the file, give up */ #ifdef USE_LIBSCHILY errmsg("Can't stat %s\n", temppoint); #else fprintf(stderr, "Can't stat %s\n", temppoint); perror(""); #endif return (0); } title_sets = vmg_ifo->vmgi_mat->vmg_nr_of_title_sets; titles = vmg_ifo->tt_srpt->nr_of_srpts; sector = e_malloc(titles * sizeof (int)); memset(sector, 0, titles * sizeof (int)); title = e_malloc(titles * sizeof (int)); title_sets_array = e_malloc(title_sets * sizeof (int)); sector_sets_array = e_malloc(title_sets * sizeof (int)); title_set_info = (title_set_info_t *)e_malloc(sizeof (title_set_info_t)); title_set_info->title_set = (title_set_t *)e_malloc((title_sets + 1) * sizeof (title_set_t)); title_set_info->num_titles = title_sets; /* Fill and sort the arrays for titles*/ if (titles >= 1) { for (counter = 0; counter < titles; counter++) { sector[counter] = vmg_ifo->tt_srpt->title[counter].title_set_sector; title[counter] = counter + 1; } } /* Yes, we should probably do a better sort than B - but what the heck*/ bsort(sector, title, titles); /* * Since title sets and titles are not the same we will need to sort * out "bogus" titles */ uniq(sector, title, title_sets_array, sector_sets_array, titles); /* Open VIDEO_TS.VOB is present */ vmg_vob_file = DVDOpenFile(_dvd, 0, DVD_READ_MENU_VOBS); /* Check VIDEO_TS title set */ vmg_ifo_file = DVDOpenFile(_dvd, 0, DVD_READ_INFO_FILE); if ((vmg_vob_file == 0) && vmg_ifo->vmgi_mat->vmg_last_sector + 1 < 2 * DVDFileSize(vmg_ifo_file)) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "IFO is not of correct size aborting\n"); #else fprintf(stderr, "IFO is not of correct size aborting\n"); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } else if ((vmg_vob_file != 0) && (vmg_ifo->vmgi_mat->vmg_last_sector + 1 < 2 * DVDFileSize(vmg_ifo_file) + DVDFileSize(vmg_vob_file))) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Either VIDEO_TS.IFO or VIDEO_TS.VOB is not of correct size"); #else fprintf(stderr, "Either VIDEO_TS.IFO or VIDEO_TS.VOB is not of correct size"); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } /* Find the actuall right size of VIDEO_TS.IFO */ if (vmg_vob_file == 0) { if (vmg_ifo->vmgi_mat->vmg_last_sector + 1 > 2 * DVDFileSize(vmg_ifo_file)) { ifo = vmg_ifo->vmgi_mat->vmg_last_sector - DVDFileSize(vmg_ifo_file) + 1; } else { ifo = vmg_ifo->vmgi_mat->vmgi_last_sector + 1; } } else { if (vmg_ifo->vmgi_mat->vmgi_last_sector + 1 < vmg_ifo->vmgi_mat->vmgm_vobs) { ifo = vmg_ifo->vmgi_mat->vmgm_vobs; } else { ifo = vmg_ifo->vmgi_mat->vmgi_last_sector + 1; } } title_set_info->title_set[0].size_ifo = ifo * 2048; title_set_info->title_set[0].realsize_ifo = fileinfo.st_size; title_set_info->title_set[0].pad_ifo = ifo - DVDFileSize(vmg_ifo_file); /* Find the actuall right size of VIDEO_TS.VOB */ if (vmg_vob_file != 0) { if (ifo + DVDFileSize(vmg_ifo_file) + DVDFileSize(vmg_vob_file) - 1 < vmg_ifo->vmgi_mat->vmg_last_sector) { menu_vob = vmg_ifo->vmgi_mat->vmg_last_sector - ifo - DVDFileSize(vmg_ifo_file) + 1; } else { menu_vob = vmg_ifo->vmgi_mat->vmg_last_sector - ifo - DVDFileSize(vmg_ifo_file) + 1; } snprintf(temppoint, sizeof (temppoint), "%s/VIDEO_TS/VIDEO_TS.VOB", mountpoint); if (stat(temppoint, &fileinfo) < 0) { #ifdef USE_LIBSCHILY errmsg("calc: Can't stat %s\n", temppoint); #else fprintf(stderr, "calc: Can't stat %s\n", temppoint); perror(""); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } title_set_info->title_set[0].realsize_menu = fileinfo.st_size; title_set_info->title_set[0].pad_menu = menu_vob - DVDFileSize(vmg_vob_file); title_set_info->title_set[0].size_menu = menu_vob * 2048; DVDCloseFile(vmg_vob_file); } else { title_set_info->title_set[0].size_menu = 0; title_set_info->title_set[0].realsize_menu = 0; title_set_info->title_set[0].pad_menu = 0; menu_vob = 0; } /* Finding the actuall right size of VIDEO_TS.BUP */ if (title_sets >= 1) { bup = sector_sets_array[0] - menu_vob - ifo; } else { /* Just in case we burn a DVD-Video without any title_sets */ bup = vmg_ifo->vmgi_mat->vmg_last_sector + 1 - menu_vob - ifo; } /* Never trust the BUP file - use a copy of the IFO */ snprintf(temppoint, sizeof (temppoint), "%s/VIDEO_TS/VIDEO_TS.IFO", mountpoint); if (stat(temppoint, &fileinfo) < 0) { #ifdef USE_LIBSCHILY errmsg("calc: Can't stat %s\n", temppoint); #else fprintf(stderr, "calc: Can't stat %s\n", temppoint); perror(""); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } title_set_info->title_set[0].realsize_bup = fileinfo.st_size; title_set_info->title_set[0].size_bup = bup * 2048; title_set_info->title_set[0].pad_bup = bup - DVDFileSize(vmg_ifo_file); /* Take care of the titles which we don't have in VMG */ title_set_info->title_set[0].number_of_vob_files = 0; title_set_info->title_set[0].realsize_vob[0] = 0; title_set_info->title_set[0].pad_title = 0; DVDCloseFile(vmg_ifo_file); if (title_sets >= 1) { for (counter = 0; counter < title_sets; counter++) { vts_ifo = ifoOpen(_dvd, counter + 1); if (!vts_ifo) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Can't open VTS info.\n"); #else fprintf(stderr, "Can't open VTS info.\n"); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } snprintf(temppoint, sizeof (temppoint), "%s/VIDEO_TS/VTS_%02i_0.IFO", mountpoint, counter + 1); if (stat(temppoint, &fileinfo) < 0) { #ifdef USE_LIBSCHILY errmsg("calc: Can't stat %s\n", temppoint); #else fprintf(stderr, "calc: Can't stat %s\n", temppoint); perror(""); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } /* Test if VTS_XX_0.VOB is present */ vts_menu_file = DVDOpenFile(_dvd, counter + 1, DVD_READ_MENU_VOBS); /* Test if VTS_XX_X.VOB are present */ vts_title_file = DVDOpenFile(_dvd, counter + 1, DVD_READ_TITLE_VOBS); /* Check VIDEO_TS.IFO */ vts_ifo_file = DVDOpenFile(_dvd, counter + 1, DVD_READ_INFO_FILE); /* * Checking that title will fit in the * space given by the ifo file */ if (vts_ifo->vtsi_mat->vts_last_sector + 1 < 2 * DVDFileSize(vts_ifo_file)) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "IFO is not of correct size aborting.\n"); #else fprintf(stderr, "IFO is not of correct size aborting\n"); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } else if ((vts_title_file != 0) && (vts_menu_file != 0) && (vts_ifo->vtsi_mat->vts_last_sector + 1 < 2 * DVDFileSize(vts_ifo_file) + DVDFileSize(vts_title_file) + DVDFileSize(vts_menu_file))) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Either VIDEO_TS.IFO or VIDEO_TS.VOB is not of correct size.\n"); #else fprintf(stderr, "Either VIDEO_TS.IFO or VIDEO_TS.VOB is not of correct size"); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } else if ((vts_title_file != 0) && (vts_menu_file == 0) && (vts_ifo->vtsi_mat->vts_last_sector + 1 < 2 * DVDFileSize(vts_ifo_file) + DVDFileSize(vts_title_file))) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Either VIDEO_TS.IFO or VIDEO_TS.VOB is not of correct size.\n"); #else fprintf(stderr, "Either VIDEO_TS.IFO or VIDEO_TS.VOB is not of correct size"); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } else if ((vts_menu_file != 0) && (vts_title_file == 0) && (vts_ifo->vtsi_mat->vts_last_sector + 1 < 2 * DVDFileSize(vts_ifo_file) + DVDFileSize(vts_menu_file))) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Either VIDEO_TS.IFO or VIDEO_TS.VOB is not of correct size.\n"); #else fprintf(stderr, "Either VIDEO_TS.IFO or VIDEO_TS.VOB is not of correct size"); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } /* Find the actuall right size of VTS_XX_0.IFO */ if ((vts_title_file == 0) && (vts_menu_file == 0)) { if (vts_ifo->vtsi_mat->vts_last_sector + 1 > 2 * DVDFileSize(vts_ifo_file)) { ifo = vts_ifo->vtsi_mat->vts_last_sector - DVDFileSize(vts_ifo_file) + 1; } else { ifo = vts_ifo->vtsi_mat->vts_last_sector - DVDFileSize(vts_ifo_file) + 1; } } else if (vts_title_file == 0) { if (vts_ifo->vtsi_mat->vtsi_last_sector + 1 < vts_ifo->vtsi_mat->vtstt_vobs) { ifo = vmg_ifo->vtsi_mat->vtstt_vobs; } else { ifo = vmg_ifo->vtsi_mat->vtstt_vobs; } } else { if (vts_ifo->vtsi_mat->vtsi_last_sector + 1 < vts_ifo->vtsi_mat->vtsm_vobs) { ifo = vts_ifo->vtsi_mat->vtsm_vobs; } else { ifo = vts_ifo->vtsi_mat->vtsi_last_sector + 1; } } title_set_info->title_set[counter + 1].size_ifo = ifo * 2048; title_set_info->title_set[counter + 1].realsize_ifo = fileinfo.st_size; title_set_info->title_set[counter + 1].pad_ifo = ifo - DVDFileSize(vts_ifo_file); /* Find the actuall right size of VTS_XX_0.VOB */ if (vts_menu_file != 0) { if (vts_ifo->vtsi_mat->vtsm_vobs == 0) { /* * Apparently start sector 0 means that * VTS_XX_0.VOB is empty after all... */ menu_vob = 0; if (DVDFileSize(vts_menu_file) != 0) { /* * Paranoia: we most likely never * come here... */ #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "%s/VIDEO_TS/VTS_%02i_0.IFO appears to be corrupted.\n", mountpoint, counter+1); #else fprintf(stderr, "%s/VIDEO_TS/VTS_%02i_0.IFO appears to be corrupted.\n", mountpoint, counter+1); #endif return (0); } } else if ((vts_title_file != 0) && (vts_ifo->vtsi_mat->vtstt_vobs - vts_ifo->vtsi_mat->vtsm_vobs > DVDFileSize(vts_menu_file))) { menu_vob = vts_ifo->vtsi_mat->vtstt_vobs - vts_ifo->vtsi_mat->vtsm_vobs; } else if ((vts_title_file == 0) && (vts_ifo->vtsi_mat->vtsm_vobs + DVDFileSize(vts_menu_file) + DVDFileSize(vts_ifo_file) - 1 < vts_ifo->vtsi_mat->vts_last_sector)) { menu_vob = vts_ifo->vtsi_mat->vts_last_sector - DVDFileSize(vts_ifo_file) - vts_ifo->vtsi_mat->vtsm_vobs + 1; } else { menu_vob = vts_ifo->vtsi_mat->vtstt_vobs - vts_ifo->vtsi_mat->vtsm_vobs; } snprintf(temppoint, sizeof (temppoint), "%s/VIDEO_TS/VTS_%02i_0.VOB", mountpoint, counter + 1); if (stat(temppoint, &fileinfo) < 0) { #ifdef USE_LIBSCHILY errmsg("calc: Can't stat %s\n", temppoint); #else fprintf(stderr, "calc: Can't stat %s\n", temppoint); perror(""); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } title_set_info->title_set[counter + 1].realsize_menu = fileinfo.st_size; title_set_info->title_set[counter + 1].size_menu = menu_vob * 2048; title_set_info->title_set[counter + 1].pad_menu = menu_vob - DVDFileSize(vts_menu_file); } else { title_set_info->title_set[counter + 1].size_menu = 0; title_set_info->title_set[counter + 1].realsize_menu = 0; title_set_info->title_set[counter + 1].pad_menu = 0; menu_vob = 0; } /* Find the actuall total size of VTS_XX_[1 to 9].VOB */ if (vts_title_file != 0) { if (ifo + menu_vob + DVDFileSize(vts_ifo_file) - 1 < vts_ifo->vtsi_mat->vts_last_sector) { title_vob = vts_ifo->vtsi_mat->vts_last_sector + 1 - ifo - menu_vob - DVDFileSize(vts_ifo_file); } else { title_vob = vts_ifo->vtsi_mat->vts_last_sector + 1 - ifo - menu_vob - DVDFileSize(vts_ifo_file); } /* * Find out how many vob files * and the size of them */ for (i = 0; i < 9; ++i) { snprintf(temppoint, sizeof (temppoint), "%s/VIDEO_TS/VTS_%02i_%i.VOB", mountpoint, counter + 1, i + 1); if (stat(temppoint, &fileinfo) < 0) { break; } title_set_info->title_set[counter + 1].realsize_vob[i] = fileinfo.st_size; } title_set_info->title_set[counter + 1].number_of_vob_files = i; title_set_info->title_set[counter + 1].size_title = title_vob * 2048; title_set_info->title_set[counter + 1].pad_title = title_vob - DVDFileSize(vts_title_file); } else { title_set_info->title_set[counter + 1].number_of_vob_files = 0; title_set_info->title_set[counter + 1].realsize_vob[0] = 0; title_set_info->title_set[counter + 1].size_title = 0; title_set_info->title_set[counter + 1].pad_title = 0; title_vob = 0; } /* Find the actuall total size of VTS_XX_0.BUP */ if (title_sets - 1 > counter) { bup = sector_sets_array[counter+1] - sector_sets_array[counter] - title_vob - menu_vob - ifo; } else { bup = vts_ifo->vtsi_mat->vts_last_sector + 1 - title_vob - menu_vob - ifo; } /* Never trust the BUP use a copy of the IFO */ snprintf(temppoint, sizeof (temppoint), "%s/VIDEO_TS/VTS_%02i_0.IFO", mountpoint, counter + 1); if (stat(temppoint, &fileinfo) < 0) { #ifdef USE_LIBSCHILY errmsg("calc: Can't stat %s\n", temppoint); #else fprintf(stderr, "calc: Can't stat %s\n", temppoint); perror(""); #endif DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); DVDFreeFileSet(title_set_info); return (0); } title_set_info->title_set[counter + 1].size_bup = bup * 2048; title_set_info->title_set[counter + 1].realsize_bup = fileinfo.st_size; title_set_info->title_set[counter + 1].pad_bup = bup - DVDFileSize(vts_ifo_file); /* Closing files */ if (vts_menu_file != 0) { DVDCloseFile(vts_menu_file); } if (vts_title_file != 0) { DVDCloseFile(vts_title_file); } if (vts_ifo_file != 0) { DVDCloseFile(vts_ifo_file); } ifoClose(vts_ifo); } } DVDFreeFileSetArrays(sector, title, title_sets_array, sector_sets_array); /* Close the VMG ifo file we got all the info we need */ ifoClose(vmg_ifo); /* Close the DVD */ DVDClose(_dvd); /* Return the actuall info*/ return (title_set_info); } int DVDGetFilePad(title_set_info_t *title_set_info, char *name) { char title_a[3]; char vob_a[2]; int title; int vob; title_a[0] = title_a[1] = title_a[2] = '\0'; vob_a[0] = vob_a[1] = '\0'; if (name[0] != 'V') { return (0); } if (memcmp(name, "VIDEO_TS", 8) == 0) { if (strstr(name, ".IFO") != 0) { return (title_set_info->title_set[0].pad_ifo); } else if (strstr(name, ".VOB") != 0) { return (title_set_info->title_set[0].pad_menu); } else if (strstr(name, ".BUP") != 0) { return (title_set_info->title_set[0].pad_bup); } else { return (0); } } else if (memcmp(name, "VTS_", 4) == 0) { title_a[0] = name[4]; title_a[1] = name[5]; title_a[2] = '\0'; vob_a[0] = name[7]; vob_a[1] = '\0'; title = atoi(title_a); vob = atoi(vob_a); if (title > title_set_info->num_titles) { return (0); } else { if (strstr(name, ".IFO") != 0) { return (title_set_info->title_set[title].pad_ifo); } else if (strstr(name, ".BUP") != 0) { return (title_set_info->title_set[title].pad_bup); } else if (vob == 0) { return (title_set_info->title_set[title].pad_menu); } else if (vob == title_set_info->title_set[title].number_of_vob_files) { return (title_set_info->title_set[title].pad_title); } else { return (0); } } } else { return (0); } } #endif /*DVD_VIDEO*/ cdrkit-1.1.11/genisoimage/udf.h0000644000372500001440000000375710563167602015364 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)udf.h 1.2 04/03/01 Copyright 2001-2004 J. Schilling */ /* * UDF external definitions for genisoimage * * Copyright (c) 2001-2004 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _UDF_H #define _UDF_H extern struct output_fragment udf_vol_recognition_area_frag; extern struct output_fragment udf_main_seq_frag; extern struct output_fragment udf_main_seq_copy_frag; extern struct output_fragment udf_integ_seq_frag; extern struct output_fragment udf_anchor_vol_desc_frag; extern struct output_fragment udf_file_set_desc_frag; extern struct output_fragment udf_dirtree_frag; extern struct output_fragment udf_file_entries_frag; extern struct output_fragment udf_end_anchor_vol_desc_frag; extern struct output_fragment udf_pad_to_sector_32_frag; extern struct output_fragment udf_pad_to_sector_256_frag; extern struct output_fragment udf_padend_avdp_frag; int assign_dvd_weights(char *name, struct directory *this_dir, int val); extern int use_udf; #endif /* _UDF_H */ cdrkit-1.1.11/genisoimage/fnmatch.h0000644000372500001440000000605710513514665016222 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)fnmatch.h 1.4 04/03/02 eric */ /* * Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. * * NOTE: The canonical source of this file is maintained with the GNU C Library. * Bugs can be reported to bug-glibc@prep.ai.mit.edu. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _FNMATCH_H #define _FNMATCH_H 1 #ifndef _PROTOTYP_H #include #endif #ifdef __cplusplus extern "C" { #endif /*#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)*/ #ifdef PROTOTYPES #undef __P #define __P(protos) protos #else /* Not C++ or ANSI C. */ #undef __P #define __P(protos) () /* * We can get away without defining `const' here only because in this file * it is used only inside the prototype for `fnmatch', which is elided in * non-ANSI C where `const' is problematical. */ #endif /* C++ or ANSI C. */ /* * We #undef these before defining them because some losing systems * (HP-UX A.08.07 for example) define these in . */ #undef FNM_PATHNAME #undef FNM_NOESCAPE #undef FNM_PERIOD /* Bits set in the FLAGS argument to `fnmatch'. */ #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined(_GNU_SOURCE) #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ #define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ #endif #ifndef FNM_FILE_NAME /* * Apparently GNU libc doesn't define this thing. */ #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ #endif /* Value returned by `fnmatch' if STRING does not match PATTERN. */ #define FNM_NOMATCH 1 /* * Match STRING against the filename pattern PATTERN, * returning zero if it matches, FNM_NOMATCH if not. */ extern int fnmatch(const char *__pattern, const char *__string, int __flags); #ifdef __cplusplus } #endif #endif /* fnmatch.h */ cdrkit-1.1.11/genisoimage/sha1.h0000644000372500001440000000636611016347153015434 0ustar steveusers/* Declarations of functions and data types used for SHA1 sum library functions. Copyright (C) 2000, 2001, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SHA1_H # define SHA1_H 1 # include typedef unsigned int md5_uint32; /* Structure to save state of computation between the single steps. */ struct sha1_ctx { md5_uint32 A; md5_uint32 B; md5_uint32 C; md5_uint32 D; md5_uint32 E; md5_uint32 total[2]; md5_uint32 buflen; char buffer[128] __attribute__ ((__aligned__ (__alignof__ (md5_uint32)))); }; /* Initialize structure containing state of computation. */ extern void sha1_init_ctx (struct sha1_ctx *ctx); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is necessary that LEN is a multiple of 64!!! */ extern void sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is NOT required that LEN is a multiple of 64. */ extern void sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx); /* Process the remaining bytes in the buffer and put result from CTX in first 20 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF be correctly aligned for a 32 bits value. */ extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf); /* Put result from CTX in first 20 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf); /* Compute SHA1 message digest for bytes read from STREAM. The resulting message digest number will be written into the 20 bytes beginning at RESBLOCK. */ extern int sha1_stream (FILE *stream, void *resblock); /* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ extern void *sha1_buffer (const char *buffer, size_t len, void *resblock); #endif cdrkit-1.1.11/genisoimage/apple_driver.c0000644000372500001440000001156410536265343017251 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)apple_driver.c 1.6 04/03/04 joerg */ /* * apple_driver.c: extract Mac partition label, maps and boot driver * * Based on Apple_Driver.pl, part of "genisoimage 1.05 PLUS" by Andy Polyakov * (I don't know Perl, so I rewrote it C ...) * (see http://fy.chalmers.se/~appro/genisoimage_plus.html for details) * * usage: apple_driver CDROM_device > HFS_driver_file * * The format of the HFS driver file: * * HFS CD Label Block 512 bytes * Driver Partition Map (for 2048 byte blocks) 512 bytes * Driver Partition Map (for 512 byte blocks) 512 bytes * Empty 512 bytes * Driver Partition N x 2048 bytes * HFS Partition Boot Block 1024 bytes * * By extracting a driver from an Apple CD, you become liable to obey * Apple Computer, Inc. Software License Agreements. * * James Pearson 17/5/98 */ #include #include "genisoimage.h" #include #include int get_732(char *p); int get_722(char *p); int get_732(char *p) { return ((p[3] & 0xff) | ((p[2] & 0xff) << 8) | ((p[1] & 0xff) << 16) | ((p[0] & 0xff) << 24)); } int get_722(char *p) { return ((p[1] & 0xff) | ((p[0] & 0xff) << 8)); } #if 0 EXPORT int main(argc, argv) int argc; char **argv; { FILE *fp; MacLabel *mac_label; MacPart *mac_part; unsigned char Block0[HFS_BLOCKSZ]; unsigned char block[SECTOR_SIZE]; unsigned char bootb[2*HFS_BLOCKSZ]; unsigned char pmBlock512[HFS_BLOCKSZ]; unsigned int sbBlkSize; unsigned int pmPyPartStart; unsigned int pmPartStatus; unsigned int pmMapBlkCnt; int have_boot = 0, have_hfs = 0; int hfs_start; int i, j; save_args(argc, argv); if (argc != 2) comerrno(EX_BAD, "Usage: %s device-path", argv[0]); if ((fp = fopen(argv[1], "rb")) == NULL) comerr("Can't open '%s'.", argv[1]); if (fread(Block0, 1, HFS_BLOCKSZ, fp) != HFS_BLOCKSZ) comerr("Can't read '%s'.", argv[1]); mac_label = (MacLabel *)Block0; mac_part = (MacPart *)block; sbBlkSize = get_722((char *)mac_label->sbBlkSize); if (! IS_MAC_LABEL(mac_label) || sbBlkSize != SECTOR_SIZE) comerrno(EX_BAD, "%s is not a bootable Mac disk", argv[1]); i = 1; do { if (fseek(fp, i * HFS_BLOCKSZ, SEEK_SET) != 0) comerr("Ccan't seek %s", argv[1]); if (fread(block, 1, HFS_BLOCKSZ, fp) != HFS_BLOCKSZ) comerr("Can't read '%s'.", argv[1]); pmMapBlkCnt = get_732((char *)mac_part->pmMapBlkCnt); if (!have_boot && strncmp((char *)mac_part->pmPartType, pmPartType_2, 12) == 0) { hfs_start = get_732((char *)mac_part->pmPyPartStart); fprintf(stderr, "%s: found 512 driver partition (at block %d)\n", argv[0], hfs_start); memcpy(pmBlock512, block, HFS_BLOCKSZ); have_boot = 1; } if (!have_hfs && strncmp((char *)mac_part->pmPartType, pmPartType_4, 9) == 0) { hfs_start = get_732((char *)mac_part->pmPyPartStart); if (fseek(fp, hfs_start*HFS_BLOCKSZ, SEEK_SET) != 0) comerr("Can't seek '%s'.", argv[1]); if (fread(bootb, 2, HFS_BLOCKSZ, fp) != HFS_BLOCKSZ) comerr("Can't read '%s'.", argv[1]); if (get_722((char *)bootb) == 0x4c4b) { fprintf(stderr, "%s: found HFS partition (at blk %d)\n", argv[0], hfs_start); have_hfs = 1; } } } while (i++ < pmMapBlkCnt); if (!have_hfs || !have_boot) comerrno(EX_BAD, "%s is not a bootable Mac disk", argv[1]); i = 1; do { if (fseek(fp, i*sbBlkSize, SEEK_SET) != 0) comerr("Can't seek '%s'.", argv[1]); if (fread(block, 1, HFS_BLOCKSZ, fp) != HFS_BLOCKSZ) comerr("Can't read '%s'.", argv[1]); pmMapBlkCnt = get_732((char *)mac_part->pmMapBlkCnt); if (strncmp((char *)mac_part->pmPartType, pmPartType_2, 12) == 0) { int start, num; fprintf(stderr, "%s: extracting %s ", argv[0], mac_part->pmPartType); start = get_732((char *)mac_part->pmPyPartStart); num = get_732((char *)mac_part->pmPartBlkCnt); fwrite(Block0, 1, HFS_BLOCKSZ, stdout); fwrite(block, 1, HFS_BLOCKSZ, stdout); fwrite(pmBlock512, 1, HFS_BLOCKSZ, stdout); memset(block, 0, HFS_BLOCKSZ); fwrite(block, 1, HFS_BLOCKSZ, stdout); if (fseek(fp, start*sbBlkSize, SEEK_SET) != 0) comerr("Can't seek '%s'.", argv[1]); for (j = 0; j < num; j++) { if (fread(block, 1, sbBlkSize, fp) != sbBlkSize) comerr("Can't read '%s'.", argv[1]); fwrite(block, 1, sbBlkSize, stdout); fprintf(stderr, "."); } fprintf(stderr, "\n"); fwrite(bootb, 2, HFS_BLOCKSZ, stdout); fclose(fp); exit(0); } if (!IS_MAC_PART(mac_part)) comerrno(EX_BAD, "Unable to find boot partition"); } while (i++ < pmMapBlkCnt); return (0); } #endif cdrkit-1.1.11/genisoimage/dvd_reader.h0000644000372500001440000000776710531416235016704 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)dvd_reader.h 1.2 04/03/02 joerg */ #ifndef _DVD_READER_H #define _DVD_READER_H /* * Copyright (C) 2001, 2002 Billy Biggs , * Håkan Hjort * (I only did the cut down no other contribs) * Jörg Schilling * (making the code portable) * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * NOTE: This is a cut down version of libdvdread for genisoimage, due * to portability issues with the current libdvdread according to * the maintainer of genisoimage. * This cut down version only reads from a harddisk file structure * and it only implements the functions necessary inorder to make * genisoimage produce valid DVD-Video images. * DON'T USE THIS LIBRARY IN ANY OTHER PROGRAM GET THE REAL * LIBDVDREAD INSTEAD */ #include /* Make sure is included */ /* * Maximum length of filenames for UDF. */ #define MAX_UDF_FILE_NAME_LEN 2048 /* * The length of one Logical Block of a DVD Video. */ #define DVD_VIDEO_LB_LEN 2048 #ifdef __cplusplus extern "C" { #endif struct dvd_reader_s { /* Information required for a directory path drive. */ char *path_root; }; typedef struct dvd_reader_s dvd_reader_t; typedef struct dvd_file_s dvd_file_t; /* * dvd = DVDOpen(path); * Opens a directory name of a DVD-Video structure on HD. * Returns zero if it fails. * The path should be like this * "path/VIDEO_TS/VTS_01_1.VOB" */ extern dvd_reader_t *DVDOpen(const char *); /* * DVDClose(dvd); * * Closes and cleans up the DVD reader object. You must close all open files * before calling this function. */ extern void DVDClose(dvd_reader_t *); /* * INFO_FILE : VIDEO_TS.IFO (manager) * VTS_XX_0.IFO (title) * * INFO_BACKUP_FILE: VIDEO_TS.BUP (manager) * VTS_XX_0.BUP (title) * * MENU_VOBS : VIDEO_TS.VOB (manager) * VTS_XX_0.VOB (title) * * TITLE_VOBS : VTS_XX_[1-9].VOB (title) * All files in the title set are opened and * read as a single file. */ typedef enum { DVD_READ_INFO_FILE, DVD_READ_INFO_BACKUP_FILE, DVD_READ_MENU_VOBS, DVD_READ_TITLE_VOBS } dvd_read_domain_t; /* * dvd_file = DVDOpenFile(dvd, titlenum, domain); * * Opens a file on the DVD given the title number and domain. If the title * number is 0, the video manager information is opened * (VIDEO_TS.[IFO,BUP,VOB]). Returns a file structure which may be used for * reads, or 0 if the file was not found. */ extern dvd_file_t * DVDOpenFile(dvd_reader_t *, int, dvd_read_domain_t); /* * DVDCloseFile(dvd_file); * * Closes a file and frees the associated structure. */ extern void DVDCloseFile(dvd_file_t *); /* * blocks = DVDFileSize(dvd_file); * * Returns the file size in blocks. */ extern ssize_t DVDFileSize(dvd_file_t *); #ifdef __cplusplus }; #endif #endif /* _DVD_READER_H */ cdrkit-1.1.11/genisoimage/CMakeLists.txt0000644000372500001440000000530011304054475017154 0ustar steveusersPROJECT (MKISOFS C) INCLUDE(../include/AddScgBits.cmake) INCLUDE(../include/AddSchilyBits.cmake) INCLUDE_DIRECTORIES(../include ../libhfs_iso ../wodim ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include) INCLUDE(CheckIncludeFiles) CHECK_INCLUDE_FILES("magic.h" USE_MAGIC) IF(USE_MAGIC) ADD_DEFINITIONS(-DUSE_MAGIC) SET(MAGICLIBS magic) ENDIF(USE_MAGIC) CHECK_INCLUDE_FILES("pthread.h" USE_PTHREAD) IF(USE_PTHREAD) ADD_DEFINITIONS(-DTHREADED_CHECKSUMS) LIST(APPEND EXTRA_LIBS "pthread") ENDIF(USE_PTHREAD) IF(HAVE_ICONV_H) ADD_DEFINITIONS(-DUSE_ICONV) #INCLUDE(CheckLibraryExists) # CHECK_LIBRARY_EXISTS (iconv "iconv_open(argv[0],argv[0])" "" USE_LIBICONV) IF(USE_LIBICONV) LIST(APPEND EXTRA_LIBS "iconv") ELSE(USE_LIBICONV) # MESSAGE("No additional libiconv found, maybe not required. If required, change linker flags, see TROUBLESHOOTING in the INSTALL file") ENDIF(USE_LIBICONV) ENDIF(HAVE_ICONV_H) ADD_DEFINITIONS(-DUSE_LARGEFILES -DABORT_DEEP_ISO_ONLY -DAPPLE_HYB -DUDF -DDVD_VIDEO -DSORTING -DHAVE_CONFIG_H -DUSE_LIBSCHILY -DUSE_SCG -DJIGDO_TEMPLATE) SET(MKISOFS_MOST_SRCS apple.c boot.c desktop.c dvd_file.c dvd_reader.c eltorito.c exclude.c files.c fnmatch.c hash.c ifo_read.c joliet.c mac_label.c match.c multi.c name.c rock.c scsi.c stream.c tree.c udf.c vms.c volume.c write.c boot-alpha.c boot-hppa.c boot-mips.c md5.c jte.c rsync.c boot-mipsel.c endian.c sha1.c sha256.c sha512.c checksum.c ) INCLUDE(CheckFunctionExists) SET(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) CHECK_FUNCTION_EXISTS("getopt_long" HAVE_GETOPT_LONG) IF(NOT HAVE_GETOPT_LONG) LIST ( APPEND MKISOFS_MOST_SRCS getopt.c getopt1.c ) ENDIF(NOT HAVE_GETOPT_LONG) #SET_SOURCE_FILES_PROPERTIES(${MKISOFS_MOST_SRCS} PROPERTIES ) LINK_DIRECTORIES(../libhfs_iso ../librols ../libusal ../libunls ../wodim) ADD_EXECUTABLE (genisoimage genisoimage.c ${MKISOFS_MOST_SRCS}) TARGET_LINK_LIBRARIES(genisoimage wodimstuff hfs_iso ${MAGICLIBS} c unls z bz2 ${EXTRA_LIBICONV} ${EXTRA_LIBS}) # common lib set and genisoimage source parts for the rest LINK_LIBRARIES(wodimstuff ${EXTRA_LIBS} unls ${EXTRA_LIBICONV} ) ADD_EXECUTABLE(devdump diag/dump.c scsi.c) ADD_EXECUTABLE(isodebug diag/isodebug.c scsi.c) ADD_EXECUTABLE(isodump diag/isodump.c scsi.c) ADD_EXECUTABLE(isoinfo diag/isoinfo.c scsi.c) ADD_EXECUTABLE(isovfy diag/isovfy.c scsi.c) SET_TARGET_PROPERTIES(genisoimage devdump isodebug isodump isoinfo isovfy PROPERTIES SKIP_BUILD_RPATH TRUE) INSTALL(TARGETS genisoimage devdump isodebug isodump isoinfo isovfy DESTINATION bin) INSTALL(FILES genisoimage.1 diag/devdump.1 diag/isodebug.1 diag/isodump.1 diag/isoinfo.1 diag/isovfy.1 DESTINATION ${MANSUBDIR}/man1) INSTALL(FILES genisoimagerc.5 DESTINATION "${MANSUBDIR}/man5") cdrkit-1.1.11/genisoimage/exclude.h0000644000372500001440000000120110513514665016215 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)exclude.h 1.3 04/03/02 eric */ /* * 9-Dec-93 R.-D. Marzusch, marzusch@odiehh.hanse.de: * added 'exclude' option (-x) to specify pathnames NOT to be included in * CD image. */ void exclude(char * fn); int is_excluded(char * fn); cdrkit-1.1.11/genisoimage/ifo_read.c0000644000372500001440000002517510536265343016350 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)ifo_read.c 1.5 04/03/04 joerg */ /* * Copyright (C) 2002 Olaf Beck * Jörg Schilling * (making the code portable) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * NOTE: This is a cut down version of libdvdread for genisoimage, due * to portability issues with the current libdvdread according to * the maintainer of genisoimage. * This cut down version only reads from a harddisk file structure * and it only implements the functions necessary inorder to make * genisoimage produce valid DVD-Video images. * DON'T USE THIS LIBRARY IN ANY OTHER PROGRAM GET THE REAL * LIBDVDREAD INSTEAD */ #ifdef DVD_VIDEO #include #include "genisoimage.h" #include #include #include #include "ifo_read.h" #include "bswap.h" #define MSGEREAD "Failed to read VIDEO_TS.IFO\n" #define MSGESEEK "Failed to seek VIDEO_TS.IFO\n" #define MSGEOPEN "Failed to open VIDEO_TS.IFO\n" static ifo_handle_t *ifoReadVTSI(int file, ifo_handle_t * ifofile); static ifo_handle_t *ifoReadVGMI(int file, ifo_handle_t * ifofile); ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title); static void ifoFree_TT_SRPT(ifo_handle_t *ifofile); void ifoClose(ifo_handle_t * ifofile); static ifo_handle_t * ifoReadVTSI(int file, ifo_handle_t *ifofile) { off_t offset; UInt32_t sector; vtsi_mat_t * vtsi_mat; /* Make the VMG part NULL */ ifofile->vmgi_mat = NULL; ifofile->tt_srpt = NULL; vtsi_mat = (vtsi_mat_t *)e_malloc(sizeof (vtsi_mat_t)); if (!vtsi_mat) { /* fprintf(stderr, "Memmory allocation error\n");*/ free(ifofile); return (0); } ifofile->vtsi_mat = vtsi_mat; /* Last sector of VTS i.e. last sector of BUP */ offset = 12; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif ifoClose(ifofile); return (0); } if (read(file, §or, sizeof (sector)) != sizeof (sector)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif ifoClose(ifofile); return (0); } B2N_32(sector); vtsi_mat->vts_last_sector = sector; /* Last sector of IFO */ offset = 28; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif ifoClose(ifofile); return (0); } if (read(file, §or, sizeof (sector)) != sizeof (sector)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif ifoClose(ifofile); return (0); } B2N_32(sector); vtsi_mat->vtsi_last_sector = sector; /* Star sector of VTS Menu VOB */ offset = 192; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif ifoClose(ifofile); return (0); } if (read(file, §or, sizeof (sector)) != sizeof (sector)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif ifoClose(ifofile); return (0); } B2N_32(sector); vtsi_mat->vtsm_vobs = sector; /* Start sector of VTS Title VOB */ offset = 196; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif ifoClose(ifofile); return (0); } if (read(file, §or, sizeof (sector)) != sizeof (sector)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif ifoClose(ifofile); return (0); } B2N_32(sector); vtsi_mat->vtstt_vobs = sector; return (ifofile); } static ifo_handle_t * ifoReadVGMI(int file, ifo_handle_t *ifofile) { off_t offset; Uint counter; UInt32_t sector; UInt16_t titles; vmgi_mat_t *vmgi_mat; tt_srpt_t *tt_srpt; /* Make the VTS part null */ ifofile->vtsi_mat = NULL; vmgi_mat = (vmgi_mat_t *)e_malloc(sizeof (vmgi_mat_t)); if (!vmgi_mat) { /* fprintf(stderr, "Memmory allocation error\n");*/ free(ifofile); return (0); } ifofile->vmgi_mat = vmgi_mat; /* Last sector of VMG i.e. last sector of BUP */ offset = 12; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif ifoClose(ifofile); return (0); } if (read(file, §or, sizeof (sector)) != sizeof (sector)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif ifoClose(ifofile); return (0); } B2N_32(sector); vmgi_mat->vmg_last_sector = sector; /* Last sector of IFO */ offset = 28; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif ifoClose(ifofile); return (0); } if (read(file, §or, sizeof (sector)) != sizeof (sector)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif ifoClose(ifofile); return (0); } B2N_32(sector); vmgi_mat->vmgi_last_sector = sector; /* Number of VTS i.e. title sets */ offset = 62; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif ifoClose(ifofile); return (0); } if (read(file, &titles, sizeof (titles)) != sizeof (titles)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif ifoClose(ifofile); return (0); } B2N_16(titles); vmgi_mat->vmg_nr_of_title_sets = titles; /* Star sector of VMG Menu VOB */ offset = 192; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif ifoClose(ifofile); return (0); } if (read(file, §or, sizeof (sector)) != sizeof (sector)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif ifoClose(ifofile); return (0); } B2N_32(sector); vmgi_mat->vmgm_vobs = sector; /* Sector offset to TT_SRPT */ offset = 196; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif ifoClose(ifofile); return (0); } if (read(file, §or, sizeof (sector)) != sizeof (sector)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif ifoClose(ifofile); return (0); } B2N_32(sector); vmgi_mat->tt_srpt = sector; tt_srpt = (tt_srpt_t *)e_malloc(sizeof (tt_srpt_t)); if (!tt_srpt) { /* fprintf(stderr, "Memmory allocation error\n");*/ ifoClose(ifofile); return (0); } ifofile->tt_srpt = tt_srpt; /* Number of titles in TT_SRPT */ offset = 2048 * vmgi_mat->tt_srpt; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif return (0); } if (read(file, &titles, sizeof (titles)) != sizeof (titles)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif return (0); } B2N_16(titles); tt_srpt->nr_of_srpts = titles; tt_srpt->title = (title_info_t *)e_malloc(sizeof (title_info_t) * tt_srpt->nr_of_srpts); if (!tt_srpt->title) { /* fprintf(stderr, "Memmory allocation error\n");*/ ifoClose(ifofile); return (0); } /* Start sector of each title in TT_SRPT */ for (counter = 0; counter < tt_srpt->nr_of_srpts; counter++) { offset = (2048 * vmgi_mat->tt_srpt) + 8 + (counter * 12) + 8; if (lseek(file, offset, SEEK_SET) != offset) { #ifdef USE_LIBSCHILY errmsg(MSGESEEK); #else printf(stderr, MSGESEEK); #endif ifoClose(ifofile); return (0); } if (read(file, §or, sizeof (sector)) != sizeof (sector)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif ifoClose(ifofile); return (0); } B2N_32(sector); tt_srpt->title[counter].title_set_sector = sector; } return (ifofile); } ifo_handle_t * ifoOpen(dvd_reader_t *dvd, int title) { /* The main ifofile structure */ ifo_handle_t *ifofile; /* File handles and offset */ int file; off_t offset; char full_path[ PATH_MAX + 1 ]; /* Identifier of the IFO */ char identifier[13]; identifier[0] = '\0'; ifofile = (ifo_handle_t *)e_malloc(sizeof (ifo_handle_t)); memset(ifofile, 0, sizeof (ifo_handle_t)); if (title) { snprintf(full_path, sizeof (full_path), "%s/VIDEO_TS/VTS_%02d_0.IFO", dvd->path_root, title); } else { snprintf(full_path, sizeof (full_path), "%s/VIDEO_TS/VIDEO_TS.IFO", dvd->path_root); } if ((file = open(full_path, O_RDONLY | O_BINARY)) == -1) { #ifdef USE_LIBSCHILY errmsg(MSGEOPEN); #else printf(stderr, MSGEOPEN); #endif free(ifofile); return (0); } offset = 0; /* Determine if we have a VMGI or VTSI */ if (read(file, identifier, sizeof (identifier)) != sizeof (identifier)) { #ifdef USE_LIBSCHILY errmsg(MSGEREAD); #else printf(stderr, MSGEREAD); #endif return (0); } if ((strstr("DVDVIDEO-VMG", identifier) != 0) && (title == 0)) { ifofile = ifoReadVGMI(file, ifofile); close(file); return (ifofile); } else if ((strstr("DVDVIDEO-VTS", identifier) != 0) && (title != 0)) { ifofile = ifoReadVTSI(file, ifofile); close(file); return (ifofile); } else { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Giving up this is not a valid IFO file\n"); #else fprintf(stderr, "Giving up this is not a valid IFO file\n"); #endif close(file); free(ifofile); ifofile = 0; return (0); } } static void ifoFree_TT_SRPT(ifo_handle_t *ifofile) { if (!ifofile) return; if (ifofile->tt_srpt) { if (ifofile->tt_srpt->title) { free(ifofile->tt_srpt->title); } free(ifofile->tt_srpt); ifofile->tt_srpt = 0; } } void ifoClose(ifo_handle_t *ifofile) { if (!ifofile) return; ifoFree_TT_SRPT(ifofile); if (ifofile->vmgi_mat) { free(ifofile->vtsi_mat); } if (ifofile->vtsi_mat) { free(ifofile->vtsi_mat); } free(ifofile); ifofile = 0; } #endif /* DVD_VIDEO */ cdrkit-1.1.11/genisoimage/ChangeLog.mkhybrid0000644000372500001440000003302610471375025020005 0ustar steveusersMon May 1 14:51:00 BST 2000 James Pearson Version 1.13a01 mkhybrid has now been merged with, and is now part of mkisofs Wed Apr 26 10:18:44 BST 2000 James Pearson Version 1.12.1a10 The -icon-position will now attempt to preserve folder window positions, scroll bars, views etc. for Apple/Unix file formats that support this information (currently CAP, EtherShare, Netatalk) Added -root-info option - which works with the -icon-position option to preserve the root folder window characteristics. See README.rootinfo for more about this option. Added 'mac-roman' to the -jcharset option. Converts Macintosh Roman file name characters to the correct Joliet characters. Tue Apr 18 14:06:00 BST 2000 James Pearson Version 1.12.1a07 HFS files/directories are made invisible (HFS_FNDR_ISINVISIBLE flag set) if the ISO file/directory is hidden. Mon Apr 3 22:04:00 BST 2000 James Pearson Version 1.12.1a05 Custom HFS volume or folder icons are now recoginised Sun Mar 19 19:12:00 GMT 2000 James Pearson Version 1.12.1a03 New options -hfs-type & -hfs-creator Wed Mar 8 11:26:00 GMT 2000 James Pearson Version 1.12 Final release of mkhybrid v1.12 mkhybrid will now be integrated with the cdrecord package (see: ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha) Wed Feb 23 14:35:20 GMT 2000 James Pearson Version 1.12b6.0 Now based on mkisofs v1.12 available as part of the cdrecord package from ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ Will now create an HFS volume of at least 800k in size. Added option to preserve the HFS icon position (if it exists) from a Apple/Unix file. Use -icon-position (Alpha) Thu Nov 25 19:59:27 GMT 1999 James Pearson Version 1.12b5.4 Added partial support for Microsoft's "Services for Macintosh" format files. See the man page for details. mkhybrid no longer tries to work out the "disk cluster size" for use with Apple File Exchange. The disk cluster size now needs to be given on the command line (-cluster-size). The code involved was not portable across various operating systems. Added minor changes for Rhapsody and BeOS. Cleaned up the code in apple.c (thanks to Ed Randall ). mkhybrid will now create a valid HFS partition as the last session on a multisession CD. (Alpha) Sun Aug 8 10:36:15 BST 1999 James Pearson Version 1.12b5.3 Changed the nature of the -hfs and -apple command line options - see README.mkhybrid for details Added PReP boot option from Troy Benjegerdes - see README.prep_boot Added support for AppleDouble/Single file names as "Pascal Strings" Added checks for Joliet and Rock Ridge filename clashes. Fixed minor install bug in Makefile.in Tue Apr 30 21:33:39 BST 1999 James Pearson Version 1.12b5.2 Fixed bug where CREATOR/TYPE not padded with spaces if less than 4 characters Added support for "DAVE" format files (and AppleDouble v2) use --dave Fixed a small signed char bug in name.c Fixed bug in diag/isoinfo.c - didn't support UCS level 1 filenames that mkisofs/mkhybrid now creates with the -J option. Thu Apr 7 20:29:04 BST 1999 James Pearson Version 1.12b5.1 Fixed bugs with MacBinary names and symbolic links to HFS files when using the -f option Re-introduced some minor changes "lost" from v1.12b4.8 Forgot to add -hide-hfs-list option in previous version ... Tue Mar 30 08:31:13 BST 1999 James Pearson Version 1.12b5.0 Now based on mkisofs v1.12b5 Option -mac-name now only uses the HFS name if the file is one of the known HFS file types Added -hide-list, -hide-joliet-list, -hide-hfs-list, -exclude-list and -path-list options. Allows a list of filenames to be excluded or hidden to be given in a file instead of on the command line. Added option -hfs-volid to give the HFS volume its own name (not using the ISO9660 volume name). Tue Jan 5 15:44:24 GMT 1999 James Pearson Version 1.12b4.8 Fixed an AppleDouble bug and added better support for more Unix flavours. Fixed -hide-hfs bug that corrupted some HFS hidden files Made the verbose output less verbose. Added initial support for the AutoStart feature. HFS partition maps can now be added without having to create a bootable HFS CD (as pre-v1.12a4.7). Added option to specify the PC Exchange "cluster size". Mon Aug 24 23:18:38 BST 1998 James Pearson Version 1.12a4.7 Fixed SGI/XINET and PC Exchange bugs By default, the output image no longer has an HFS partition map (as pre-v1.12a3.4). Partition maps are only added if making a bootable HFS CD Fixed possible bug with odd-length structure alignment with gcc on some architectures Tue Aug 4 23:09:17 BST 1998 James Pearson Version 1.12a4.6 Made a couple of Netatalk changes Altered way Apple/Unix associated files are excluded - e.g. if just --cap is selected, then files associated with the other Apple/Unix encodings are processed as normal files. Previously they would have been ignored Added option (-no-desktop) to prevent the (empty) HFS desktop files being created. These will be created when the CD is used on a Macintosh (and stored in the System Folder). Sun Jul 26 09:44:50 BST 1998 James Pearson Version 1.12a4.5 Fixed serious bug that could cause corrupt output when used with the -J option Tue Jul 21 14:33:20 BST 1998 James Pearson Version 1.12a4.4 HFS file/directory names that share the first 31 characters have '_N' (N == decimal number) substituted for the last few characters to generate unique names. 1 year since the first release ... Sat Jul 11 12:57:04 BST 1998 James Pearson Version 1.12a4.3 Added options to "hide" (options -hide and -hide-joliet) files or directories from the ISO9660/RockRidge and/or Joliet directory trees. Renamed the -hfs-exclude option to -hide-hfs to be compatible with the above options. Fixed a bug with the -hide-hfs option (very rare case ...) Thu Jun 25 20:02:20 BST 1998 James Pearson Version 1.12a4.2 Fixed an HFS bug introduced with v1.12a3.4 that created some corrupt HFS volumes over about 400Mb Tighten up checking for MacBinary files to prevent false matches Sun Jun 21 11:55:09 BST 1998 James Pearson Version 1.12a4.1 Default TYPE and CREATOR can now be set via the .mkisofsrc file Order of magic and mapping file on the command line is now important. This defines the order in which TYPE and CREATOR are set. Apple/Unix file types found are logged as part of the verbose output (need to give -v twice) Added option (-log-file) to redirect stderr messages Added option (-hfs-exclude) to exclude files/directories from the HFS part of the CD. Fixed a couple of MacBinary/AppleSingle bugs. Thu Jun 8 23:40:56 BST 1998 James Pearson Version 1.12a4.0 Resource fork file names not added to TRANS.TBL Re-enabled support of non-regular Win32 files. GNU-Win32 can create symbolic links etc. These are now recognised. mkhybrid man page added. Based on mkisofs v1.12b4 Wed May 20 12:54:36 BST 1998 James Pearson Version 1.12a3.5 Added support for using a "magic" file to set CREATOR/TYPE for a file - see README.hfs_magic for details. Mon May 18 16:22:32 BST 1998 James Pearson Version 1.12a3.4 Added possible support for bootable Mac CDs - see README.hfs_boot or details. Fixed -x bug (mkisofs v1.12 bug) Mon May 4 14:23:46 BST 1998 James Pearson Version 1.12a3.3 Added support for UShare Mac/Unix files Individual Mac/Unix file types can now be selected instead of searching for all possible types. See README.mkhybrid for details. Fri May 1 10:34:29 BST 1998 James Pearson Version 1.12a3.2 Various bug fixes to Mac file names Tue Mar 10 14:42:03 GMT 1998 James Pearson Version 1.12a3.1 Added -no-hfs-files option that assumes there are no Unix/Mac files (CAP, Netatalk, etc) - speeds up processing in these cases Case insensitive HFS file/folder names that are the same are now allowed - one or more '_' characters are added to one or more of the filenames. (Changed -macname option to -mac-name option) Mon Feb 23 16:09:27 GMT 1998 James Pearson Version 1.12a3.0 Based on mkisofs v1.12b3 Fixed serious HFS bug that crept in from v1.11 -> v1.12 Tue Feb 17 16:20:12 GMT 1998 James Pearson Version 1.12a2.0 Based on mkisofs v1.12b2 Improved Win32 support: using -r now makes all files executable when run under Win95/NT4 Tue Feb 3 10:30:18 GMT 1998 James Pearson Version 1.12a1.2 Fixed memory bug when used without any HFS options Improved PC Exchange support (although still needs testing) Tue Jan 27 10:32:26 GMT 1998 James Pearson Version 1.12a1.1 Can now handle multiple hard linked source files with the -hfs option (multiple hard linked source files are handled as separate files) configure script changed to check for ranlib Fixed a couple of AppleSingle bugs. Added option to use Mac names as starting point for ISO9660, Joliet and RockRidge names Wed Jan 21 14:00:56 GMT 1998 James Pearson Version 1.12a1 See README.mkhybrid for details Fri Jan 16 17:09:48 GMT 1998 James Pearson Version 1.11 Changed version numbering to be the same as mkisofs Code no longer considered beta level Minor changes to allow the code to be complied and run on Win95/NT using Cygnus' GNU-Win32 (available from http://www.cygnus.com/misc/gnu-win32/) Thu Dec 4 17:17:45 GMT 1997 James Pearson Version 0.49b Fixed an HFS bug that caused a failure with directory names that had special AUFS characters Fixed mkisofs bug in eltorito.c that wrote warning messages to stdout not stderr Code no longer considered alpha level Thu Nov 27 19:00:02 GMT 1997 James Pearson Version 0.48a Added Apple's extensions to ISO9660 that can be used instead of the HFS options (see README.mkhybrid for more details). Added more verbose HFS error messages. Changed the Joliet option flag to -J (-j still works) to be compatible the with next release of mkisofs (v1.12) Wed Oct 15 11:16:21 BST 1997 James Pearson Version 0.47a Fixed bug that prevented volume_space_size not being set in the PVD (or SVD) Mon Oct 6 15:46:24 BST 1997 James Pearson Version 0.46a Small Joliet bug fix - source directories that are not readable are set to empty ordinary files in the ISO9660 filesystem - this is now true for the Joliet directory (partially responsible for NT4 having problems with CDs where this happened) Minor documentation updates. Mon Sep 15 14:15:11 BST 1997 James Pearson Version 0.45a Attempt to prevent the HFS Catalog file growing (see "Implementation" in README.mkhybrid for more details) This is only likely to be a problem where folders have lots of small files. Mon Aug 18 12:00:24 BST 1997 James Pearson Version 0.44a If the directories were deeper than 8 and the -D flag was not used, then the "rr_moved" directory was not added to the Joliet directory tree. This has now been fixed - but one day, the deep Joliet directories may not have to be relocated ... Fixed memcmp problem with possible uninitialised memory in j_compare_paths(), which *might* cause incorrect Joliet directory sort order Wed Aug 13 14:58:56 BST 1997 James Pearson Version 0.43a Fixed bug for incorrect Joliet path table size Fixed some old minor mkisofs bugs (TRANS.TBL not having a version number by default and incorrect date in the PVD). Mon Aug 11 17:17:07 BST 1997 James Pearson Version 0.42a Now will not try to create the HFS "Desktop DB" and "Desktop DF" if they already exist when used with the HFS options. Fixed a serious bug in the hfs code that truncated some files. "TRANS.TBL" was missed out of the Joliet directory if the -T option was given (previously an empty file with no name was used which could cause problems on NT 4) Fri Aug 8 10:19:46 BST 1997 James Pearson Version 0.41a Fixed bug which created invalid HFS/ISO9660 volumes if the -j (Joliet) option was not used Mon Aug 4 15:08:43 BST 1997 James Pearson Version 0.4a Added (partial?) Joliet support. Now based on mkisofs v1.11 Tue Jul 29 11:57:14 BST 1997 James Pearson Version 0.32a Allocation sizes improved to cut down on wasted space. Now uses the HFS "allocation" size rounded up to the nearest 2048 bytes. Savings can be significant with a large volume containing lots of smallish files. Wed Jul 23 15:36:08 BST 1997 James Pearson Version 0.31a Deep directories (greater than RR_relocation_depth) cause core dump in "copy_to_mac_volume" as the relocated directory was not marked as an HFS folder. Fixed by putting deep HFS folders in their correct location. Mon Jul 21 15:50:05 BST 1997 James Pearson Version 0.3a, first public release. cdrkit-1.1.11/genisoimage/COPYING0000644000372500001440000004344010471375025015457 0ustar steveusers The GPL below is copyrighted by the Free Software Foundation, but the instance of code that it refers to (the mkisofs utility is copyrighted by Yggdrasil Computing, Incorporated). ---------------------------------------- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. cdrkit-1.1.11/genisoimage/sha512.h0000644000372500001440000000433011201646002015557 0ustar steveusers/* Declaration of functions and data types used for SHA512 sum computing library functions. Copyright (C) 2007 Free Software Foundation, Inc. Copied here from the GNU C Library version 2.7 on the 10 May 2009 by Steve McIntyre <93sam@debian.org>. This code was under GPL v2.1 in glibc, and that license gives us the option to use and distribute the code under the terms of the GPL v2 instead. I'm taking that option. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _SHA512_H #define _SHA512_H 1 #include #include #include /* Structure to save state of computation between the single steps. */ struct sha512_ctx { uint64_t H[8]; uint64_t total[2]; uint64_t buflen; char buffer[256] __attribute__ ((__aligned__ (__alignof__ (uint64_t)))); }; /* Initialize structure containing state of computation. (FIPS 180-2: 5.3.3) */ extern void sha512_init_ctx (struct sha512_ctx *ctx) __THROW; /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is NOT required that LEN is a multiple of 128. */ extern void sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx) __THROW; /* Process the remaining bytes in the buffer and put result from CTX in first 64 bytes following RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 64 bits value. */ extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf) __THROW; #endif /* sha512.h */ cdrkit-1.1.11/genisoimage/rsync.c0000644000372500001440000001052010531416235015713 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ #include "genisoimage.h" #include "utypes.h" #include #include /* Borrowed from jigdo; original notice: These are purely random, no patterns or anything... (I hope) I do not claim copyright for the actual numbers below, you may use them for a re-implementation of the algorithm under a license of your choice. -- Richard Atterer. */ static UInt32_t charTable[256] = { 0x51d65c0f, 0x083cd94b, 0x77f73dd8, 0xa0187d36, 0x29803d07, 0x7ea8ac0e, 0xea4c16c9, 0xfc576443, 0x6213df29, 0x1c012392, 0xb38946ae, 0x2e20ca31, 0xe4dc532f, 0xcb281c47, 0x8508b6a5, 0xb93c210d, 0xef02b5f3, 0x66548c74, 0x9ae2deab, 0x3b59f472, 0x4e546447, 0x45232d1f, 0x0ac0a4b1, 0x6c4c264b, 0x5d24ce84, 0x0f2752cc, 0xa35c7ac7, 0x3e31af51, 0x79675a59, 0x581f0e81, 0x49053122, 0x7339c9d8, 0xf9833565, 0xa3dbe5b3, 0xcc06eeb9, 0x92d0671c, 0x3eb220a7, 0x64864eae, 0xca100872, 0xc50977a1, 0xd90378e1, 0x7a36cab9, 0x15c15f4b, 0x8b9ef749, 0xcc1432dc, 0x1ec578ed, 0x27e6e092, 0xbb06db8f, 0x67f661ac, 0x8dd1a3db, 0x2a0ca16b, 0xb229ab84, 0x127a3337, 0x347d846f, 0xe1ea4b50, 0x008dbb91, 0x414c1426, 0xd2be76f0, 0x08789a39, 0xb4d93e30, 0x61667760, 0x8871bee9, 0xab7da12d, 0xe3c58620, 0xe9fdfbbe, 0x64fb04f7, 0x8cc5bbf0, 0xf5272d30, 0x8f161b50, 0x11122b05, 0x7695e72e, 0xa1c5d169, 0x1bfd0e20, 0xef7e6169, 0xf652d08e, 0xa9d0f139, 0x2f70aa04, 0xae2c7d6d, 0xa3cb9241, 0x3ae7d364, 0x348788f8, 0xf483b8f1, 0x55a011da, 0x189719dc, 0xb0c5d723, 0x8b344e33, 0x300d46eb, 0xd44fe34f, 0x1a2016c1, 0x66ce4cd7, 0xa45ea5e3, 0x55cb708a, 0xbce430df, 0xb01ae6e0, 0x3551163b, 0x2c5b157a, 0x574c4209, 0x430fd0e4, 0x3387e4a5, 0xee1d7451, 0xa9635623, 0x873ab89b, 0xb96bc6aa, 0x59898937, 0xe646c6e7, 0xb79f8792, 0x3f3235d8, 0xef1b5acf, 0xd975b22b, 0x427acce6, 0xe47a2411, 0x75f8c1e8, 0xa63f799d, 0x53886ad8, 0x9b2d6d32, 0xea822016, 0xcdee2254, 0xd98bcd98, 0x2933a544, 0x961f379f, 0x49219792, 0xc61c360f, 0x77cc0c64, 0x7b872046, 0xb91c7c12, 0x7577154b, 0x196573be, 0xf788813f, 0x41e2e56a, 0xec3cd244, 0x8c7401f1, 0xc2e805fe, 0xe8872fbe, 0x9e2faf7d, 0x6766456b, 0x888e2197, 0x28535c6d, 0x2ce45f3f, 0x24261d2a, 0xd6faab8b, 0x7a7b42b8, 0x15f0f6fa, 0xfe1711df, 0x7e5685a6, 0x00930268, 0x74755331, 0x1998912c, 0x7b60498b, 0x501a5786, 0x92ace0f6, 0x1d9752fe, 0x5a731add, 0x5b3b44fc, 0x473673f9, 0xa42c0321, 0xd82f9f18, 0xb4b225da, 0xfc89ece2, 0x072e1130, 0x5772aae3, 0x29010857, 0x542c970c, 0x94f67fe5, 0x71209e9b, 0xdb97ea39, 0x2689b41b, 0xae815804, 0xfc5e2651, 0xd4521674, 0x48ed979a, 0x2f617da3, 0xc350353d, 0xc3accd94, 0xbd8d313a, 0xc61a8e77, 0xf34940a4, 0x8d2c6b0f, 0x0f0e7225, 0x39e183db, 0xd19ebba9, 0x6a0f37b9, 0xd18922f3, 0x106420c5, 0xaa5a640b, 0x7cf0d273, 0xcf3238a7, 0x3b33204f, 0x476be7bb, 0x09d23bca, 0xbe84b2f7, 0xb7a3bace, 0x2528cee1, 0x3dcaa1dd, 0x900ad31a, 0xf21dea6d, 0x9ce51463, 0xf1540bba, 0x0fab1bdd, 0x89cfb79a, 0x01a2a6e6, 0x6f85d67c, 0xd1669ec4, 0x355db722, 0x00ebd5c4, 0x926eb385, 0x69ead869, 0x0da2b122, 0x402779fe, 0xdaed92d0, 0x57e9aabb, 0x3df64854, 0xfcc774b5, 0x2e1740ed, 0xa615e024, 0xf7bac938, 0x377dfd1a, 0xd0559d66, 0x25499be8, 0x2d8f2006, 0xfaa9e486, 0x95e980e7, 0x82aeba67, 0x5a7f2561, 0xbc60dff6, 0x6c8739a2, 0x7ec59a8b, 0x9998f265, 0xdfe37e5e, 0xb47cee1e, 0x4dd8bc9e, 0x35c57e09, 0x07850b63, 0x06eadbcb, 0x6c1f2956, 0x01685c2c, 0xf5725eef, 0xf13b98b5, 0xaab739c2, 0x200b1da2, 0xa716b98b, 0xd9ee3058, 0x76acf20b, 0x2f259e04, 0xed11658b, 0x1532b331, 0x0ab43204, 0xf0beb023, 0xb1685483, 0x58cbdc4f, 0x079384d3, 0x049b141c, 0xc38184b9, 0xaf551d9a, 0x66222560, 0x059deeca, 0x535f99e2 }; unsigned long long rsync64(unsigned char *mem, size_t size) { UInt32_t a = 0; UInt32_t b = 0; unsigned char *limit = mem + size; unsigned long long result = 0; while (mem < limit) { a += charTable[*mem++]; b += a; } a = a & 0xffffffff; /* Just in case uint32 can be 64 bits */ b = b & 0xffffffff; result = ((unsigned long long)b << 32) | a; return result; } cdrkit-1.1.11/genisoimage/dvd_file.h0000644000372500001440000000270210513514665016347 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)dvd_file.h 1.1 02/07/21 Copyright 2002 J. Schilling */ /* * Defnitions for users of dvd_file.c * * Copyright (c) 2002 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _DVD_FILE_H #define _DVD_FILE_H extern void DVDFreeFileSet(title_set_info_t *title_set_info); extern title_set_info_t *DVDGetFileSet(char *dvd); extern int DVDGetFilePad(title_set_info_t *title_set_info, char *name); #endif /* _DVD_FILE_H */ cdrkit-1.1.11/genisoimage/scsi.c0000644000372500001440000001162010536265343015527 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)scsi.c 1.20 05/05/01 Copyright 1997 J. Schilling */ /* * Copyright (c) 1997 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef USE_SCG #include #include #include #include #include #include #include "genisoimage.h" #include #include #include "wodim.h" #include "../wodim/defaults.h" /* * NOTICE: You should not make BUF_SIZE more than * the buffer size of the CD-Recorder. * * Do not set BUF_SIZE to be more than 126 KBytes * if you are running cdrecord on a sun4c machine. * * WARNING: Philips CDD 521 dies if BUF_SIZE is to big. */ #define BUF_SIZE (62*1024) /* Must be a multiple of 2048 */ static SCSI *usalp; static long bufsize; /* The size of the transfer buffer */ int readsecs(int startsecno, void *buffer, int sectorcount); int scsidev_open(char *path); int scsidev_close(void); int readsecs(int startsecno, void *buffer, int sectorcount) { int f; int secsize; /* The drive's SCSI sector size */ long amount; /* The number of bytes to be transfered */ long secno; /* The sector number to read from */ long secnum; /* The number of sectors to read */ char *bp; long amt; if (in_image == NULL) { /* * We are using the standard CD-ROM sectorsize of 2048 bytes * while the drive may be switched to 512 bytes per sector. * * XXX We assume that secsize is no more than SECTOR_SIZE * XXX and that SECTOR_SIZE / secsize is not a fraction. */ secsize = usalp->cap->c_bsize; amount = sectorcount * SECTOR_SIZE; secno = startsecno * (SECTOR_SIZE / secsize); bp = buffer; while (amount > 0) { amt = amount; if (amount > bufsize) amt = bufsize; secnum = amt / secsize; if (read_scsi(usalp, bp, secno, secnum) < 0 || usal_getresid(usalp) != 0) { #ifdef OLD return (-1); #else comerr("Read error on old image\n"); #endif } amount -= secnum * secsize; bp += secnum * secsize; secno += secnum; } return (SECTOR_SIZE * sectorcount); } f = fileno(in_image); if (lseek(f, (off_t)startsecno * SECTOR_SIZE, SEEK_SET) == (off_t)-1) { #ifdef USE_LIBSCHILY comerr("Seek error on old image\n"); #else fprintf(stderr, "Seek error on old image\n"); exit(10); #endif } if ((amt = read(f, buffer, (sectorcount * SECTOR_SIZE))) != (sectorcount * SECTOR_SIZE)) { #ifdef USE_LIBSCHILY if (amt < 0) comerr("Read error on old image\n"); comerrno(EX_BAD, "Short read on old image\n"); /* < secnt aber > 0 */ #else if (amt < 0) fprintf(stderr, "Read error on old image\n"); else fprintf(stderr, "Short read on old image\n"); exit(10); #endif } return (sectorcount * SECTOR_SIZE); } int scsidev_open(char *path) { char errstr[80]; char *buf; /* ignored, bit OS/2 ASPI layer needs memory which */ /* has been allocated by scsi_getbuf() */ /* * Call usal_remote() to force loading the remote SCSI transport library * code that is located in librusal instead of the dummy remote routines * that are located inside libusal. */ usal_remote(); cdr_defaults(&path, NULL, NULL, NULL); /* path, debug, verboseopen */ usalp = usal_open(path, errstr, sizeof (errstr), 0, 0); if (usalp == 0) { errmsg("%s%sCannot open SCSI driver.\n", errstr, errstr[0]?". ":""); return (-1); } bufsize = usal_bufsize(usalp, BUF_SIZE); if ((buf = usal_getbuf(usalp, bufsize)) == NULL) { errmsg("Cannot get SCSI I/O buffer.\n"); usal_close(usalp); return (-1); } bufsize = (bufsize / SECTOR_SIZE) * SECTOR_SIZE; allow_atapi(usalp, TRUE); if (!wait_unit_ready(usalp, 60)) { /* Eat Unit att / Wait for drive */ usalp->silent--; return (-1); } usalp->silent++; read_capacity(usalp); /* Set Capacity/Sectorsize for I/O */ usalp->silent--; return (1); } int scsidev_close() { if (in_image == NULL) { return (usal_close(usalp)); } else { return (fclose(in_image)); } } #endif /* USE_SCG */ cdrkit-1.1.11/genisoimage/sunlabel.h0000644000372500001440000001572110531416235016377 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)sunlabel.h 1.5 03/12/28 Copyright 1999-2003 J. Schilling */ /* * Support for Sun disk label * * Copyright (c) 1999-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif #ifndef roundup #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) #endif #define NDKMAP 8 /* # of sparc partitions */ #define NX86MAP 16 /* # if x86 partitions */ #define DKL_MAGIC 0xDABE /* magic number */ #define DKL_MAGIC_0 0xDA /* magic number high byte */ #define DKL_MAGIC_1 0xBE /* magic number low byte */ #define CD_DEFLABEL "CD-ROM Disc with Sun sparc boot created by genisoimage" #define CD_X86LABEL "CD-ROM Disc with Sun x86 boot created by genisoimage" /* * Define a virtual geometry for the CD disk label. * The current values are stolen from Sun install disks and do not seem to be * a good idea as they limit the size of the CD to 327680 sectors which is less * than 74 minutes. * There are 84 minute CD's with 378000 sectors and there will be DVD's with * even more. */ #define CD_RPM 350 #define CD_PCYL 2048 #define CD_APC 0 #define CD_INTRLV 1 #define CD_NCYL 2048 #define CD_ACYL 0 #define CD_NHEAD 1 #define CD_NSECT 640 /* * NOTE: The virtual cylinder size on CD must be a mutiple of 2048. * This is true if CD_NSECT is a multiple of 4. */ #define CD_CYLSIZE (CD_NSECT*CD_NHEAD*512) #define V_VERSION 1 /* The VTOC version */ #define VTOC_SANE 0x600DDEEE /* Indicates a sane VTOC */ #define V_ROOT 0x02 /* Root partiton */ #define V_USR 0x04 /* Usr partiton */ #define V_RONLY 0x10 /* Read only */ /* * The Sun sparc disk label (at offset 0 on a disk) */ struct sun_label { char dkl_ascilabel[128]; struct dk_vtoc { Uchar v_version[4]; /* layout version */ char v_volume[8]; /* volume name */ Uchar v_nparts[2]; /* number of partitions */ struct dk_map2 { Uchar p_tag[2]; /* ID tag of partition */ Uchar p_flag[2]; /* permission flag */ } v_part[NDKMAP]; Uchar v_xxpad[2]; /* To come over Sun's alignement problem */ Uchar v_bootinfo[3*4]; /* info for mboot */ Uchar v_sanity[4]; /* to verify vtoc sanity */ Uchar v_reserved[10*4]; Uchar v_timestamp[NDKMAP*4]; } dkl_vtoc; /* vtoc inclusions from AT&T SVr4 */ char dkl_pad[512-(128+sizeof (struct dk_vtoc)+NDKMAP*8+14*2)]; Uchar dkl_rpm[2]; /* rotations per minute */ Uchar dkl_pcyl[2]; /* # physical cylinders */ Uchar dkl_apc[2]; /* alternates per cylinder */ Uchar dkl_obs1[2]; /* obsolete */ Uchar dkl_obs2[2]; /* obsolete */ Uchar dkl_intrlv[2]; /* interleave factor */ Uchar dkl_ncyl[2]; /* # of data cylinders */ Uchar dkl_acyl[2]; /* # of alternate cylinders */ Uchar dkl_nhead[2]; /* # of heads in this partition */ Uchar dkl_nsect[2]; /* # of 512 byte sectors per track */ Uchar dkl_obs3[2]; /* obsolete */ Uchar dkl_obs4[2]; /* obsolete */ struct dk_map { /* logical partitions */ Uchar dkl_cylno[4]; /* starting cylinder */ Uchar dkl_nblk[4]; /* number of blocks */ } dkl_map[NDKMAP]; /* logical partition headers */ Uchar dkl_magic[2]; /* identifies this label format */ Uchar dkl_cksum[2]; /* xor checksum of sector */ }; /* * The Sun x86 / AT&T disk label (at offset 512 on a fdisk partition) */ struct x86_label { struct x86_vtoc { Uchar v_bootinfo[3*4]; /* unsupported */ Uchar v_sanity[4]; /* to verify vtoc sanity */ Uchar v_version[4]; /* layout version */ char v_volume[8]; /* volume name */ Uchar v_sectorsz[2]; /* # of bytes in a sector */ Uchar v_nparts[2]; /* # of partitions */ Uchar v_reserved[10*4]; struct dkl_partition { Uchar p_tag[2]; /* ID tag of partition */ Uchar p_flag[2]; /* permission flag */ Uchar p_start[4]; /* starting sector */ Uchar p_size[4]; /* number of blocks */ } v_part[NX86MAP]; Uchar timestamp[NX86MAP][4]; char v_asciilabel[128]; } dkl_vtoc; /* vtoc inclusions from AT&T SVr4 */ Uchar dkl_pcyl[4]; /* # physical cylinders */ Uchar dkl_ncyl[4]; /* # of data cylinders */ Uchar dkl_acyl[2]; /* # of alternate cylinders */ Uchar dkl_bcyl[2]; Uchar dkl_nhead[4]; /* # of heads in this partition */ Uchar dkl_nsect[4]; /* # of 512 byte sectors per track */ Uchar dkl_intrlv[2]; /* interleave factor */ Uchar dkl_skew[2]; Uchar dkl_apc[2]; /* alternates per cylinder */ Uchar dkl_rpm[2]; /* rotations per minute */ Uchar dkl_write_reinstruct[2]; Uchar dkl_read_reinstruct[2]; Uchar dkl_extra[4*2]; /* for later expansions */ char dkl_pad[512-(sizeof (struct x86_vtoc)+4*4+14*2)]; Uchar dkl_magic[2]; /* identifies this label format */ Uchar dkl_cksum[2]; /* xor checksum of sector */ }; /* * One x86 PC fdisk partition record. */ struct pc_pr { Uchar pr_status; /* Boot status */ Uchar pr_head; /* Starting head # */ char pr_sec_cyl[2]; /* Starting sec+cyl # */ Uchar pr_type; /* Partition type */ Uchar pr_e_head; /* Ending head # */ char pr_e_sec_cyl[2]; /* Ending sec+cyl # */ char pr_partoff[4]; /* Partition start sector # */ char pr_nsect[4]; /* # of sectors in partition */ }; /* * Flags and macros for above partition record. */ #define SEC_MASK 0x3F #define GET_SEC(a) ((a) & SEC_MASK) #define GET_CYL(a) ((((a) & 0xFF) >> 8) | (((a) & 0xC0) << 2)) #define STATUS_INACT 0 /* Marked non bootable */ #define STATUS_ACTIVE 0x80 /* Marked as bootable */ #define TYPE_FREE 0 /* Unused partition */ #define TYPE_DOS12 0x01 /* FAT12 fileystem */ #define TYPE_XENIX 0x02 /* XENIX root */ #define TYPE_XENIX2 0x03 /* XENIX usr */ #define TYPE_DOS16 0x04 /* FAT16 filesystem */ #define TYPE_XDOS 0x05 /* Extended DOS part */ #define TYPE_DOS4 0x06 /* FAT16 >= 32 MB */ #define TYPE_SOLARIS 0x82 /* Solaris x86 */ #define TYPE_SOLARIS_BOOT 0xBE /* Solaris boot */ #define TYPE_CDOS4 0xDB /* CPM */ /* * The first sector on a disk from a x86 PC (at offset 0 on a disk) */ struct pc_part { char bootcode[0x1BE]; /* Master boot record */ struct pc_pr part[4]; /* The 4 primary partitions */ Uchar magic[2]; /* Fixed at 0x55 0xAA */ }; cdrkit-1.1.11/genisoimage/stream.c0000644000372500001440000001722210576062671016070 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)stream.c 1.3 04/03/04 Copyright 2002-2003 J. Schilling */ /* Parts from @(#)stream.c 1.9 07/02/17 Copyright 2002-2007 J. Schilling */ /* * ISO-9660 stream (pipe) file module for genisoimage * * Copyright (c) 2002-2003 J. Schilling * Implemented after an idea from M.H. Voase */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "genisoimage.h" #include "iso9660.h" static int size_str_file(int starting_extent); static int size_str_dir(int starting_extent); static int size_str_path(int starting_extent); static int gen_str_path(void); static int write_str_file(FILE *outfile); static int write_str_dir(FILE *outfile); static int write_str_path(FILE *outfile); extern struct directory *root; extern unsigned int session_start; extern int stream_media_size; extern char *stream_filename; extern time_t begun; extern int volume_sequence_number; static unsigned int avail_extent; static unsigned int stream_extent; static unsigned int stream_size; static unsigned int stream_pad; static char *l_path; static char *m_path; static struct iso_directory_record s_dir; static int stream_finished = 0; /* * Compute the size of the file */ static int size_str_file(int starting_extent) { int n; extern int dopad; stream_extent = last_extent; /* Start of stream file content */ avail_extent = stream_media_size; n = last_extent; /* Room for FS blocks before file */ n += 1; /* Room for the directory block */ stream_pad = 0; if (n < 50) { stream_pad = 50 - n; n = 50; /* Make net. size easy to compute */ } if (dopad) n += 150; /* Room for final padding */ avail_extent -= n; last_extent += avail_extent + stream_pad; return (0); } /* * The size of the directory record - one sector */ static int size_str_dir(int starting_extent) { root->extent = last_extent; last_extent += 1; return (0); } /* * The size of the path tables - two sectors */ static int size_str_path(int starting_extent) { path_table[0] = starting_extent; path_table[1] = 0; path_table[2] = path_table[0] + 1; path_table[3] = 0; last_extent += 2 * 1; return (0); } /* * Generate the path table data */ static int gen_str_path() { /* * Basically add the root directory entry */ l_path = (char *)e_malloc(SECTOR_SIZE); m_path = (char *)e_malloc(SECTOR_SIZE); memset(l_path, 0, SECTOR_SIZE); memset(m_path, 0, SECTOR_SIZE); l_path[0] = 1; m_path[0] = 1; set_731(l_path + 2, root->extent); set_732(m_path + 2, root->extent); set_721(l_path + 6, 1); set_722(m_path + 6, 1); l_path[8] = '\0'; l_path[9] = '\0'; m_path[8] = '\0'; m_path[9] = '\0'; return (0); } /* * Write the file content */ static int write_str_file(FILE *outfile) { unsigned int idx = 0; unsigned int iso_blocks; int count; char *buf; buf = e_malloc(SECTOR_SIZE); stream_size = 0; while ((idx + SECTOR_SIZE) < (avail_extent * SECTOR_SIZE)) { memset(buf, 0, SECTOR_SIZE); count = fread(buf, 1, SECTOR_SIZE, stdin); if (count <= 0) { stream_finished = 1; break; } idx += count; jtwrite(buf, count, 1, 0, FALSE); xfwrite(buf, count, 1, outfile, 0, FALSE); } stream_size = idx; iso_blocks = ISO_BLOCKS(idx); memset(buf, 0, SECTOR_SIZE); if (SECTOR_SIZE * iso_blocks - idx) { jtwrite(buf, SECTOR_SIZE * iso_blocks - idx, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE * iso_blocks - idx, 1, outfile, 0, FALSE); } /* * If we didn't fill the available area, pad to directory block */ for (count = 0; count < (avail_extent - iso_blocks); count++) { jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, outfile, 0, FALSE); } for (count = 0; count < stream_pad; count++) { jtwrite(buf, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE, 1, outfile, 0, FALSE); } last_extent_written += avail_extent + stream_pad; return (0); } /* * Generate and write the directory record data */ static int write_str_dir(FILE *outfile) { int to_write; char *buf; buf = e_malloc(SECTOR_SIZE); memset(buf, 0, SECTOR_SIZE); memset(&s_dir, 0, sizeof (struct iso_directory_record)); s_dir.length[0] = 34; /* BAD: Hardcoded - Will fix, MHV */ s_dir.ext_attr_length[0] = 0; set_733((char *)s_dir.extent, root->extent); set_733((char *)s_dir.size, SECTOR_SIZE); iso9660_date(s_dir.date, begun); s_dir.flags[0] = ISO_DIRECTORY; s_dir.file_unit_size[0] = 0; s_dir.interleave[0] = 0; set_723((char *)s_dir.volume_sequence_number, volume_sequence_number); s_dir.name_len[0] = 1; s_dir.name[0] = 0; /* "." */ jtwrite(&s_dir, offsetof(struct iso_directory_record, name[0]) + 1, 1, 0, FALSE); xfwrite(&s_dir, offsetof(struct iso_directory_record, name[0]) + 1, 1, outfile, 0, FALSE); s_dir.name[0] = 1; /* ".." */ jtwrite(&s_dir, offsetof(struct iso_directory_record, name[0]) + 1, 1, 0, FALSE); xfwrite(&s_dir, offsetof(struct iso_directory_record, name[0]) + 1, 1, outfile, 0, FALSE); memset(&s_dir, 0, sizeof (struct iso_directory_record)); s_dir.length[0] = 34 + strlen(stream_filename); s_dir.ext_attr_length[0] = 0; set_733((char *) s_dir.extent, stream_extent); set_733((char *) s_dir.size, stream_size); iso9660_date(s_dir.date, begun); s_dir.flags[0] = 0; s_dir.file_unit_size[0] = 0; set_723((char *)s_dir.volume_sequence_number, volume_sequence_number); s_dir.name_len[0] = strlen(stream_filename); memcpy(s_dir.name, stream_filename, s_dir.name_len[0]); jtwrite(&s_dir, offsetof(struct iso_directory_record, name[0]) + s_dir.name_len[0], 1, 0, FALSE); xfwrite(&s_dir, offsetof(struct iso_directory_record, name[0]) + s_dir.name_len[0], 1, outfile, 0, FALSE); /* * This calc is: 2 single char directory entries (34) + an additional entry * with filename length stream_filename + round up for even lenght count */ to_write = (s_dir.name_len[0] % 2) ? 0 : 1; jtwrite(buf, SECTOR_SIZE - ((3 * 34) + s_dir.name_len[0]) + to_write, 1, 0, FALSE); xfwrite(buf, SECTOR_SIZE - ((3 * 34) + s_dir.name_len[0]) + to_write, 1, outfile, 0, FALSE); free(buf); last_extent_written++; return (0); } /* * Generate the path table data */ static int write_str_path(FILE *outfile) { jtwrite(l_path, SECTOR_SIZE, 1, 0, FALSE); xfwrite(l_path, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; jtwrite(m_path, SECTOR_SIZE, 1, 0, FALSE); xfwrite(m_path, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; free(l_path); free(m_path); path_table_l = NULL; path_table_m = NULL; return (0); } struct output_fragment strfile_desc = { NULL, size_str_file, NULL, write_str_file, "Stream File" }; struct output_fragment strdir_desc = { NULL, size_str_dir, NULL, write_str_dir, "Stream File Directory" }; struct output_fragment strpath_desc = { NULL, size_str_path, gen_str_path, write_str_path, "Stream File Path table" }; cdrkit-1.1.11/genisoimage/boot-mips.c0000644000372500001440000003014110760521377016477 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* * Program boot-mips.c - Handle big-endian boot extensions to iso9660. * * Written by Steve McIntyre June 2004 * * Heavily inspired by / borrowed from genisovh: * * Copyright: (C) 2002 by Florian Lohoff * (C) 2004 by Thiemo Seufer * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, Version 2, as published by the * Free Software Foundation. * * Format for volume header information * * The volume header is a block located at the beginning of all disk * media (sector 0). It contains information pertaining to physical * device parameters and logical partition information. * * The volume header is manipulated by disk formatters/verifiers, * partition builders (e.g. fx, dvhtool, and mkfs), and disk drivers. * * Previous versions of IRIX wrote a copy of the volume header is * located at sector 0 of each track of cylinder 0. These copies were * never used, and reduced the capacity of the volume header to hold large * files, so this practice was discontinued. * The volume header is constrained to be less than or equal to 512 * bytes long. A particular copy is assumed valid if no drive errors * are detected, the magic number is correct, and the 32 bit 2's complement * of the volume header is correct. The checksum is calculated by initially * zeroing vh_csum, summing the entire structure and then storing the * 2's complement of the sum. Thus a checksum to verify the volume header * should be 0. * * The error summary table, bad sector replacement table, and boot blocks are * located by searching the volume directory within the volume header. * * Tables are sized simply by the integral number of table records that * will fit in the space indicated by the directory entry. * * The amount of space allocated to the volume header, replacement blocks, * and other tables is user defined when the device is formatted. */ #include #ifndef MIN #define MIN(a,b) ( (a #include "genisoimage.h" #include #include #include #include "match.h" #include "diskmbr.h" #include "bootinfo.h" #include #include "endianconv.h" int add_boot_mips_filename(char *filename); static int boot_mips_write(FILE *outfile); #define MAX_NAMES 15 static char *boot_mips_filename[MAX_NAMES] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static int boot_mips_num_files = 0; #define SECTORS_PER_TRACK 32 #define BYTES_PER_SECTOR 512 int add_boot_mips_filename(char *filename) { if (boot_mips_num_files < MAX_NAMES) { boot_mips_filename[boot_mips_num_files] = filename; boot_mips_num_files++; } else { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Too many MIPS boot files!\n"); #else fprintf(stderr, "Too many MIPS boot files!\n"); exit(1); #endif } return 0; } static void vh_calc_checksum(struct volume_header *vh) { uint32_t newsum = 0; unsigned char *buffer = (unsigned char *)vh; unsigned int i; vh->vh_csum = 0; for(i = 0; i < sizeof(struct volume_header); i += 4) newsum -= read_be32(&buffer[i]); write_be32(newsum, (unsigned char *)&vh->vh_csum); } static char *file_base_name(char *path) { char *endptr = path; char *ptr = path; while (*ptr != '\0') { if ('/' == *ptr) endptr = ++ptr; else ++ptr; } return endptr; } static int boot_mips_write(FILE *outfile) { struct directory_entry *boot_file; /* Boot file we need to search for */ unsigned long length = 0; unsigned long extent = 0; int i; struct volume_header vh; unsigned long long iso_size = 0; char *filename = NULL; memset(&vh, 0, sizeof(vh)); iso_size = last_extent * 2048; write_be32(VHMAGIC, (unsigned char *)&vh.vh_magic); /* Values from an IRIX cd */ write_be16(BYTES_PER_SECTOR, (unsigned char *)&vh.vh_dp.dp_secbytes); write_be16(SECTORS_PER_TRACK, (unsigned char *)&vh.vh_dp.dp_secs); write_be32(DP_RESEEK|DP_IGNOREERRORS|DP_TRKFWD, (unsigned char *)&vh.vh_dp.dp_flags); write_be16(1, (unsigned char *)&vh.vh_dp.dp_trks0); write_be16((iso_size + BYTES_PER_SECTOR - 1) / (SECTORS_PER_TRACK * BYTES_PER_SECTOR), (unsigned char *)&vh.vh_dp.dp_cyls); for(i = 0; i < boot_mips_num_files; i++) { boot_file = search_tree_file(root, boot_mips_filename[i]); if (!boot_file) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Uh oh, I cant find the MIPS boot file '%s'!\n", boot_mips_filename[i]); #else fprintf(stderr, "Uh oh, I cant find the MIPS boot file '%s'!\n", boot_mips_filename[i]); exit(1); #endif } extent = get_733(boot_file->isorec.extent) * 4; length = ((get_733(boot_file->isorec.size) + 2047) / 2048) * 2048; filename = file_base_name(boot_mips_filename[i]); strncpy((char *)vh.vh_vd[i].vd_name, filename, MIN(VDNAMESIZE, strlen(filename))); write_be32(extent, (unsigned char *)&vh.vh_vd[i].vd_lbn); write_be32(length, (unsigned char *)&vh.vh_vd[i].vd_nbytes); fprintf(stderr, "Found mips boot image %s, using extent %lu (0x%lX), #blocks %lu (0x%lX)\n", filename, extent, extent, length, length); } /* Create volume partition on whole cd iso */ write_be32((iso_size + (BYTES_PER_SECTOR - 1))/ BYTES_PER_SECTOR, (unsigned char *)&vh.vh_pt[10].pt_nblks); write_be32(0, (unsigned char *)&vh.vh_pt[10].pt_firstlbn); write_be32(PTYPE_VOLUME, (unsigned char *)&vh.vh_pt[10].pt_type); /* Create volume header partition, also on WHOLE cd iso */ write_be32((iso_size + (BYTES_PER_SECTOR - 1))/ BYTES_PER_SECTOR, (unsigned char *)&vh.vh_pt[8].pt_nblks); write_be32(0, (unsigned char *)&vh.vh_pt[8].pt_firstlbn); write_be32(PTYPE_VOLHDR, (unsigned char *)&vh.vh_pt[8].pt_type); /* Create checksum */ vh_calc_checksum(&vh); jtwrite(&vh, sizeof(vh), 1, 0, FALSE); xfwrite(&vh, sizeof(vh), 1, outfile, 0, FALSE); last_extent_written++; return 0; } struct output_fragment mipsboot_desc = {NULL, oneblock_size, NULL, boot_mips_write, "MIPS boot block"}; cdrkit-1.1.11/genisoimage/md5.c0000644000372500001440000002673711016345501015257 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. */ /* This code was modified in 1997 by Jim Kingdon of Cyclic Software to not require an integer type which is exactly 32 bits. This work draws on the changes for the same purpose by Tatu Ylonen as part of SSH, but since I didn't actually use that code, there is no copyright issue. I hereby disclaim copyright in any changes I have made; this code remains in the public domain. */ /* Note regarding cvs_* namespace: this avoids potential conflicts with libraries such as some versions of Kerberos. No particular need to worry about whether the system supplies an MD5 library, as this file is only about 3k of object code. */ /* Steve McIntyre, 2004/05/31: borrowed this code from the CVS library. s/cvs_/mk_/ across the source */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* for memcpy() and memset() */ #include #include #include #include "md5.h" /* Little-endian byte-swapping routines. Note that these do not depend on the size of datatypes such as mk_uint32, nor do they require us to detect the endianness of the machine we are running on. It is possible they should be macros for speed, but I would be surprised if they were a performance bottleneck for MD5. */ static mk_uint32 getu32 (const unsigned char *addr) { return (((((unsigned long)addr[3] << 8) | addr[2]) << 8) | addr[1]) << 8 | addr[0]; } static void putu32 (mk_uint32 data, unsigned char *addr) { addr[0] = (unsigned char)data; addr[1] = (unsigned char)(data >> 8); addr[2] = (unsigned char)(data >> 16); addr[3] = (unsigned char)(data >> 24); } /* * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ void mk_MD5Init (struct mk_MD5Context *ctx) { ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; ctx->buf[3] = 0x10325476; ctx->bits[0] = 0; ctx->bits[1] = 0; } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void mk_MD5Update (struct mk_MD5Context *ctx, unsigned char const *buf, unsigned len) { mk_uint32 t; /* Update bitcount */ t = ctx->bits[0]; if ((ctx->bits[0] = (t + ((mk_uint32)len << 3)) & 0xffffffff) < t) ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1] += len >> 29; t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ /* Handle any leading odd-sized chunks */ if ( t ) { unsigned char *p = ctx->in + t; t = 64-t; if (len < t) { memcpy(p, buf, len); return; } memcpy(p, buf, t); mk_MD5Transform (ctx->buf, ctx->in); buf += t; len -= t; } /* Process data in 64-byte chunks */ while (len >= 64) { memcpy(ctx->in, buf, 64); mk_MD5Transform (ctx->buf, ctx->in); buf += 64; len -= 64; } /* Handle any remaining bytes of data. */ memcpy(ctx->in, buf, len); } /* * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void mk_MD5Final (unsigned char digest[16], struct mk_MD5Context *ctx) { unsigned count; unsigned char *p; /* Compute number of bytes mod 64 */ count = (ctx->bits[0] >> 3) & 0x3F; /* Set the first char of padding to 0x80. This is safe since there is always at least one byte free */ p = ctx->in + count; *p++ = 0x80; /* Bytes of padding needed to make 64 bytes */ count = 64 - 1 - count; /* Pad out to 56 mod 64 */ if (count < 8) { /* Two lots of padding: Pad the first block to 64 bytes */ memset(p, 0, count); mk_MD5Transform (ctx->buf, ctx->in); /* Now fill the next block with 56 bytes */ memset(ctx->in, 0, 56); } else { /* Pad block to 56 bytes */ memset(p, 0, count-8); } /* Append length in bits and transform */ putu32(ctx->bits[0], ctx->in + 56); putu32(ctx->bits[1], ctx->in + 60); mk_MD5Transform (ctx->buf, ctx->in); putu32(ctx->buf[0], digest); putu32(ctx->buf[1], digest + 4); putu32(ctx->buf[2], digest + 8); putu32(ctx->buf[3], digest + 12); memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w &= 0xffffffff, w = w<>(32-s), w += x ) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ void mk_MD5Transform (mk_uint32 buf[4], const unsigned char inraw[64]) { register mk_uint32 a, b, c, d; mk_uint32 in[16]; int i; for (i = 0; i < 16; ++i) in[i] = getu32 (inraw + 4 * i); a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD5STEP(F1, a, b, c, d, in[ 0]+0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[ 1]+0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[ 2]+0x242070db, 17); MD5STEP(F1, b, c, d, a, in[ 3]+0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[ 4]+0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[ 5]+0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[ 6]+0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[ 7]+0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[ 8]+0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[ 9]+0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10]+0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11]+0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12]+0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13]+0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14]+0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15]+0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[ 1]+0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[ 6]+0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11]+0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[ 0]+0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[ 5]+0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10]+0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15]+0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[ 4]+0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[ 9]+0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14]+0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[ 3]+0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[ 8]+0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13]+0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[ 2]+0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[ 7]+0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12]+0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[ 5]+0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[ 8]+0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11]+0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14]+0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[ 1]+0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[ 4]+0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[ 7]+0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10]+0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13]+0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[ 0]+0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[ 3]+0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[ 6]+0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[ 9]+0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12]+0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15]+0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[ 2]+0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[ 0]+0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[ 7]+0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14]+0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[ 5]+0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12]+0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[ 3]+0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10]+0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[ 1]+0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[ 8]+0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15]+0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[ 6]+0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13]+0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[ 4]+0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11]+0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[ 2]+0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[ 9]+0xeb86d391, 21); buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } /* Read in a hex-dumped MD5 sum and parse it */ int mk_MD5Parse(unsigned char in[33], unsigned char out[16]) { int i = 0; for (i = 0; i < 16; i++) { if (in[2*i] >= '0' && in[2*i] <= '9') in[2*i] -= '0'; else if (in[2*i] >= 'A' && in[2*i] <= 'F') in[2*i] += 10 - 'A'; else if (in[2*i] >= 'a' && in[2*i] <= 'f') in[2*i] += 10 - 'a'; else return 1; if (in[1+(2*i)] >= '0' && in[1+(2*i)] <= '9') in[1+(2*i)] -= '0'; else if (in[1+(2*i)] >= 'A' && in[1+(2*i)] <= 'F') in[1+(2*i)] += 10 - 'A'; else if (in[1+(2*i)] >= 'a' && in[1+(2*i)] <= 'f') in[1+(2*i)] += 10 - 'a'; else return 1; out[i] = in[2*i] << 4 | in[1+(2*i)]; } return 0; } /* Calculate the MD5sum of the specified file */ int calculate_md5sum(char *filename, unsigned long long size, unsigned char out[16]) { char buffer[32768]; int i = 0; FILE *infile = NULL; unsigned long long remain = 0; int use; struct mk_MD5Context file_context; /* Start MD5 work for the file */ mk_MD5Init(&file_context); infile = fopen(filename, "rb"); if (!infile) { #ifndef HAVE_STRERROR fprintf(stderr, "cannot open '%s': (%d)\n", filename, errno); #else fprintf(stderr, "cannot open '%s': %s\n", filename, strerror(errno)); #endif exit(1); } remain = size; while (remain > 0) { use = (remain > sizeof(buffer) ? sizeof(buffer) : remain); if (fread(buffer, 1, use, infile) == 0) { fprintf(stderr, "cannot read from '%s'\n", filename); exit(1); } /* Update the checksum */ mk_MD5Update(&file_context, (unsigned char *)buffer, use); remain -= use; } fclose(infile); mk_MD5Final(&out[0], &file_context); return 0; } #ifdef TEST /* Simple test program. Can use it to manually run the tests from RFC1321 for example. */ #include int main (int argc, char *argv[]) { struct mk_MD5Context context; unsigned char checksum[16]; int i; int j; if (argc < 2) { fprintf (stderr, "usage: %s string-to-hash\n", argv[0]); exit (1); } for (j = 1; j < argc; ++j) { printf ("MD5 (\"%s\") = ", argv[j]); mk_MD5Init (&context); mk_MD5Update (&context, argv[j], strlen (argv[j])); mk_MD5Final (checksum, &context); for (i = 0; i < 16; i++) { printf ("%02x", (unsigned int) checksum[i]); } printf ("\n"); } return 0; } #endif /* TEST */ cdrkit-1.1.11/genisoimage/getopt1.c0000644000372500001440000001163110536265343016153 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)getopt1.c 1.1 97/11/04 eric */ /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987, 88, 89, 90, 91, 92, 1993 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #if defined (emacs) || defined (CONFIG_BROKETS) /* We use instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h (which it would do because it found this file in $srcdir). */ #include #else #include "config.h" #endif #endif #include "getopt.h" #ifndef __STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ /* Many versions of the Linux C library include older, broken versions of these routines, which will break the linker's command-line parsing. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) || defined (__linux__) /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #else char *getenv (); #endif #ifndef NULL #define NULL 0 #endif int getopt_long (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* _LIBC or not __GNU_LIBRARY__. */ #ifdef TEST #include int main (int argc, char *argv[]) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == EOF) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ cdrkit-1.1.11/genisoimage/boot-mipsel.c0000644000372500001440000002155210532407327017021 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* * Program boot-mipsel.c - Handle Mipsel boot extensions to iso9660. * * Written by Steve McIntyre (2004). * * Heavily inspired by / borrowed from delo: * * Copyright: (C) 2002 by Florian Lohoff * (C) 2004 by Thiemo Seufer * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, Version 2, as published by the * Free Software Foundation. * * Format for volume header information * * The volume header is a block located at the beginning of all disk * media (sector 0). It contains information pertaining to physical * device parameters and logical partition information. * * The volume header is manipulated by disk formatters/verifiers, * partition builders (e.g. fx, dvhtool, and mkfs), and disk drivers. * * Previous versions of IRIX wrote a copy of the volume header is * located at sector 0 of each track of cylinder 0. These copies were * never used, and reduced the capacity of the volume header to hold large * files, so this practice was discontinued. * The volume header is constrained to be less than or equal to 512 * bytes long. A particular copy is assumed valid if no drive errors * are detected, the magic number is correct, and the 32 bit 2's complement * of the volume header is correct. The checksum is calculated by initially * zeroing vh_csum, summing the entire structure and then storing the * 2's complement of the sum. Thus a checksum to verify the volume header * should be 0. * * The error summary table, bad sector replacement table, and boot blocks are * located by searching the volume directory within the volume header. * * Tables are sized simply by the integral number of table records that * will fit in the space indicated by the directory entry. * * The amount of space allocated to the volume header, replacement blocks, * and other tables is user defined when the device is formatted. */ #include #include "genisoimage.h" #include #include #include #include "match.h" #include "diskmbr.h" #include "bootinfo.h" #include #include "endianconv.h" #include #include int add_boot_mipsel_filename(char *filename); static int boot_mipsel_write(FILE *outfile); static char *boot_file_name = NULL; #define MAX_MAPS 51 #define DEC_BOOT_MAGIC 0x02757a #define HD_SECTOR_SIZE 512 /* Those were stolen from linux kernel headers. */ struct extent { uint32_t count; uint32_t start; } #ifdef __GNUC__ __attribute__((packed)) #endif ; struct dec_bootblock { int8_t pad[8]; int32_t magic; /* We are a DEC BootBlock */ int32_t mode; /* 0: Single extent, 1: Multi extent boot */ int32_t loadAddr; /* Load below kernel */ int32_t execAddr; /* And exec there */ struct extent bootmap[MAX_MAPS]; } #ifdef __GNUC__ __attribute__((packed)) #endif ; static void swap_in_elf32_ehdr(Elf32_Ehdr *ehdr) { ehdr->e_type = read_le16((unsigned char *)&ehdr->e_type); ehdr->e_machine = read_le16((unsigned char *)&ehdr->e_machine); ehdr->e_version = read_le32((unsigned char *)&ehdr->e_version); ehdr->e_entry = read_le32((unsigned char *)&ehdr->e_entry); ehdr->e_phoff = read_le32((unsigned char *)&ehdr->e_phoff); ehdr->e_shoff = read_le32((unsigned char *)&ehdr->e_shoff); ehdr->e_flags = read_le32((unsigned char *)&ehdr->e_flags); ehdr->e_ehsize = read_le16((unsigned char *)&ehdr->e_ehsize); ehdr->e_phentsize = read_le16((unsigned char *)&ehdr->e_phentsize); ehdr->e_phnum = read_le16((unsigned char *)&ehdr->e_phnum); ehdr->e_shentsize = read_le16((unsigned char *)&ehdr->e_shentsize); ehdr->e_shnum = read_le16((unsigned char *)&ehdr->e_shnum); ehdr->e_shstrndx = read_le16((unsigned char *)&ehdr->e_shstrndx); } static void swap_in_elf32_phdr(Elf32_Phdr *phdr) { phdr->p_type = read_le32((unsigned char *)&phdr->p_type); phdr->p_offset = read_le32((unsigned char *)&phdr->p_offset); phdr->p_vaddr = read_le32((unsigned char *)&phdr->p_vaddr); phdr->p_paddr = read_le32((unsigned char *)&phdr->p_paddr); phdr->p_filesz = read_le32((unsigned char *)&phdr->p_filesz); phdr->p_memsz = read_le32((unsigned char *)&phdr->p_memsz); phdr->p_flags = read_le32((unsigned char *)&phdr->p_flags); phdr->p_align = read_le32((unsigned char *)&phdr->p_align); } /* Simple function: store the filename to be used later when we need to find the boot file */ extern int add_boot_mipsel_filename(char *filename) { boot_file_name = filename; return 0; } /* Parse the ELF header of the boot loaded to work out the load address and exec address */ static int parse_boot_file(char *filename, int32_t *loadaddr, int32_t *execaddr, int32_t *offset, int32_t *count) { int error = 0; FILE *loader = NULL; Elf32_Ehdr ehdr; Elf32_Phdr phdr; loader = fopen(filename, "rb"); if (!loader) return errno; error = fread(&ehdr, sizeof(ehdr), 1, loader); if (1 != error) return EIO; swap_in_elf32_ehdr(&ehdr); if (!(ehdr.e_ident[EI_MAG0] == ELFMAG0 && ehdr.e_ident[EI_MAG1] == ELFMAG1 && ehdr.e_ident[EI_MAG2] == ELFMAG2 && ehdr.e_ident[EI_MAG3] == ELFMAG3 && ehdr.e_ident[EI_CLASS] == ELFCLASS32 && ehdr.e_ident[EI_DATA] == ELFDATA2LSB && ehdr.e_ident[EI_VERSION] == EV_CURRENT && ehdr.e_type == ET_EXEC && ehdr.e_machine == EM_MIPS && ehdr.e_version == EV_CURRENT)) { fprintf(stderr, "Sorry, %s is not a MIPS ELF32 little endian file", filename); return EINVAL; } if (ehdr.e_phnum != 1) { fprintf(stderr, "Sorry, %s has more than one ELF segment", filename); return EINVAL; } fseek(loader, ehdr.e_phoff, SEEK_SET); error = fread(&phdr, sizeof(phdr), 1, loader); if (1 != error) return EIO; *loadaddr = phdr.p_vaddr; *execaddr = ehdr.e_entry; *offset = (phdr.p_offset + HD_SECTOR_SIZE - 1) / HD_SECTOR_SIZE; *count = (phdr.p_filesz + HD_SECTOR_SIZE - 1) / HD_SECTOR_SIZE; fprintf(stderr, "Parsed mipsel boot image %s: using loadaddr 0x%X, execaddr 0x%X, offset 0x%X, count 0x%X\n", filename, *loadaddr, *execaddr, *offset, *count); fclose(loader); return 0; } static int boot_mipsel_write(FILE *outfile) { char sector[2048]; struct dec_bootblock *bb = (struct dec_bootblock *)sector; int error = 0; int offset = 0; int count = 0; struct directory_entry *boot_file; /* Boot file we need to search for in the image */ unsigned long length = 0; unsigned long extent = 0; int loadaddr = 0; int execaddr = 0; memset(sector, 0, sizeof(sector)); /* Fill in our values we care on */ write_le32(DEC_BOOT_MAGIC, (unsigned char *)&bb->magic); write_le32(1, (unsigned char *)&bb->mode); /* Find the file entry in the CD image */ boot_file = search_tree_file(root, boot_file_name); if (!boot_file) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Uh oh, unable to find the mipsel boot file '%s'!\n", boot_file_name); #else fprintf(stderr, "Uh oh, unable to find the mipsel boot file '%s'!\n", boot_file_name); exit(1); #endif } extent = get_733(boot_file->isorec.extent); length = get_733(boot_file->isorec.size); fprintf(stderr, "Found mipsel boot loader %s: using extent %lu, #blocks %lu\n", boot_file_name, extent, length); /* Parse the ELF headers on the boot file */ error = parse_boot_file(boot_file->whole_name, &loadaddr, &execaddr, &offset, &count); if (error) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Uh oh, unable to parse the mipsel boot file '%s'!\n", boot_file->whole_name); #else fprintf(stderr, "Uh oh, unable to parse the mipsel boot file '%s'!\n", boot_file->whole_name); exit(1); #endif } write_le32(loadaddr, (unsigned char *)&bb->loadAddr); write_le32(execaddr, (unsigned char *)&bb->execAddr); write_le32((extent * 4) + offset, (unsigned char *)&bb->bootmap[0].start); write_le32(count, (unsigned char *)&bb->bootmap[0].count); jtwrite(sector, sizeof(sector), 1, 0, FALSE); xfwrite(sector, sizeof(sector), 1, outfile, 0, FALSE); last_extent_written++; return 0; } struct output_fragment mipselboot_desc = {NULL, oneblock_size, NULL, boot_mipsel_write, "mipsel boot block"}; cdrkit-1.1.11/genisoimage/bswap.h0000644000372500001440000000431510531416235015703 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)bswap.h 1.2 03/03/25 Copyright 2002 J. Schilling */ #ifndef _BSWAP_H #define _BSWAP_H /* * Allow to use B2N_* macros found in libdvdread in a portable way. * These macros should better be avoided as in place conversion in * general only works on processors like Motorola 68000 and Intel x86. * Modern processors usually have alignement restrictions that may * cause problems. The stripped down libdvdread for genisoimage is known * not to have these alignement problems, so we may use the macros * as they have been introduced by the authors of libdvdread. * * Copyright (c) 2002 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #if defined(WORDS_BIGENDIAN) /* All bigendian systems are fine, just ignore the swaps. */ #define B2N_16(x) (void)(x) #define B2N_32(x) (void)(x) #define B2N_64(x) (void)(x) #else /* * It is a bad idea to convert numbers in place. * In protocols, there is usually the additional problem that the * data is not properly aligned. */ #define B2N_16(x) (x) = a_to_u_2_byte(&(x)) #define B2N_32(x) (x) = a_to_u_4_byte(&(x)) #define B2N_64(x) (x) = a_to_u_8_byte(&(x)) #endif #endif /* _BSWAP_H */ cdrkit-1.1.11/genisoimage/volume.c0000644000372500001440000004407110536265343016103 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)volume.c 1.14 04/07/09 joerg, Copyright 1997, 1998, 1999, 2000 James Pearson */ /* * Copyright (c) 1997, 1998, 1999, 2000 James Pearson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * volume.c: prepare HFS volume for mkhybrid * * James Pearson 17/7/97 * modified JCP 29/7/97 to improve allocation sizes to cut * down on wasted space. Now uses the HFS "allocation" size rounded * up to the nearest 2048 bytes. Savings can be significant with * a large volume containing lots of smallish files. * * Updated for v1.12 - now uses the built in RELOCATED_DIRECTORY * flag for finding the real directory location JCP 8/1/97 */ #ifdef APPLE_HYB #include #include "genisoimage.h" #include #define HFS_MIN_SIZE 1600 /* 800k == 1600 HFS blocks */ static hfsvol *vol_save = 0; /* used to "destroy" an HFS volume */ static int AlcSiz(Ulong); static int XClpSiz(Ulong); static int get_vol_size(int); int write_fork(hfsfile * hfp, long tot); int make_mac_volume(struct directory *, int); static int copy_to_mac_vol(hfsvol *, struct directory *); static void set_dir_info(hfsvol *, struct directory *); /* * AlcSiz: find allocation size for given volume size */ static int AlcSiz(Ulong vlen) { int lpa, drAlBlkSiz; /* code extracted from hfs_format() */ lpa = 1 + vlen / 65536; drAlBlkSiz = lpa * HFS_BLOCKSZ; /* * now set our "allocation size" to the allocation block rounded up to * the nearest SECTOR_SIZE (2048 bytes) */ drAlBlkSiz = ROUND_UP(drAlBlkSiz, SECTOR_SIZE); return (drAlBlkSiz); } /* * XClpSiz: find the default size of the catalog/extent file */ static int XClpSiz(Ulong vlen) { int olpa, lpa, drNmAlBlks, drAlBlkSiz; int vbmsz, drXTClpSiz; /* code extracted from hfs_format() */ /* get the lpa from our calculated allocation block size */ drAlBlkSiz = AlcSiz(vlen); lpa = drAlBlkSiz / HFS_BLOCKSZ; vbmsz = (vlen / lpa + 4095) / 4096; drNmAlBlks = (vlen - 5 - vbmsz) / lpa; drXTClpSiz = drNmAlBlks / 128 * drAlBlkSiz; /* override the drXTClpSiz size for large volumes */ if (drXTClpSiz > hce->max_XTCsize) { drXTClpSiz = hce->max_XTCsize; } else { /* * make allowances because we have possibly rounded up the * allocation size get the "original" lpa " */ olpa = 1 + vlen / 65536; /* adjust size upwards */ drXTClpSiz = ((Ullong)drXTClpSiz * lpa) / olpa; } /* round up to the nearest allocation size */ drXTClpSiz = ROUND_UP(drXTClpSiz, drAlBlkSiz); return (drXTClpSiz); } /* * get_vol_size: get the size of the volume including the extent/catalog */ static int get_vol_size(int vblen) { int drXTClpSiz; int drAlBlkSiz; int new_vblen; /* * try to estimate a "volume size" based on the code in hfs_format * - we need the size of the catalog/extents and Desktop files included * in the volume, as we add this to the end of the ISO volume */ drXTClpSiz = XClpSiz(vblen); drAlBlkSiz = AlcSiz(vblen); /* * catalog file is set at CTC times (default twice) the extents * file size - hence the (ctc_size + 1) below. The Desktop starts of * the same size as the "clump size" == 4 x drAlBlkSiz, * plus a spare drAlBlkSiz for the alternative MDB */ new_vblen = vblen + ((hce->ctc_size + 1) * drXTClpSiz + 5 * drAlBlkSiz) / HFS_BLOCKSZ; return (new_vblen); } /* * write_fork: "write" file data to the volume * * This is used to update the HFS file internal structures * but no data is actually written (it's trapped deep down in * libhfs). */ int write_fork(hfsfile *hfp, long tot) { char blk[HFS_BLOCKSZ]; unsigned short start; long len; len = tot; /* we need to know where this fork starts */ start = hfs_get_drAllocPtr(hfp); /* loop through the data a block at a time */ while (len >= HFS_BLOCKSZ) { if (hfs_write(hfp, blk, HFS_BLOCKSZ) < 0) return (-1); len -= HFS_BLOCKSZ; } /* write out anything left */ if (len) if (hfs_write(hfp, blk, len) < 0) return (-1); /* * set the start of the allocation search to be immediately after * this fork */ hfs_set_drAllocPtr(hfp, start, tot); return (0); } /* * make_mac_volume: "create" an HFS volume using the ISO data * * The HFS volume structures are set up (but no data is written yet). * * ISO volumes have a allocation size of 2048 bytes - regardless * of the size of the volume. HFS allocation size is depends on volume * size, so we may have to update the ISO structures to add in any * padding. */ int make_mac_volume(struct directory *dpnt, int start_extent) { char vol_name[HFS_MAX_VLEN + 1]; /* Mac volume name */ hfsvol *vol; /* Mac volume */ int vblen; /* vol length (HFS blocks) */ int Csize, lastCsize; /* allocation sizes */ int ret = 0; /* return value */ int loop = 1; /* umount volume if we have had a previous attempt */ if (vol_save) if (hfs_umount(vol_save, 0, hfs_lock) < 0) return (-1); /* set the default clump size to the ISO block size */ Csize = lastCsize = SECTOR_SIZE; if (verbose > 1) fprintf(stderr, "Creating HFS Volume info\n"); /* name or copy ISO volume name to Mac Volume name */ strncpy(vol_name, hfs_volume_id ? hfs_volume_id : volume_id, HFS_MAX_VLEN); vol_name[HFS_MAX_VLEN] = '\0'; /* get initial size of HFS volume (size of current ISO volume) */ vblen = (last_extent - session_start) * HFS_BLK_CONV; /* make sure volume is at least 800k */ if (vblen < HFS_MIN_SIZE) vblen += insert_padding_file(HFS_MIN_SIZE - vblen); /* * add on size of extents/catalog file, but this may mean the * allocation size will change, so loop round until the * allocation size doesn't change */ while (loop) { hce->XTCsize = XClpSiz(vblen); vblen = get_vol_size(vblen); Csize = AlcSiz(vblen); if (Csize == lastCsize) { /* allocation size hasn't changed, so carry on */ loop = 0; } else { /* * allocation size has changed, so update * ISO volume size */ if ((vblen = get_adj_size(Csize)) < 0) { sprintf(hce->error, "too many files for HFS volume"); return (-1); } vblen += ROUND_UP((start_extent - session_start) * HFS_BLK_CONV, Csize); lastCsize = Csize; } } /* take off the label/map size */ vblen -= hce->hfs_map_size; hce->hfs_vol_size = vblen; /* set the default allocation size for libhfs */ hce->Csize = Csize; /* format and mount the "volume" */ if (hfs_format(hce, 0, vol_name) < 0) { sprintf(hce->error, "can't HFS format %s", vol_name); return (-1); } /* * update the ISO structures with new start extents and any * padding required */ if (Csize != SECTOR_SIZE) { last_extent = adj_size(Csize, start_extent, hce->hfs_hdr_size + hce->hfs_map_size); adj_size_other(dpnt); } if ((vol = hfs_mount(hce, 0, 0)) == 0) { sprintf(hce->error, "can't HFS mount %s", vol_name); return (-1); } /* save the volume for possible later use */ vol_save = vol; /* * Recursively "copy" the files to the volume * - we need to know the first allocation block in the volume as * starting blocks of files are relative to this. */ ret = copy_to_mac_vol(vol, dpnt); if (ret < 0) return (ret); /* * make the Desktop files - I *think* this stops the Mac rebuilding the * desktop when the CD is mounted on a Mac These will be ignored if they * already exist */ if (create_dt) ret = make_desktop(vol, (last_extent - session_start) * HFS_BLK_CONV); if (ret < 0) return (ret); /* close the volume */ if (hfs_flush(vol) < 0) return (-1); /* unmount and set the start blocks for the catalog/extents files */ if (hfs_umount(vol, (last_extent - session_start) * HFS_BLK_CONV, hfs_lock) < 0) return (-1); return (Csize); } #define TEN 10 /* well, it is! */ #define LCHAR "_" /* * copy_to_mac_vol: copy all files in a directory to corresponding * Mac folder. * * Files are copied recursively to corresponding folders on the Mac * volume. The caller routine needs to do a hfs_chdir before calling this * routine. */ static int copy_to_mac_vol(hfsvol *vol, struct directory *node) { struct directory_entry *s_entry; /* ISO directory entry */ struct directory_entry *s_entry1; /* tmp ISO directory entry */ struct directory *dpnt; /* ISO directory */ hfsfile *hfp; /* HFS file */ hfsdirent *ent; /* HFS file entities */ long id; /* current HFS folder */ long dext, rext; /* real data/rsrc start blk */ int ret; /* result code */ int new_name; /* HFS file has modified name */ int tens; int digits; int i; /* store the current HFS directory ID */ if ((id = hfs_getcwd(vol)) == 0) return (-1); if (verbose > 1) fprintf(stderr, "HFS scanning %s\n", node->whole_name); /* loop through the ISO directory entries and process files */ for (s_entry = node->contents; s_entry; s_entry = s_entry->next) { /* ignore directory and associated (rsrc) files */ if (s_entry->isorec.flags[0] & (ISO_DIRECTORY|ISO_ASSOCIATED)) continue; /* ignore any non-Mac type file */ if (!s_entry->hfs_ent) continue; /* * ignore if from a previous session * - should be trapped above */ if (s_entry->starting_block < session_start) continue; #ifdef DEBUG fprintf(stderr, " Name = %s", s_entry->whole_name); fprintf(stderr, " Startb = %d\n", s_entry->starting_block); #endif /* DEBUG */ ent = s_entry->hfs_ent; /* create file */ i = HFS_MAX_FLEN - strlen(ent->name); new_name = 0; tens = TEN; digits = 1; while (1) { /* * try to open file - if it exists, * then append '_' to the name and try again */ errno = 0; if ((hfs_create(vol, ent->name, ent->u.file.type, ent->u.file.creator)) < 0) { if (errno != EEXIST) { /* * not an "exist" error, or we can't * append as the filename is already * HFS_MAX_FLEN chars */ sprintf(hce->error, "can't HFS create file %s", s_entry->whole_name); return (-1); } else if (i == 0) { /* * File name at max HFS length * - make unique name */ if (!new_name) new_name++; sprintf(ent->name + HFS_MAX_FLEN - digits - 1, "%s%d", LCHAR, new_name); new_name++; if (new_name == tens) { tens *= TEN; digits++; } } else { /* append '_' to get new name */ strcat(ent->name, LCHAR); i--; new_name = 1; } } else break; } /* warn that we have a new name */ if (new_name && verbose > 0) { fprintf(stderr, "Using HFS name: %s for %s\n", ent->name, s_entry->whole_name); } /* open file */ if ((hfp = hfs_open(vol, ent->name)) == 0) { sprintf(hce->error, "can't HFS open %s", s_entry->whole_name); return (-1); } /* if it has a data fork, then "write" it out */ if (ent->u.file.dsize) write_fork(hfp, ent->u.file.dsize); /* if it has a resource fork, set the fork and "write" it out */ if (ent->u.file.rsize) { if ((hfs_setfork(hfp, 1)) < 0) return (-1); write_fork(hfp, ent->u.file.rsize); } /* make file invisible if ISO9660 hidden */ if (s_entry->de_flags & HIDDEN_FILE) ent->fdflags |= HFS_FNDR_ISINVISIBLE; /* update any HFS file attributes */ if ((hfs_fsetattr(hfp, ent)) < 0) { sprintf(hce->error, "can't HFS set attributes %s", s_entry->whole_name); return (-1); } /* * get the ISO starting block of data fork (may be zero) * and convert to the equivalent HFS block */ if (ent->u.file.dsize) { dext = (s_entry->starting_block - session_start) * HFS_BLK_CONV; } else { dext = 0; } /* * if the file has a resource fork (associated file), * get it's ISO starting block and convert as above */ if (s_entry->assoc && ent->u.file.rsize) { rext = (s_entry->assoc->starting_block - session_start) * HFS_BLK_CONV; } else { rext = 0; } /* close the file and update the starting blocks */ if (hfs_close(hfp, dext, rext) < 0) { sprintf(hce->error, "can't HFS close file %s", s_entry->whole_name); return (-1); } } /* set folder info and custom icon (if it exists) */ set_dir_info(vol, node); /* * process sub-directories - have a slight problem here, * if the directory had been relocated, then we need to find the * real directory - we do this by first finding the * real directory_entry, and then finding it's directory info */ /* following code taken from joliet.c */ for (s_entry = node->contents; s_entry; s_entry = s_entry->next) { if ((s_entry->de_flags & RELOCATED_DIRECTORY) != 0) { /* * if the directory has been reloacted, then search the * relocated directory for the real entry */ for (s_entry1 = reloc_dir->contents; s_entry1; s_entry1 = s_entry1->next) { if (s_entry1->parent_rec == s_entry) break; } /* have a problem - can't find the real directory */ if (s_entry1 == NULL) { sprintf(hce->error, "can't locate relocated directory %s", s_entry->whole_name); return (-1); } } else s_entry1 = s_entry; /* now have the correct entry - now find the actual directory */ if ((s_entry1->isorec.flags[0] & ISO_DIRECTORY) && strcmp(s_entry1->name, ".") && strcmp(s_entry1->name, "..")) { if ((s_entry->de_flags & RELOCATED_DIRECTORY) != 0) dpnt = reloc_dir->subdir; else dpnt = node->subdir; while (1) { if (dpnt->self == s_entry1) break; dpnt = dpnt->next; if (!dpnt) { sprintf(hce->error, "can't find directory location %s", s_entry1->whole_name); return (-1); } } /* * now have the correct directory * - so do the HFS stuff */ ent = dpnt->hfs_ent; /* * if we don't have hfs entries, then this is a "deep" * directory - this will be processed later */ if (!ent) continue; /* make sub-folder */ i = HFS_MAX_FLEN - strlen(ent->name); new_name = 0; tens = TEN; digits = 1; while (1) { /* * try to create new directory * - if it exists, then append '_' to the name * and try again */ errno = 0; if (hfs_mkdir(vol, ent->name) < 0) { if (errno != EEXIST) { /* * not an "exist" error, * or we can't append as the * filename is already * HFS_MAX_FLEN chars */ sprintf(hce->error, "can't HFS create folder %s", s_entry->whole_name); return (-1); } else if (i == 0) { /* * File name at max HFS length * - make unique name */ if (!new_name) new_name++; sprintf(ent->name + HFS_MAX_FLEN - digits - 1, "%s%d", LCHAR, new_name); new_name++; if (new_name == tens) { tens *= TEN; digits++; } } else { /* append '_' to get new name */ strcat(ent->name, LCHAR); i--; new_name = 1; } } else break; } /* warn that we have a new name */ if (new_name && verbose > 0) { fprintf(stderr, "Using HFS name: %s for %s\n", ent->name, s_entry->whole_name); } /* see if we need to "bless" this folder */ if (hfs_bless && strcmp(s_entry->whole_name, hfs_bless) == 0) { hfs_stat(vol, ent->name, ent); hfs_vsetbless(vol, ent->cnid); if (verbose > 0) { fprintf(stderr, "Blessing %s (%s)\n", ent->name, s_entry->whole_name); } /* stop any further checks */ hfs_bless = NULL; } /* change to sub-folder */ if (hfs_chdir(vol, ent->name) < 0) return (-1); /* recursively copy files ... */ ret = copy_to_mac_vol(vol, dpnt); if (ret < 0) return (ret); /* change back to this folder */ if (hfs_setcwd(vol, id) < 0) return (-1); } } return (0); } /* * set_dir_info: Set directory info for a file - also use a custom * Icon - if it exists. * * Sets folder' layout (window layout, view, scroll bars etc) * * Set the 'HFS_FNDR_HASCUSTOMICON' bit of the folder flags * if a file called 'Icon\r' exists in the folder * * Also makes sure the Icon file is invisible * Don't worry if any of this fails ... * * Thanks to Rob Leslie for how to do this. */ #define ICON "Icon" static void set_dir_info(hfsvol *vol, struct directory *de) { hfsdirent *ent = de->hfs_ent; hfsdirent ent1; char name[HFS_MAX_FLEN + 1]; unsigned short flags = 0; memset(&ent1, 0, sizeof (hfsdirent)); sprintf(name, "%s\r", ICON); /* get the attributes for the Icon file */ if (hfs_stat(vol, name, &ent1) == 0) { /* make sure it is invisible */ ent1.fdflags |= HFS_FNDR_ISINVISIBLE; /* set the new attributes for the Icon file */ hfs_setattr(vol, name, &ent1); /* flag the folder as having a custom icon */ flags |= HFS_FNDR_HASCUSTOMICON; } /* make the current folder invisible if ISO9660 hidden */ if (de->self->de_flags & HIDDEN_FILE) { flags |= HFS_FNDR_ISINVISIBLE; } /* may not have an hfs_ent for this directory */ if (ent == NULL) { ent = &ent1; memset(ent, 0, sizeof (hfsdirent)); /* get the attributes for the folder */ if (hfs_stat(vol, ":", ent) < 0) return; } /* set HFS_FNDR_HASCUSTOMICON/HFS_FNDR_ISINVISIBLE if needed */ ent->fdflags |= flags; /* set the new attributes for the folder */ if (hfs_setattr(vol, ":", ent) < 0) { /* * Only needed if we add things after this if statement. */ /* return;*/ } } #endif /* APPLE_HYB */ cdrkit-1.1.11/genisoimage/ChangeLog0000644000372500001440000037065610531367430016210 0ustar steveusers****** Version 2.01 ****** Wed Sep 8 20:28:58 2004 Joerg Schilling * isoinfo.c 1.47 * isovfy.c 1.23 * dump.c 1.21 * isodebug.c 1.9 * isodump.c 1.24 * mkisofs.c 1.161 Version -> 2.01 Thu Sep 2 13:05:11 2004 Joerg Schilling * mkisofs.8 1.108 -D Hinweis auf ISO9660:1999 Mon Aug 30 12:24:17 2004 Joerg Schilling * mkisofs.8 1.107 ISO-9690 -> ISO-9660 Tue Aug 24 19:21:54 2004 Joerg Schilling * write.c 1.85 Intermediate Cast auf (void *) damit GCC nicht wegen "strict-aliasing rules" meckert Tue Aug 3 21:21:54 2004 Joerg Schilling * mkisofs.8 1.106 Hinweis auf Bugfix fuer -no-split-symlink-components / -no-split-symlink-fields Sat Jul 31 17:11:30 2004 Joerg Schilling * mkisofs.8 1.105 Schreibfehler beseitigt Sat Jul 17 23:42:14 2004 Joerg Schilling * mkisofs.8 1.104 * mkisofs.c 1.160 Version -> 2.01a34 -volset-size ist nun auf 1 begrenzt Sun Jul 11 18:30:27 2004 Joerg Schilling * mkisofs.c 1.159 Fehlermeldung bei -L/-H/-P weis nun korrekt auf 2.02 hin Sun Jul 11 02:03:26 2004 Joerg Schilling * mkisofs.c 1.158 -> NEED_O_BINARY Fri Jul 9 17:34:41 2004 Joerg Schilling * mkisofs.c 1.157 Version -> 2.01a33 Fri Jul 9 16:06:36 2004 Joerg Schilling * volume.c 1.14 * write.c 1.84 static -> LOCAL + EXPORT Fri Jul 9 15:32:26 2004 Joerg Schilling * write.c 1.83 'VIDEO_TS' wird jetzt immer gefunden und mkisofs bricht ab wenn es nicht gefunden werden konnte und -dvd-video Fri Jun 18 11:17:08 2004 Joerg Schilling * hash.c 1.18 Nachdenken ueber Speedup Thu Jun 17 12:25:43 2004 Joerg Schilling * mkisofs.c 1.156 Version -> 2.01a32 Thu Jun 17 11:22:11 2004 Joerg Schilling * dump.c 1.20 * isodump.c 1.23 For Schleife ohne strlen() in Ende Bedingung Sat Jun 12 16:15:16 2004 Joerg Schilling * tree.c 1.82 sprintf() zur besseren Geschwindigkeit beim Erzeugen von 8.3 Filenamen in sort_n_finish() vermeiden Mon Jun 7 13:02:01 2004 Joerg Schilling * mkisofs.8 1.103 Dokumentation der maximalen Stringlaenge der Eintraege im PVD nun auch bei den Optionen Sat Jun 5 16:48:02 2004 Joerg Schilling * mkisofs.8 1.102 * mkisofs.c 1.155 Optionen -H/-L/-P sind veraltet und werden mit 2.02 POSIX.1-2001 konform Tue Jun 1 18:27:04 2004 Joerg Schilling * mkisofs.c 1.154 Version -> 2.01a31 Tue Jun 1 16:53:24 2004 Joerg Schilling * tree.c 1.81 Bei DJGPP auch alle Files eXecutable machen. Tue Jun 1 16:52:47 2004 Joerg Schilling * mkisofs.c 1.153 load_nls("cp437") per Default auch fuer DJGPP Tue Jun 1 16:51:47 2004 Joerg Schilling * defaults.h 1.18 SYSTEM_ID -> DOS fuer DJGPP Tue Jun 1 16:50:58 2004 Joerg Schilling * isoinfo.c 1.46 setmode(fileno(stdout), O_BINARY) beim Extrahieren von Dateien nach STDOUT Tue Jun 1 14:07:06 2004 Joerg Schilling * isodebug.c 1.8 Funktionen moeglichst LOCAL Tue Jun 1 13:50:50 2004 Joerg Schilling * dump.mk 1.4 * dump.c 1.19 * isoinfo.8 1.7 * isodump.c 1.22 * isoinfo.mk 1.5 * isodump.mk 1.4 * isovfy.mk 1.4 * isovfy.c 1.22 * isodebug.mk 1.2 * isodebug.c 1.7 Umstellung auf libusal Sat May 29 17:46:26 2004 Joerg Schilling * isoinfo.c 1.45 cdr_defaults() nur mit libusal rufen Sat May 29 16:55:08 2004 Joerg Schilling * isodebug.c 1.6 Version -> 2.01a31 Cstyle Fri May 28 13:51:13 2004 Joerg Schilling * isoinfo.c 1.44 Support fuer cdr_defaults() (/etc/default/cdrecord) neu Fri May 28 13:39:35 2004 Joerg Schilling * isoinfo.c 1.43 Cstyle Fri May 28 13:37:39 2004 Joerg Schilling * isoinfo.c 1.42 Version -> 2.01a31 Umbau auf libusal Fri May 28 13:36:25 2004 Joerg Schilling * isodump.c 1.21 * isovfy.c 1.21 Version -> 2.01a31 Cstyle Fri May 28 01:09:55 2004 Joerg Schilling * dump.c 1.18 Version -> 2.01a31 Cstyle Thu May 27 01:54:59 2004 Joerg Schilling * mkisofs.h 1.94 scsi.c Prototypen -> scsi.h Thu May 27 01:54:31 2004 Joerg Schilling * scsi.h 1.1 date and time created 04/05/27 00:54:31 by joerg Sun May 23 23:46:05 2004 Joerg Schilling * eltorito.c 1.32 Debug Messages beseitigt Sun May 23 23:23:27 2004 Joerg Schilling * mkisofs.8 1.101 * tree.c 1.80 * eltorito.c 1.31 * match.h 1.9 * mkisofs.c 1.152 * match.c 1.18 Version -> 2.01a30 Eltorito Boot Images per Default nach Vorne Sortieren Thu May 20 13:38:31 2004 Joerg Schilling * eltorito.c 1.30 Copyright J. Schilling neu Thu May 20 13:33:59 2004 Joerg Schilling * eltorito.c 1.29 Keine Ausgabe der Bootmethode bei mkisofs -quiet Sat May 15 22:25:17 2004 Joerg Schilling * mkisofs.c 1.151 Version -> 2.01a29 Hinweis auf unerwuenschte SILO Optionen Sat May 15 21:48:26 2004 Joerg Schilling * write.c 1.82 Neuer Kommentar damit SuSE keine sinnlosen Patches anbringt Sat May 15 21:05:49 2004 Joerg Schilling * isoinfo.c 1.41 Version -> 2.01a29 Sat May 15 19:59:40 2004 Joerg Schilling * multi.c 1.66 * mkisofs.c 1.150 * isoinfo.c 1.40 GCC shadowed Variblen beseitigt Thu Apr 15 16:33:41 2004 Joerg Schilling * mkisofs.c 1.149 Version -> 2.01a28 Thu Apr 15 16:30:40 2004 Joerg Schilling * hash.c 1.17 isoname_endsok() neu zum besseren Vergleich von ISO-9660 namen Thu Apr 15 14:51:22 2004 Joerg Schilling * hash.c 1.16 * udf.c 1.14 Cstyle Wed Apr 14 12:55:56 2004 Joerg Schilling * write.c 1.81 Schreibfehler beseitigt (Initial Padbock) Tue Apr 6 12:30:26 2004 Joerg Schilling * tree.c 1.79 Fix fuer doppeltes Free von Juergen Keil Absturz durch: echo bar >/tmp/bar echo foo/bar=/tmp/bar > /tmp/pathlist env LD_PRELOAD=libumem.so.1 UMEM_DEBUG=default UMEM_LOGGING=transaction mkisofs -hfs -graft-points -o /tmp/foo.raw -path-list=/tmp/pathlist Tue Apr 6 11:57:30 2004 Joerg Schilling * tree.c 1.78 beruecksichtigung des Null Bytes beim malloc() fuer die Datei TRANS_TBL Sun Apr 4 20:24:38 2004 Joerg Schilling * multi.c 1.65 Bessere Fehlermeldung bei multi Session mit volset size > 1 Mon Mar 15 15:43:58 2004 Joerg Schilling * defaults.h 1.17 "SCO-OPENSERVER"/"SCO-UNIXWARE", Default ist nun "UNIX" statt "LINUX" Fri Mar 5 00:22:28 2004 Joerg Schilling * mkisofs.c 1.148 Version -> 2.01a27 Fri Mar 5 00:12:50 2004 Joerg Schilling * mac_label.c 1.9 * match.c 1.17 * name.c 1.28 * scsi.c 1.19 * stream.c 1.3 * files.c 1.12 * exclude.c 1.9 * dvd_reader.c 1.3 * eltorito.c 1.28 * ifo_read.c 1.5 * dvd_file.c 1.3 * desktop.c 1.6 * apple_driver.c 1.6 * vms.c 1.9 * volume.c 1.13 Cstyle Thu Mar 4 22:47:39 2004 Joerg Schilling * multi.c 1.64 * mkisofs.h 1.93 * mkisofs.c 1.147 * mkisofs.8 1.100 Neue Optionen -root & -old-root von Patrik Ohly Thu Mar 4 22:40:24 2004 Joerg Schilling * mac_label.c 1.8 Korrektur fuer PREP/CHRP Erweiterung Tue Mar 2 00:54:16 2004 Joerg Schilling * fnmatch.h 1.4 * exclude.h 1.3 * diskmbr.h 1.2 * defaults.h 1.16 * bootinfo.h 1.3 * apple.h 1.7 * apple.c 1.19 * ifo_read.h 1.2 * ifo_types.h 1.2 * iso9660.h 1.19 * mac_label.h 1.3 * mactypes.h 1.3 * match.h 1.8 Cstyle Tue Mar 2 00:50:27 2004 Joerg Schilling * dvd_reader.h 1.2 Cstyle Mon Mar 1 12:05:40 2004 Joerg Schilling * vms.h 1.3 * udf.h 1.2 * udf_fs.h 1.2 Cstyle Sun Feb 29 17:53:16 2004 Joerg Schilling * isoinfo.c 1.39 Eltorito Boot mit -d anzeigen Extension Records fuer lange RR Namen korrekt anzeigen Sun Feb 29 17:20:47 2004 Joerg Schilling * mac_label.h 1.2 * write.c 1.80 * mkisofs.c 1.146 * mkisofs.h 1.92 * mac_label.c 1.7 CHRP Support von "Leigh Brown" Sun Feb 29 16:49:18 2004 Joerg Schilling * rock.c 1.42 * multi.c 1.63 }; in Funktionen -> } Sun Feb 29 16:43:37 2004 Joerg Schilling * multi.c 1.62 Korrekte Behandlung von CE Extension Records fuer RR NM & fue rTime Stamps Wed Feb 25 00:16:47 2004 Joerg Schilling * udf.c 1.13 Support fuer rationalize_uid/rationalize_gid Sun Feb 22 16:27:28 2004 Joerg Schilling * mkisofs.c 1.145 Version -> 2.01a26 Mb -> MB Sun Feb 22 16:26:26 2004 Joerg Schilling * rock.c 1.41 gen_xa_attr(mode_t attr) ANSI C Variante wegen aelteren UNIX Versionen mit mode_t == short Sun Feb 22 16:25:09 2004 Joerg Schilling * boot.c 1.13 Total extents including sparc boot -> Total extents including %s boot Sun Feb 22 16:13:43 2004 Joerg Schilling * scsi.c 1.18 cdr_defaults() wird nun fuer das SCSI dev= gerufen (/etc/default/cdrecord) Wed Jan 7 00:23:46 2004 Joerg Schilling * mkisofs.c 1.144 Copyright -> 2004 Tue Jan 6 23:53:42 2004 Joerg Schilling * mkisofs.c 1.143 Version -> 2.01a24 Tue Jan 6 22:37:55 2004 Joerg Schilling * tree.c 1.77 Rock Ridge Laengenbehandlung in update_nlink()/increment_nlink() korrigiert (Bugfix) Mon Dec 29 14:46:02 2003 Joerg Schilling * mkisofs.c 1.142 * boot.c 1.12 Cstyle Anpassungen Mon Dec 29 14:36:10 2003 Joerg Schilling * boot.c 1.11 Neue Optionen -sunx86-boot & -sunx86-label Mon Dec 29 14:35:05 2003 Joerg Schilling * mkisofs.c 1.141 Version -> 2.01a22 Neue Optionen -sunx86-boot & -sunx86-label Mon Dec 29 14:34:16 2003 Joerg Schilling * mkisofs.8 1.99 Neue Optionen -sunx86-boot & -sunx86-label -sparc-label war vergessen - nun dokumentiert Mon Dec 29 13:31:28 2003 Joerg Schilling * mkisofs.8 1.98 Kommentar zu SILO in den NOTES Fehlende backslashes for diversen - Zeichen eingefuegt Sun Dec 28 14:46:10 2003 Joerg Schilling * sunlabel.h 1.5 Cstyle Aenderungen Sun Dec 28 14:44:50 2003 Joerg Schilling * sunlabel.h 1.4 Erweiterungen fuer Solaris x86 Disk Label und fdisk Sun Dec 28 14:38:51 2003 Joerg Schilling * mkisofs.h 1.91 Cstyle Anpassungen Sun Dec 28 14:37:09 2003 Joerg Schilling * mkisofs.h 1.90 make_sunx86_label()/scan_sunx86_boot()/sunx86_boot_label() neu Sat Nov 29 23:58:30 2003 Joerg Schilling * mkisofs.c 1.140 #include fuer setmode(fileno, OBINARY) #include auch fuer DJGPP Sat Nov 29 23:11:14 2003 Joerg Schilling * mkisofs.c 1.139 Version -> 2.01a20 setmode(fileno, O_BINARY) auch fuer DJGPP Sun Jul 13 15:42:15 2003 Joerg Schilling * write.c 1.79 * mkisofs.h 1.89 * mkisofs.c 1.138 secsize -> osecsize, Version -> 2.01a17 Fri Jul 11 11:42:32 2003 Joerg Schilling * mkisofs.8 1.97 Schreibfehler Thu Jul 10 01:26:47 2003 Joerg Schilling * tree.c 1.76 Bessere Meldung bei Stat Buffer Overflow Sat Jun 21 14:28:25 2003 Joerg Schilling * mkisofs.c 1.137 Eltorito PVD muss vor direkt nach dem Primaeren PVD kommen -> also vor Enhanced PVD Sat Jun 21 14:16:30 2003 Joerg Schilling * match.c 1.16 Wenn ein TAB nach einem Space im Sort File kommt, dann wird dieses genommen Sat Jun 21 14:11:05 2003 Joerg Schilling * mkisofs.8 1.96 Schreibfehler und Formulierungen korrigiert Sat Jun 21 14:10:13 2003 Joerg Schilling * eltorito.c 1.27 Schreibfehler bei 'is not the an allowable size' beseitigt Tue May 6 19:04:03 2003 Joerg Schilling * rock.c 1.40 Fix fuer defekte CE Signaturen bei ../../../ in Symlinks Wed Apr 30 01:19:33 2003 Joerg Schilling * mkisofs.c 1.136 no_rr nur dann automatisch setzen wenn keine XA Signaturen gefunden wurden Wed Apr 30 01:18:10 2003 Joerg Schilling * multi.c 1.61 find_rr() nun mit XA Flag Wed Apr 30 01:15:59 2003 Joerg Schilling * mkisofs.h 1.88 Rock Ridge Defines neu Tue Apr 29 21:22:52 2003 Joerg Schilling * write.c 1.78 Variable secsize neu, struct xa_subhdr neu Tue Apr 29 21:20:40 2003 Joerg Schilling * mkisofs.h 1.87 Neue Variable secsize Tue Apr 29 21:19:13 2003 Joerg Schilling * mkisofs.c 1.135 Neue Option -sectype Tue Apr 29 01:39:14 2003 Joerg Schilling * mkisofs.c 1.134 -apple bedeutet nicht mehr -r Tue Apr 29 01:17:55 2003 Joerg Schilling * tree.c 1.75 insert_file_entry() erzeugt auch XA oder RockRidge Signaturen fuer rsrc Files Tue Apr 29 01:06:32 2003 Joerg Schilling * write.c 1.77 Umbau von xfwrite() fuer XA subheader Mon Apr 28 01:44:30 2003 Joerg Schilling * mkisofs.8 1.95 Hinwies, dasz -apple nicht mehr -R beinhaltet Mon Apr 28 01:36:07 2003 Joerg Schilling * joliet.c 1.37 * eltorito.c 1.26 * boot.c 1.10 * stream.c 1.2 * udf.c 1.12 * mkisofs.h 1.86 Umbau von xfwrite() fuer XA subheader Mon Apr 28 01:06:38 2003 Joerg Schilling * iso9660.h 1.18 XA Sektor Subheader Definitionen neu Sun Apr 27 15:46:18 2003 Joerg Schilling * tree.c 1.74 * eltorito.c 1.25 generate_rock_ridge_attributes() -> generate_xa_rr_attributes(), if (use_RockRidge) -> if (use_XA || use_RockRidge) Sun Apr 27 15:38:59 2003 Joerg Schilling * rock.c 1.39 generate_rock_ridge_attributes() -> generate_xa_rr_attributes(), if (!use_RockRidge) goto xa_only; Sun Apr 27 15:36:45 2003 Joerg Schilling * mkisofs.h 1.85 generate_rock_ridge_attributes() -> generate_xa_rr_attributes() Sun Apr 27 15:35:49 2003 Joerg Schilling * mkisofs.c 1.133 Version -> 2.01a12 Sun Apr 27 14:09:25 2003 Joerg Schilling * TODO 1.6 13.4.2003 HFS > 2 GB Tue Apr 15 18:47:55 2003 Joerg Schilling * write.c 1.76 CD-XA001 Signatur hinzufuegen Sun Apr 13 19:05:06 2003 Joerg Schilling * isoinfo.c 1.38 Version -> 2.01a10 st_size ist unsigned bei ISO-9660, map auf Llong Sun Apr 13 01:36:22 2003 Joerg Schilling * write.c 1.75 * tree.c 1.73 * mkisofs.h 1.84 Erster Versuch Files bis zu 4 GB zu unterstuetzen Sun Apr 13 01:32:15 2003 Joerg Schilling * vms.h 1.2 * vms.c 1.8 vms_write_one_file() mit off_t size Fri Apr 11 19:19:24 2003 Joerg Schilling * rock.c 1.38 gen_xa()/gen_xa_attr() neu Thu Apr 10 15:38:04 2003 Joerg Schilling * iso9660.h 1.17 Kommentar fuer XA Flags korrigiert Thu Apr 10 15:37:25 2003 Joerg Schilling * mkisofs.c 1.132 Version -> 2.01a10, Optionen -XA/-xa neu, Schreibfehler bei -iso-level beseitigt Thu Apr 10 15:36:03 2003 Joerg Schilling * mkisofs.h 1.83 use_XA neu Thu Apr 10 15:34:30 2003 Joerg Schilling * write.c 1.74 Skip XA Record neu Sat Apr 5 13:39:51 2003 Joerg Schilling * isoinfo.c 1.37 Usage Schreibfehler beseitigt Fri Apr 4 23:42:02 2003 Joerg Schilling * name.c 1.27 conv_charset() bei -iso-level 4 fuer 8 Bit Zeichen Fri Apr 4 23:41:05 2003 Joerg Schilling * rock.c 1.37 statis -> LOCAL, unsigned char -> Uchar Fri Apr 4 23:40:06 2003 Joerg Schilling * ifo_read.c 1.4 Umbau um ANSI C Warnungen zu vermeiden Sat Mar 29 13:01:43 2003 Joerg Schilling * udf.c 1.11 Hinweis auf VIDEO_TS in joliet.c Sat Mar 29 12:59:14 2003 Joerg Schilling * joliet.c 1.36 * write.c 1.73 #ifdef __STDC__ -> PROTOTYPES, Eingerueckt nach cstyle Sat Mar 29 12:43:35 2003 Joerg Schilling * multi.c 1.60 * rock.c 1.36 #ifdef __STDC__ -> PROTOTYPES Thu Mar 27 00:19:50 2003 Joerg Schilling * rock.c 1.35 Anpassungen fuer cstyle Thu Mar 27 00:05:17 2003 Joerg Schilling * rock.c 1.34 Bessere Debug Ausgaben fuer add_CE_entry & Bug Fix fuer Split Symplinks (2 Byte Offsetfehler) Tue Mar 25 21:31:29 2003 Joerg Schilling * bswap.h 1.2 * mkisofs.h 1.82 Eingerueckt nach cstyle Tue Mar 25 20:51:55 2003 Joerg Schilling * multi.c 1.59 Eingerückt nach cstyle Tue Mar 25 20:48:56 2003 Joerg Schilling * mkisofs.c 1.131 Version -> 2.01a07, Eingerueckt nach cstyle Sun Mar 9 13:38:18 2003 Joerg Schilling * getopt.c 1.6 FSF Junk Code (#define _NO_PROTO) beseitigt der #include strings.h verhinderte; stattdessen #define getopt __nothing_ Thu Mar 6 22:11:16 2003 Joerg Schilling * getopt.h 1.3 * fnmatch.h 1.3 mconfig.h statt (internem) protoyp.h Thu Mar 6 22:03:51 2003 Joerg Schilling * getopt.h 1.2 * fnmatch.h 1.2 Umbau auf prototyp.h & PROTOTYPES statt __STDC__ damit Prototypen korrekt auch bei SCO Unixware gehen Thu Mar 6 22:01:40 2003 Joerg Schilling * dvd_reader.c 1.2 DVDOpenFile() mit Prototype implementierung wegen SCO cc (enum) Sun Mar 2 17:33:16 2003 Joerg Schilling * tree.c 1.72 strdup() -> libport Sat Mar 1 21:19:56 2003 Joerg Schilling * match.c 1.15 #include match.h nach #include libport.h wegen MAX define in param.h bei Linux Sat Mar 1 19:25:08 2003 Joerg Schilling * match.c 1.14 #includ fuer strdup() Sat Mar 1 18:56:35 2003 Joerg Schilling * multi.c 1.58 *nent -> *nentp & nent Sat Mar 1 18:41:25 2003 Joerg Schilling * multi.c 1.57 pnt->assoc schon direkt nach dem Einlesen der direcory zuweisen damit es zuverlaessig funktioniert Sat Mar 1 13:00:37 2003 Joerg Schilling * isoinfo.c 1.36 Ausgabe der ISO-9660 directory flags Sat Mar 1 12:54:45 2003 Joerg Schilling * iso9660.h 1.16 Definitionen fuer XA attributes neu Fri Feb 28 01:32:10 2003 Joerg Schilling * write.c 1.72 * vms.c 1.7 * mkisofs.c 1.130 * mkisofs.h 1.81 strdup() -> libport.h Fri Feb 28 01:23:34 2003 Joerg Schilling * isodump.c 1.20 * dump.c 1.17 Umbau auf ttydefs.h und Portabilitaet fuer alte UNIX Versionen ohne termio* Sun Feb 23 19:34:23 2003 Joerg Schilling * tree.c 1.71 LOCAL statt static & Umbau wegen cstyle Sun Feb 23 14:25:55 2003 Joerg Schilling * multi.c 1.56 * mkisofs.h 1.80 Einige Funktionen in multi.c -> LOCAL, Eingerueckt nach cstyle Sat Feb 22 21:57:34 2003 Joerg Schilling * joliet.c 1.35 sort_goof -> jsort_goof Sun Feb 16 01:17:25 2003 Joerg Schilling * apple_driver.c 1.5 Unsinniger Parameter aus comerr() Aufruf beseitigt Sat Feb 15 22:05:58 2003 Joerg Schilling * isoinfo.c 1.35 Bei -debug wird nun auch der root directory extent ausgegeben Sat Feb 15 22:03:43 2003 Joerg Schilling * mkisofs.8 1.94 Padding neu beschrieben (150 Sektoren) Sat Feb 15 22:00:28 2003 Joerg Schilling * write.c 1.71 Interpad rundet nur noch auf ein Vielfaches von 16 Sektoren auf Sat Feb 15 21:50:27 2003 Joerg Schilling * stream.c 1.1 date and time created 03/02/15 21:50:27 by joerg Sat Feb 15 21:01:49 2003 Joerg Schilling * mkisofs.h 1.79 * mkisofs.c 1.129 * udf.c 1.10 * write.c 1.70 Umbau auf 150 Sektoren Padding am Ende des FS Images Sat Feb 15 13:59:11 2003 Joerg Schilling * mkisofs.8 1.93 * mkisofs.c 1.128 Neue Option -stream-media-size Thu Feb 13 09:37:52 2003 Joerg Schilling * write.c 1.69 time_t begun -> EXTERN Freigeben fuer UDF & Stream.c Thu Feb 13 09:34:41 2003 Joerg Schilling * mkisofs.h 1.78 Definitionen fuer stream.c Thu Feb 13 09:33:19 2003 Joerg Schilling * udf.c 1.9 Externe time_t begun aus write.c uebernehmen fuer: PDV, LVDESC, File Set Desc, Main Seq Mon Feb 10 01:47:19 2003 Joerg Schilling * isoinfo.c 1.34 Eingerueckt nach cstyle Sun Feb 9 21:49:45 2003 Joerg Schilling * udf.c 1.8 Umformatier fuer cstyle Fri Feb 7 11:15:06 2003 Joerg Schilling * mkisofs.c 1.127 Version -> 2.01a03, Graft-point nodename ist nun [2*PATH_MAX + 1 + 1] grosz Tue Jan 28 01:28:37 2003 Joerg Schilling * isoinfo.c 1.33 Erkennung von ISO-9660:1999 Tue Jan 28 01:27:23 2003 Joerg Schilling * mkisofs.c 1.126 Version -> 2.01a02 Tue Jan 28 01:25:58 2003 Joerg Schilling * mkisofs.c 1.125 ISO-9660:1998 -> ISO-9660:1999, Schreibfehler bei -pad help beseitigt Tue Jan 28 01:25:04 2003 Joerg Schilling * write.c 1.68 Bei ISO-9660:1999 ist der 2. VD ein ISO_VD_SUPPLEMENTARY (war vorher wie PVD) Tue Jan 28 01:24:09 2003 Joerg Schilling * mkisofs.8 1.92 * iso9660.h 1.15 ISO-9660:1998 -> ISO-9660:1999 Sun Jan 19 20:18:08 2003 Joerg Schilling * mkisofs.8 1.91 Warnung vor Suns Eltorito Patch bei -iso-level 4 Sun Jan 19 16:19:29 2003 Joerg Schilling * name.c 1.26 Bei relaxed Filenames wird '/' verboten. Sun Jan 19 16:00:57 2003 Joerg Schilling * mkisofs.8 1.90 * iso9660.h 1.14 * mkisofs.h 1.77 * rock.c 1.33 * mkisofs.c 1.124 * multi.c 1.55 * write.c 1.67 Version -> 2.01a01, Erweiterungen fuer ISO-9660:1998 Sun Jan 19 15:55:18 2003 Joerg Schilling * tree.c 1.70 Bessere RR overflow Meldung Wed Dec 25 15:16:49 2002 Joerg Schilling * name.c 1.25 * files.c 1.11 * multi.c 1.54 ctype.h nach schily.h wegen OpenBSD #define EOF Bug Tue Dec 24 16:39:28 2002 Joerg Schilling * mkisofs.8 1.89 * isoinfo.8 1.6 Version -> 2.0 Mon Dec 23 18:25:55 2002 Joerg Schilling * dvd_file.c 1.2 Support fuer 0 Byte VIDEO_TS/VTS_xx_0.VOB Files Mon Dec 16 22:37:04 2002 Joerg Schilling * mkisofs.8 1.88 Umbau auf Berlios & fhg.de Sun Dec 15 02:03:20 2002 Joerg Schilling * write.c 1.66 DVD-Video Pad Ausgaben auch ohne DEBUG Sat Dec 14 19:03:33 2002 Joerg Schilling * ChangeLog 1.22 -> Version 2.0 Sat Dec 14 19:03:09 2002 Joerg Schilling * TODO 1.5 Hints for ISO 9660:1988 Thu Dec 12 01:25:27 2002 Joerg Schilling * write.c 1.65 Consistency check for DVD-Video Pad (<0) Thu Dec 12 01:25:01 2002 Joerg Schilling * ifo_read.c 1.3 open() with O_BINARY Sat Dec 7 21:40:44 2002 Joerg Schilling * tree.c 1.69 in #ifdef ABORT_DEEP_ISO_ONLY print a hint for -R/-r and -D Sat Dec 7 21:14:50 2002 Joerg Schilling * udf.c 1.7 write_udf_file_entries() now ignores de->de_flags & RELOCATED_DIRECTORY and does not create a broken FS if RR_MOVED exists Sat Dec 7 21:02:08 2002 Joerg Schilling * write.c 1.64 * mkisofs.h 1.76 * mkisofs.c 1.123 opnt->of_start_extent new for Constistency Check Sat Dec 7 20:41:36 2002 Joerg Schilling * mkisofs.8 1.87 Better Documentation for -split-output Sat Dec 7 19:37:11 2002 Joerg Schilling * mkisofs.c 1.122 Cast to int forr name_end-name (parameter in %.*s) Sat Nov 30 17:10:36 2002 Joerg Schilling * mkisofs.c 1.121 Version -> 2.0 Sun Nov 24 12:54:45 2002 Joerg Schilling * TODO 1.4 Open Problems for time past 2.0 Sun Nov 24 01:17:25 2002 Joerg Schilling * udf.c 1.6 Patch from Wei DING for UDF Files > 1 GB Fri Nov 22 17:32:25 2002 Joerg Schilling * tree.c 1.68 Another attempt to fix mkisofs -f Fri Nov 22 17:16:43 2002 Joerg Schilling * mkisofs.c 1.120 Disable Joliet for -dvd-video (because of Sort in joliet.c) -s/-S Warning disabled until 2.1alpha Fri Nov 22 17:15:34 2002 Joerg Schilling * joliet.c 1.34 Make VIDEO_TS.IFO 1st dir entry with -dvd-video Sun Nov 17 15:42:19 2002 Joerg Schilling * mkisofs.c 1.119 Mark -s/-S as reserved options Sat Nov 2 21:41:25 2002 Joerg Schilling * mkisofs.c 1.118 Version -> 1.15a40, Tags in ~/.mkisofsrc have '_' in HFS_* Thu Oct 24 22:12:30 2002 Joerg Schilling * tree.c 1.67 scan_directory_tree() with new Flag DIR_WAS_SCANNED to avoid double scan scan_directory_tree() more stable by setting errno = 0 before readdir() no_scandir = 1 commented out to make mkisofs -f not to omit dir content with symlinks to dies Thu Oct 24 22:03:25 2002 Joerg Schilling * mkisofs.h 1.75 #define DIR_WAS_SCANNED new Mon Oct 21 19:29:14 2002 Joerg Schilling * mkisofs.8 1.86 * tree.c 1.66 Typo removed Mon Oct 21 19:28:25 2002 Joerg Schilling * mkisofs.c 1.117 Typo efective -> effective uid Sat Oct 5 00:38:01 2002 Joerg Schilling * write.c 1.63 * volume.c 1.12 * mkisofs.8 1.85 * mkisofs.c 1.116 * mkisofs.h 1.74 Version -> 1.15a36, New Option -hfs-parms for better HFS > 4 GB Support from James Pearson Sat Oct 5 00:17:22 2002 Joerg Schilling * mkisofs.c 1.115 Version -> 1.15a35, Warning for -L/-P/-H Options in POSIX.1-2001 Tue Oct 1 01:13:40 2002 Joerg Schilling * write.c 1.62 * volume.c 1.11 * mkisofs.8 1.84 * desktop.c 1.5 Patch from James for HSFS > 4 GB Sat Sep 28 16:55:52 2002 Joerg Schilling * mkisofs.8 1.83 * mkisofs.h 1.73 * write.c 1.61 * volume.c 1.10 Fix from James for 4 GB HFS Support Tue Sep 24 15:41:27 2002 Joerg Schilling * write.c 1.60 * volume.c 1.9 Patches from James to aboert on HFS volume size > 2 GB Sun Sep 1 23:59:52 2002 Joerg Schilling * udf.c 1.5 Make sure directories have execute permission in default permissions. Sat Aug 10 23:33:36 2002 Joerg Schilling * mkisofs.c 1.114 UDF Filenames may be 255 chars if not using Joliet Thu Aug 8 23:48:11 2002 Joerg Schilling * rock.c 1.32 * tree.c 1.65 Symlink buffer size -> PATH_MAX to avoid Overflow Thu Aug 8 23:25:14 2002 Joerg Schilling * ifo_read.c 1.2 Comment around Tag past #endif Thu Aug 8 23:24:37 2002 Joerg Schilling * joliet.c 1.33 * mkisofs.8 1.82 * mkisofs.c 1.113 * mkisofs.h 1.72 New Option -joliet-long Sun Jul 28 01:29:19 2002 Joerg Schilling * mkisofs.h 1.71 Tag past #endif now as comment Sun Jul 28 01:28:29 2002 Joerg Schilling * write.c 1.59 Defect Debug printf() with newline in String fixed Sun Jul 21 17:36:20 2002 Joerg Schilling * mkisofs.8 1.81 -dvd-video Option new Sun Jul 21 17:00:26 2002 Joerg Schilling * joliet.c 1.32 * write.c 1.58 * mkisofs.h 1.70 Pathtable now works wth more than 65535 Dires if all Parent indices are <= 65535 Sun Jul 21 16:42:36 2002 Joerg Schilling * dvd_reader.c 1.1 date and time created 02/07/21 15:42:36 by joerg Sun Jul 21 16:40:43 2002 Joerg Schilling * ifo_read.c 1.1 date and time created 02/07/21 15:40:43 by joerg Sun Jul 21 16:23:35 2002 Joerg Schilling * apple.c 1.18 * multi.c 1.53 malloc() -> e_malloc() Sun Jul 21 15:51:54 2002 Joerg Schilling * dvd_file.c 1.1 date and time created 02/07/21 14:51:54 by joerg Sun Jul 21 15:18:47 2002 Joerg Schilling * dvd_file.h 1.1 date and time created 02/07/21 14:18:47 by joerg Sun Jul 21 15:16:26 2002 Joerg Schilling * write.c 1.57 Support for DVD-Video -dvd-video Sun Jul 21 14:59:31 2002 Joerg Schilling * mkisofs.c 1.112 * multi.c 1.52 * tree.c 1.64 * files.c 1.10 1024 -> PATH_MAX Sun Jul 21 14:21:02 2002 Joerg Schilling * rock.c 1.31 Hack against wrong GCC warning Sat Jul 20 17:57:49 2002 Joerg Schilling * apple.c 1.17 Function perr() now uses comerr() Sat Jul 20 17:54:57 2002 Joerg Schilling * ifo_types.h 1.1 * dvd_reader.h 1.1 date and time created 02/07/20 16:54:57 by joerg Sat Jul 20 17:54:56 2002 Joerg Schilling * ifo_read.h 1.1 date and time created 02/07/20 16:54:56 by joerg Sat Jul 20 17:37:32 2002 Joerg Schilling * mkisofs.h 1.69 Enhancements for DVD-Video -dvd-video Sat Jul 20 17:28:10 2002 Joerg Schilling * bswap.h 1.1 date and time created 02/07/20 16:28:10 by joerg Sat Jul 20 01:17:52 2002 Joerg Schilling * udf.c 1.4 DVD-Video comment new Sat Jul 20 01:15:19 2002 Joerg Schilling * mkisofs.c 1.111 Version -> 1.15a27, Option -dvd-video new Sat Jul 20 01:13:31 2002 Joerg Schilling * tree.c 1.63 Sort Video Files only with -dvd-video Tue Jul 16 21:32:42 2002 Joerg Schilling * tree.c 1.62 * mkisofs.c 1.110 * mactypes.h 1.2 * mkisofs.8 1.80 * apple.h 1.6 * apple.c 1.16 Support for Apple files on MacOS X Thu Jul 4 12:31:42 2002 Joerg Schilling * mkisofs.c 1.109 Version -> 1.15a25, verbose > 1 writes debug info for output fragments. Thu May 30 01:48:28 2002 Joerg Schilling * udf.c 1.3 * write.c 1.56 * joliet.c 1.31 * eltorito.c 1.24 * boot.c 1.9 * mkisofs.h 1.68 of_name in struct output_fragment new Mon May 20 13:58:11 2002 Joerg Schilling * mac_label.c 1.6 ISO_ROUND_UP(mac_boot->size) / SECTOR_SIZE -> ISO_BLOCKS(mac_boot->size) Mon May 20 13:55:53 2002 Joerg Schilling * write.c 1.55 Unused Var in graftcp() removed Mon May 20 13:51:28 2002 Joerg Schilling * mkisofs.h 1.67 HFS_BLOCKS() new Tue May 14 21:13:04 2002 Joerg Schilling * write.c 1.54 graftcp() Bug fixed (simple Filenames as Arg not shortened) Mon May 13 00:45:28 2002 Joerg Schilling * udf.c 1.2 Now using ISO_ROUND_UP()/ISO_BLOCKS()/SEC_SIZE Mon May 13 00:40:04 2002 Joerg Schilling * write.c 1.53 * joliet.c 1.30 Now using ISO_ROUND_UP()/ISO_BLOCKS() Mon May 13 00:24:43 2002 Joerg Schilling * multi.c 1.51 Now using ISO_ROUND_UP() Mon May 13 00:22:40 2002 Joerg Schilling * mkisofs.c 1.108 Version -> 1.15a23, Now using ISO_ROUND_UP()/ISO_BLOCKS() Mon May 13 00:08:55 2002 Joerg Schilling * eltorito.c 1.23 Now using ISO_BLOCKS() Sun May 12 14:42:18 2002 Joerg Schilling * mkisofs.h 1.66 Comment for ISO_ROUND_UP(X)/ISO_BLOCKS(X) Sun May 12 14:10:20 2002 Joerg Schilling * tree.c 1.61 Function filetype() better Sun May 12 00:32:18 2002 Joerg Schilling * mkisofs.h 1.65 ISO_BLOCKS() new Sat May 4 15:31:00 2002 Joerg Schilling * multi.c 1.50 file_addr now based on sectors not on bytes to avoid overflow with DVDs Fri May 3 01:17:51 2002 Joerg Schilling * name.c 1.24 * mkisofs.c 1.107 -no-iso-translate now also using '-' Sun Apr 28 14:50:15 2002 Joerg Schilling * mkisofs.8 1.79 Remove outdated hint that at least one "pathspec" is needed (even for File from list List) Sun Apr 28 14:48:46 2002 Joerg Schilling * mkisofs.c 1.106 Version -> 1.15a22, susage() Bugfix (program_name missing) Tue Apr 16 19:19:41 2002 Joerg Schilling * eltorito.c 1.22 make boot.catalog sortable via -sort Sun Apr 14 22:53:26 2002 Joerg Schilling * write.c 1.52 * mkisofs.h 1.64 * mkisofs.c 1.105 Avoid to put unwanted information into the version info Thu Apr 11 23:53:41 2002 Joerg Schilling * mkisofs.c 1.104 Support for xxx/../yyy in graft-points Thu Apr 11 19:27:13 2002 Joerg Schilling * tree.c 1.60 * mkisofs.c 1.103 Fix -graft-points /a/b//.///=some_dir bug (doubled / Dir), Version -> 1.15a21 Thu Apr 11 18:55:48 2002 Joerg Schilling * mkisofs.8 1.78 UTF comment corrected Thu Apr 11 18:55:23 2002 Joerg Schilling * mkisofs.h 1.63 debug new Wed Apr 3 19:47:46 2002 Joerg Schilling * mkisofs.c 1.102 Version -> 1.15a20 Wed Apr 3 19:42:41 2002 Joerg Schilling * mkisofs.c 1.101 Corrected file type recognition for graft points Wed Apr 3 19:00:32 2002 Joerg Schilling * rock.c 1.30 * mkisofs.c 1.100 * mkisofs.8 1.77 Transparent compression (-z) from H.P. Anvin integrated Wed Apr 3 18:12:07 2002 Joerg Schilling * mkisofs.c 1.99 escstrcpy() corrected for multiple '//', new option -debug Tue Apr 2 00:57:38 2002 Joerg Schilling * mkisofs.c 1.98 short usage added Fri Mar 8 16:44:37 2002 Joerg Schilling * mkisofs.8 1.76 Hint for multisession on MAC -> -part Fri Mar 8 16:43:46 2002 Joerg Schilling * mac_label.c 1.5 Mac Label mpm[mpc].start = session_start + ... -> mpm[mpc].start = hce->hfs_map_size ... Tue Feb 26 22:39:16 2002 Joerg Schilling * boot.c 1.8 Support generic boot for CD-extra (session_start != 0 Dreamcast) Sun Feb 10 20:18:32 2002 Joerg Schilling * hash.c 1.15 use Prototyped function definition if we have dev_t arg because it may be < int Sun Feb 10 16:13:16 2002 Joerg Schilling * fnmatch.c 1.4 Now using utypes.h, >=/<= compare with Uchar cast Sun Feb 10 15:56:51 2002 Joerg Schilling * apple.c 1.15 cast info->nlen to int for comparison Sat Feb 9 22:21:33 2002 Joerg Schilling * apple.c 1.14 strcmp() -> memcmp() for sfm_magic/sfm_version Fri Jan 18 12:48:35 2002 Joerg Schilling * mkisofs.8 1.75 Write correct size info (1440 kB instead of 1.44 meg) for boot floppy sizes, correct .R typo (used instead of .B) at -magic Fri Jan 18 12:47:51 2002 Joerg Schilling * eltorito.c 1.21 Write correct size info (1440 kB instead of 1.44 meg) for boot floppy sizes Mon Dec 10 01:05:06 2001 Joerg Schilling * mkisofs.8 1.74 -udf option documented Mon Dec 10 01:04:38 2001 Joerg Schilling * getopt.c 1.5 prototype for my_index() Sun Nov 25 12:53:17 2001 Joerg Schilling * mkisofs.8 1.73 long unreadable option list removed from sysnopsis line Thu Nov 22 22:34:18 2001 Joerg Schilling * mkisofs.c 1.97 Version -> 1.15a12 Thu Nov 22 22:24:38 2001 Joerg Schilling * udf_fs.h 1.1 * udf.c 1.1 * udf.h 1.1 date and time created 01/11/22 22:24:38 by joerg Thu Nov 22 16:42:30 2001 Joerg Schilling * Makefile 1.10 * Makefile 1.10 * mkisofs.c 1.96 * mkisofs.h 1.62 Enhancements for UDF support Thu Nov 22 16:41:13 2001 Joerg Schilling * tree.c 1.59 add sort criteria for UDF VIDEO_TS and AUDIO_TS files. Thu Nov 22 16:40:47 2001 Joerg Schilling * joliet.c 1.29 make convert_to_unicode()/joliet_strlen() global if UDF support is compiled in Thu Nov 22 15:24:44 2001 Joerg Schilling * mkisofs.8 1.72 better documentation for README.sort/README.hide from James Pearson Thu Nov 22 00:42:31 2001 Joerg Schilling * write.c 1.51 compare_sort() now behaves correctly if the parameters are exchanged so qsort() may sort correctly Tue Nov 20 00:55:44 2001 Joerg Schilling * mkisofs.8 1.71 better documentation for -print-size, use \& if '.' is at beginning of line Tue Nov 20 00:54:35 2001 Joerg Schilling * write.c 1.50 avoid #if defined(sun) || defined(_AUX_SOURCE), better error messages Fri Nov 16 18:15:42 2001 Joerg Schilling * desktop.c 1.4 nitialize the whole struct hfsdirent in make_desktop() Sun Nov 11 20:38:20 2001 Joerg Schilling * apple.h 1.5 d_dtoutime() Prototype new Sun Nov 11 20:28:56 2001 Joerg Schilling * apple.h 1.4 * apple.c 1.13 Preserves HFS file dates for AppleDouble, AppleSingle and NetaTalk files Sun Nov 11 13:38:45 2001 Joerg Schilling * rock.c 1.29 QNX Neutrino has no st_ftime Sun Oct 21 01:01:23 2001 Joerg Schilling * getopt.c 1.4 Try to compensate FSF rubish code and supress warnings by always including standard include files Sun Oct 21 01:00:30 2001 Joerg Schilling * mkisofs.c 1.95 Always use local getopt.h, version -> 1.15a09 Tue Oct 9 01:27:16 2001 Joerg Schilling * mkisofs.h 1.61 sys/types.h & sys/stat.h -> statdefs.h Thu May 31 10:56:32 2001 Joerg Schilling * mkisofs.8 1.70 -split-output description new, -hard-disk-boot/-no-emul-boot/-no-boot hint added to -b Sun Apr 22 11:34:46 2001 Joerg Schilling * mkisofs.c 1.94 Comment for memset() in e_malloc() Fri Apr 20 23:53:40 2001 Joerg Schilling * ChangeLog 1.21 Late changes for 1.14 Fri Apr 20 18:46:36 2001 Joerg Schilling * multi.c 1.49 Initalize more data from struct directory_record Fri Apr 20 18:45:47 2001 Joerg Schilling * mkisofs.c 1.93 Always clear allocated memory to avoid uninitialized data. Tue Apr 17 00:57:30 2001 Joerg Schilling * mkisofs.8 1.69 Hint to mailman Fri Apr 13 23:31:42 2001 Joerg Schilling * ChangeLog 1.20 updated to release 1.14 Fri Apr 13 20:42:30 2001 Joerg Schilling * mkisofs.c 1.92 Version -> 1.14 final Fri Apr 13 20:12:50 2001 Joerg Schilling * mkisofs.8 1.68 New Support mail Adresses Thu Apr 12 19:36:39 2001 Joerg Schilling * mkisofs.c 1.91 make insert_file_entry() failure non fatal in mkisofs main code Sat Apr 7 17:31:44 2001 Joerg Schilling * multi.c 1.48 starting to implement associated files in multi-session Sat Apr 7 14:47:49 2001 Joerg Schilling * tree.c 1.58 * mkisofs.c 1.90 No exit() for warnings Tue Apr 3 23:33:26 2001 Joerg Schilling * Makefile 1.9 * defaults.h 1.15 APPID_DEFAULT now includes Copyright messages Mon Apr 2 23:17:05 2001 Joerg Schilling * multi.c 1.47 unused vars removed Mon Apr 2 20:09:22 2001 Joerg Schilling * mkisofs.c 1.89 Fixed -check-session handling for -C0,0 default, Search for SUSP RR record in '.' of root Mon Apr 2 20:05:48 2001 Joerg Schilling * mkisofs.8 1.67 New option -force-rr Mon Apr 2 20:05:25 2001 Joerg Schilling * multi.c 1.46 rr_flags()/parse_rrflags()/find_rr() new, get_session_start() handling for -check-session fixed Mon Apr 2 20:04:34 2001 Joerg Schilling * mkisofs.h 1.60 rr_flags()/parse_rrflags()/find_rr() new Sun Apr 1 21:51:43 2001 Joerg Schilling * mkisofs.8 1.66 -check-session new Sun Apr 1 21:51:11 2001 Joerg Schilling * mkisofs.c 1.88 Parameter for -check-session added to usage Sun Apr 1 21:49:56 2001 Joerg Schilling * mkisofs.h 1.59 -check-session neu Sun Apr 1 19:13:37 2001 Joerg Schilling * mkisofs.c 1.87 * multi.c 1.45 Need to handle -C (cdrecord_data) special if -check-session is set Sun Apr 1 17:46:59 2001 Joerg Schilling * name.c 1.23 Back up to last '.' found if trying to find a better '.' did not work Sun Apr 1 17:45:17 2001 Joerg Schilling * mkisofs.c 1.86 New option -check-session Tue Mar 20 01:09:27 2001 Joerg Schilling * volume.c 1.8 * mkisofs.h 1.58 * mkisofs.c 1.85 * mkisofs.8 1.65 New options for writable HFS files from James Pearson Sun Mar 4 15:13:00 2001 Joerg Schilling * mkisofs.8 1.64 Better documentation for -no-cache-inodes Sun Mar 4 00:53:59 2001 Joerg Schilling * mkisofs.c 1.84 Fix a bug with '-- filename' Sun Mar 4 00:52:29 2001 Joerg Schilling * mkisofs.8 1.63 * hash.c 1.14 * mkisofs.h 1.57 * mkisofs.c 1.83 new options -no-cache-inodes/-cache-inodes as a workaround for non unique inodes on Cygwin Fri Feb 23 21:58:52 2001 Joerg Schilling * mkisofs.8 1.62 Einfo for RR_MOVED dir added Fri Feb 23 17:33:54 2001 Joerg Schilling * apple.c 1.12 set_Dinfo(hfs_info->finderinfo, hfs_ent); -> set_Finfo(hfs_info->finderinfo, hfs_ent); according to James Pearson to make --xinet option work Thu Feb 15 23:04:00 2001 Joerg Schilling * write.c 1.49 output_fraagment now copied to allocated space to allow a desc to be used more than once Thu Feb 15 23:02:53 2001 Joerg Schilling * mkisofs.c 1.82 version -> 1.14a14 Thu Jan 25 23:28:32 2001 Joerg Schilling * Makefile 1.8 * eltorito.c 1.20 * apple.c 1.11 * mkisofs.h 1.56 * tree.c 1.57 * write.c 1.48 changes to support large files Tue Jan 23 13:27:44 2001 Joerg Schilling * tree.c 1.56 * mkisofs.c 1.81 * mkisofs.h 1.55 * write.c 1.47 * apple.c 1.10 * rock.c 1.28 * eltorito.c 1.19 * joliet.c 1.28 Avoid gcc -W warnings (e.g. signed/unsigned) Sat Jan 20 23:17:37 2001 Joerg Schilling * write.c 1.46 * mkisofs.8 1.61 * mkisofs.c 1.80 -quiet make mkisofs really quiet Sat Jan 20 23:03:26 2001 Joerg Schilling * mkisofs.c 1.79 Modified to allow EBCDIC Sat Jan 20 22:46:10 2001 Joerg Schilling * mkisofs.8 1.60 * mkisofs.h 1.54 * mkisofs.c 1.78 * rock.c 1.27 * joliet.c 1.27 * apple.c 1.9 Better charset tables for Apple Fri Jan 19 19:26:19 2001 Joerg Schilling * tree.c 1.55 * mkisofs.c 1.77 * mkisofs.8 1.59 * mkisofs.h 1.53 better rationalized uid/gid/modes Sat Dec 9 19:55:17 2000 Joerg Schilling * apple.c 1.8 u_short -> Ushort, u_int -> Uint Sat Dec 9 19:36:48 2000 Joerg Schilling * joliet.c 1.26 u_char -> Uchar Tue Dec 5 15:25:02 2000 Joerg Schilling * volume.c 1.7 * write.c 1.45 * vms.c 1.6 * tree.c 1.54 * rock.c 1.26 * name.c 1.22 * multi.c 1.44 * mkisofs.h 1.52 * mkisofs.c 1.76 * match.c 1.13 * match.h 1.7 * mac_label.c 1.4 * joliet.c 1.25 * hash.c 1.13 * files.c 1.9 * exclude.c 1.8 * eltorito.c 1.18 * desktop.c 1.3 * apple_driver.c 1.4 * boot.c 1.7 * apple.c 1.7 Completed conversion to Schily SING autoconfiguration Mon Dec 4 12:56:49 2000 Joerg Schilling * mkisofs.h 1.51 Now first includes mconfig.h then stdio.h (for largefiles), now uses strdefs.h, standard.h for const abstraction, stdxlib.h instead of stdlib.h Mon Dec 4 12:53:32 2000 Joerg Schilling * multi.c 1.43 * scsi.c 1.17 lseek now using SEEK_* macros Mon Dec 4 12:53:11 2000 Joerg Schilling * mac_label.c 1.3 * apple_driver.c 1.3 * apple.c 1.6 fseek now using SEEK_* macros Fri Dec 1 14:14:23 2000 Joerg Schilling * multi.c 1.42 Now working without usal_prbytes() from libusal Fri Nov 24 10:49:58 2000 Joerg Schilling * mkisofs.c 1.75 -print-size now also prints an easy to parse string to stdout Fri Nov 24 10:49:29 2000 Joerg Schilling * mkisofs.8 1.58 New -print-size behavior documented Sun Nov 19 16:34:56 2000 Joerg Schilling * mkisofs.c 1.74 New option -no-pad, -pad now default, support for Cygwin-1.x Sun Nov 19 16:33:13 2000 Joerg Schilling * Makefile 1.7 Umbau fuer mkhybrid Sun Nov 19 16:32:40 2000 Joerg Schilling * Makefile.man 1.3 INSMODE= beseitigt Sun Nov 19 13:03:18 2000 Joerg Schilling * name.c 1.21 Special handling for '#' and '~' disabled because the code created infinite dir tree loops Sat Nov 4 17:59:36 2000 Joerg Schilling * mkisofs.8 1.57 New option -no-pad, -pad now default Sat Oct 14 15:33:50 2000 Joerg Schilling * mkisofs.8 1.56 hint for CD-Extra usage (-M/-C), note for -graft-points option in examples that need -graft-points Fri Sep 8 02:49:31 2000 Joerg Schilling * scsi.c 1.16 Call to usal_remote() Fri Sep 8 02:49:00 2000 Joerg Schilling * mkisofs.c 1.73 Warning for using Joliet without Rock Ridge Fri Aug 25 15:31:13 2000 Joerg Schilling * match.c 1.12 * mkisofs.c 1.72 new-line discarded only if really present Mon Aug 14 01:36:38 2000 Joerg Schilling * mkisofs.c 1.71 Graft-points repariert fuer esacped = Sun Jul 30 14:08:38 2000 Joerg Schilling * multi.c 1.41 * scsi.c 1.15 Modified for new libusal with usal_*() Thu Jul 20 19:29:19 2000 Joerg Schilling * mkisofs.c 1.70 Version -> 1.13 Thu Jul 20 19:27:54 2000 Joerg Schilling * mac_label.c 1.2 Size arithmetic fix for HFS vol size Thu Jul 20 19:27:12 2000 Joerg Schilling * mkisofs.8 1.55 Small typo fixes Tue Jun 27 19:12:02 2000 Joerg Schilling * mkisofs.c 1.69 * mkisofs.8 1.54 New option -graft-points Tue Jun 27 01:38:35 2000 Joerg Schilling * mkisofs.c 1.68 1.13a02 -> 1.13a03 Tue Jun 27 01:31:27 2000 Joerg Schilling * mkisofs.c 1.67 allow -path-list option to work without a command line arg, graft pointer escapes haf way ready Tue Jun 27 01:20:27 2000 Joerg Schilling * match.c 1.11 better parser for -sort option, avoid buffer overflows by not using fscanf Tue Jun 27 01:18:01 2000 Joerg Schilling * mkisofs.8 1.53 Better doc for -sort option Mon Jun 26 23:50:33 2000 Joerg Schilling * apple_driver.c 1.2 Converted for Schily SING makefile system, made portable Mon Jun 5 03:19:54 2000 Joerg Schilling * write.c 1.44 percent output now even works with NO_FLOATINGPOINT Sat Jun 3 14:24:26 2000 Joerg Schilling * write.c 1.43 buffer[] -> static in write_one_file() for sake of the silly Metrowerks C found on BeOS/PPC Sun May 28 17:41:40 2000 Joerg Schilling * mkisofs.c 1.66 version -> 1.13a02 Sun May 28 17:03:48 2000 Joerg Schilling * eltorito.c 1.17 * mkisofs.8 1.52 * mkisofs.h 1.50 * mkisofs.c 1.65 New option -eltorito-alt-boot Sun May 28 16:28:01 2000 Joerg Schilling * mkisofs.8 1.51 Integration of mkisofs/mkhybrid to one single application Sun May 28 13:21:51 2000 Joerg Schilling * multi.c 1.40 Check for reloc_dir != NULL in match_cl_re_entries() Sun May 7 17:23:57 2000 Joerg Schilling * match.c 1.10 * scsi.c 1.14 * boot.c 1.6 * eltorito.c 1.16 * name.c 1.20 * joliet.c 1.24 * multi.c 1.39 * rock.c 1.25 * hash.c 1.12 * write.c 1.42 * tree.c 1.53 * mkisofs.c 1.64 #include Sun May 7 17:14:34 2000 Joerg Schilling * mkisofs.c 1.63 Release -> 1.13a01, removed comment for associated files as it has been wrong Thu Apr 27 14:11:30 2000 Joerg Schilling * RELEASE 1.31 Release 1.12.1 Thu Apr 27 14:06:09 2000 Joerg Schilling * mkisofs.8 1.50 New Opton -root-info, typo's corrected Thu Apr 27 13:54:09 2000 Joerg Schilling * apple.c 1.5 cast for correct char * / unsigned char * handling Thu Apr 27 13:36:25 2000 Joerg Schilling * volume.c 1.6 * apple.h 1.3 * desktop.c 1.2 * apple.c 1.4 Major changes to implement new HFS option -root-info and -jcharset mac-roman Thu Apr 27 12:47:26 2000 Joerg Schilling * Makefile 1.6 New file place sorting option activated with -DSORTING Thu Apr 27 12:46:35 2000 Joerg Schilling * ChangeLog 1.19 updated to release 1.12.1 **************** Release 1.12.1 ******************* Thu Apr 27 12:44:54 2000 Joerg Schilling * tree.c 1.52 * rock.c 1.24 * mkisofs.h 1.49 * mkisofs.c 1.62 New HFS option -root-info Fri Apr 21 22:11:17 2000 Joerg Schilling * write.c 1.41 better double conversion for estimation time computation Fri Apr 21 22:04:56 2000 Joerg Schilling * name.c 1.19 Name trucation warning removed because it does not work. Fri Apr 21 18:37:36 2000 Joerg Schilling * name.c 1.18 * mkisofs.h 1.48 * mkisofs.c 1.61 * mkisofs.8 1.49 -max-iso0660-filenames Fri Apr 21 18:09:55 2000 Joerg Schilling * tree.c 1.51 Creating unique filenames now works even if we are creating 37 char names Thu Apr 20 22:14:55 2000 Joerg Schilling * tree.c 1.50 Make TRANS.TBL wider to allow 37 char iso names, avoid hard coded values Thu Apr 20 21:44:34 2000 Joerg Schilling * multi.c 1.38 Parsing of TRANS.TBL now adaptive instead of using hard coded numbers Wed Apr 19 23:59:22 2000 Joerg Schilling * tree.c 1.49 * multi.c 1.37 * iso9660.h 1.13 MAX_ISONAME fom 38 -> 37 Tue Apr 18 16:22:56 2000 Joerg Schilling * volume.c 1.5 Use HFS_FNDR_ISINVISIBLE for dirs too Tue Apr 18 16:20:03 2000 Joerg Schilling * name.c 1.17 * tree.c 1.48 * multi.c 1.36 * mkisofs.h 1.47 * mkisofs.c 1.60 * mkisofs.8 1.48 Removed Option -all-files, New options -iso-level, -allow-lowercase, -allow-multidot, -relaxed-filenames, -use-fileversion, name.c completely rewritten Sun Apr 16 16:30:40 2000 Joerg Schilling * mkisofs.8 1.47 * name.c 1.16 * mkisofs.h 1.46 * mkisofs.c 1.59 New Option -no-iso-translate Sun Apr 16 16:26:37 2000 Joerg Schilling * mkisofs.8 1.46 New Options -sort & -ucs-level Sun Apr 16 15:24:16 2000 Joerg Schilling * defaults.h 1.14 * mkisofs.h 1.45 * multi.c 1.35 Copyright Schilling added Sun Apr 16 15:22:32 2000 Joerg Schilling * iso9660.h 1.12 struct iso_ext_attr_record new Sun Apr 16 14:47:53 2000 Joerg Schilling * joliet.c 1.23 * mkisofs.h 1.44 * mkisofs.c 1.58 New Option -ucs-level Sun Apr 16 14:12:24 2000 Joerg Schilling * mkisofs.h 1.43 * mkisofs.c 1.57 * tree.c 1.47 * hash.c 1.11 * write.c 1.40 New sort code from James Pearson Sun Apr 16 13:39:46 2000 Joerg Schilling * match.h 1.6 * match.c 1.9 Converted to unified match code, new sort match code Sat Apr 15 21:59:15 2000 Joerg Schilling * volume.c 1.4 Apply ISO Hidden flag to files on HFS volume too Sat Apr 15 20:57:06 2000 Joerg Schilling * name.c 1.15 Handle '.' and '..' entries corretly in iso9660_check() Wed Apr 12 23:56:56 2000 Joerg Schilling * mkisofs.8 1.45 New option -check-oldnames Wed Apr 12 23:44:18 2000 Joerg Schilling * apple.c 1.3 strcasecmp() local implementation Wed Apr 12 23:24:10 2000 Joerg Schilling * Makefile 1.5 HFILES added to get better ctags Wed Apr 12 23:23:34 2000 Joerg Schilling * multi.c 1.34 * name.c 1.14 * mkisofs.h 1.42 * mkisofs.c 1.56 New Option -check-oldnames, new function iso9660_check() to check/repair filenames from old session, better error messages for bad RR attributes, avoid coredump with calling memset with negative count. Tue Apr 11 10:50:04 2000 Joerg Schilling * iso9660.h 1.11 * tree.c 1.46 iso_directory_record now uses MAX_ISONAME (38) old was 34 Sun Apr 9 22:04:42 2000 Joerg Schilling * multi.c 1.33 Better error messages for bad XA disks. Sun Apr 9 17:06:34 2000 Joerg Schilling * mkisofs.c 1.55 Version -> 1.12.1a06, corrected help for -l (30 chars!) Sun Apr 9 17:05:47 2000 Joerg Schilling * tree.c 1.45 Put number to make names unique before the dot to retain the suffix Sun Apr 9 14:28:01 2000 Joerg Schilling * tree.c 1.44 some more curly brackets.... Sat Apr 8 23:51:20 2000 Joerg Schilling * mkisofs.c 1.54 removed duplicate OPTION_H_LIST Sat Apr 8 23:44:43 2000 Joerg Schilling * mkisofs.8 1.44 * tree.c 1.43 * mkisofs.c 1.53 * match.c 1.8 * mkisofs.h 1.41 * match.h 1.5 New option -hidden & -hidden-list to implement hidden (ISO existence flag) files Sat Apr 8 23:32:45 2000 Joerg Schilling * mkisofs.8 1.43 better padding documentation (-pad) Sat Apr 8 20:55:49 2000 Joerg Schilling * mkisofs.8 1.42 added description for mkhybrid Sat Apr 8 20:50:47 2000 Joerg Schilling * mkisofs.8 1.41 add \ before some - signs and mark some mkisofs places with \& to prevent repleacement with sed script Sat Apr 8 19:40:05 2000 Joerg Schilling * mkisofs.8 1.40 typo correction and preparation towards unified manual (mkisofs/mkhybrid) Sat Apr 8 16:05:51 2000 Joerg Schilling * volume.c 1.3 * write.c 1.39 * tree.c 1.42 * multi.c 1.32 * joliet.c 1.22 * eltorito.c 1.15 * iso9660.h 1.10 * mkisofs.h 1.40 Now using iso directory flag definition from iso9660.h Mon Apr 3 23:59:05 2000 Joerg Schilling * multi.c 1.31 Minor clean up, Message about XA records Mon Apr 3 23:40:21 2000 Joerg Schilling * mkisofs.h 1.39 * match.c 1.7 * exclude.c 1.7 indented Mon Apr 3 21:06:04 2000 Joerg Schilling * eltorito.c 1.14 insert_boot_cat() prototype Mon Apr 3 02:22:16 2000 Joerg Schilling * tree.c 1.41 * write.c 1.38 * mkisofs.c 1.52 * rock.c 1.23 * name.c 1.13 * joliet.c 1.21 * hash.c 1.10 * files.c 1.8 * eltorito.c 1.13 * vms.c 1.4 indented Mon Apr 3 00:38:28 2000 Joerg Schilling * tree.c 1.40 * multi.c 1.30 parse_xa() new to skip XA extended directory attributes Sun Apr 2 22:24:43 2000 Joerg Schilling * mkisofs.h 1.38 * write.c 1.37 version_desc new Sun Apr 2 21:15:21 2000 Joerg Schilling * mkisofs.c 1.51 version desc new Sun Apr 2 20:28:06 2000 Joerg Schilling * vms.c 1.5 eric -> joerg Sun Apr 2 19:10:28 2000 Joerg Schilling * iso9660.h 1.9 struct iso_xa_dir_record new Sun Apr 2 19:01:16 2000 Joerg Schilling * joliet.c 1.20 stdlib.h -> stdxlib.h, rtmp, ltmp (short -> char[2]) for correct byteorder handling Sun Apr 2 18:14:35 2000 Joerg Schilling * files.c 1.7 Typo correction Sat Apr 1 22:29:29 2000 Joerg Schilling * iso9660.h 1.8 Indented Fri Mar 31 18:50:41 2000 Joerg Schilling * volume.c 1.2 New function set_cusstom_icon() Fri Mar 31 18:48:21 2000 Joerg Schilling * apple.h 1.2 * apple.c 1.2 sys/param.h removed, MAXPATHLEN -> PATH_MAX for portability Fri Mar 31 18:44:31 2000 Joerg Schilling * joliet.c 1.19 Now sort joliet tree according to Unicode order Fri Mar 31 18:38:55 2000 Joerg Schilling * mkisofs.8 1.39 * write.c 1.36 * mkisofs.h 1.37 * mkisofs.c 1.50 New option -pad Fri Mar 31 12:59:06 2000 Joerg Schilling * mkisofs.8 1.38 -jcharset implies -J Fri Mar 31 12:55:30 2000 Joerg Schilling * mkisofs.c 1.49 hfs_ct var new, -hfs-creator typo in option parsing fixed Thu Mar 30 02:47:14 2000 Joerg Schilling * mkisofs.c 1.48 1.8.1a04 -> 1.8.1a05, -icon-position option needs no argument, -jcharset now implies -J Thu Mar 30 02:43:18 2000 Joerg Schilling * mkisofs.h 1.36 #include limits.h for NAME_MAX, PATH_MAX definition new Wed Mar 29 10:33:45 2000 Joerg Schilling * apple.c.bak 1.1 date and time created 00/03/29 09:33:45 by joerg Sun Mar 26 18:44:46 2000 Joerg Schilling * mkisofs.8 1.37 Better doc for -jcharset Sun Mar 26 18:40:23 2000 Joerg Schilling * mkisofs.c 1.47 Unicode mapping now defaults to iso8859-1 resp. cp437 Sun Mar 26 18:31:24 2000 Joerg Schilling * mkisofs.c 1.46 * defaults.h 1.13 defined(__CYGWIN__) added for Cygwin recognition Sat Mar 25 17:10:43 2000 Joerg Schilling * mkisofs.8 1.36 * joliet.c 1.18 * Makefile 1.4 * mkisofs.c 1.45 Joliet character translation using different character sets (-jcharset) Sun Mar 19 20:08:24 2000 Joerg Schilling * boot.c 1.5 -B ... zum Duplizieren der letzten Partition bis zum Ende der Partitions Map Sun Mar 19 20:02:40 2000 Joerg Schilling * mkisofs.8 1.35 New usage for -B option: ... means replicate previous boot partition Sun Mar 19 19:19:46 2000 Joerg Schilling * defaults.h 1.12 Mac OS X definition new Sun Mar 19 16:46:31 2000 Joerg Schilling * tree.c 1.39 * multi.c 1.29 * mkisofs.c 1.44 * mkisofs.h 1.35 RR deep directory relocation fixes for multi-session from: "Artem Hodyush" Sun Mar 19 16:15:54 2000 Joerg Schilling * multi.c 1.28 made conform to schily programming rules Sun Mar 19 16:02:46 2000 Joerg Schilling * multi.c 1.27 indented Sat Mar 18 23:59:42 2000 Joerg Schilling * README.eltorito 1.2 typo corrected Sat Mar 18 22:43:10 2000 Joerg Schilling * mkisofs.c 1.43 * tree.c 1.38 added code for APPLE_HYBRID Sat Mar 18 19:39:14 2000 Joerg Schilling * mkisofs.8 1.34 removed superfluous spaces Sat Mar 18 19:24:34 2000 Joerg Schilling * apple.h 1.1 date and time created 00/03/18 19:24:34 by joerg Sat Mar 18 19:24:13 2000 Joerg Schilling * mac_label.h 1.1 date and time created 00/03/18 19:24:13 by joerg Sat Mar 18 19:23:54 2000 Joerg Schilling * mactypes.h 1.1 date and time created 00/03/18 19:23:54 by joerg Sat Mar 18 19:18:36 2000 Joerg Schilling * desktop.c 1.1 date and time created 00/03/18 19:18:36 by joerg Sat Mar 18 19:18:09 2000 Joerg Schilling * mac_label.c 1.1 date and time created 00/03/18 19:18:09 by joerg Sat Mar 18 19:16:33 2000 Joerg Schilling * volume.c 1.1 date and time created 00/03/18 19:16:33 by joerg Sat Mar 18 17:56:59 2000 Joerg Schilling * apple.c 1.1 date and time created 00/03/18 17:56:59 by joerg Sat Mar 18 13:52:21 2000 Joerg Schilling * write.c 1.35 * mkisofs.h 1.34 added code for APPLE_HYBRID, ROUND_UP() -> ISO_ROUND_UP() Sat Mar 18 13:44:25 2000 Joerg Schilling * defaults.h 1.11 Use better recognition code for Rhapsody Sat Mar 18 13:41:24 2000 Joerg Schilling * joliet.c 1.17 ROUND_UP() -> ISO_ROUND_UP() Sat Mar 18 13:02:55 2000 Joerg Schilling * boot.c 1.4 2048 -> SECTOR_SIZE Sat Mar 18 13:00:02 2000 Joerg Schilling * eltorito.c 1.12 csum_buffer[2048] -> csum_buffer[SECTOR_SIZE] Sun Mar 12 20:50:51 2000 Joerg Schilling * joliet.c 1.16 * rock.c 1.22 added code for APPLE_HYBRID Sat Mar 11 14:00:40 2000 Joerg Schilling * match.c 1.6 added match code for APPLE_HYBRID, better error messages Sat Mar 11 13:38:16 2000 Joerg Schilling * hash.c 1.9 New function flush_hash() for APPLE_HYBRID Sat Mar 11 13:21:13 2000 Joerg Schilling * match.h 1.4 Added definitions for APPLE_HYBRID Sat Mar 11 13:19:07 2000 Joerg Schilling * defaults.h 1.10 Defaults for HFS (mkhybrid), SYSTEM_ID_DEAULT for Rhapsody Sun Mar 5 18:08:30 2000 Joerg Schilling * joliet.c 1.15 Always sort root dir to be first in path table Sun Mar 5 14:28:41 2000 Joerg Schilling * mkisofs.8 1.33 correction for boot.catalog description, -table-name documented Sun Mar 5 14:27:21 2000 Joerg Schilling * name.c 1.12 replace forgotten but illegal chars by '_' Sat Mar 4 16:33:38 2000 Joerg Schilling * mkisofs.c 1.42 close_merge_image() call from multi.c, do not close merge image a second time Sat Mar 4 16:32:32 2000 Joerg Schilling * mkisofs.h 1.33 * multi.c 1.26 new function clode_merge_image(), close_merge_image() -> mkisofs.c Thu Feb 17 00:10:46 2000 Joerg Schilling * sunlabel.h 1.3 * boot.c 1.3 splitted into boot.c and sunlabel.h Wed Feb 16 17:55:06 2000 Joerg Schilling * getopt.c 1.3 Prototypes for exchange() & _getopt_initialize() Wed Feb 16 17:08:57 2000 Joerg Schilling * mkisofs.h 1.32 prototype for scsidev_close() Wed Feb 16 17:08:36 2000 Joerg Schilling * multi.c 1.25 merge_previous_session() now calls scsidev_close() to allow mkisofs | cdrecord with multi session Mon Feb 14 15:58:26 2000 Joerg Schilling * bootinfo.h 1.2 comment added Thu Feb 10 01:10:21 2000 Joerg Schilling * scsi.c 1.13 scsidev_close() neu **************** Release 1.12 ******************* Mon Jan 17 23:53:16 2000 Joerg Schilling * RELEASE 1.30 * mkisofs.c 1.41 * mkisofs.8 1.32 Release 1.12 Fri Jan 14 02:26:40 2000 Joerg Schilling * mkisofs.8 1.31 -no-rr new, Bugs section Wed Jan 12 16:19:55 2000 Joerg Schilling * README.graft_dirs 1.1 date and time created 00/01/12 16:19:55 by joerg Tue Jan 11 13:17:32 2000 Joerg Schilling * joliet.c 1.14 allow odd to buffer sizes when converting to unicode Mon Jan 10 23:17:25 2000 Joerg Schilling * tree.c 1.37 * rock.c 1.21 now using device.h Mon Jan 10 02:26:07 2000 Joerg Schilling * mkisofs.c 1.40 -no-rr new Mon Jan 10 01:45:07 2000 Joerg Schilling * multi.c 1.24 * mkisofs.h 1.31 no_rr new Sat Jan 8 23:42:24 2000 Joerg Schilling * scsi.c 1.12 scsi_read() beachtet nun is_atapi damit mkisofs auch mit ATAPI multi-session kann Fri Jan 7 20:51:10 2000 Joerg Schilling * tree.c 1.36 print file typee, better error messages, no_scandir added Fri Jan 7 20:42:00 2000 Joerg Schilling * rock.c 1.20 * exclude.c 1.6 better error messages Fri Jan 7 20:41:04 2000 Joerg Schilling * mkisofs.c 1.39 new -U flag, -F flag removed, new list match code Fri Jan 7 20:32:22 2000 Joerg Schilling * match.c 1.5 new list match code Fri Jan 7 19:26:08 2000 Joerg Schilling * mkisofs.8 1.30 new hide options, -F removed -U new Fri Jan 7 18:58:12 2000 Joerg Schilling * write.c 1.34 make TRANS.TBL a variable, gui code gives faster verbose message Fri Jan 7 18:55:19 2000 Joerg Schilling * multi.c 1.23 make TRANS.TML name a variable Fri Jan 7 18:52:55 2000 Joerg Schilling * mkisofs.h 1.30 -U new, new match list code Fri Jan 7 18:07:38 2000 Joerg Schilling * match.h 1.3 new match list code Wed Jan 5 20:06:55 2000 Joerg Schilling * name.c 1.11 -U flag new Sun Jan 2 00:37:28 2000 Joerg Schilling * mkisofs.c 1.38 Version js-a38 Sat Jan 1 23:05:28 2000 Joerg Schilling * write.c 1.33 using offsetof() to get around odd structure length, better error messages Sat Jan 1 23:03:42 2000 Joerg Schilling * joliet.c 1.13 * multi.c 1.22 * tree.c 1.35 using offsetof() to get around odd structure length Sat Jan 1 20:31:59 2000 Joerg Schilling * iso9660.h 1.7 Note for odd length added Sat Jan 1 20:31:53 2000 Joerg Schilling * mkisofs.h 1.29 offsetof() macro new Wed Dec 29 14:38:31 1999 Joerg Schilling * mkisofs.8 1.29 * mkisofs.h 1.28 * mkisofs.c 1.37 New options -hide-rr-moved & -hide-joliet-trans-tbl Wed Dec 29 14:21:22 1999 Joerg Schilling * tree.c 1.34 New options -hide-rr-moved & -hide-joliet-trans-tbl, better error messages Tue Dec 28 18:23:43 1999 Joerg Schilling * multi.c 1.21 better error messages, free more structures, check for bad RR Version, fix direactory handling code for graft pointers Tue Dec 28 16:32:00 1999 Joerg Schilling * getopt.c 1.2 fixed uninitialized variable Tue Dec 28 15:12:05 1999 Joerg Schilling * hash.c 1.8 * files.c 1.6 * write.c 1.32 better error messages Tue Dec 28 15:07:29 1999 Joerg Schilling * eltorito.c 1.11 better error messages, make boot file/ boot catalog hidable Tue Dec 28 14:21:26 1999 Joerg Schilling * joliet.c 1.12 Error message made different from others Mon Dec 27 15:34:43 1999 Joerg Schilling * iso9660.h 1.6 indented Mon Dec 20 00:14:20 1999 Joerg Schilling * tree.c 1.33 config.h must be first, boot catalog becomes MEMORY FILE Sun Dec 19 22:31:42 1999 Joerg Schilling * mkisofs.c 1.36 hard disk boot, no emulation boot Sun Dec 19 21:29:59 1999 Joerg Schilling * eltorito.c 1.10 better autoconf, hd boot, no emulation boot, boot catalog as memory file Sun Dec 19 21:06:46 1999 Joerg Schilling * name.c 1.10 fix with file priority Sun Dec 19 21:01:37 1999 Joerg Schilling * mkisofs.h 1.27 hard disk boot/ no emulation boot new, MEMORY FILE new Sun Dec 19 20:58:32 1999 Joerg Schilling * write.c 1.31 config.h must be first get_731()/get_732() new Sun Dec 19 20:57:02 1999 Joerg Schilling * rock.c 1.19 * multi.c 1.20 config.h must be first Sun Dec 19 20:55:22 1999 Joerg Schilling * hash.c 1.7 include stdlib.h past config.h Sun Dec 19 20:33:49 1999 Joerg Schilling * diskmbr.h 1.1 date and time created 99/12/19 20:33:49 by joerg Sun Dec 19 19:54:43 1999 Joerg Schilling * iso9660.h 1.5 changes for NOEMUL BOOT Sun Dec 19 18:16:10 1999 Joerg Schilling * bootinfo.h 1.1 date and time created 99/12/19 18:16:10 by joerg Sun Dec 19 16:38:04 1999 Joerg Schilling * mkisofs.8 1.28 hard disk boot and no emulation boot Sun Dec 19 16:13:21 1999 Joerg Schilling * sunlabel.h 1.2 * boot.c 1.2 Ueberfluessige Variablen beseitigt, Prototypen fuer geboot_*() Sat Dec 18 01:11:43 1999 Joerg Schilling * Makefile.in 1.16 Erics final changes Wed Dec 15 01:24:58 1999 Joerg Schilling * mkisofs.c 1.35 sparc boot new, -nomak new, suid mode now safe Sun Dec 12 22:01:32 1999 Joerg Schilling * README.sparcboot 1.1 date and time created 99/12/12 22:01:32 by joerg Sun Dec 12 19:26:57 1999 Joerg Schilling * write.c 1.30 * mkisofs.8 1.27 * mkisofs.h 1.26 sparc boot new Sun Dec 12 18:28:09 1999 Joerg Schilling * Makefile 1.3 boot.c new Sun Dec 12 18:03:39 1999 Joerg Schilling * sunlabel.h 1.1 * boot.c 1.1 date and time created 99/12/12 18:03:39 by joerg Sat Dec 11 16:26:54 1999 Joerg Schilling * tree.c 1.32 rstr() new to check for .bak files Fri Dec 10 01:58:22 1999 Joerg Schilling * multi.c 1.19 Check first if -M file exists before trying to use scsidev_open() Tue Dec 7 00:33:13 1999 Joerg Schilling * write.c 1.29 new sort_dir code checks for is_rr_dir Tue Dec 7 00:21:00 1999 Joerg Schilling * tree.c 1.31 Do not make directory loop fatal, new sort_directory code Tue Dec 7 00:19:32 1999 Joerg Schilling * mkisofs.h 1.25 sort directory prototyp modified Mon Dec 6 23:40:22 1999 Joerg Schilling * joliet.c 1.11 use comerr() Mon Dec 6 22:46:07 1999 Joerg Schilling * mkisofs.c 1.34 Version js-a34 Sat Dec 4 20:56:21 1999 Joerg Schilling * multi.c 1.18 Allow RR Version 2 for Mac, memcmp() returns != null for misscompare of date!!! Sat Dec 4 20:48:22 1999 Joerg Schilling * write.c 1.28 Allow the same name in rr_moved Tue Nov 30 17:16:47 1999 Joerg Schilling * joliet.c 1.10 strncmp() for max of 64 chars in Joliet dirs Sat Nov 27 22:05:15 1999 Joerg Schilling * tree.c 1.30 Force graft dirs to be at least SECTOR_SIZE, dup missing whole_name Thu Nov 25 10:44:05 1999 Joerg Schilling * defaults.h 1.9 Various new system definitions Thu Nov 25 00:25:08 1999 Joerg Schilling * mkisofs.c 1.33 -version new Tue Nov 23 00:11:24 1999 Joerg Schilling * mkisofs.8 1.26 Hint to new maintainer Joerg Schilling Tue Nov 23 00:05:30 1999 Joerg Schilling * mkisofs.c 1.32 Version js-a32, -cdwrite-params -> -cdrecord-params Tue Nov 23 00:03:15 1999 Joerg Schilling * README 1.7 cdwrite hint removed Tue Nov 23 00:01:13 1999 Joerg Schilling * multi.c 1.17 TRANS.TBL handling corrected Mon Nov 22 23:47:21 1999 Joerg Schilling * scsi.c 1.11 Abbruch bei Lesefehlern in readsecs() Mon Nov 22 21:41:38 1999 Joerg Schilling * rock.c 1.18 #ifdef corrected for BLK/CHR devices Fri Nov 19 23:01:59 1999 Joerg Schilling * tree.c 1.29 S_IFBLK checked for OS/2 Fri Nov 12 11:55:44 1999 Joerg Schilling * eltorito.c 1.9 clean castings Fri Nov 12 11:53:07 1999 Joerg Schilling * write.c 1.27 clean casting Fri Nov 12 11:45:03 1999 Joerg Schilling * mkisofs.h 1.24 #include statdefs.h Wed Nov 3 23:56:49 1999 Joerg Schilling * mkisofs.c 1.31 Release js-a31 Mon Nov 1 22:29:15 1999 Joerg Schilling * Makefile.man 1.2 INSMODE new Sat Oct 16 18:52:16 1999 Joerg Schilling * mkisofs.c 1.30 Release 1.12b5-js-a30, removed & before array Fri Oct 15 22:01:18 1999 Joerg Schilling * multi.c 1.16 Removed & before array Fri Oct 8 19:54:24 1999 Joerg Schilling * match.c 1.4 make it work correctly on 64 bit systems Mon Sep 13 12:10:13 1999 Joerg Schilling * mkisofs.c 1.29 Version to 1.12b5-js-28 Tue Sep 7 16:45:13 1999 Joerg Schilling * scsi.c 1.10 Umbau auf neues open_scsi(), commerr() statt fprintf(stderr) Tue Sep 7 14:52:25 1999 Joerg Schilling * rock.c 1.17 HAVE_READLINK test, use comerr() Tue Sep 7 14:50:50 1999 Joerg Schilling * joliet.c 1.9 * hash.c 1.6 * files.c 1.5 * eltorito.c 1.8 * multi.c 1.15 * write.c 1.26 use comerr() Tue Sep 7 14:32:27 1999 Joerg Schilling * tree.c 1.28 use comerr(), HAVE_READLINK test Tue Sep 7 14:13:12 1999 Joerg Schilling * mkisofs.c 1.28 use comerr()/save_args() Tue Sep 7 14:10:48 1999 Joerg Schilling * Makefile 1.2 USE_LIBSCHILY new Sun Aug 29 01:59:22 1999 Joerg Schilling * mkisofs.h 1.23 HAVE_LSTAT test new Sun Aug 1 22:50:12 1999 Joerg Schilling * defaults.h 1.8 SYSTEM ID DEFAULT for OS/2 Sun Jul 11 19:32:42 1999 Joerg Schilling * multi.c 1.14 -> TRTANS.TBL for Joliet, round up to SECSIZE for reading TRANS.TBL Sun Jul 11 19:30:08 1999 Joerg Schilling * tree.c 1.27 -> TRTANS.TBL for Joliet, ignore-loops new Mon Jun 21 11:46:40 1999 Joerg Schilling * write.c 1.25 Check for Rock Ridge files with same name Thu Jun 17 16:31:43 1999 Joerg Schilling * name.c 1.9 cleaned up Thu Jun 17 16:30:18 1999 Joerg Schilling * mkisofs.8 1.25 Better words, -F option new Thu Jun 17 16:17:18 1999 Joerg Schilling * mkisofs.c 1.27 wildcard for EMX, ignore loops, no-split-symlink-fields/no-split-symlink-components now work Tue May 25 21:09:44 1999 Joerg Schilling * mkisofs.h 1.22 ignore-loops new Wed May 19 16:41:02 1999 Joerg Schilling * joliet.c 1.8 debug print for joliet files wirh same name Wed Apr 28 16:58:37 1999 Joerg Schilling * name.c 1.8 Better handling for chars > 128 Sat Apr 24 18:39:19 1999 Joerg Schilling * scsi.c 1.9 Wegen OS/2 wird nun scsi_getbuf() aufgerufen, wait_inut_ready() neu, read_capacity() neu, Schleife ueber read_scsi, falls der transfer groeszer als der SCSI Puffer ist. Sat Apr 24 18:25:00 1999 Joerg Schilling * mkisofs.c 1.26 #ifdef for EMX (OS/2) **************** Release 1.12b5 ******************* Mon Mar 8 01:32:05 1999 Eric Youngdale * RELEASE 1.29 Release1.12b5 Mon Mar 8 01:31:05 1999 Eric Youngdale * mkisofs.8 1.24 many new options from Joerg Schilling, Release 1.12b5 Sun Mar 7 22:48:49 1999 Eric Youngdale * mkisofs.c 1.25 several new options, binary open for Win32 Sun Mar 7 18:41:19 1999 Eric Youngdale * write.c 1.24 split-output new, binary open for Win32, avoid incorrect sorting for ./.. with -L, ISO hide code Sun Mar 7 18:41:19 1999 Eric Youngdale * tree.c 1.26 Inhibit code, sprintf() now correct, varoius other fixes Sun Mar 7 18:41:19 1999 Eric Youngdale * joliet.c 1.7 Let all iso8859-1 chars be unicode, Joliet hide code Tue Mar 2 05:16:41 1999 Eric Youngdale * multi.c 1.13 Prototypes and other various bug fixes Tue Mar 2 05:16:41 1999 Eric Youngdale * mkisofs.h 1.21 better prototypes, INHIBIT_ISO9660_entry new, volume_set_size/volume_sequence_number Tue Mar 2 05:16:40 1999 Eric Youngdale * Makefile.in 1.15 Release 1.12b5 Tue Mar 2 05:16:40 1999 Joerg Schilling * README.session 1.3 Modified for cdrecord Tue Mar 2 04:41:26 1999 Eric Youngdale * rock.c 1.16 Binary open for Win32, some other fixes Tue Mar 2 04:41:26 1999 Eric Youngdale * name.c 1.7 casts for unsigned char * Tue Mar 2 04:41:25 1999 Eric Youngdale * match.h 1.2 * match.c 1.3 Joliet/ISO hide code new Tue Mar 2 04:41:25 1999 Eric Youngdale * defaults.h 1.7 APPID_DEFAULT new Tue Mar 2 04:41:25 1999 Joerg Schilling * exclude.h 1.2 __PR() macros Tue Mar 2 04:41:25 1999 Joerg Schilling * fnmatch.c 1.3 some casts for unsigned char * Tue Mar 2 04:41:25 1999 Eric Youngdale * eltorito.c 1.7 small bug fixes Sun Nov 29 19:13:43 1998 Joerg Schilling * scsi.c 1.8 usalio.h -> usalcmd.h/usalio.h, usalio.h usalcmd.h scsidefs.h scsireg.h scsitransp.h -> include/usal Sun Nov 29 18:30:41 1998 Joerg Schilling * Makefile 1.1 date and time created 98/11/29 18:30:41 by joerg Sat Nov 14 04:20:05 1998 Joerg Schilling * Makefile.man 1.1 date and time created 98/11/14 04:20:05 by joerg Fri Oct 30 02:06:35 1998 Joerg Schilling * scsi.c 1.7 open_scsi() returniert nun SCSI *usalp, wird auch fuer read_scsi() verwendet Sat Oct 24 01:29:24 1998 Joerg Schilling * scsi.c 1.6 open_scsi(dev, timeout, verboseopen) -> open_scsi(dev, debug, verboseopen) **************** Release 1.12b4 ******************* Tue Jun 2 06:44:45 1998 Eric Youngdale * RELEASE 1.28 Release 1.12b4 Tue Jun 2 06:43:45 1998 Eric Youngdale * mkisofs.c 1.24 New options -print-size & -split-output, put Joliet & ElTorite PVD in right order Tue Jun 2 06:43:44 1998 Eric Youngdale * mkisofs.8 1.23 -print-size/-split-output new, Release 1.12b4 Tue Jun 2 06:14:58 1998 Eric Youngdale * tree.c 1.25 Win32 changes, do not use sprintf result, some other fixes Tue Jun 2 05:40:39 1998 Eric Youngdale * write.c 1.23 -split-output, several fixes Tue Jun 2 05:40:38 1998 Eric Youngdale * multi.c 1.12 Some fixes with DOT/DODOT, create whole_name by strdup Tue Jun 2 05:40:38 1998 Eric Youngdale * mkisofs.h 1.20 Win32, -print-size, -split-output Tue Jun 2 05:40:38 1998 Eric Youngdale * name.c 1.6 No version number if it is part of the filename Tue Jun 2 05:40:37 1998 Eric Youngdale * eltorito.c 1.6 O_BINARY for Win32 Tue Jun 2 05:40:37 1998 Eric Youngdale * joliet.c 1.6 bug fix for ce_bytes and chars > 128 Tue Jun 2 05:40:37 1998 Eric Youngdale * defaults.h 1.6 Defaults for Win32 Tue Jun 2 05:40:36 1998 Eric Youngdale * Makefile.in 1.14 CFLAGS new Fri Apr 17 12:39:39 1998 Joerg Schilling * scsi.c 1.5 Prototypen entfernt fuer K&R C **************** Release 1.12b3 ******************* Wed Feb 18 05:51:47 1998 Eric Youngdale * RELEASE 1.27 * mkisofs.c 1.23 * mkisofs.8 1.22 Release 1.12b3 Wed Feb 18 05:48:24 1998 Eric Youngdale * tree.c 1.24 check for relocated dirs Wed Feb 18 05:48:23 1998 Eric Youngdale * rock.c 1.15 check strlen of symlink buffer **************** Release 1.12b2 ******************* Mon Feb 16 18:57:56 1998 Eric Youngdale * RELEASE 1.26 * mkisofs.c 1.22 * mkisofs.8 1.21 Release 1.12b2 Mon Feb 16 18:56:56 1998 Eric Youngdale * tree.c 1.23 small bug fixes, Ingoring file message Mon Feb 16 18:56:56 1998 Eric Youngdale * write.c 1.22 bug fix.... Mon Feb 16 18:56:55 1998 Eric Youngdale * mkisofs.h 1.19 better autoconf, better prototypes Mon Feb 16 18:56:55 1998 Eric Youngdale * joliet.c 1.5 several casts to unsigned char * **************** Release 1.12b1 ******************* Mon Dec 15 13:48:59 1997 Eric Youngdale * RELEASE 1.25 * mkisofs.c 1.21 * mkisofs.8 1.20 Release 1.12b1 Mon Dec 15 13:47:59 1997 Eric Youngdale * rock.c 1.14 mkdev() autoconf corrected Mon Dec 15 13:47:59 1997 Eric Youngdale * mkisofs.h 1.18 string.h/strings.h autoconf Mon Dec 15 13:47:59 1997 Eric Youngdale * tree.c 1.22 set isorec.size later Mon Dec 15 13:47:58 1997 Eric Youngdale * eltorito.c 1.5 some printf's moved to stderr to avoid problems Mon Dec 15 13:47:57 1997 Joerg Schilling * configure.in 1.4 several new tests **************** Release 120697 ******************* Sat Dec 6 22:06:07 1997 Eric Youngdale * RELEASE 1.24 * ChangeLog 1.18 Release 120697 Sat Dec 6 22:05:07 1997 Eric Youngdale * write.c 1.21 * tree.c 1.21 * rock.c 1.13 Fix uninitialized memory usage that screwed up lots of stupid things. Add support for non-split symlinks. Sat Dec 6 22:05:05 1997 Eric Youngdale * multi.c 1.11 init struct directory to null Sat Dec 6 22:05:05 1997 Eric Youngdale * mkisofs.h 1.17 readdir include handling new, *split_SL* new Sat Dec 6 22:05:05 1997 Eric Youngdale * mkisofs.c 1.20 * mkisofs.8 1.19 new option -no-split-symlink-fields/-no-split-symlink-components Sat Dec 6 22:05:03 1997 Eric Youngdale * defaults.h 1.5 SunOS/Solaris switch **************** Release 112597 ******************* Tue Nov 25 14:09:37 1997 Eric Youngdale * RELEASE 1.23 Release 112597 Tue Nov 25 14:08:37 1997 Eric Youngdale * mkisofs.8 1.18 Release 112597, -quiet option new Tue Nov 25 14:08:37 1997 Eric Youngdale * mkisofs.c 1.19 verbose levels, -quiet Tue Nov 25 14:06:43 1997 Eric Youngdale * write.c 1.20 vervose levels Tue Nov 25 14:06:42 1997 Eric Youngdale * joliet.c 1.4 some bug fixes, handling of reloc dir Tue Nov 25 14:06:42 1997 Eric Youngdale * tree.c 1.20 * hash.c 1.5 verbose levels **************** Release 112397 ******************* Mon Nov 24 03:52:49 1997 Eric Youngdale * RELEASE 1.22 Release 112397 Mon Nov 24 03:51:49 1997 Eric Youngdale * multi.c 1.10 print error messages to stderr Mon Nov 24 03:51:49 1997 Eric Youngdale * joliet.c 1.3 fixed some bugs that prevented images working on NT, convert to unicode new Mon Nov 24 03:51:49 1997 Eric Youngdale * tree.c 1.19 put error/debug messages to stderr, INHIBIT_JOLIET_ENTRY new Thu Nov 13 06:01:42 1997 Eric Youngdale * name.c 1.5 typo fix Mon Nov 10 04:27:17 1997 Eric Youngdale * write.c 1.19 casting to unsigned char * **************** Release 110997 ******************* Sun Nov 9 19:56:51 1997 Eric Youngdale * RELEASE 1.21 110997 Sun Nov 9 19:55:51 1997 Eric Youngdale * mkisofs.c 1.18 getopt_long() codem, graft pointers, struct output_fragment new Sun Nov 9 19:55:44 1997 Eric Youngdale * mkisofs.8 1.17 Joliet new, Graft pointers new Sun Nov 9 19:54:58 1997 Eric Youngdale * tree.c 1.18 Joliet handling and graft pointer handling Sun Nov 9 19:54:45 1997 Eric Youngdale * write.c 1.18 struct output_fragment new, sort goof check new, free unused space, better statistics Sun Nov 9 19:54:27 1997 Eric Youngdale * multi.c 1.9 correct line length for TRANS.TBL, graft pointer merging code new Sun Nov 9 19:43:36 1997 Eric Youngdale * mkisofs.h 1.16 struct output_fragment new, some defines for the tree Sun Nov 9 19:43:36 1997 Eric Youngdale * iso9660.h 1.4 defines for unicode level, PVD ID for Joliet Sun Nov 9 19:43:36 1997 Eric Youngdale * joliet.c 1.2 first code added Sun Nov 9 19:43:36 1997 Eric Youngdale * Makefile.in 1.13 joliet.c, getopt*.c new Sun Nov 9 19:43:36 1997 Eric Youngdale * name.c 1.4 mapping chars > 128 Sun Nov 9 19:43:36 1997 Eric Youngdale * eltorito.c 1.4 error messages to stderr, struct output_fragement new Sun Nov 9 19:43:36 1997 Eric Youngdale * README 1.6 Notes for Release 1.12 added Thu Nov 6 20:19:25 1997 Joerg Schilling * scsi.c 1.4 #include fuer AIX Tue Nov 4 03:27:44 1997 Joerg Schilling * getopt.h 1.1 date and time created 97/11/04 03:27:44 by joerg Tue Nov 4 03:27:39 1997 Joerg Schilling * getopt1.c 1.1 date and time created 97/11/04 03:27:39 by joerg Tue Nov 4 03:27:32 1997 Eric Youngdale * getopt.c 1.1 date and time created 97/11/04 03:27:32 by eric Sat Oct 18 19:14:05 1997 Joerg Schilling * scsi.c 1.3 stdlib.h -> stdxlib.h, unistd.h -> unixstd.h Wed Oct 15 07:25:15 1997 Joerg Schilling * TODO 1.3 New list for 1.12 **************** Release 1.11.1 ******************* Mon Oct 13 05:56:49 1997 Eric Youngdale * RELEASE 1.20 * mkisofs.8 1.16 Release 1.11.1 Mon Oct 13 05:55:49 1997 Eric Youngdale * mkisofs.c 1.17 Release 1.11.1, let path_table start on correct sector # depending on El Torito or not Mon Oct 13 05:46:46 1997 Eric Youngdale * multi.c 1.8 better checking for null pointers, USE_SCG code included, type casts for unsigned char * Mon Oct 13 05:46:01 1997 Eric Youngdale * write.c 1.17 Make local time a structure rahte than a pointer so data will not overwritten, add Joliet support Mon Oct 13 05:41:16 1997 Eric Youngdale * tree.c 1.17 file renaming code corrected, iso9660_file_length() called correctly (not dir!) for TRANS.TBL Mon Oct 13 05:32:57 1997 Eric Youngdale * mkisofs.h 1.15 prototypes for readsecs() and scsidev_open() Mon Oct 13 05:30:51 1997 Eric Youngdale * name.c 1.3 seen_dot new, include '%' to illegal characters Mon Oct 13 05:30:21 1997 Eric Youngdale * rock.c 1.12 major() autoconf changed Mon Oct 13 05:29:40 1997 Eric Youngdale * eltorito.c 1.3 Limit publisher ID to 23 chars Wed May 21 18:11:25 1997 Joerg Schilling * scsi.c 1.2 scsireg.h Include Sat May 17 18:49:03 1997 Eric Youngdale * joliet.c 1.1 date and time created 97/05/17 17:49:03 by eric Fri May 16 15:46:48 1997 Joerg Schilling * config.h 1.1 * scsi.c 1.1 date and time created 97/05/16 14:46:48 by joerg **************** Release 1.11 ******************* Thu Apr 10 06:46:21 1997 Eric Youngdale * RELEASE 1.19 * RELEASE 1.18 * mkisofs.8 1.15 Release 1.11 Thu Apr 10 06:43:02 1997 Eric Youngdale * write.c 1.16 Check for . and .. entries in dir Thu Apr 10 06:41:49 1997 Eric Youngdale * tree.c 1.16 Strip off non-significant part of filename /*--------------------------------------------------------------------------*/ The text below is not autogenerated from SCCS comments: Wed Nov 5 10:46:29 1997 Andreas Buschmann US/EC4 60/1F/110 #40409 Circumvent a bug in the SunOS / Solaris CD-ROM driver (and maybe HP/UX, too). * mkisofs.8 (-S): Document switch. * mkisofs.c (split_SL_field): new Variable, new switch -S. * mkisofs.h (split_SL_field): new Variable. * rock.c (generate_rock_ridge_attributes): only split SL field, when split_SL_field is set. Tue Jun 3 15:32:21 1997 Andreas Buschmann Circumvent a bug in the SunOS CD-ROM driver (and maybee HP/UX, too). * mkisofs.8 (-s): Document switch. * mkisofs.c (split_SL_component): new Variable, new switch -s. * mkisofs.h (split_SL_component): new Variable. * rock.c (generate_rock_ridge_attributes): only split SL components, when split_SL_component is set. * defaults.h: Added SunOS string. Wed Mar 19 16:50:17 1997 Fred Fish * Makefile.in (CFLAGS): Let configure set basic flags. Move compilation option -c to actual CC commands. (LDFLAGS): Let configure set basic flags. (Makefile): Depends upon config.status, not configure. Regenerate if necessary from Makefile.in using config.status. (configure): Cd to srcdir before running autoconf. * acconfig.h: New file to hold nonstandard entries used in config.h.in. Used by autoheader to generate config.h.in. * config.h.in: Regenerated with autoheader. * configure.in: Check for existance of sbrk() function. * configure: Regenerated with autoconf 2.12. * fnmatch.c (FMN_FILE_NAME): Define if not already defined. (FNM_LEADING_DIR): Ditto. (FNM_CASEFOLD): Ditto. * mkisofs.c (main): Only use sbrk() if system supports it. Fri Mar 14 21:54:37 1997 Eric Youngdale * Bump version number to 1.10, public release. * Put entire thing under RCS. History is buried there now. * Fix bug involving empty directories, translation tables and malloc(0). Mon Feb 17 12:44:03 1997 Eric Youngdale * Bump version number to 1.10b7. * Makefile.in, configure.in, config.in: Change to use GNU autoconf. * Configure: Delete old configuration script. * tree.c: Fix bug where we had a rename limit of 1000 files instead of 0x1000. * mkisofs.c: Fix sign of timezone offset. Linux iso filesystem also need to be fixed, unfortunately. Tue Dec 3 22:21:21 1996 Eric Youngdale Fixed a couple of multi-session bugs. Discs now seem to work on both Solaris and Windows-NT. * Bump version number to 1.10b6. Tue Dec 3 22:21:21 1996 Eric Youngdale Multi-session stuff *almost* there. Discs seem to work under Linux without any problem, but under DOS only the first session is seen. The patch to write.c inspired by disc written by Windows generated multi-session disc, which will hopefully make the discs usable under DOS as well. * Bump version number to 1.10b5. * write.c: use size of new session, not total of all sessions in volume_space_size field. * mkisofs.8: Update with current location of cdwrite. Mon Nov 4 23:45:01 1996 Eric Youngdale * Bump version number to 1.10b4. * Add cdwrite.c.diff file, which provides a very crude, minimal interface between mkisofs and cdwrite. It should be enough to generate a multi-session disc, but it hasn't been tested yet. Thu Oct 17 00:39:52 1996 Eric Youngdale * Bump version number to 1.10b3. Wed Oct 16 23:40:44 1996 Michael Fulbright Add support for 'El Torito' specification which allows for bootable cdroms. * Makefile.in: Add eltorito.[c,o]. * defaults.h: Add default settings for El Torito related things. * iso9660.h: Add structure definitions for El Torito. * mkisofs.8: Document new options. * mkisofs.c: Add support for new options related to El Torito. * mkisofs.h: Add definitions, prototypes as required. * tree.c: Add search_tree_file function to search for a specified file. * write.c: Add support for writing special records for El Torito. * eltorito.c: New file. Wed Oct 16 23:40:44 1996 Eric Youngdale * rock.c: Fix bug whereby we made assumptions about how dev_t was split into major/minor. Use major() and minor() macros to do this for us, since each system should do this correctly. * write.c: Fix bug whereby abstract, copyright and appid strings were not properly filled if application ID weren't in use. Sun Sep 29 10:05:10 1996 Eric Youngdale * Bump version number to 1.10b2. Minor bug fixes here and there. Sun Sep 15 18:54:05 1996 Eric Youngdale * Bump version number to 1.10b1. Major new functionality is support for multi-session. Still a bit preliminary, but most of the pieces are there now. Wed Dec 20 16:44:44 1995 Eric Youngdale (eric@andante.aib.com) * mkisofs.c, mkisofs.8, Makefile (version_string): Bump to 1.05. * rock.c: Bugfix for cases where sizeof(int) == 4 and sizeof(dev_t) > 4. * rock.c: Bugfix for long symbolic links ('/' characters were being dropped). Patches from Peter Miller : * mkisofs.8: Documentation fix (some versions of nroff don't like '.' in column 1 if it is not a nroff command). * mkisofs.c: Add support for 'rationalize' option. Similar to rock ridge, except echos of development environment are removed. * write.c Status indicator now indicates percent finished, and estimated time of completion. Sun Feb 26 01:52:06 1995 Eric Youngdale (eric@largo) * Add patches from Ross Biro to allow you to merge arbitrary trees into the image. This is not compiled in by default but you need to add -DADD_FILES when compiling. Fri Feb 17 02:29:03 1995 Paul Eggert * tree.c: Port to Solaris 2.4. Prefer if HASMKDEV. Cast unknown integer types to unsigned long and print them with %lu or %lx. Thu Jan 26 15:25:00 1995 H. Peter Anvin (hpa@yggdrasil.com) * mkisofs.c: Substitute underscore for leading dot in non-Rock Ridge filenames, since MS-DOS cannot read files whose names begin with a period. Mon Jan 16 18:31:41 1995 Eric Youngdale (eric@aib.com) * rock.c (generate_rock_ridge_attributes): Only use ROOT record for symlinks if we are at the start of the symlink. Otherwise just generate an empty entry. Mon Jan 16 16:19:50 1995 Eric Youngdale (eric@aib.com) * diag/isodump.c: Use isonum_733 instead of trying to dereference pointers when trying to decode 733 numbers in the iso9660 image. * diag/isovfy.c: Likewise. * write.c: Always assign an extent number, even for zero length files. A zero length file with a NULL extent is apparently dropped by many readers. Wed Jan 11 13:46:50 1995 Eric Youngdale (eric@aib.com) * mkisofs.c: Modify extension record to conform to IEEE P1282 specifications. This is commented out right now, but a trivial change to a #define enables this. I need to see the specs to see whether anything else changed before this becomes final. * write.c (FDECL4): Fix so that we properly determine error conditions. * mkisofs.h: Change rr_attributes to unsigned. * tree.c(increment_nlink): Change pnt since rr_attributes is now unsigned. Ultrix patches from petav@argon.e20.physik.tu-muenchen.de (Peter Averkamp) * rock.c: Fix for ultrix systems, we have 64 bit device numbers. Type cast when generating file size. Change rr_attributes to unsigned. * mkisofs.c: For ultrix systems, define our own function for strdup. * mkisofs.c: Fix usage() since some compilers do not concatenate strings properly (i.e. ultrix). Bugs found with Sentinel II: * write.c: Fix a couple of memory leaks. * mkisofs.c: Bugfix - always put a zero byte at end of name for ".." entry. * tree.c: Set isorec.date from fstatbuf.st_ctime, not current_time, since current_time might not be set. Sat Dec 3 14:55:42 1994 Eric Youngdale (eric@andante) * mkisofs.c: When returning entry for ".." file, set second byte to 0. * write.c: Free name and rr_attributes fields when writing. Mon Nov 28 13:36:27 1994 Eric Youngdale (eric@andante) * mkisofs.h: Change rr_attributes to unsigned. * rock.c: Ditto. Work around >>32 bug in ultrix for 64 bit data types. * mkisofs.c (usage): Fix for ultrix - use continuation lines instead of assuming that strings are catenated by the compiler. Mon Jun 20 20:25:26 1994 Eric Youngdale (eric@esp22) * mkisofs.c, mkisofs.8, Makefile (version_string): Bump to pre-1.02. * mkisofs.h: Fix declaration of e_malloc to use DECL macros. * tree.c: Fix bug in previous change. * diag/*.c: Add appropriate copyright notices. Sat Apr 9 13:30:46 1994 Eric Youngdale (ericy@cais.com) * Configure: New file - shell script that determines a bunch of things to properly build mkisofs. * Makefile.in: New file - copy of Makefile, but Configure sets a few things up for it. * tree.c: Do not depend upon opendir to return NULL if we cannot open a directory - actually try and read the first entry. The foibles of NFS seem to require this. * write.c: Fix definition of xfwrite (Use FDECL4) Add some changes to allow more configurability of some of the volume header fields: * mkisofs.8: Document new configuration options. * mkisofs.c: Add variables to hold new fields. Add function to read .mkisofsrc files. * defaults.h: Another way of configuring the same things. Add some changes from Leo Weppelman leo@ahwau.ahold.nl. * mkisofs.c: Allow -A to specify application ID. Fix usage(), getopt and add case switch. * rock.c: Fix handling of device numbers (dev_t high should only be used when sizeof(dev_t) > 32 bits). Add a bunch of changes from Manuel Bouyer. * diag/Makefile: New file. * diag/dump.c, diag/isodump.c: Use termios if system supports it. * (throughout): Replace all occurences of "malloc" with e_malloc. * mkisofs.c: For NetBSD, attempt to increase the rlimit for the size of the data segment to about 33 Mb. * mkisofs.c (e_malloc): New function. Calls malloc, and prints nice error message and exits if NULL is returned. Sun Jan 23 19:23:57 1994 Eric Youngdale (eric@esp22) * mkisofs.c, mkisofs.8, Makefile (version_string): Bump to 1.01. Add a bunch of stuff so that mkisofs will work on a VMS system. * (ALL): Change any direct use of the "st_ino" field from the statbuf to use a macro. * mkisofs.h: Define appropriate macros for both VMS and unix. * (ALL): Add type casts whenever we use the UNCACHED_DEV macro. * rock.c: Wrap a #ifndef VMS around block and character device stuff. * write.c: Add prototype for strdup if VMS is defined. * make.com: Script for building mkisofs on a VMS system. * Makefile: Include make.com in the distribution. * mkisofs.c: Include on VMS systems. * tree.c: Include and "vms.h" on VMS systems. * mkisofs.h (PATH_SEPARATOR, SPATH_SEPARATOR): New macros that define the ascii character that separates the last directory component from the filename. * tree.c, mkisofs.c: Use them. * vms.c: New file. Contains version of getopt, strdup, opendir, readdir and closedir. * vms.h: New file. Defines S_IS* macros. Define gmtime as localtime, since gmtime under VMS returns NULL. Sat Jan 15 13:57:42 1994 Eric Youngdale (eric@esp22) * mkisofs.h (transparent_compression): New prototype. * mkisofs.c (transparent_compression): Declare, use '-z' option to turn on. * tree.c: Change TRANS.TBL;1 to TRANS.TBL (version gets added later, if required). * rock.c: If transparent compression requested, verify file is really suitable (check magic numbers), and extract correct file length to store in SUSP record. Sat Jan 15 01:57:42 1994 Eric Youngdale (eric@esp22) * write.c (compare_dirs): Bugfix for patch from Jan 6. * mkisofs.h (struct directory_entry): Add element total_rr_attr_size. (struct file_hash): Add element ce_bytes. * write.c (iso_write): Update last_extent_written, as required, and check it against last_extent as a sanity check. (generate_one_directory): If ce_bytes is non-zero, allocate a buffer and fill it with the CE records. Also, update the extent and offset entries in the CE SUSP field and output after directory is written. (assign_directory_addresses): Allow for CE sectors after each directory. * tree.c (sort_n_finish): Set field ce_bytes by summing the sizes of all CE blocks in each files RR attributes. Do not count these bytes for main directory. * rock.c (generate_rock_ridge_attributes): Generate CE entries to break up large records into manageable sizes. Allow long names to be split, and allow long symlinks to be split. Allow splitting before each SUSP field as well, to make sure we do not screw outselves. Thu Jan 6 21:47:43 1994 Eric Youngdale (eric@esp22) Bugfix. * write.c (compare_dirs): Only compare directory names up to the ';' for the version number. Add four new options: (1) Full 31 character filenames, (2) Omit version number, (3) Omit trailing period from filenames, (4) Skip deep directory relocation. * iso9660.h: Allow 34 characters for filename. * mkisofs.8: Update for new options. * mkisofs.c: Add flag variables for new options. Mention new options in usage(), tell getopt about new options, and set appropriate flags when new options are specified. * mkisofs.c (iso9660_file_length): Implement new options. * mkisofs.h: Declare flag variables for new options. * tree.c (sort_n_finish): Increase declaration of newname and rootname to 34 characters. If full_iso9660_filenames in effect, use different rules for making unique names. * tree.c (scan_directory_tree): Use RR_relocation_depth instead of constant for threshold for starting deep directory relocation. Wed Jan 5 01:32:34 1994 John Brezak (brezak@ch.hp.com) * Makefile.bsd: New file. For NetBSD. * rock.c, tree.c: Do not include sys/sysmacros.h for NetBSD. Fri Dec 31 13:22:52 1993 Eric Youngdale (eric@esp22) * mkisofs.c, mkisofs.8, Makefile (version_string): Bump to 1.00. * tree.c (scan_directory_tree): Handle case where we do not have permissions to open a directory. * write.c (xfwrite): New function - wrapper for fwrite, except that we print message and punt if write fails. * write.c: Move include of mkisofs.h and iso9660.h until after string.h and stdlib.h is included. * write.c: Do not attempt to use strerror on sun systems. Thu Dec 9 13:17:28 1993 R.-D. Marzusch (marzusch@odiehh.hanse.de) * exclude.c, exclude.h: New files. Contains list of files to exclude from consideration. * Makefile: Compile exclude.c, add dependencies to other files. * mkisofs.8: Describe -x option. * mkisofs.c: Include exclude.h, handle -x option. Fri Dec 10 01:07:43 1993 Peter van der Veen (peterv@qnx.com) * mkisofs.c, mkisofs.h: Moved declaration of root_record. * mkisofs.h: Added prototype for get_733(). * write.c(iso_write), tree.c, rock.c(generate_rock_ridge_attributes): Added defines for QNX operation system * rock.c(generate_rock_ridge_attributes): symbolic links should not have CONTINUE component flag set unless there are multiple component records, and mkisofs does not generate these. st_ctime was stored as the creation time, changed to attribute time. QNX has a creation time, so that is stored as well under QNX. Thu Oct 28 19:54:38 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.99. * write.c(iso_write): Put hour, minute, second into date fields in volume descriptor. * write.c (iso_write): Set file_structure_version to 1, instead of ' ' (Seems to screw up Macs). Sun Oct 17 01:13:36 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.98. Increment nlink in root directory when rr_moved directory is present. * tree.c (increment_nlink): New function. * tree.c (finish_cl_pl_entries): Call increment_nlink for all references to the root directory. * tree.c (root_statbuf): New variable. * tree.c (scan_directory_tree): Initialize root_statbuf when we stat the root directory. * tree.c (generate_reloc_directory): Use root_statbuf when generating the Rock Ridge stuff for the ".." entry in the reloc_dir. * tree.c (scan_directory_tree): Use root_statbuf when generating the ".." entry in the root directory. Sat Oct 16 10:28:30 1993 Eric Youngdale (eric@kafka) Fix path tables so that they are sorted. * tree.c (assign_directory_addresses): Move to write.c * write.c (generate_path_tables): Create an array of pointers to the individual directories, and sort it based upon the name and the parent path table index. Then update all of the indexes and repeat the sort until the path table indexes no longer need to be changed, and then write the path table. Fix problem where hard links were throwing off the total extent count. * write.c (iso_write): Call assign_file_addresses, and then use last_extent to determine how big the volume is. * write.c (generate_one_directory): Decrement n_data_extents for hard links to non-directories so that the expected number of extents is written correctly. * write.c(assign_file_addresses): New function. Fri Oct 15 22:35:43 1993 Eric Youngdale (eric@kafka) The standard says we should do these things: * tree.c (generate_reloc_directory): Add RR attributes to the rr_moved directory. * mkisofs.c(main): Change ER text strings back to recommended values. Tue Oct 12 21:07:38 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.97. * tree.c (scan_directory_tree): Do not insert PL entry into root directory record (i.e. !parent) * tree.c (finish_cl_pl_entries): Do not rely upon name comparison to locate parent - use d_entry->self instead, which is guaranteed to be correct. * mkisofs.h: New variable n_data_extents. * tree.c: Declare and initialize n_data_extents to 0. (scan_directory_tree) for non-directories, add ROUND_UP(statbuf.st_size) to n_data_extents. (sort_n_finish): Increment n_data_extents for translation tables, as appropriate. * write.c(iso_write): Add n_data_extents to the volume_space_size field. * hash.c(add_hash): If size != 0 and extent == 0, or if size == 0 and extent != 0, then complain about inserting this into the hash table. Kind of a sanity check. Sat Oct 9 16:39:15 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.96. Numerous bugfixes, thanks to a one-off disc from rab@cdrom.com. * write.c(generate_one_directory): Wait until after we have filled in the starting_extent field to s_entry before calling add_hash. This fixes a problem where the hash table gets an extent of 0 for all regular files, and this turns up when you have hard links on the disc. (The hash table allows us to have each hard link point to the same extent on the cdrom, thereby saving some space). * tree.c(scan_directory_tree): Set statbuf.st_dev and statbuf.st_ino to the UNCACHED numbers for symlinks that we are not following. This prevents the function find_hash from returning an inode that cooresponds to the file the symlink points to, which in turn prevents generate_one_directory from filling in a bogus file length (should be zero for symlinks). * tree.c(scan_directory_tree): Always call lstat for the file so that non-RockRidge discs get correct treatment of symlinks. Improve error message when we ignore a symlink on a non-RR disc. * write.c(generate_one_directory): Set fields for starting_extent and size in the "." and ".." entries before we add them to the file hash. Fixes problems with incorrect backlinks for second level directories. Wed Oct 6 19:53:40 1993 Eric Youngdale (eric@kafka) * write.c (write_one_file): Print message and punt if we are unable to open the file. * tree.c(scan_directory_tree): For regular files, use the access function to verify that the file is readable in the first place. If not, issue a warning and skip it. For directories, it probably does not matter, since we would not be able to descend into them in the first place. Wed Sep 29 00:02:47 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.95. * write.c, tree.c: Cosmetic changes to printed information. * tree.c(scan_directory_tree): Set size to zero for special stub entries that correspond to the relocated directories. Hopefully last big bug. * mkisofs.h: Change TABLE_INODE, UNCACHED_* macros to be 0x7fff... to be compatible with signed datatypes. Mon Sep 27 20:14:49 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.94. * write.c (write_path_tables): Actually search the directory for the matching entry in case we renamed the directory because of a name conflict. * tree.c(scan_directory_tree): Take directory_entry pointer as second argument so that we can create a backpointer in the directory structure that points back to the original dir. * mkisofs.c: Fix call to scan_directory_tree to use new calling sequence. * write.c(generate_one_directory): Punt if the last_extent counter ever exceeds 700Mb/2048. Print name of responsible file, extent counter, and starting extent. Perhaps we can catch it in the act. Sun Sep 26 20:58:05 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.93. * tree.c(scan_directory_tree): Handle symlinks better. Either leave them as symlinks, or erase any trace that they were a symlink but do not do it 1/2 way as before. Also, watch for directory loops created with symlinks. * mkisofs.h: Add new flag follow_links. * mkisofs.c: Add command line switch "-f" to toggle follow_links. * mkisofs.8: Document new switch. * tree.c: Add code to handle symlinks using new flag. * hash.c: Add add_directory_hash, find_directory_hash functions. * mkisofs.h: Add prototypes. Sat Sep 25 14:26:31 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.92. * mkisofs.c: Make sure path is an actual directory before trying to scan it. * mkisofs.h: Add DECL and FDECL? macros for sparc like systems. Do proper define of optind and optarg under SVr4. * tree.c: Change translation table name from YMTRANS.TBL to TRANS.TBL. * mkisofs.c: Neaten up message in extension record when RRIP is in use. * Throughout - change all function declarations so that traditional C compilers (i.e. sparc) will work. * Makefile: Change to use system default C compiler. * mkisofs.c: Add some stuff so that this will compile under VMS. Many things missing for VMS still. * iso9660.h: Do not use zero length array in struct definition. * tree.c (sort_n_finish): Account for this. * Change copyright notice. Wed Aug 25 08:06:51 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.91. * mkisofs.h: Only include sys/dir.h for linux. Other systems will need other things. * mkisofs.c, tree.c: Include unistd.h. * Makefile: Use OBJS to define list of object files. Sun Aug 22 20:55:17 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.9. * write.c (iso_7*): Fix so that they work properly on Motorola systems. Fri Aug 20 00:14:36 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.8. * rock.c: Do not mask off write permissions from posix file modes. Wed Aug 18 09:02:12 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.7. * rock.c: Do not write NM field for . and .. (redundant and a waste of space). * mkisofs.c: Take -P and -p options for publisher and preparer id fields. * write.c: Store publisher and preparer id in volume descriptor. * rock.c: Write optional SP field to identify SUSP. Write optional CE field to point to the extension header. * tree.c: Request SP and CE fields be added to root directory. * tree.c: Fix bug in name conflict resolution. * write.c: Fill in date fields in the colume descriptor. * write.c (write_one_file): If the file is large enough, write in chunks of 16 sectors to improve performance. * hash.c (add_hash, find_hash, etc): Do not hash s_entry, instead store relevant info in hash structure (we free s_entry structs as we write files, and we need to have access to the hash table the whole way through. * write.c: Add a few statistics about directory sizes, RR sizes, translation table sizes, etc. * tree.c: Use major, not MAJOR. Same for minor. Define S_ISSOCK and S_ISLNK if not defined. * rock.c: Define S_ISLNK if not defined. * mkisofs.c: Print out max memory usage. Fix bug in call to getopt. * mkisofs.c, Makefile (version_string): Bump to 0.6. * tree.c: Simplify the calculation of isorec.len, isorec.name_len and the calculation of the path table sizes by doing it all at one point after conflict resolution is done. * tree.c: scan_directory_tree is now responsible for generating the line that goes into the YMTRANS.TBL file. These lines are collected later on into something that will be dumped to the file. Correctly handle all of the special file types. Mon Aug 16 21:59:47 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.5. * mkisofs.c: Add -a option (to force all files to be transferred). Remove find_file_hash stuff. * write.c: Pad length even if Rock Ridge is not in use. * hash.c: Rewrite hash_file_* stuff so that it can be used to easily detect (and look up) filenames that have been accepted for use in this directory. Used for name collision detection. * tree.c (sort_n_finish): If two names collide, generate a unique one (verified with the hash routines). Change the lower priority name if there is a difference. Sat Aug 14 13:18:21 1993 Eric Youngdale (eric@kafka) * mkisofs.c, Makefile (version_string): Bump to 0.4. * tree.c (load_translation_table): New function - read YMTRANS.TBL. (scan_directory_tree) Call it. * mkisofs.c (iso9660_file_length): Call find_file_hash to see if translated name is specified. If so, use it. * hash.c (name_hash, add_file_hash, find_file_hash, flush_file_hash): New functions for hashing stuff from YMTRANS.TBL. * mkisofs.h: Add a bunch of prototypes for the new functions. * mkisofs.8: Update. * mkisofs.c, Makefile (version_string): Bump to 0.3. * Makefile: Add version number to tar file in dist target. * mkisofs.c: Call finish_cl_pl_entries() after directories have been generated, and extent numbers assigned. * write.c (generate_one_directory): Update s_entry->size for directories (as well as isorec.size). * rock.c: Add code to generate CL, PL, and RE entries. The extent numbers for the CL and PL entries are NULL, and these are filled in later once we know where they actually belong. * mkisofs.h: Add parent_rec to directory_entry. Used to fix CL/PL stuff. * tree.c (scan_directory_tree): Set flag to generate CL/PL/RE entries as required, update sizes as well. Fri Aug 13 19:49:30 1993 Eric Youngdale (eric@kafka) * mkisofs.c (version_string): Bump to 0.2. * hash.c: Do not use entries with inode == 0xffffffff or dev == 0xffff. * write.c (write_path_tables): Strip leading directory specifications. * mkisofs.h: Add definition for reloc_dir symbol. Add prototype for sort_n_finish, add third parameter to scan_directory_tree (for true parent, when directories are relocated). * mkisofs.c (main): Modify call to scan_directory_tree. Call sort_n_finish for reloc_dir. * tree.c (sort_n_finish): New function - moved code from scan_directory_tree. * tree.c (generate_reloc_directory): New function. Generate directory to hold relocated directories. * tree.c (scan_directory_tree): Strip leading directories when generating this_dir->name. If depth is too great, then move directory to reloc_dir (creating if it does not exist, and leave a dummy (non-directory) entry in the regular directory so that we can eventually add the required Rock Ridge record. * tree.c (scan_directory_tree): Use s_entry instead of sort_dir, assign to this_dir->contents sooner. Thu Aug 12 22:38:17 1993 Eric Youngdale (eric@kafka) * mkisofs.c (usage): Fix syntax. * mkisofs.c (main): Add new argument to scan_directory_tree * tree.c (scan_directory_tree): If directory is at depth 8 or more, create rr_moved directory in main directory. Mon Jul 26 19:45:47 1993 Eric Youngdale (eric@kafka) * mkisofs v 0.1 released. cdrkit-1.1.11/genisoimage/name.c0000644000372500001440000003135610536265343015516 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)name.c 1.28 04/03/05 joerg */ /* * File name.c - map full Unix file names to unique 8.3 names that * would be valid on DOS. * * * Written by Eric Youngdale (1993). * Almost totally rewritten by J. Schilling (2000). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999,2000 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "genisoimage.h" #include #include #include void iso9660_check(struct iso_directory_record *idr, struct directory_entry *ndr); int iso9660_file_length(const char *name, struct directory_entry *sresult, int dirflag); void iso9660_check(struct iso_directory_record *idr, struct directory_entry *ndr) { int nlen; char schar; char *p; char *np; nlen = idr->name_len[0]; schar = idr->name[nlen]; if (nlen == 1 && (idr->name[0] == '\0' || idr->name[0] == '\001')) return; idr->name[nlen] = '\0'; /* Make it null terminated */ if ((p = strrchr(idr->name, ';')) != NULL) { *p = '\0'; /* Strip off old version # */ } iso9660_file_length(idr->name, ndr, (idr->flags[0] & ISO_DIRECTORY) != 0); if ((np = strrchr(ndr->isorec.name, ';')) != NULL) { *np = '\0'; /* Strip off new version # */ } if (strcmp(idr->name, ndr->isorec.name)) { if (p) *p = ';'; /* Restore old version # */ if (np) *np = ';'; /* Restore new version # */ errmsgno(EX_BAD, "Old session has illegal name '%.*s' length %d\n", idr->name_len[0], idr->name, idr->name_len[0]); errmsgno(EX_BAD, "New session will use name '%s'\n", ndr->isorec.name); } if (p) *p = ';'; /* Restore old version # */ if (np) *np = ';'; /* Restore new version # */ idr->name[nlen] = schar; /* Restore old iso record*/ } /* * Function: iso9660_file_length * * Purpose: Map file name to 8.3 format, return length * of result. * * Arguments: name file name we need to map. * sresult directory entry structure to contain mapped name. * dirflag flag indicating whether this is a directory or not. * * Note: name being const * is a bug introduced by Eric but hard to * fix without going through the whole source. */ int iso9660_file_length(const char *name /* Not really const !!! */, struct directory_entry *sresult, int dirflag) { char c; char *cp; int before_dot = 8; int after_dot = 3; int chars_after_dot = 0; int chars_before_dot = 0; int current_length = 0; int extra = 0; int ignore = 0; char *last_dot; const char *pnt; int priority = 32767; char *result; int ochars_after_dot; int ochars_before_dot; int seen_dot = 0; int seen_semic = 0; int tildes = 0; result = sresult->isorec.name; if (sresult->priority) priority = sresult->priority; /* * For the '.' entry, generate the correct record, and return 1 for * the length. */ if (strcmp(name, ".") == 0) { *result = 0; return (1); } /* * For the '..' entry, generate the correct record, and return 1 * for the length. */ if (strcmp(name, "..") == 0) { *result++ = 1; *result++ = 0; return (1); } /* * Now scan the directory one character at a time, and figure out * what to do. */ pnt = name; /* * Find the '.' that we intend to use for the extension. * Usually this is the last dot, but if we have . followed by nothing * or a ~, we would consider this to be unsatisfactory, and we keep * searching. */ last_dot = strrchr(pnt, '.'); if ((last_dot != NULL) && ((last_dot[1] == '~') || (last_dot[1] == '\0'))) { cp = last_dot; *cp = '\0'; last_dot = strrchr(pnt, '.'); *cp = '.'; /* * If we found no better '.' back up to the last match. */ if (last_dot == NULL) last_dot = cp; } if (last_dot != NULL) { ochars_after_dot = strlen(last_dot); /* dot counts */ ochars_before_dot = last_dot - pnt; } else { ochars_before_dot = 128; ochars_after_dot = 0; } /* * If we have full names, the names we generate will not work * on a DOS machine, since they are not guaranteed to be 8.3. * Nonetheless, in many cases this is a useful option. We * still only allow one '.' character in the name, however. */ if (full_iso9660_filenames || iso9660_level > 1) { before_dot = iso9660_namelen; after_dot = before_dot - 1; if (!dirflag) { if (ochars_after_dot > ((iso9660_namelen/2)+1)) { /* * The minimum number of characters before * the dot is 3 to allow renaming. * Let us allow to have 15 characters after * dot to give more rational filenames. */ before_dot = iso9660_namelen/2; after_dot = ochars_after_dot; } else { before_dot -= ochars_after_dot; /* dot counts */ after_dot = ochars_after_dot; } } } while (*pnt) { #ifdef VMS if (strcmp(pnt, ".DIR;1") == 0) { break; } #endif #ifdef Eric_code_does_not_work /* * XXX If we make this code active we get corrupted direcrory * XXX trees with infinite loops. */ /* * This character indicates a Unix style of backup file * generated by some editors. Lower the priority of the file. */ if (iso_translate && *pnt == '#') { priority = 1; pnt++; continue; } /* * This character indicates a Unix style of backup file * generated by some editors. Lower the priority of the file. */ if (iso_translate && *pnt == '~') { priority = 1; tildes++; pnt++; continue; } #endif /* * This might come up if we had some joker already try and put * iso9660 version numbers into the file names. This would be * a silly thing to do on a Unix box, but we check for it * anyways. If we see this, then we don't have to add our own * version number at the end. UNLESS the ';' is part of the * filename and no valid version number is following. */ if (use_fileversion && *pnt == ';' && seen_dot) { /* * Check if a valid version number follows. * The maximum valid version number is 32767. */ for (c = 1, cp = (char *)&pnt[1]; c < 6 && *cp; c++, cp++) { if (*cp < '0' || *cp > '9') break; } if (c <= 6 && *cp == '\0' && atoi(&pnt[1]) <= 32767) seen_semic++; } /* * If we have a name with multiple '.' characters, we ignore * everything after we have gotten the extension. */ if (ignore) { pnt++; continue; } if (current_length >= iso9660_namelen) { #ifdef nono /* * Does not work as we may truncate before the dot. */ fprintf(stderr, "Truncating '%s' to '%.*s'.\n", name, current_length, sresult->isorec.name); ignore++; #endif pnt++; continue; } /* Spin past any iso9660 version number we might have. */ if (seen_semic) { if (seen_semic == 1) { seen_semic++; *result++ = ';'; } if (*pnt >= '0' && *pnt <= '9') { *result++ = *pnt; } extra++; pnt++; continue; } if (*pnt == '.') { if (!allow_multidot) { if (strcmp(pnt, ".tar.gz") == 0) pnt = last_dot = ".tgz"; if (strcmp(pnt, ".ps.gz") == 0) pnt = last_dot = ".psz"; } if (!chars_before_dot && !allow_leading_dots) { /* * DOS can't read files with dot first */ chars_before_dot++; *result++ = '_'; /* Substitute underscore */ } else if (pnt == last_dot) { if (seen_dot) { ignore++; continue; } *result++ = '.'; seen_dot++; } else if (allow_multidot) { if (chars_before_dot < before_dot) { chars_before_dot++; *result++ = '.'; } } else { /* * If this isn't the dot that we use * for the extension, then change the * character into a '_' instead. */ if (chars_before_dot < before_dot) { chars_before_dot++; *result++ = '_'; } } } else { if ((seen_dot && (chars_after_dot < after_dot) && ++chars_after_dot) || (!seen_dot && (chars_before_dot < before_dot) && ++chars_before_dot)) { c = *pnt; if (c & 0x80) { /* * We allow 8 bit chars if -iso-level * is at least 4 * * XXX We should check if the output * XXX character set is a 7 Bit ASCI * extension. */ if (iso9660_level >= 4) { c = conv_charset(c, in_nls, out_nls); } else { c = '_'; } } else if (!allow_lowercase) { c = islower((unsigned char)c) ? toupper((unsigned char)c) : c; } if (relaxed_filenames) { /* * Here we allow a more relaxed syntax. */ if (c == '/') c = '_'; *result++ = c; } else switch (c) { /* * Dos style filenames. * We really restrict the names here. */ default: *result++ = c; break; /* * Descriptions of DOS's 'Parse Filename' * (function 29H) describes V1 and V2.0+ * separator and terminator characters. These * characters in a DOS name make the file * visible but un-manipulable (all useful * operations error off. */ /* separators */ case '+': case '=': case '%': /* not legal DOS */ /* filename */ case ':': case ';': /* already handled */ case '.': /* already handled */ case ',': /* already handled */ case '\t': case ' ': /* V1 only separators */ case '/': case '"': case '[': case ']': /* terminators */ case '>': case '<': case '|': /* * Other characters that are not valid ISO-9660 * characters. */ case '!': /* case '#':*/ case '$': case '&': case '\'': case '(': case ')': case '*': /* case '-':*/ case '?': case '@': case '\\': case '^': case '`': case '{': case '}': /* case '~':*/ /* * All characters below 32 (space) are not * allowed too. */ case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: /* case 9: */ case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: /* * Hmm - what to do here? Skip? Win95 * looks like it substitutes '_' */ *result++ = '_'; break; case '#': case '-': case '~': /* * Check if we should allow these * illegal characters used by * Microsoft. */ if (iso_translate) *result++ = '_'; else *result++ = c; break; } /* switch (*pnt) */ } else { /* if (chars_{after,before}_dot) ... */ pnt++; continue; } } /* else *pnt == '.' */ current_length++; pnt++; } /* while (*pnt) */ /* * OK, that wraps up the scan of the name. Now tidy up a few other * things. * Look for emacs style of numbered backups, like foo.c.~3~. If we * see this, convert the version number into the priority number. * In case of name conflicts, this is what would end up being used as * the 'extension'. */ if (tildes == 2) { int prio1 = 0; pnt = name; while (*pnt && *pnt != '~') { pnt++; } if (*pnt) { pnt++; } while (*pnt && *pnt != '~') { prio1 = 10 * prio1 + *pnt - '0'; pnt++; } priority = prio1; } /* * If this is not a directory, force a '.' in case we haven't seen one, * and add a version number if we haven't seen one of those either. */ if (!dirflag) { if (!seen_dot && !omit_period) { if (chars_before_dot >= (iso9660_namelen-1)) { chars_before_dot--; result--; } *result++ = '.'; extra++; } if (!omit_version_number && !seen_semic) { *result++ = ';'; *result++ = '1'; extra += 2; } } *result++ = 0; sresult->priority = priority; /*#define DEBBUG*/ #ifdef DEBBUG fprintf(stderr, "NAME: '%s'\n", sresult->isorec.name); fprintf(stderr, "chars_before_dot %d chars_after_dot %d seen_dot %d extra %d\n", chars_before_dot, chars_after_dot, seen_dot, extra); #endif return (chars_before_dot + chars_after_dot + seen_dot + extra); } cdrkit-1.1.11/genisoimage/bootinfo.h0000644000372500001440000000323510531416235016406 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)bootinfo.h 1.3 04/03/02 Copyright 1999, 2004 J. Schilling */ /* * Header file bootinfo.h - genisoimage-defined boot information table * useful for an El Torito-loaded disk image. * * Copyright (c) 1999, 2004 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _BOOTINFO_H #define _BOOTINFO_H struct genisoimage_boot_info { char bi_pvd [ISODCL(1, 4)]; /* LBA of PVD */ char bi_file [ISODCL(5, 8)]; /* LBA of boot image */ char bi_length [ISODCL(9, 12)]; /* Length of boot image */ char bi_csum [ISODCL(13, 16)]; /* Checksum of boot image */ char bi_reserved [ISODCL(17, 56)]; /* Reserved */ }; #endif /* _BOOTINFO_H */ cdrkit-1.1.11/genisoimage/diskmbr.h0000644000372500001440000000360710477233650016234 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)diskmbr.h 1.2 04/03/02 Copyright 1999-2004 J. Schilling */ /* * Header file diskmbr.h - assorted structure definitions and macros * describing standard PC partition table * * Copyright (c) 1999-2004 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _DISKMBR_H #define _DISKMBR_H #define MBR_MAGIC 0xAA55 #define PARTITION_UNUSED 0x00 #define PARTITION_ACTIVE 0x80 #define PARTITION_COUNT 4 #define MBR_SECTOR(x) ((x)&0x3F) #define MBR_CYLINDER(x) ((x)>>8|((x)<<2&0x300)) struct disk_partition { unsigned char status; unsigned char s_head; unsigned char s_cyl_sec[2]; unsigned char type; unsigned char e_head; unsigned char e_cyl_sec[2]; unsigned char boot_sec[4]; unsigned char size[4]; }; struct disk_master_boot_record { char pad[0x1BE]; struct disk_partition partition[PARTITION_COUNT]; unsigned char magic[2]; }; #endif /* _DISKMBR_H */ cdrkit-1.1.11/genisoimage/dvd_reader.c0000644000372500001440000001513510536265343016672 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)dvd_reader.c 1.3 04/03/04 joerg */ /* * Copyright (C) 2001, 2002 Billy Biggs , * Håkan Hjort , * Olaf Beck * (I only did the cut down no other contribs) * Jörg Schilling * (making the code portable) * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * NOTE: This is a cut down version of libdvdread for genisoimage, due * to portability issues with the current libdvdread according to * the maintainer of genisoimage. * This cut down version only reads from a harddisk file structure * and it only implements the functions necessary inorder to make * genisoimage produce valid DVD-Video images. * DON'T USE THIS LIBRARY IN ANY OTHER PROGRAM GET THE REAL * LIBDVDREAD INSTEAD */ #ifdef DVD_VIDEO #include "genisoimage.h" #include #include #include "dvd_reader.h" struct dvd_file_s { /* Basic information. */ dvd_reader_t *dvd; /* Calculated at open-time, size in blocks. */ ssize_t filesize; }; void DVDCloseFile(dvd_file_t *dvd_file); static dvd_file_t *DVDOpenFilePath(dvd_reader_t *dvd, char *filename); static dvd_file_t *DVDOpenVOBPath(dvd_reader_t *dvd, int title, int menu); dvd_file_t *DVDOpenFile(dvd_reader_t *dvd, int titlenum, dvd_read_domain_t domain); static dvd_reader_t *DVDOpenPath(const char *path_root); dvd_reader_t *DVDOpen(const char *path); void DVDClose(dvd_reader_t *dvd); ssize_t DVDFileSize(dvd_file_t *dvd_file); /* * Free a DVD file */ void DVDCloseFile(dvd_file_t *dvd_file) { free(dvd_file); dvd_file = 0; } /* * Stat a IFO or BUP file from a DVD directory tree. */ static dvd_file_t * DVDOpenFilePath(dvd_reader_t *dvd, char *filename) { char full_path[PATH_MAX + 1]; dvd_file_t *dvd_file; struct stat fileinfo; /* Get the full path of the file. */ snprintf(full_path, sizeof (full_path), "%s/%s", dvd->path_root, filename); dvd_file = (dvd_file_t *) e_malloc(sizeof (dvd_file_t)); if (!dvd_file) return (0); dvd_file->dvd = dvd; dvd_file->filesize = 0; if (stat(full_path, &fileinfo) < 0) { free(dvd_file); return (0); } dvd_file->filesize = fileinfo.st_size / DVD_VIDEO_LB_LEN; return (dvd_file); } /* * Stat a VOB file from a DVD directory tree. */ static dvd_file_t * DVDOpenVOBPath(dvd_reader_t *dvd, int title, int menu) { char filename[PATH_MAX + 1]; struct stat fileinfo; dvd_file_t *dvd_file; int i; dvd_file = (dvd_file_t *) e_malloc(sizeof (dvd_file_t)); if (!dvd_file) return (0); dvd_file->dvd = dvd; dvd_file->filesize = 0; if (menu) { if (title == 0) { snprintf(filename, sizeof (filename), "%s/VIDEO_TS/VIDEO_TS.VOB", dvd->path_root); } else { snprintf(filename, sizeof (filename), "%s/VIDEO_TS/VTS_%02i_0.VOB", dvd->path_root, title); } if (stat(filename, &fileinfo) < 0) { free(dvd_file); return (0); } dvd_file->filesize = fileinfo.st_size / DVD_VIDEO_LB_LEN; } else { for (i = 0; i < 9; ++i) { snprintf(filename, sizeof (filename), "%s/VIDEO_TS/VTS_%02i_%i.VOB", dvd->path_root, title, i + 1); if (stat(filename, &fileinfo) < 0) { break; } dvd_file->filesize += fileinfo.st_size / DVD_VIDEO_LB_LEN; } } return (dvd_file); } /* * Stat a DVD file from a DVD directory tree */ EXPORT dvd_file_t * DVDOpenFile(dvd_reader_t *dvd, int titlenum, dvd_read_domain_t domain) { char filename[MAX_UDF_FILE_NAME_LEN]; switch (domain) { case DVD_READ_INFO_FILE: if (titlenum == 0) { snprintf(filename, sizeof (filename), "/VIDEO_TS/VIDEO_TS.IFO"); } else { snprintf(filename, sizeof (filename), "/VIDEO_TS/VTS_%02i_0.IFO", titlenum); } break; case DVD_READ_INFO_BACKUP_FILE: if (titlenum == 0) { snprintf(filename, sizeof (filename), "/VIDEO_TS/VIDEO_TS.BUP"); } else { snprintf(filename, sizeof (filename), "/VIDEO_TS/VTS_%02i_0.BUP", titlenum); } break; case DVD_READ_MENU_VOBS: return (DVDOpenVOBPath(dvd, titlenum, 1)); case DVD_READ_TITLE_VOBS: if (titlenum == 0) return (0); return (DVDOpenVOBPath(dvd, titlenum, 0)); default: #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Invalid domain for file open.\n"); #else fprintf(stderr, "Invalid domain for file open.\n"); #endif return (0); } return (DVDOpenFilePath(dvd, filename)); } /* * Stat a DVD directory structure */ static dvd_reader_t * DVDOpenPath(const char *path_root) { dvd_reader_t *dvd; dvd = (dvd_reader_t *) e_malloc(sizeof (dvd_reader_t)); if (!dvd) return (0); dvd->path_root = strdup(path_root); return (dvd); } /* * Stat a DVD structure - this one only works with directory structures */ dvd_reader_t * DVDOpen(const char *path) { struct stat fileinfo; int ret; if (!path) return (0); ret = stat(path, &fileinfo); if (ret < 0) { /* If we can't stat the file, give up */ #ifdef USE_LIBSCHILY errmsg("Can't stat %s\n", path); #else fprintf(stderr, "Can't stat %s\n", path); perror(""); #endif return (0); } if (S_ISDIR(fileinfo.st_mode)) { return (DVDOpenPath(path)); } /* If it's none of the above, screw it. */ #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Could not open %s\n", path); #else fprintf(stderr, "Could not open %s\n", path); #endif return (0); } /* * Free a DVD structure - this one will only close a directory tree */ void DVDClose(dvd_reader_t *dvd) { if (dvd) { if (dvd->path_root) free(dvd->path_root); free(dvd); dvd = 0; } } /* * Return the size of a DVD file */ ssize_t DVDFileSize(dvd_file_t *dvd_file) { return (dvd_file->filesize); } #endif /* DVD_VIDEO */ cdrkit-1.1.11/genisoimage/tree.c0000644000372500001440000021353511077466173015543 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)tree.c 1.82 04/06/12 joerg */ /* * File tree.c - scan directory tree and build memory structures for iso9660 * filesystem * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999,2000-2004 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */ /* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 23/2/2000 */ #include #include "genisoimage.h" #include "match.h" #include "udf.h" #include "exclude.h" #include #include #include #include #include extern int allow_limited_size; #ifdef VMS #include #include #include "vms.h" #endif /* * Autoconf should be able to figure this one out for us and let us know * whether the system has memmove or not. */ #ifndef HAVE_MEMMOVE #define memmove(d, s, n) bcopy((s), (d), (n)) #endif static Uchar symlink_buff[PATH_MAX+1]; static char *filetype(int t); static char *rstr(char *s1, char *s2); static void stat_fix(struct stat * st); int stat_filter(char *path, struct stat *st); int lstat_filter(char *path, struct stat *st); static int sort_n_finish(struct directory *this_dir); static void generate_reloc_directory(void); static void attach_dot_entries(struct directory *dirnode, struct stat *dir_stat, struct stat *parent_stat); static void update_nlink(struct directory_entry *s_entry, int value); static void increment_nlink(struct directory_entry *s_entry); char *find_rr_attribute(unsigned char *pnt, int len, char *attr_type); void finish_cl_pl_entries(void); int scan_directory_tree(struct directory *this_dir, char *path, struct directory_entry *de); #ifdef APPLE_HYB int insert_file_entry(struct directory *this_dir, char *whole_path, char *short_name, int have_rsrc); #else int insert_file_entry(struct directory *this_dir, char *whole_path, char *short_name); #endif void generate_iso9660_directories(struct directory *node, FILE *outfile); struct directory *find_or_create_directory(struct directory *parent, const char *path, struct directory_entry *de, int flag, struct stat* stat_template); static void delete_directory(struct directory *parent, struct directory *child); int sort_tree(struct directory *node); void dump_tree(struct directory *node); void update_nlink_field(struct directory *node); struct directory_entry *search_tree_file(struct directory *node, char *filename); void init_fstatbuf(void); extern int verbose; struct stat fstatbuf; /* We use this for the artificial */ /* entries we create */ struct stat root_statbuf; /* Stat buffer for root directory */ struct directory *reloc_dir; static char * filetype(int t) { static char unkn[32]; if (S_ISFIFO(t)) /* 1 */ return ("fifo"); if (S_ISCHR(t)) /* 2 */ return ("chr"); if (S_ISMPC(t)) /* 3 */ return ("multiplexed chr"); if (S_ISDIR(t)) /* 4 */ return ("dir"); if (S_ISNAM(t)) /* 5 */ return ("named file"); if (S_ISBLK(t)) /* 6 */ return ("blk"); if (S_ISMPB(t)) /* 7 */ return ("multiplexed blk"); if (S_ISREG(t)) /* 8 */ return ("regular file"); if (S_ISCNT(t)) /* 9 */ return ("contiguous file"); if (S_ISLNK(t)) /* 10 */ return ("symlink"); if (S_ISSHAD(t)) /* 11 */ return ("Solaris shadow inode"); if (S_ISSOCK(t)) /* 12 */ return ("socket"); if (S_ISDOOR(t)) /* 13 */ return ("door"); if (S_ISWHT(t)) /* 14 */ return ("whiteout"); if (S_ISEVC(t)) /* 15 */ return ("event count"); /* * Needs to be last in case somebody makes this * a supported file type. */ if ((t & S_IFMT) == 0) /* 0 (unallocated) */ return ("unallocated"); sprintf(unkn, "octal '%o'", t & S_IFMT); return (unkn); } /* * Check if s1 ends in strings s2 */ static char * rstr(char *s1, char *s2) { int l1; int l2; l1 = strlen(s1); l2 = strlen(s2); if (l2 > l1) return ((char *) NULL); if (strcmp(&s1[l1 - l2], s2) == 0) return (&s1[l1 - l2]); return ((char *) NULL); } static void stat_fix(struct stat *st) { int adjust_modes = 0; if (S_ISREG(st->st_mode)) adjust_modes = rationalize_filemode; else if (S_ISDIR(st->st_mode)) adjust_modes = rationalize_dirmode; else adjust_modes = (rationalize_filemode || rationalize_dirmode); /* * If rationalizing, override the uid and gid, since the * originals will only be useful on the author's system. */ if (rationalize_uid) st->st_uid = uid_to_use; if (rationalize_gid) st->st_gid = gid_to_use; if (adjust_modes) { if (S_ISREG(st->st_mode) && (filemode_to_use != 0)) { st->st_mode = filemode_to_use | S_IFREG; } else if (S_ISDIR(st->st_mode) && (dirmode_to_use != 0)) { st->st_mode = dirmode_to_use | S_IFDIR; } else { /* * Make sure the file modes make sense. Turn * on all read bits. Turn on all exec/search * bits if any exec/search bit is set. Turn * off all write bits, and all special mode * bits (on a r/o fs lock bits are useless, * and with uid+gid 0 don't want set-id bits, * either). */ st->st_mode |= 0444; #if !defined(_WIN32) && !defined(__DJGPP__) /* make all file "executable" */ if (st->st_mode & 0111) #endif st->st_mode |= 0111; st->st_mode &= ~07222; } } } int stat_filter(char *path, struct stat *st) { int result = stat(path, st); if (result >= 0 && rationalize) stat_fix(st); return (result); } int lstat_filter(char *path, struct stat *st) { int result = lstat(path, st); if (result >= 0 && rationalize) stat_fix(st); return (result); } static int sort_n_finish(struct directory *this_dir) { struct directory_entry *s_entry; struct directory_entry *s_entry1; struct directory_entry *table; int count; int d1; int d2; int d3; register int new_reclen; char *c; int status = 0; int tablesize = 0; char newname[MAX_ISONAME+1]; char rootname[MAX_ISONAME+1]; char extname[MAX_ISONAME+1]; /* * Here we can take the opportunity to toss duplicate entries from the * directory. */ /* ignore if it's hidden */ if (this_dir->dir_flags & INHIBIT_ISO9660_ENTRY) { return (0); } table = NULL; init_fstatbuf(); /* * If we had artificially created this directory, then we might be * missing the required '.' entries. Create these now if we need * them. */ if ((this_dir->dir_flags & (DIR_HAS_DOT | DIR_HAS_DOTDOT)) != (DIR_HAS_DOT | DIR_HAS_DOTDOT)) { fstatbuf.st_mode = new_dir_mode | S_IFDIR; fstatbuf.st_nlink = 2; attach_dot_entries(this_dir, &fstatbuf, &fstatbuf); } flush_file_hash(); s_entry = this_dir->contents; while (s_entry) { /* ignore if it's hidden */ if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) { s_entry = s_entry->next; continue; } /* First assume no conflict, and handle this case */ if (!(s_entry1 = find_file_hash(s_entry->isorec.name))) { add_file_hash(s_entry); s_entry = s_entry->next; continue; } #ifdef APPLE_HYB /* * if the pair are associated, then skip (as they have the * same name!) */ if (apple_both && s_entry1->assoc && s_entry1->assoc == s_entry) { s_entry = s_entry->next; continue; } #endif /* APPLE_HYB */ if (s_entry1 == s_entry) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Fatal goof, file '%s' already in hash table.\n", s_entry->isorec.name); #else fprintf(stderr, "Fatal goof, file '%s' already in hash table.\n", s_entry->isorec.name); exit(1); #endif } /* * OK, handle the conflicts. Try substitute names until we * come up with a winner */ strcpy(rootname, s_entry->isorec.name); /* * Strip off the non-significant part of the name so that we * are left with a sensible root filename. If we don't find * a '.', then try a ';'. */ c = strchr(rootname, '.'); /* * In case we ever allow more than on dot, only modify the * section past the last dot if the file name starts with a * dot. */ if (c != NULL && c == rootname && c != strrchr(rootname, '.')) { c = strrchr(rootname, '.'); } extname[0] = '\0'; /* In case we have no ext. */ if (c) { strcpy(extname, c); *c = 0; /* Cut off complete ext. */ } else { /* * Could not find any '.'. */ c = strchr(rootname, ';'); if (c) { *c = 0; /* Cut off version number */ } } c = strchr(extname, ';'); if (c) { *c = 0; /* Cut off version number */ } d1 = strlen(rootname); if (full_iso9660_filenames || iso9660_level > 1) { d2 = strlen(extname); /* * 31/37 chars minus the 3 characters we are * appending below to create unique filenames. */ if ((d1 + d2) > (iso9660_namelen - 3)) rootname[iso9660_namelen - 3 - d2] = 0; } else { if (d1 > 5) rootname[5] = 0; } new_reclen = strlen(rootname); sprintf(newname, "%s000%s%s", rootname, extname, ((s_entry->isorec.flags[0] & ISO_DIRECTORY) || omit_version_number ? "" : ";1")); for (d1 = 0; d1 < 36; d1++) { for (d2 = 0; d2 < 36; d2++) { for (d3 = 0; d3 < 36; d3++) { newname[new_reclen + 0] = (d1 <= 9 ? '0' + d1 : 'A' + d1 - 10); newname[new_reclen + 1] = (d2 <= 9 ? '0' + d2 : 'A' + d2 - 10); newname[new_reclen + 2] = (d3 <= 9 ? '0' + d3 : 'A' + d3 - 10); if (debug) fprintf(stderr, "NEW name '%s'\n", newname); #ifdef VMS /* Sigh. VAXCRTL seems to be broken here */ { int ijk = 0; while (newname[ijk]) { if (newname[ijk] == ' ') newname[ijk] = '0'; ijk++; } } #endif if (!find_file_hash(newname)) goto got_valid_name; } } } /* If we fell off the bottom here, we were in real trouble. */ #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Unable to generate unique name for file %s\n", s_entry->name); #else fprintf(stderr, "Unable to generate unique name for file %s\n", s_entry->name); exit(1); #endif got_valid_name: /* * OK, now we have a good replacement name. Now decide which * one of these two beasts should get the name changed */ if (s_entry->priority < s_entry1->priority) { if (verbose > 0) { fprintf(stderr, "Using %s for %s%s%s (%s)\n", newname, this_dir->whole_name, SPATH_SEPARATOR, s_entry->name, s_entry1->name); } s_entry->isorec.name_len[0] = strlen(newname); new_reclen = offsetof(struct iso_directory_record, name[0]) + strlen(newname); if (use_XA || use_RockRidge) { if (new_reclen & 1) new_reclen++; /* Pad to an even byte */ new_reclen += s_entry->rr_attr_size; } if (new_reclen & 1) new_reclen++; /* Pad to an even byte */ s_entry->isorec.length[0] = new_reclen; strcpy(s_entry->isorec.name, newname); #ifdef APPLE_HYB /* has resource fork - needs new name */ if (apple_both && s_entry->assoc) { struct directory_entry *s_entry2 = s_entry->assoc; /* * resource fork name *should* be the same as * the data fork */ s_entry2->isorec.name_len[0] = s_entry->isorec.name_len[0]; strcpy(s_entry2->isorec.name, s_entry->isorec.name); s_entry2->isorec.length[0] = new_reclen; } #endif /* APPLE_HYB */ } else { delete_file_hash(s_entry1); if (verbose > 0) { fprintf(stderr, "Using %s for %s%s%s (%s)\n", newname, this_dir->whole_name, SPATH_SEPARATOR, s_entry1->name, s_entry->name); } s_entry1->isorec.name_len[0] = strlen(newname); new_reclen = offsetof(struct iso_directory_record, name[0]) + strlen(newname); if (use_XA || use_RockRidge) { if (new_reclen & 1) new_reclen++; /* Pad to an even byte */ new_reclen += s_entry1->rr_attr_size; } if (new_reclen & 1) new_reclen++; /* Pad to an even byte */ s_entry1->isorec.length[0] = new_reclen; strcpy(s_entry1->isorec.name, newname); add_file_hash(s_entry1); #ifdef APPLE_HYB /* has resource fork - needs new name */ if (apple_both && s_entry1->assoc) { struct directory_entry *s_entry2 = s_entry1->assoc; /* * resource fork name *should* be the same as * the data fork */ s_entry2->isorec.name_len[0] = s_entry1->isorec.name_len[0]; strcpy(s_entry2->isorec.name, s_entry1->isorec.name); s_entry2->isorec.length[0] = new_reclen; } #endif /* APPLE_HYB */ } add_file_hash(s_entry); s_entry = s_entry->next; } if (generate_tables && !find_file_hash(trans_tbl) && (reloc_dir != this_dir) && (this_dir->extent == 0)) { /* First we need to figure out how big this table is */ for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { if (strcmp(s_entry->name, ".") == 0 || strcmp(s_entry->name, "..") == 0) continue; #ifdef APPLE_HYB /* skip table entry for the resource fork */ if (apple_both && (s_entry->isorec.flags[0] & ISO_ASSOCIATED)) continue; #endif /* APPLE_HYB */ if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) continue; if (s_entry->table) { /* * Max namelen, a space before and a space * after the iso filename. */ tablesize += MAX_ISONAME + 2 + strlen(s_entry->table); } } } if (tablesize > 0) { table = (struct directory_entry *) e_malloc(sizeof (struct directory_entry)); memset(table, 0, sizeof (struct directory_entry)); table->table = NULL; table->next = this_dir->contents; this_dir->contents = table; table->filedir = root; table->isorec.flags[0] = ISO_FILE; table->priority = 32768; iso9660_date(table->isorec.date, fstatbuf.st_mtime); table->inode = TABLE_INODE; table->dev = (dev_t) UNCACHED_DEVICE; set_723(table->isorec.volume_sequence_number, volume_sequence_number); set_733((char *) table->isorec.size, tablesize); table->realsize = tablesize; table->size = tablesize; table->filedir = this_dir; if (jhide_trans_tbl) table->de_flags |= INHIBIT_JOLIET_ENTRY; /* table->name = strdup("");*/ table->name = strdup(trans_tbl); /* * We use sprintf() to create the strings, for this reason * we need to add one byte for the null character at the * end of the string even though we don't use it. */ table->table = (char *) e_malloc(ISO_ROUND_UP(tablesize)+1); memset(table->table, 0, ISO_ROUND_UP(tablesize)+1); iso9660_file_length(trans_tbl, table, 0); if (use_XA || use_RockRidge) { fstatbuf.st_mode = 0444 | S_IFREG; fstatbuf.st_nlink = 1; generate_xa_rr_attributes("", trans_tbl, table, &fstatbuf, &fstatbuf, 0); } } /* * We have now chosen the 8.3 names and we should now know the length * of every entry in the directory. */ for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { /* skip if it's hidden */ if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) { continue; } new_reclen = strlen(s_entry->isorec.name); /* First update the path table sizes for directories. */ if (s_entry->isorec.flags[0] & ISO_DIRECTORY) { if (strcmp(s_entry->name, ".") != 0 && strcmp(s_entry->name, "..") != 0) { path_table_size += new_reclen + offsetof(struct iso_path_table, name[0]); if (new_reclen & 1) path_table_size++; } else { new_reclen = 1; if (this_dir == root && strlen(s_entry->name) == 1) { path_table_size += new_reclen + offsetof(struct iso_path_table, name[0]); } } } if (path_table_size & 1) path_table_size++; /* For odd lengths we pad */ s_entry->isorec.name_len[0] = new_reclen; new_reclen += offsetof(struct iso_directory_record, name[0]); if (new_reclen & 1) new_reclen++; new_reclen += s_entry->rr_attr_size; if (new_reclen & 1) new_reclen++; if (new_reclen > 0xff) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Fatal error - RR overflow (reclen %d) for file %s\n", new_reclen, s_entry->name); #else fprintf(stderr, "Fatal error - RR overflow (reclen %d) for file %s\n", new_reclen, s_entry->name); exit(1); #endif } s_entry->isorec.length[0] = new_reclen; } status = sort_directory(&this_dir->contents, (reloc_dir == this_dir)); if (status > 0) { fprintf(stderr, "Unable to sort directory %s\n", this_dir->whole_name); if(merge_warn_msg) fprintf(stderr, merge_warn_msg); exit(1); } /* * If we are filling out a TRANS.TBL, generate the entries that will * go in the thing. */ if (table) { count = 0; for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { if (s_entry == table) continue; if (!s_entry->table) continue; if (strcmp(s_entry->name, ".") == 0 || strcmp(s_entry->name, "..") == 0) continue; #ifdef APPLE_HYB /* skip table entry for the resource fork */ if (apple_both && (s_entry->isorec.flags[0] & ISO_ASSOCIATED)) continue; #endif /* APPLE_HYB */ if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) continue; /* * Warning: we cannot use the return value of sprintf * because old BSD based sprintf() implementations * will return a pointer to the result instead of a * count. * Old mkiofs introduced a space after the iso * filename to make parsing TRANS.TBL easier. */ sprintf(table->table + count, "%c %-*s%s", s_entry->table[0], MAX_ISONAME + 1, s_entry->isorec.name, s_entry->table + 1); count += strlen(table->table + count); free(s_entry->table); /* * for a memory file, set s_entry->table to the * correct data - which is stored in * s_entry->whole_name */ if (s_entry->de_flags & MEMORY_FILE) { s_entry->table = s_entry->whole_name; s_entry->whole_name = NULL; } else { s_entry->table = NULL; } } if (count != tablesize) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Translation table size mismatch %d %d\n", count, tablesize); #else fprintf(stderr, "Translation table size mismatch %d %d\n", count, tablesize); exit(1); #endif } } /* * Now go through the directory and figure out how large this one will * be. Do not split a directory entry across a sector boundary */ s_entry = this_dir->contents; this_dir->ce_bytes = 0; while (s_entry) { /* skip if it's hidden */ if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) { s_entry = s_entry->next; continue; } new_reclen = s_entry->isorec.length[0]; if ((this_dir->size & (SECTOR_SIZE - 1)) + new_reclen >= SECTOR_SIZE) this_dir->size = (this_dir->size + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1); this_dir->size += new_reclen; /* See if continuation entries were used on disc */ if (use_RockRidge && s_entry->rr_attr_size != s_entry->total_rr_attr_size) { unsigned char *pnt; int len; int nbytes; pnt = s_entry->rr_attributes; len = s_entry->total_rr_attr_size; pnt = parse_xa(pnt, &len, 0); /* pnt = parse_xa(pnt, &len, s_entry);*/ /* * We make sure that each continuation entry record is * not split across sectors, but each file could in * theory have more than one CE, so we scan through * and figure out what we need. */ while (len > 3) { if (pnt[0] == 'C' && pnt[1] == 'E') { nbytes = get_733((char *) pnt + 20); if ((this_dir->ce_bytes & (SECTOR_SIZE - 1)) + nbytes >= SECTOR_SIZE) this_dir->ce_bytes = ISO_ROUND_UP(this_dir->ce_bytes); /* * Now store the block in the * ce buffer */ this_dir->ce_bytes += nbytes; if (this_dir->ce_bytes & 1) this_dir->ce_bytes++; } len -= pnt[2]; pnt += pnt[2]; } } s_entry = s_entry->next; } return (status); } static void generate_reloc_directory() { time_t current_time; struct directory_entry *s_entry; /* Create an entry for our internal tree */ time(¤t_time); reloc_dir = (struct directory *) e_malloc(sizeof (struct directory)); memset(reloc_dir, 0, sizeof (struct directory)); reloc_dir->parent = root; reloc_dir->next = root->subdir; root->subdir = reloc_dir; reloc_dir->depth = 1; if (hide_rr_moved) { reloc_dir->whole_name = strdup("./.rr_moved"); reloc_dir->de_name = strdup(".rr_moved"); } else { reloc_dir->whole_name = strdup("./rr_moved"); reloc_dir->de_name = strdup("rr_moved"); } reloc_dir->extent = 0; /* Now create an actual directory entry */ s_entry = (struct directory_entry *) e_malloc(sizeof (struct directory_entry)); memset(s_entry, 0, sizeof (struct directory_entry)); s_entry->next = root->contents; reloc_dir->self = s_entry; /* The rr_moved entry will not appear in the Joliet tree. */ reloc_dir->dir_flags |= INHIBIT_JOLIET_ENTRY; s_entry->de_flags |= INHIBIT_JOLIET_ENTRY; /* Hiding RR_MOVED seems not to be possible..... */ #ifdef HIDE_RR reloc_dir->dir_flags |= INHIBIT_ISO9660_ENTRY; s_entry->de_flags |= INHIBIT_ISO9660_ENTRY; #endif root->contents = s_entry; root->contents->name = strdup(reloc_dir->de_name); root->contents->filedir = root; root->contents->isorec.flags[0] = ISO_DIRECTORY; root->contents->priority = 32768; iso9660_date(root->contents->isorec.date, current_time); root->contents->inode = UNCACHED_INODE; root->contents->dev = (dev_t) UNCACHED_DEVICE; set_723(root->contents->isorec.volume_sequence_number, volume_sequence_number); iso9660_file_length(reloc_dir->de_name, root->contents, 1); init_fstatbuf(); if (use_XA || use_RockRidge) { fstatbuf.st_mode = 0555 | S_IFDIR; fstatbuf.st_nlink = 2; generate_xa_rr_attributes("", hide_rr_moved ? ".rr_moved" : "rr_moved", s_entry, &fstatbuf, &fstatbuf, 0); }; /* Now create the . and .. entries in rr_moved */ /* Now create an actual directory entry */ memset(&root_statbuf, 0x0, sizeof(struct stat)); /* be sure */ attach_dot_entries(reloc_dir, &fstatbuf, &root_statbuf); } /* * Function: attach_dot_entries * * Purpose: Create . and .. entries for a new directory. * * Arguments: dir_stat contains the ownership/permission information * for dirnode, and parent_stat contains * ownership/permission information for its parent * * * Notes: Only used for artificial directories that * we are creating. */ static void attach_dot_entries(struct directory *dirnode, struct stat *dir_stat, struct stat *parent_stat) { struct directory_entry *s_entry; struct directory_entry *orig_contents; int deep_flag = 0; init_fstatbuf(); orig_contents = dirnode->contents; if ((dirnode->dir_flags & DIR_HAS_DOTDOT) == 0) { s_entry = (struct directory_entry *) e_malloc(sizeof (struct directory_entry)); memcpy(s_entry, dirnode->self, sizeof (struct directory_entry)); #ifdef APPLE_HYB if (dirnode->self->hfs_ent) { s_entry->hfs_ent = (hfsdirent *) e_malloc(sizeof (hfsdirent)); memcpy(s_entry->hfs_ent, dirnode->self->hfs_ent, sizeof (hfsdirent)); } #endif s_entry->name = strdup(".."); s_entry->whole_name = NULL; s_entry->isorec.name_len[0] = 1; s_entry->isorec.flags[0] = ISO_DIRECTORY; iso9660_file_length("..", s_entry, 1); iso9660_date(s_entry->isorec.date, fstatbuf.st_mtime); set_723(s_entry->isorec.volume_sequence_number, volume_sequence_number); set_733(s_entry->isorec.size, SECTOR_SIZE); s_entry->realsize = SECTOR_SIZE; memset(s_entry->isorec.extent, 0, 8); s_entry->filedir = dirnode->parent; dirnode->contents = s_entry; dirnode->contents->next = orig_contents; orig_contents = s_entry; if (use_XA || use_RockRidge) { generate_xa_rr_attributes("", "..", s_entry, parent_stat, parent_stat, 0); } dirnode->dir_flags |= DIR_HAS_DOTDOT; } if ((dirnode->dir_flags & DIR_HAS_DOT) == 0) { s_entry = (struct directory_entry *) e_malloc(sizeof (struct directory_entry)); memcpy(s_entry, dirnode->self, sizeof (struct directory_entry)); #ifdef APPLE_HYB if (dirnode->self->hfs_ent) { s_entry->hfs_ent = (hfsdirent *) e_malloc(sizeof (hfsdirent)); memcpy(s_entry->hfs_ent, dirnode->self->hfs_ent, sizeof (hfsdirent)); } #endif s_entry->name = strdup("."); s_entry->whole_name = NULL; s_entry->isorec.name_len[0] = 1; s_entry->isorec.flags[0] = ISO_DIRECTORY; iso9660_file_length(".", s_entry, 1); iso9660_date(s_entry->isorec.date, fstatbuf.st_mtime); set_723(s_entry->isorec.volume_sequence_number, volume_sequence_number); set_733(s_entry->isorec.size, SECTOR_SIZE); s_entry->realsize=SECTOR_SIZE; memset(s_entry->isorec.extent, 0, 8); s_entry->filedir = dirnode; dirnode->contents = s_entry; dirnode->contents->next = orig_contents; if (use_XA || use_RockRidge) { if (dirnode == root) { deep_flag |= NEED_CE | NEED_SP; /* For extension record */ } generate_xa_rr_attributes("", ".", s_entry, dir_stat, dir_stat, deep_flag); } dirnode->dir_flags |= DIR_HAS_DOT; } } static void update_nlink(struct directory_entry *s_entry, int value) { unsigned char *pnt; int len; pnt = s_entry->rr_attributes; len = s_entry->total_rr_attr_size; pnt = parse_xa(pnt, &len, 0); while (len >= 4) { if (pnt[3] != 1 && pnt[3] != 2) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #else fprintf(stderr, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #endif } if (pnt[0] == 'P' && pnt[1] == 'X') { set_733((char *) pnt + 12, value); break; } len -= pnt[2]; pnt += pnt[2]; } } static void increment_nlink(struct directory_entry *s_entry) { unsigned char *pnt; int len, nlink; pnt = s_entry->rr_attributes; len = s_entry->total_rr_attr_size; pnt = parse_xa(pnt, &len, 0); while (len >= 4) { if (pnt[3] != 1 && pnt[3] != 2) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #else fprintf(stderr, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #endif } if (pnt[0] == 'P' && pnt[1] == 'X') { nlink = get_733((char *) pnt + 12); set_733((char *) pnt + 12, nlink + 1); break; } len -= pnt[2]; pnt += pnt[2]; } } char * find_rr_attribute(unsigned char *pnt, int len, char *attr_type) { pnt = parse_xa(pnt, &len, 0); while (len >= 4) { if (pnt[3] != 1 && pnt[3] != 2) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #else fprintf(stderr, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #endif } if (strncmp((char *) pnt, attr_type, 2) == 0) return ((char *) pnt); else if (strncmp((char *) pnt, "ST", 2) == 0) return (NULL); len -= pnt[2]; pnt += pnt[2]; } return (NULL); } void finish_cl_pl_entries() { struct directory_entry *s_entry; struct directory_entry *s_entry1; struct directory *d_entry; /* if the reloc_dir is hidden (empty), then return */ if (reloc_dir->dir_flags & INHIBIT_ISO9660_ENTRY) return; s_entry = reloc_dir->contents; s_entry = s_entry->next->next; /* Skip past . and .. */ for (; s_entry; s_entry = s_entry->next) { /* skip if it's hidden */ if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) { continue; } d_entry = reloc_dir->subdir; while (d_entry) { if (d_entry->self == s_entry) break; d_entry = d_entry->next; }; if (!d_entry) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Unable to locate directory parent\n"); #else fprintf(stderr, "Unable to locate directory parent\n"); exit(1); #endif }; if (s_entry->filedir != NULL && s_entry->parent_rec != NULL) { char *rr_attr; /* * First fix the PL pointer in the directory in the * rr_reloc dir */ s_entry1 = d_entry->contents->next; /* set_733((char *) s_entry1->rr_attributes +*/ /* s_entry1->total_rr_attr_size - 8,*/ /* s_entry->filedir->extent); */ /* * The line above won't work when entry was read from * the previous session, because if total_rr_attr_size * was odd when recording previous session, now we have * total_rr_attr_size off by 1 due to padding. * * So, just search for the attributes by name */ rr_attr = find_rr_attribute(s_entry1->rr_attributes, s_entry1->total_rr_attr_size, "PL"); if (rr_attr != NULL) set_733(rr_attr + 4, s_entry->filedir->extent); /* Now fix the CL pointer */ s_entry1 = s_entry->parent_rec; /* set_733((char *) s_entry1->rr_attributes +*/ /* s_entry1->total_rr_attr_size - 8, d_entry->extent); */ rr_attr = find_rr_attribute(s_entry1->rr_attributes, s_entry1->total_rr_attr_size, "CL"); if (rr_attr != NULL) set_733(rr_attr + 4, d_entry->extent); } s_entry->filedir = reloc_dir; /* Now we can fix this */ } /* * Next we need to modify the NLINK terms in the assorted root * directory records to account for the presence of the RR_MOVED * directory */ increment_nlink(root->self); increment_nlink(root->self->next); d_entry = root->subdir; while (d_entry) { increment_nlink(d_entry->contents->next); d_entry = d_entry->next; }; finish_cl_pl_for_prev_session(); } /* * Function: scan_directory_tree * * Purpose: Walk through a directory on the local machine * filter those things we don't want to include * and build our representation of a dir. * * Notes: */ int scan_directory_tree(struct directory *this_dir, char *path, struct directory_entry *de) { DIR *current_dir; char whole_path[PATH_MAX]; struct dirent *d_entry; struct directory *parent; int dflag; char *old_path; if (verbose > 1) { fprintf(stderr, "Scanning %s\n", path); } /*#define check_needed*/ #ifdef check_needed /* * Trying to use this to avoid directory loops from hard links * or followed symlinks does not work. It would prevent us from * implementing merge directories. */ if (this_dir->dir_flags & DIR_WAS_SCANNED) { fprintf(stderr, "Already scanned directory %s\n", path); return (1); /* It's a directory */ } #endif this_dir->dir_flags |= DIR_WAS_SCANNED; errno = 0; /* Paranoia */ current_dir = opendir(path); d_entry = NULL; /* * Apparently NFS sometimes allows you to open the directory, but then * refuses to allow you to read the contents. Allow for this */ old_path = path; if (current_dir) { errno = 0; d_entry = readdir(current_dir); } if (!current_dir || !d_entry) { int ret = 1; #ifdef USE_LIBSCHILY errmsg("Unable to open directory %s\n", path); #else fprintf(stderr, "Unable to open directory %s\n", path); #endif if (errno == ENOTDIR) { /* Mark as not a directory */ de->isorec.flags[0] &= ~ISO_DIRECTORY; ret = 0; } if (current_dir) closedir(current_dir); return (ret); } #ifdef ABORT_DEEP_ISO_ONLY if ((this_dir->depth > RR_relocation_depth) && !use_RockRidge) { static BOOL did_hint = FALSE; errmsgno(EX_BAD, "Directories too deep for '%s' (%d) max is %d; ignored - continuing.\n", path, this_dir->depth, RR_relocation_depth); if (!did_hint) { did_hint = TRUE; errmsgno(EX_BAD, "To include the complete directory tree,\n"); errmsgno(EX_BAD, "use Rock Ridge extensions via -R or -r,\n"); errmsgno(EX_BAD, "or allow deep ISO9660 directory nesting via -D.\n"); } closedir(current_dir); return (1); } #endif parent = de->filedir; /* * Set up the struct for the current directory, and insert it into * the tree */ #ifdef VMS vms_path_fixup(path); #endif /* * if entry for this sub-directory is hidden, then hide this directory */ if (de->de_flags & INHIBIT_ISO9660_ENTRY) this_dir->dir_flags |= INHIBIT_ISO9660_ENTRY; if (de->de_flags & INHIBIT_JOLIET_ENTRY) this_dir->dir_flags |= INHIBIT_JOLIET_ENTRY; #ifdef SORTING /* * set any sort weighting from it's own directory entry - if a * directory is given a weighting, then all the contents will use * this as the default weighting */ this_dir->sort = de->sort; #endif /* SORTING */ /* * Now we scan the directory itself, and look at what is inside of it. */ dflag = 0; while (1 == 1) { /* * The first time through, skip this, since we already asked * for the first entry when we opened the directory. */ if (dflag) d_entry = readdir(current_dir); dflag++; if (!d_entry) break; /* OK, got a valid entry */ /* If we do not want all files, then pitch the backups. */ if (!all_files) { if (strchr(d_entry->d_name, '~') || strchr(d_entry->d_name, '#') || rstr(d_entry->d_name, ".bak")) { if (verbose > 0) { fprintf(stderr, "Ignoring file %s\n", d_entry->d_name); } continue; } } #ifdef APPLE_HYB if (apple_both) { /* * exclude certain HFS type files/directories for the * time being */ if (hfs_exclude(d_entry->d_name)) continue; } #endif /* APPLE_HYB */ if (strlen(path) + strlen(d_entry->d_name) + 2 > sizeof (whole_path)) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Path name %s/%s too long.\n", path, d_entry->d_name); comerrno(EX_BAD, "Overflow of stat buffer\n"); #else fprintf(stderr, "Path name %s/%s too long.\n", path, d_entry->d_name); fprintf(stderr, "Overflow of stat buffer\n"); exit(1); #endif }; /* Generate the complete ASCII path for this file */ strcpy(whole_path, path); #ifndef VMS if (whole_path[strlen(whole_path) - 1] != '/') strcat(whole_path, "/"); #endif strcat(whole_path, d_entry->d_name); /** Should we exclude this file ? */ if (matches(d_entry->d_name) || matches(whole_path)) { if (verbose > 1) { fprintf(stderr, "Excluded by match: %s\n", whole_path); } continue; } if (generate_tables && strcmp(d_entry->d_name, trans_tbl) == 0) { /* * Ignore this entry. We are going to be generating * new versions of these files, and we need to ignore * any originals that we might have found. */ if (verbose > 1) { fprintf(stderr, "Excluded: %s\n", whole_path); } continue; } /* * If we already have a '.' or a '..' entry, then don't insert * new ones. */ if (strcmp(d_entry->d_name, ".") == 0 && this_dir->dir_flags & DIR_HAS_DOT) { continue; } if (strcmp(d_entry->d_name, "..") == 0 && this_dir->dir_flags & DIR_HAS_DOTDOT) { continue; } #if 0 if (verbose > 1) fprintf(stderr, "%s\n", whole_path); #endif /* This actually adds the entry to the directory in question.*/ #ifdef APPLE_HYB insert_file_entry(this_dir, whole_path, d_entry->d_name, 0); #else insert_file_entry(this_dir, whole_path, d_entry->d_name); #endif /* APPLE_HYB */ } closedir(current_dir); #ifdef APPLE_HYB /* * if we cached the HFS info stuff for this directory, then delete it */ if (this_dir->hfs_info) { del_hfs_info(this_dir->hfs_info); this_dir->hfs_info = 0; } #endif /* APPLE_HYB */ return (1); } /* * Function: insert_file_entry * * Purpose: Insert one entry into our directory node. * * Note: * This function inserts a single entry into the directory. It * is assumed that all filtering and decision making regarding what * we want to include has already been made, so the purpose of this * is to insert one entry (file, link, dir, etc), into this directory. * Note that if the entry is a dir (or if we are following links, * and the thing it points to is a dir), then we will scan those * trees before we return. */ #ifdef APPLE_HYB int insert_file_entry(struct directory *this_dir, char *whole_path, char *short_name, int have_rsrc) #else int insert_file_entry(struct directory *this_dir, char *whole_path, char *short_name) #endif /* APPLE_HYB */ { struct stat statbuf, lstatbuf; struct directory_entry *s_entry, *s_entry1; int lstatus; int status; int deep_flag; int no_scandir = 0; #ifdef APPLE_HYB int x_hfs = 0; int htype = TYPE_NONE; #endif /* APPLE_HYB */ status = stat_filter(whole_path, &statbuf); lstatus = lstat_filter(whole_path, &lstatbuf); if ((status == -1) && (lstatus == -1)) { /* * This means that the file doesn't exist, or isn't accessible. * Sometimes this is because of NFS permissions problems. */ #ifdef USE_LIBSCHILY errmsg("Non-existent or inaccessible: %s\n", whole_path); #else fprintf(stderr, "Non-existent or inaccessible: %s\n", whole_path); #endif return (0); } if (this_dir == root && strcmp(short_name, ".") == 0) root_statbuf = statbuf; /* Save this for later on */ /* We do this to make sure that the root entries are consistent */ if (this_dir == root && strcmp(short_name, "..") == 0) { statbuf = root_statbuf; lstatbuf = root_statbuf; } if (S_ISLNK(lstatbuf.st_mode)) { /* * Here we decide how to handle the symbolic links. Here we * handle the general case - if we are not following links or * there is an error, then we must change something. If RR * is in use, it is easy, we let RR describe the file. If * not, then we punt the file. */ if ((status || !follow_links)) { if (use_RockRidge) { status = 0; statbuf.st_size = (off_t)0; STAT_INODE(statbuf) = UNCACHED_INODE; statbuf.st_dev = (dev_t) UNCACHED_DEVICE; statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG; } else { if (follow_links) { #ifdef USE_LIBSCHILY /* XXX errno may be wrong! */ errmsg("Unable to stat file %s - ignoring and continuing.\n", whole_path); #else fprintf(stderr, "Unable to stat file %s - ignoring and continuing.\n", whole_path); #endif } else { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Symlink %s ignored - continuing.\n", whole_path); #else fprintf(stderr, "Symlink %s ignored - continuing.\n", whole_path); #endif return (0); /* Non Rock Ridge discs */ /* - ignore all symlinks */ } } } /* * Here we handle a different kind of case. Here we have a * symlink, but we want to follow symlinks. If we run across * a directory loop, then we need to pretend that we are not * following symlinks for this file. If this is the first * time we have seen this, then make this seem as if there was * no symlink there in the first place */ if (follow_links && S_ISDIR(statbuf.st_mode)) { if (strcmp(short_name, ".") && strcmp(short_name, "..")) { if (find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) { if (!use_RockRidge) { fprintf(stderr, "Already cached directory seen (%s)\n", whole_path); return (0); } lstatbuf = statbuf; /* * XXX when this line was active, * XXX genisoimage did not include all * XXX files if it was called with '-f' * XXX (follow symlinks). * XXX Now scan_directory_tree() * XXX checks if the directory has * XXX already been scanned via the * XXX DIR_WAS_SCANNED flag. */ /* no_scandir = 1;*/ } else { lstatbuf = statbuf; add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); } } } /* * For non-directories, we just copy the stat information over * so we correctly include this file. */ if (follow_links && !S_ISDIR(statbuf.st_mode)) { lstatbuf = statbuf; } } /* * Add directories to the cache so that we don't waste space even if * we are supposed to be following symlinks. */ if (follow_links && strcmp(short_name, ".") && strcmp(short_name, "..") && S_ISDIR(statbuf.st_mode)) { add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); } #ifdef VMS if (!S_ISDIR(lstatbuf.st_mode) && (statbuf.st_fab_rfm != FAB$C_FIX && statbuf.st_fab_rfm != FAB$C_STMLF)) { fprintf(stderr, "Warning - file %s has an unsupported VMS record" " format (%d)\n", whole_path, statbuf.st_fab_rfm); } #endif if (S_ISREG(lstatbuf.st_mode) && (status = access(whole_path, R_OK))) { #ifdef USE_LIBSCHILY errmsg("File %s is not readable - ignoring\n", whole_path); #else fprintf(stderr, "File %s is not readable (errno = %d) - ignoring\n", whole_path, errno); #endif return (0); } /* print a warning but don't spam too much */ if (S_ISREG(lstatbuf.st_mode) && (lstatbuf.st_size >= (off_t)0xFFFFFFFF)) { static int udf_warned; if( !allow_limited_size || verbose>1) fprintf(stderr, "File %s is larger than 4GiB-1.\n", whole_path); if( !allow_limited_size) { fprintf(stderr, "-allow-limited-size was not specified. There is no way do represent this file size. Aborting.\n"); exit(1); } if(verbose>=1 && ! udf_warned ) { udf_warned++; fprintf(stderr, "This size can only be represented in the UDF filesystem.\n" "Make sure that your clients support and use it.\n" "ISO9660, Joliet, RockRidge, HFS will display incorrect size.\n"); } } /* * Add this so that we can detect directory loops with hard links. * If we are set up to follow symlinks, then we skip this checking. */ if (!follow_links && S_ISDIR(lstatbuf.st_mode) && strcmp(short_name, ".") && strcmp(short_name, "..")) { if (find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) { #ifdef USE_LIBSCHILY /* comerrno(EX_BAD,*/ /* "Directory loop - fatal goof (%s %lx %lu).\n",*/ errmsgno(EX_BAD, "Warning: Directory loop (%s dev: %lx ino: %lu).\n", whole_path, (unsigned long) statbuf.st_dev, (unsigned long) STAT_INODE(statbuf)); #else /* fprintf(stderr,*/ /* "Directory loop - fatal goof (%s %lx %lu).\n",*/ fprintf(stderr, "Warning: Directory loop (%s dev: %lx ino: %lu).\n", whole_path, (unsigned long) statbuf.st_dev, (unsigned long) STAT_INODE(statbuf)); #endif } add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); } if (!S_ISCHR(lstatbuf.st_mode) && !S_ISBLK(lstatbuf.st_mode) && !S_ISFIFO(lstatbuf.st_mode) && !S_ISSOCK(lstatbuf.st_mode) && !S_ISLNK(lstatbuf.st_mode) && !S_ISREG(lstatbuf.st_mode) && !S_ISDIR(lstatbuf.st_mode)) { if ( ! (this_dir == root && strcmp(short_name, "..") == 0)) { fprintf(stderr, "Unknown file type (%s) %s - ignoring and continuing.\n", filetype((int) lstatbuf.st_mode), whole_path); } return (0); } /* Who knows what trash this is - ignore and continue */ if (status) { #ifdef USE_LIBSCHILY errmsg("Unable to stat file %s - ignoring and continuing.\n", whole_path); #else fprintf(stderr, "Unable to stat file %s - ignoring and continuing.\n", whole_path); #endif return (0); } /* * Check to see if we have already seen this directory node. If so, * then we don't create a new entry for it, but we do want to recurse * beneath it and add any new files we do find. */ if (S_ISDIR(statbuf.st_mode)) { int dflag; for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { if (strcmp(s_entry->name, short_name) == 0) { break; } } if (s_entry != NULL && strcmp(short_name, ".") && strcmp(short_name, "..")) { struct directory *child; if ((s_entry->de_flags & RELOCATED_DIRECTORY) != 0) { for (s_entry = reloc_dir->contents; s_entry; s_entry = s_entry->next) { if (strcmp(s_entry->name, short_name) == 0) { break; } } child = find_or_create_directory(reloc_dir, whole_path, s_entry, 1, NULL); } else { child = find_or_create_directory(this_dir, whole_path, s_entry, 1, NULL); /* * If unable to scan directory, mark this as a * non-directory */ } /* if (no_scandir)*/ if (0) dflag = 1; else dflag = scan_directory_tree(child, whole_path, s_entry); if (!dflag) { lstatbuf.st_mode = (lstatbuf.st_mode & ~S_IFMT) | S_IFREG; } return (0); } } #ifdef APPLE_HYB /* Should we exclude this HFS file ? - only works with -hfs */ if (!have_rsrc && apple_hyb && strcmp(short_name, ".") && strcmp(short_name, "..")) { if ((x_hfs = (hfs_matches(short_name) || hfs_matches(whole_path))) == 1) { if (verbose > 1) { fprintf(stderr, "Hidden from HFS tree: %s\n", whole_path); } } } /* * check we are a file, using Apple extensions and have a .resource * part and not excluded */ if (S_ISREG(lstatbuf.st_mode) && !have_rsrc && apple_both && !x_hfs) { char rsrc_path[PATH_MAX]; /* rsrc fork filename */ /* construct the resource full path */ htype = get_hfs_rname(whole_path, short_name, rsrc_path); /* check we can read the resouce fork */ if (htype) { struct stat rstatbuf, rlstatbuf; /* some further checks on the file */ status = stat_filter(rsrc_path, &rstatbuf); lstatus = lstat_filter(rsrc_path, &rlstatbuf); /* if (!status && !lstatus && S_ISREG(rlstatbuf.st_mode)*/ /* && rlstatbuf.st_size > (off_t)0) { */ if (!status && !lstatus && S_ISREG(rstatbuf.st_mode) && rstatbuf.st_size > (off_t)0) { /* * have a resource file - insert it into the * current directory but flag that we have a * resource fork */ insert_file_entry(this_dir, rsrc_path, short_name, htype); } } } #endif /* APPLE_HYB */ s_entry = (struct directory_entry *) e_malloc(sizeof (struct directory_entry)); /* memset the whole struct, not just the isorec.extent part JCP */ memset(s_entry, 0, sizeof (struct directory_entry)); s_entry->next = this_dir->contents; /* memset(s_entry->isorec.extent, 0, 8); */ this_dir->contents = s_entry; deep_flag = 0; s_entry->table = NULL; s_entry->name = strdup(short_name); s_entry->whole_name = strdup(whole_path); s_entry->de_flags = 0; /* * If the current directory is hidden, then hide all it's members * otherwise check if this entry needs to be hidden as well */ if (this_dir->dir_flags & INHIBIT_ISO9660_ENTRY) { s_entry->de_flags |= INHIBIT_ISO9660_ENTRY; } else if (strcmp(short_name, ".") != 0 && strcmp(short_name, "..") != 0) { if (i_matches(short_name) || i_matches(whole_path)) { if (verbose > 1) { fprintf(stderr, "Hidden from ISO9660 tree: %s\n", whole_path); } s_entry->de_flags |= INHIBIT_ISO9660_ENTRY; } if (h_matches(short_name) || h_matches(whole_path)) { if (verbose > 1) { fprintf(stderr, "Hidden ISO9660 attribute: %s\n", whole_path); } s_entry->de_flags |= HIDDEN_FILE; } } if (this_dir != reloc_dir && this_dir->dir_flags & INHIBIT_JOLIET_ENTRY) { s_entry->de_flags |= INHIBIT_JOLIET_ENTRY; } else if (strcmp(short_name, ".") != 0 && strcmp(short_name, "..") != 0) { if (j_matches(short_name) || j_matches(whole_path)) { if (verbose > 1) { fprintf(stderr, "Hidden from Joliet tree: %s\n", whole_path); } s_entry->de_flags |= INHIBIT_JOLIET_ENTRY; } } #ifdef SORTING /* inherit any sort weight from parent directory */ s_entry->sort = this_dir->sort; #ifdef DVD_VIDEO /* * No use at all to do a sort if we don't make a dvd video/audio */ /* * Assign special weights to VIDEO_TS and AUDIO_TS files. * This can't be done with sort_matches for two reasons: * first, we need to match against the destination (DVD) * path rather than the source path, and second, there are * about 2400 different file names to check, each needing * a different priority, and adding that many patterns to * sort_matches would slow things to a crawl. */ if (dvd_video) { s_entry->sort = assign_dvd_weights(s_entry->name, this_dir, s_entry->sort); /* turn on sorting if necessary, regardless of cmd-line options */ if ((s_entry->sort != this_dir->sort) && do_sort == 0) do_sort++; } #endif /* see if this entry should have a new weighting */ if (do_sort && strcmp(short_name, ".") != 0 && strcmp(short_name, "..") != 0) { s_entry->sort = sort_matches(whole_path, s_entry->sort); } #endif /* SORTING */ s_entry->filedir = this_dir; s_entry->isorec.flags[0] = ISO_FILE; if (s_entry->de_flags & HIDDEN_FILE) s_entry->isorec.flags[0] |= ISO_EXISTENCE; s_entry->isorec.ext_attr_length[0] = 0; iso9660_date(s_entry->isorec.date, statbuf.st_mtime); s_entry->isorec.file_unit_size[0] = 0; s_entry->isorec.interleave[0] = 0; #ifdef APPLE_HYB if (apple_both && !x_hfs) { s_entry->hfs_ent = NULL; s_entry->assoc = NULL; s_entry->hfs_off = (off_t)0; s_entry->hfs_type = htype; if (have_rsrc) { /* associated (rsrc) file */ s_entry->isorec.flags[0] |= ISO_ASSOCIATED; /* set the type of HFS file */ s_entry->hfs_type = have_rsrc; /* * don't want the rsrc file to be included in any * Joliet tree */ s_entry->de_flags |= INHIBIT_JOLIET_ENTRY; } else if (s_entry->next) { /* * if previous entry is an associated file, * then "link" it to this file i.e. we have a * data/resource pair */ if (s_entry->next->isorec.flags[0] & ISO_ASSOCIATED) { s_entry->assoc = s_entry->next; /* share the same HFS parameters */ s_entry->hfs_ent = s_entry->next->hfs_ent; s_entry->hfs_type = s_entry->next->hfs_type; } } /* allocate HFS entry if required */ if (apple_both && strcmp(short_name, ".") && strcmp(short_name, "..")) { if (!s_entry->hfs_ent) { hfsdirent *hfs_ent; hfs_ent = (hfsdirent *) e_malloc(sizeof (hfsdirent)); /* fill in the defaults */ memset(hfs_ent, 0, sizeof (hfsdirent)); s_entry->hfs_ent = hfs_ent; } /* * the resource fork is processed first, but the * data fork's time info is used in preference * i.e. time info is set from the resource fork * initially, then it is set from the data fork */ if (have_rsrc) { /* set rsrc size */ s_entry->hfs_ent->u.file.rsize = lstatbuf.st_size; /* * this will be overwritten - but might as * well set it here ... */ s_entry->hfs_ent->crdate = lstatbuf.st_ctime; s_entry->hfs_ent->mddate = lstatbuf.st_mtime; } else { /* set data size */ s_entry->hfs_ent->u.file.dsize = lstatbuf.st_size; s_entry->hfs_ent->crdate = lstatbuf.st_ctime; s_entry->hfs_ent->mddate = lstatbuf.st_mtime; } } } #endif /* APPLE_HYB */ if (strcmp(short_name, ".") == 0) { this_dir->dir_flags |= DIR_HAS_DOT; } if (strcmp(short_name, "..") == 0) { this_dir->dir_flags |= DIR_HAS_DOTDOT; } if (this_dir->parent && this_dir->parent == reloc_dir && strcmp(short_name, "..") == 0) { s_entry->inode = UNCACHED_INODE; s_entry->dev = (dev_t) UNCACHED_DEVICE; deep_flag = NEED_PL; } else #ifdef APPLE_HYB if (have_rsrc) { /* don't want rsrc files to be cached */ s_entry->inode = UNCACHED_INODE; s_entry->dev = (dev_t) UNCACHED_DEVICE; } else #endif /* APPLE_HYB */ { s_entry->inode = STAT_INODE(statbuf); s_entry->dev = statbuf.st_dev; } set_723(s_entry->isorec.volume_sequence_number, volume_sequence_number); iso9660_file_length(short_name, s_entry, S_ISDIR(statbuf.st_mode)); s_entry->rr_attr_size = 0; s_entry->total_rr_attr_size = 0; s_entry->rr_attributes = NULL; /* Directories are assigned sizes later on */ if (!S_ISDIR(statbuf.st_mode)) { if (S_ISCHR(lstatbuf.st_mode) || S_ISBLK(lstatbuf.st_mode) || S_ISFIFO(lstatbuf.st_mode) || S_ISSOCK(lstatbuf.st_mode) || S_ISLNK(lstatbuf.st_mode)) { s_entry->size = (off_t)0; statbuf.st_size = (off_t)0; } else { s_entry->size = statbuf.st_size; } set_733((char *) s_entry->isorec.size, statbuf.st_size); s_entry->realsize = statbuf.st_size; } else { s_entry->isorec.flags[0] |= ISO_DIRECTORY; } #ifdef APPLE_HYB /* if the directory is HFS excluded, then we don't have an hfs_ent */ if (apple_both && s_entry->hfs_ent && (s_entry->isorec.flags[0] & ISO_DIRECTORY)) { /* get the Mac directory name */ get_hfs_dir(whole_path, short_name, s_entry); /* if required, set ISO directory name from HFS name */ if (use_mac_name) iso9660_file_length(s_entry->hfs_ent->name, s_entry, 1); } #endif /* APPLE_HYB */ if (strcmp(short_name, ".") != 0 && strcmp(short_name, "..") != 0 && S_ISDIR(statbuf.st_mode) && this_dir->depth > RR_relocation_depth) { struct directory *child; if (!reloc_dir) generate_reloc_directory(); /* * Replicate the entry for this directory. The old one will * stay where it is, and it will be neutered so that it no * longer looks like a directory. The new one will look like * a directory, and it will be put in the reloc_dir. */ s_entry1 = (struct directory_entry *) e_malloc(sizeof (struct directory_entry)); memcpy(s_entry1, s_entry, sizeof (struct directory_entry)); s_entry1->table = NULL; s_entry1->name = strdup(this_dir->contents->name); s_entry1->whole_name = strdup(this_dir->contents->whole_name); s_entry1->next = reloc_dir->contents; reloc_dir->contents = s_entry1; s_entry1->priority = 32768; s_entry1->parent_rec = this_dir->contents; set_723(s_entry1->isorec.volume_sequence_number, volume_sequence_number); deep_flag = NEED_RE; if (use_XA || use_RockRidge) { generate_xa_rr_attributes(whole_path, short_name, s_entry1, &statbuf, &lstatbuf, deep_flag); } deep_flag = 0; /* * We need to set this temporarily so that the parent to this * is correctly determined. */ s_entry1->filedir = reloc_dir; child = find_or_create_directory(reloc_dir, whole_path, s_entry1, 0, NULL); /* if (!no_scandir)*/ if (!0) scan_directory_tree(child, whole_path, s_entry1); s_entry1->filedir = this_dir; statbuf.st_size = (off_t)0; statbuf.st_mode &= 0777; set_733((char *) s_entry->isorec.size, 0); s_entry->realsize=0; s_entry->size = 0; s_entry->isorec.flags[0] = ISO_FILE; s_entry->inode = UNCACHED_INODE; s_entry->de_flags |= RELOCATED_DIRECTORY; deep_flag = NEED_CL; } if (generate_tables && strcmp(s_entry->name, ".") != 0 && strcmp(s_entry->name, "..") != 0) { char buffer[SECTOR_SIZE]; int nchar; switch (lstatbuf.st_mode & S_IFMT) { case S_IFDIR: sprintf(buffer, "D\t%s\n", s_entry->name); break; /* * extra for WIN32 - if it doesn't have the major/minor defined, then * S_IFBLK and S_IFCHR type files are unlikely to exist anyway ... * code similar to that in rock.c */ #if 0 /* * Use the device handling code from */ #ifndef major #define major(dev) (sizeof (dev_t) <= 2 ? ((dev) >> 8) : \ (sizeof (dev_t) <= 4 ? (((dev) >> 8) >> 8) : \ (((dev) >> 16) >> 16))) #define minor(dev) (sizeof (dev_t) <= 2 ? (dev) & 0xff : \ (sizeof (dev_t) <= 4 ? (dev) & 0xffff : \ (dev) & 0xffffffff)) #endif #endif #ifdef S_IFBLK case S_IFBLK: sprintf(buffer, "B\t%s\t%lu %lu\n", s_entry->name, (unsigned long) major(statbuf.st_rdev), (unsigned long) minor(statbuf.st_rdev)); break; #endif #ifdef S_IFIFO case S_IFIFO: sprintf(buffer, "P\t%s\n", s_entry->name); break; #endif #ifdef S_IFCHR case S_IFCHR: sprintf(buffer, "C\t%s\t%lu %lu\n", s_entry->name, (unsigned long) major(statbuf.st_rdev), (unsigned long) minor(statbuf.st_rdev)); break; #endif #ifdef S_IFLNK case S_IFLNK: #ifdef HAVE_READLINK nchar = readlink(whole_path, (char *) symlink_buff, sizeof (symlink_buff)-1); #else nchar = -1; #endif symlink_buff[nchar < 0 ? 0 : nchar] = 0; sprintf(buffer, "L\t%s\t%s\n", s_entry->name, symlink_buff); break; #endif #ifdef S_IFSOCK case S_IFSOCK: sprintf(buffer, "S\t%s\n", s_entry->name); break; #endif case S_IFREG: default: sprintf(buffer, "F\t%s\n", s_entry->name); break; }; s_entry->table = strdup(buffer); } if (S_ISDIR(statbuf.st_mode)) { int dflag; if (strcmp(short_name, ".") != 0 && strcmp(short_name, "..") != 0) { struct directory *child; child = find_or_create_directory(this_dir, whole_path, s_entry, 1, NULL); if (no_scandir) dflag = 1; else dflag = scan_directory_tree(child, whole_path, s_entry); if (!dflag) { lstatbuf.st_mode = (lstatbuf.st_mode & ~S_IFMT) | S_IFREG; if (child->contents == NULL) { delete_directory(this_dir, child); } } } /* If unable to scan directory, mark this as a non-directory */ } if (use_RockRidge && this_dir == root && strcmp(s_entry->name, ".") == 0) { deep_flag |= NEED_CE | NEED_SP; /* For extension record */ } /* Now figure out how much room this file will take in the directory */ #ifdef APPLE_HYB /* if the file is HFS excluded, then we don't have an hfs_ent */ if (apple_both && !have_rsrc && s_entry->hfs_ent) { if (S_ISREG(lstatbuf.st_mode)) { /* it's a regular file */ /* fill in the rest of the HFS entry */ get_hfs_info(whole_path, short_name, s_entry); /* if required, set ISO directory name from HFS name */ if (use_mac_name) iso9660_file_length(s_entry->hfs_ent->name, s_entry, 0); /* print details about the HFS file */ if (verbose > 2) print_hfs_info(s_entry); /* * copy the new ISO9660 name to the rsrc fork * - if it exists */ if (s_entry->assoc) strcpy(s_entry->assoc->isorec.name, s_entry->isorec.name); /* * we can't handle hard links in the hybrid case, so we * "uncache" the file. The downside to this is that * hard linked files are added to the output image * more than once (we've already done this for rsrc * files) */ if (apple_hyb) { s_entry->inode = UNCACHED_INODE; s_entry->dev = (dev_t) UNCACHED_DEVICE; } } else if (!(s_entry->isorec.flags[0] & ISO_DIRECTORY)) { /* not a directory .. */ /* * no mac equivalent, so ignore - have to be careful * here, the hfs_ent may be also be for a relocated * directory */ if (s_entry->hfs_ent && !(s_entry->de_flags & RELOCATED_DIRECTORY)) free(s_entry->hfs_ent); s_entry->hfs_ent = NULL; } /* * if the rsrc size is zero, then we don't need the entry, so * we might as well delete it - this will only happen if we * didn't know the rsrc size from the rsrc file size */ if (s_entry->assoc && s_entry->assoc->size == 0) delete_rsrc_ent(s_entry); } if (apple_ext && s_entry->assoc) { /* need Apple extensions for the resource fork as well */ generate_xa_rr_attributes(whole_path, short_name, s_entry->assoc, &statbuf, &lstatbuf, deep_flag); } /* leave out resource fork for the time being */ /* * XXX This is most likely wrong and should just be: * XXX if (use_XA || use_RockRidge) { */ /* if ((use_XA || use_RockRidge) && !have_rsrc) {*/ if (use_XA || use_RockRidge) { #else if (use_XA || use_RockRidge) { #endif /* APPLE_HYB */ generate_xa_rr_attributes(whole_path, short_name, s_entry, &statbuf, &lstatbuf, deep_flag); } return (1); } void generate_iso9660_directories(struct directory *node, FILE *outfile) { struct directory *dpnt; dpnt = node; while (dpnt) { if (dpnt->extent > session_start) { generate_one_directory(dpnt, outfile); } if (dpnt->subdir) generate_iso9660_directories(dpnt->subdir, outfile); dpnt = dpnt->next; } } /* * Function: find_or_create_directory * * Purpose: Locate a directory entry in the tree, create if needed. * If a directory is created and stat_template is non-null, * create the directory with ownership, permissions, etc., * from stat_template, otherwise use fallback defaults. * * Arguments: parent & de are never NULL at the same time. */ struct directory * find_or_create_directory(struct directory *parent, const char *path, struct directory_entry *de, int flag, struct stat *stat_template) { struct directory *dpnt; struct directory_entry *orig_de; struct directory *next_brother; const char *cpnt; const char *pnt; struct stat my_statbuf; orig_de = de; /* * XXX It seems that the tree that has been read from the * XXX previous session does not carry whole_name entries. * XXX We provide a hack in multi.c:find_or_create_directory() * XXX that should be removed when a reasonable method could * XXX be found. */ if (path == NULL) { fprintf(stderr, "Warning: missing whole name for: '%s'\n", de->name); path = de->name; } pnt = strrchr(path, PATH_SEPARATOR); if (pnt == NULL) { pnt = path; } else { pnt++; } if (parent != NULL) { dpnt = parent->subdir; while (dpnt) { /* * Weird hack time - if there are two directories by * the same name in the reloc_dir, they are not * treated as the same thing unless the entire path * matches completely. */ if (flag && strcmp(dpnt->de_name, pnt) == 0) { return (dpnt); } dpnt = dpnt->next; } } /* * We don't know if we have a valid directory entry for this one yet. * If not, we need to create one. */ if (de == NULL) { de = (struct directory_entry *) e_malloc(sizeof (struct directory_entry)); memset(de, 0, sizeof (struct directory_entry)); de->next = parent->contents; parent->contents = de; de->name = strdup(pnt); de->whole_name = strdup(path); de->filedir = parent; de->isorec.flags[0] = ISO_DIRECTORY; de->priority = 32768; de->inode = UNCACHED_INODE; de->dev = (dev_t) UNCACHED_DEVICE; set_723(de->isorec.volume_sequence_number, volume_sequence_number); iso9660_file_length(pnt, de, 1); /* * If we were given a stat template, use it for * ownership/permissions, otherwise use fallback defaults. */ init_fstatbuf(); if (stat_template) { my_statbuf = *stat_template; } else { my_statbuf = fstatbuf; /* defaults */ my_statbuf.st_mode = new_dir_mode; } my_statbuf.st_mode &= ~S_IFMT; /* zero out file type */ my_statbuf.st_mode |= S_IFDIR; /* force to be a directory */ my_statbuf.st_nlink = 2; /* * Apply attributes from my_statbuf to the new directory. */ if (use_XA || use_RockRidge) { generate_xa_rr_attributes("", (char *) pnt, de, &my_statbuf, &my_statbuf, 0); } iso9660_date(de->isorec.date, fstatbuf.st_mtime); #ifdef APPLE_HYB if (apple_both) { /* give the directory an HFS entry */ hfsdirent *hfs_ent; hfs_ent = (hfsdirent *) e_malloc(sizeof (hfsdirent)); /* fill in the defaults */ memset(hfs_ent, 0, sizeof (hfsdirent)); hfs_ent->crdate = my_statbuf.st_ctime; hfs_ent->mddate = my_statbuf.st_mtime; de->hfs_ent = hfs_ent; /* get the Mac directory name */ get_hfs_dir((char *) path, (char *) pnt, de); } #endif /* APPLE_HYB */ } /* * If we don't have a directory for this one yet, then allocate it now, * and patch it into the tree in the appropriate place. */ dpnt = (struct directory *) e_malloc(sizeof (struct directory)); memset(dpnt, 0, sizeof (struct directory)); dpnt->next = NULL; dpnt->subdir = NULL; dpnt->self = de; dpnt->contents = NULL; dpnt->whole_name = strdup(path); cpnt = strrchr(path, PATH_SEPARATOR); if (cpnt) cpnt++; else cpnt = path; dpnt->de_name = strdup(cpnt); dpnt->size = 0; dpnt->extent = 0; dpnt->jextent = 0; dpnt->jsize = 0; #ifdef APPLE_HYB dpnt->hfs_ent = de->hfs_ent; #endif /* APPLE_HYB */ if (orig_de == NULL) { struct stat xstatbuf; struct stat parent_statbuf; int sts; /* * Now add a . and .. entry in the directory itself. This is a * little tricky - if the real directory exists, we need to * stat it first. Otherwise, we use the fictitious fstatbuf * which points to the time at which genisoimage was started. */ if (parent == NULL || parent->whole_name[0] == '\0') sts = -1; else sts = stat_filter(parent->whole_name, &parent_statbuf); if (sts != 0) { parent_statbuf = fstatbuf; parent_statbuf.st_mode = new_dir_mode | S_IFDIR; parent_statbuf.st_nlink = 2; } if (debug && parent) { fprintf(stderr, "stat parent->whole_name: '%s' -> %d.\n", parent->whole_name, sts); } attach_dot_entries(dpnt, &my_statbuf, &parent_statbuf); } if (!parent || parent == root) { if (!root) { root = dpnt; /* First time through for root */ /* directory only */ root->depth = 0; root->parent = root; } else { dpnt->depth = 1; if (!root->subdir) { root->subdir = dpnt; } else { next_brother = root->subdir; while (next_brother->next) next_brother = next_brother->next; next_brother->next = dpnt; } dpnt->parent = parent; } } else { /* Come through here for normal traversal of tree */ #ifdef DEBUG fprintf(stderr, "%s(%d) ", path, dpnt->depth); #endif if (parent->depth > RR_relocation_depth) { /* * XXX to prevent this, we would need to add * XXX support for RR directory relocation * XXX to find_or_create_directory() */ #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Directories too deep for '%s' (%d) max is %d.\n", path, parent->depth, RR_relocation_depth); #else fprintf(stderr, "Directories too deep for '%s' (%d) max is %d.\n", path, parent->depth, RR_relocation_depth); exit(1); #endif } dpnt->parent = parent; dpnt->depth = parent->depth + 1; if (!parent->subdir) { parent->subdir = dpnt; } else { next_brother = parent->subdir; while (next_brother->next) next_brother = next_brother->next; next_brother->next = dpnt; } } return (dpnt); } /* * Function: delete_directory * * Purpose: Locate a directory entry in the tree, create if needed. * * Arguments: */ static void delete_directory(parent, child) struct directory *parent; struct directory *child; { struct directory *tdir; if (child->contents != NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Unable to delete non-empty directory\n"); #else fprintf(stderr, "Unable to delete non-empty directory\n"); exit(1); #endif } free(child->whole_name); child->whole_name = NULL; free(child->de_name); child->de_name = NULL; #ifdef APPLE_HYB if (apple_both && child->hfs_ent) free(child->hfs_ent); #endif /* APPLE_HYB */ if (parent->subdir == child) { parent->subdir = child->next; } else { for (tdir = parent->subdir; tdir->next != NULL; tdir = tdir->next) { if (tdir->next == child) { tdir->next = child->next; break; } } if (tdir == NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Unable to locate child directory in parent list\n"); #else fprintf(stderr, "Unable to locate child directory in parent list\n"); exit(1); #endif } } free(child); } int sort_tree(struct directory *node) { struct directory *dpnt; int ret = 0; dpnt = node; while (dpnt) { ret = sort_n_finish(dpnt); if (ret) { break; } if (dpnt->subdir) sort_tree(dpnt->subdir); dpnt = dpnt->next; } return (ret); } void dump_tree(struct directory *node) { struct directory *dpnt; dpnt = node; while (dpnt) { fprintf(stderr, "%4d %5d %s\n", dpnt->extent, dpnt->size, dpnt->de_name); if (dpnt->subdir) dump_tree(dpnt->subdir); dpnt = dpnt->next; } } void update_nlink_field(struct directory *node) { struct directory *dpnt; struct directory *xpnt; struct directory_entry *s_entry; int i; dpnt = node; while (dpnt) { if (dpnt->dir_flags & INHIBIT_ISO9660_ENTRY) { dpnt = dpnt->next; continue; } /* * First, count up the number of subdirectories this guy has. */ for (i = 0, xpnt = dpnt->subdir; xpnt; xpnt = xpnt->next) if ((xpnt->dir_flags & INHIBIT_ISO9660_ENTRY) == 0) i++; /* * Next check to see if we have any relocated directories in * this directory. The nlink field will include these as * real directories when they are properly relocated. * In the non-rockridge disk, the relocated entries appear as * zero length files. */ for (s_entry = dpnt->contents; s_entry; s_entry = s_entry->next) { if ((s_entry->de_flags & RELOCATED_DIRECTORY) != 0 && (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) == 0) { i++; } } /* Now update the field in the Rock Ridge entry. */ update_nlink(dpnt->self, i + 2); /* Update the '.' entry for this directory. */ update_nlink(dpnt->contents, i + 2); /* Update all of the '..' entries that point to this guy. */ for (xpnt = dpnt->subdir; xpnt; xpnt = xpnt->next) update_nlink(xpnt->contents->next, i + 2); if (dpnt->subdir) update_nlink_field(dpnt->subdir); dpnt = dpnt->next; } } /* * something quick and dirty to locate a file given a path * recursively walks down path in filename until it finds the * directory entry for the desired file */ struct directory_entry * search_tree_file(struct directory *node, char *filename) { struct directory_entry *depnt; struct directory *dpnt; char *p1; char *rest; char *subdir; /* strip off next directory name from filename */ subdir = strdup(filename); if ((p1 = strchr(subdir, '/')) == subdir) { fprintf(stderr, "call to search_tree_file with an absolute path, stripping\n"); fprintf(stderr, "initial path separator. Hope this was intended...\n"); memmove(subdir, subdir + 1, strlen(subdir) - 1); p1 = strchr(subdir, '/'); } /* do we need to find a subdirectory */ if (p1) { *p1 = '\0'; #ifdef DEBUG_TORITO fprintf(stderr, "Looking for subdir called %s\n", p1); #endif rest = p1 + 1; #ifdef DEBUG_TORITO fprintf(stderr, "Remainder of path name is now %s\n", rest); #endif dpnt = node->subdir; while (dpnt) { #ifdef DEBUG_TORITO fprintf(stderr, "%4d %5d %s\n", dpnt->extent, dpnt->size, dpnt->de_name); #endif if (strcmp(subdir, dpnt->de_name) == 0) { #ifdef DEBUG_TORITO fprintf(stderr, "Calling next level with filename = %s", rest); #endif return (search_tree_file(dpnt, rest)); } dpnt = dpnt->next; } /* if we got here means we couldnt find the subdir */ return (NULL); } else { /* look for a normal file now */ depnt = node->contents; while (depnt) { #ifdef DEBUG_TORITO fprintf(stderr, "%4d %5d %s\n", depnt->isorec.extent, depnt->size, depnt->name); #endif if (strcmp(filename, depnt->name) == 0) { #ifdef DEBUG_TORITO fprintf(stderr, "Found our file %s", filename); #endif return (depnt); } depnt = depnt->next; } /* if we got here means we couldnt find the subdir */ return (NULL); } #ifdef ERIC_FUN fprintf(stderr, "We cant get here in search_tree_file :-/ \n"); #endif } void init_fstatbuf() { time_t current_time; if (fstatbuf.st_ctime == 0) { time(¤t_time); if (rationalize_uid) fstatbuf.st_uid = uid_to_use; else fstatbuf.st_uid = getuid(); if (rationalize_gid) fstatbuf.st_gid = gid_to_use; else fstatbuf.st_gid = getgid(); fstatbuf.st_ctime = current_time; fstatbuf.st_mtime = current_time; fstatbuf.st_atime = current_time; } } cdrkit-1.1.11/genisoimage/genisoimage.c0000644000372500001440000032002511417055101017043 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* * * Patched version with stuff from the Debian's cdrtools. * Replaced various warnings/disclaimers with more simple ones. * * Eduard Bloch */ /* @(#)mkisofs.c 1.167 06/01/30 joerg */ /* Parts from @(#)mkisofs.c 1.206 07/02/26 joerg */ /* * Program genisoimage.c - generate iso9660 filesystem based upon directory * tree on hard disk. * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999,2000-2004 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 22/2/2000 */ #include #include "genisoimage.h" #include #include #include #include #include "match.h" #include "exclude.h" #include /* For UNICODE translation */ #include #ifdef UDF #include "udf.h" #endif #ifdef NEED_O_BINARY #include /* for setmode() prototype */ #endif #ifdef HAVE_GETOPT_H #include #else #include "getopt.h" extern int optind; extern char *optarg; #endif #ifdef VMS #include "vms.h" #endif #ifdef no_more_needed #ifdef __NetBSD__ #include #endif #endif /* no_more_needed */ #ifdef USE_ICONV #include #include #endif struct directory *root = NULL; int path_ind; char version_string[] = "genisoimage " CDRKIT_VERSION; char *outfile; FILE *discimage; unsigned int next_extent = 0; unsigned int last_extent = 0; unsigned int session_start = 0; unsigned int path_table_size = 0; unsigned int path_table[4] = {0, }; unsigned int path_blocks = 0; unsigned int jpath_table_size = 0; unsigned int jpath_table[4] = {0, }; unsigned int jpath_blocks = 0; struct iso_directory_record root_record; struct iso_directory_record jroot_record; char *extension_record = NULL; int extension_record_extent = 0; int extension_record_size = 0; /* These variables are associated with command line options */ int check_oldnames = 0; int check_session = 0; int use_eltorito = 0; int hard_disk_boot = 0; int not_bootable = 0; int no_emul_boot = 0; int load_addr = 0; int load_size = 0; int boot_info_table = 0; int use_alphaboot = 0; int use_sparcboot = 0; int use_hppaboot = 0; int use_mipsboot = 0; int use_mipselboot = 0; int use_sunx86boot = 0; int use_genboot = 0; int use_RockRidge = 0; int use_XA = 0; int osecsize = 0; /* Output-sector size, 0 means default secsize 2048 */ int use_Joliet = 0; int jlen = JMAX; /* maximum Joliet file name length */ int verbose = 1; int debug = 0; int gui = 0; int all_files = 1; /* New default is to include all files */ int follow_links = 0; #ifdef IS_CYGWIN int cache_inodes = 0; /* Do not cache inodes on Cygwin by default */ #else int cache_inodes = 1; /* Cache inodes if OS has unique inodes */ #endif int rationalize = 0; int rationalize_uid = 0; int rationalize_gid = 0; int rationalize_filemode = 0; int rationalize_dirmode = 0; uid_t uid_to_use = 0; /* when rationalizing uid */ gid_t gid_to_use = 0; /* when rationalizing gid */ int filemode_to_use = 0; /* if non-zero, when rationalizing file mode */ int dirmode_to_use = 0; /* if non-zero, when rationalizing dir mode */ int new_dir_mode = 0555; int generate_tables = 0; int dopad = 1; /* Now default to do padding */ int print_size = 0; int split_output = 0; char *icharset = NULL; /* input charset to convert to UNICODE */ char *ocharset = NULL; /* output charset to convert from UNICODE */ char *preparer = PREPARER_DEFAULT; char *publisher = PUBLISHER_DEFAULT; char *appid = APPID_DEFAULT; char *copyright = COPYRIGHT_DEFAULT; char *biblio = BIBLIO_DEFAULT; char *abstract = ABSTRACT_DEFAULT; char *volset_id = VOLSET_ID_DEFAULT; char *volume_id = VOLUME_ID_DEFAULT; char *system_id = SYSTEM_ID_DEFAULT; char *boot_catalog = BOOT_CATALOG_DEFAULT; char *boot_image = BOOT_IMAGE_DEFAULT; char *genboot_image = BOOT_IMAGE_DEFAULT; int ucs_level = 3; /* We now have Unicode tables so use level 3 */ int volume_set_size = 1; int volume_sequence_number = 1; struct eltorito_boot_entry_info *first_boot_entry = NULL; struct eltorito_boot_entry_info *last_boot_entry = NULL; struct eltorito_boot_entry_info *current_boot_entry = NULL; int use_graft_ptrs; /* Use graft points */ int jhide_trans_tbl; /* Hide TRANS.TBL from Joliet tree */ int hide_rr_moved; /* Name RR_MOVED .rr_moved in Rock Ridge tree */ int omit_period = 0; /* Violates iso9660, but these are a pain */ int transparent_compression = 0; /* So far only works with linux */ int omit_version_number = 0; /* May violate iso9660, but noone uses vers */ int no_rr = 0; /* Do not use RR attributes from old session */ int force_rr = 0; /* Force to use RR attributes from old session */ Uint RR_relocation_depth = 6; /* Violates iso9660, but most systems work */ int iso9660_level = 1; int iso9660_namelen = LEN_ISONAME; /* 31 characters, may be set to 37 */ int full_iso9660_filenames = 0; /* Full 31 character iso9660 filenames */ int relaxed_filenames = 0; /* For Amiga. Disc will not work with DOS */ int allow_lowercase = 0; /* Allow lower case letters */ int allow_multidot = 0; /* Allow more than on dot in filename */ int iso_translate = 1; /* 1 == enables '#', '-' and '~' removal */ int allow_leading_dots = 0; /* DOS cannot read names with leading dots */ int allow_limited_size = 0; /* Let the user to allow the trick explicitely */ #ifdef VMS int use_fileversion = 1; /* Use file version # from filesystem */ #else int use_fileversion = 0; /* Use file version # from filesystem */ #endif int split_SL_component = 1; /* circumvent a bug in the SunOS driver */ int split_SL_field = 1; /* circumvent a bug in the SunOS */ char *trans_tbl = "TRANS.TBL"; /* default name for translation table */ int stream_media_size = 0; /* # of blocks on the media */ char *stream_filename = NULL; /* Stream file, 0 to use default STREAM.IMG */ #ifdef APPLE_HYB int apple_hyb = 0; /* create HFS hybrid flag */ int apple_ext = 0; /* create HFS extensions flag */ int apple_both = 0; /* common flag (for above) */ int hfs_extra = 0; /* extra HFS blocks added to end of ISO vol */ int use_mac_name = 0; /* use Mac name for ISO/Joliet/RR flag */ hce_mem *hce; /* libhfs/genisoimage extras */ char *hfs_boot_file = 0; /* name of HFS boot file */ int gen_pt = 0; /* generate HFS partition table */ char *autoname = 0; /* AutoStart filename */ char *magic_filename = 0; /* name of magic file */ int probe = 0; /* search files for HFS/Unix type */ int nomacfiles = 0; /* don't look for Mac/Unix files */ int hfs_select = 0; /* Mac/Unix types to select */ int create_dt = 1; /* create the Desktp files */ int afe_size = 0; /* Apple File Exchange block size */ int hfs_last = MAG_LAST; /* process magic file after map file */ char *deftype = APPLE_TYPE_DEFAULT; /* default Apple TYPE */ char *defcreator = APPLE_CREATOR_DEFAULT; /* default Apple CREATOR */ char *hfs_volume_id = NULL; /* HFS volume ID */ int icon_pos = 0; /* Keep icon position */ char *hfs_icharset = NULL; /* input HFS charset name */ char *hfs_ocharset = NULL; /* output HFS charset name */ int hfs_lock = 1; /* lock HFS volume (read-only) */ char *hfs_bless = NULL; /* name of folder to 'bless' (System Folder) */ char *hfs_parms = NULL; /* low level HFS parameters */ #ifdef PREP_BOOT char *prep_boot_image[4]; int use_prep_boot = 0; int use_chrp_boot = 0; #endif /* PREP_BOOT */ #endif /* APPLE_HYB */ #ifdef UDF int use_udf = 0; #endif #ifdef DVD_VIDEO int dvd_video = 0; #endif #ifdef SORTING int do_sort = 0; /* sort file data */ #endif /* SORTING */ #ifdef USE_ICONV int iconv_possible; #endif struct unls_table *in_nls = NULL; /* input UNICODE conversion table */ struct unls_table *out_nls = NULL; /* output UNICODE conversion table */ #ifdef APPLE_HYB struct unls_table *hfs_inls = NULL; /* input HFS UNICODE conversion table */ struct unls_table *hfs_onls = NULL; /* output HFS UNICODE conversion table */ #endif /* APPLE_HYB */ struct rcopts { char *tag; char **variable; }; struct rcopts rcopt[] = { {"PREP", &preparer}, {"PUBL", &publisher}, {"APPI", &appid}, {"COPY", ©right}, {"BIBL", &biblio}, {"ABST", &abstract}, {"VOLS", &volset_id}, {"VOLI", &volume_id}, {"SYSI", &system_id}, #ifdef APPLE_HYB {"HFS_TYPE", &deftype}, {"HFS_CREATOR", &defcreator}, #endif /* APPLE_HYB */ {NULL, NULL} }; char *merge_warn_msg=0; /* use as pointer and boolean */ /* * In case it isn't obvious, the option handling code was ripped off * from GNU-ld. */ struct ld_option { /* The long option information. */ struct option opt; /* The short option with the same meaning ('\0' if none). */ char shortopt; /* The name of the argument (NULL if none). */ const char *arg; /* * The documentation string. If this is NULL, this is a synonym for * the previous option. */ const char *doc; enum { /* Use one dash before long option name. */ ONE_DASH, /* Use two dashes before long option name. */ TWO_DASHES, /* Don't mention this option in --help output. */ NO_HELP } control; }; /* * Codes used for the long options with no short synonyms. Note that all these * values must not be ASCII or EBCDIC. */ #define OPTION_HELP 1000 #define OPTION_QUIET 1001 #define OPTION_NOSPLIT_SL_COMPONENT 1002 #define OPTION_NOSPLIT_SL_FIELD 1003 #define OPTION_PRINT_SIZE 1004 #define OPTION_SPLIT_OUTPUT 1005 #define OPTION_ABSTRACT 1006 #define OPTION_BIBLIO 1007 #define OPTION_COPYRIGHT 1008 #define OPTION_SYSID 1009 #define OPTION_VOLSET 1010 #define OPTION_VOLSET_SIZE 1011 #define OPTION_VOLSET_SEQ_NUM 1012 #define OPTION_I_HIDE 1013 #define OPTION_J_HIDE 1014 #define OPTION_LOG_FILE 1015 #define OPTION_PVERSION 1016 #define OPTION_NOBAK 1017 #define OPTION_SPARCLABEL 1018 #define OPTION_HARD_DISK_BOOT 1019 #define OPTION_NO_EMUL_BOOT 1020 #define OPTION_NO_BOOT 1021 #define OPTION_BOOT_LOAD_ADDR 1022 #define OPTION_BOOT_LOAD_SIZE 1023 #define OPTION_BOOT_INFO_TABLE 1024 #define OPTION_HIDE_TRANS_TBL 1025 #define OPTION_HIDE_RR_MOVED 1026 #define OPTION_GUI 1027 #define OPTION_TRANS_TBL 1028 #define OPTION_P_LIST 1029 #define OPTION_I_LIST 1030 #define OPTION_J_LIST 1031 #define OPTION_X_LIST 1032 #define OPTION_NO_RR 1033 #define OPTION_JCHARSET 1034 #define OPTION_PAD 1035 #define OPTION_H_HIDE 1036 #define OPTION_H_LIST 1037 #define OPTION_CHECK_OLDNAMES 1038 #ifdef SORTING #define OPTION_SORT 1039 #endif /* SORTING */ #define OPTION_UCS_LEVEL 1040 #define OPTION_ISO_TRANSLATE 1041 #define OPTION_ISO_LEVEL 1042 #define OPTION_RELAXED_FILENAMES 1043 #define OPTION_ALLOW_LOWERCASE 1044 #define OPTION_ALLOW_MULTIDOT 1045 #define OPTION_USE_FILEVERSION 1046 #define OPTION_MAX_FILENAMES 1047 #define OPTION_ALT_BOOT 1048 #define OPTION_USE_GRAFT 1049 #define OPTION_INPUT_CHARSET 1050 #define OPTION_OUTPUT_CHARSET 1051 #define OPTION_NOPAD 1052 #define OPTION_UID 1053 #define OPTION_GID 1054 #define OPTION_FILEMODE 1055 #define OPTION_DIRMODE 1056 #define OPTION_NEW_DIR_MODE 1057 #define OPTION_CACHE_INODES 1058 #define OPTION_NOCACHE_INODES 1059 #define OPTION_CHECK_SESSION 1060 #define OPTION_FORCE_RR 1061 #define OPTION_DEBUG 1062 #define OPTION_JLONG 1063 #define OPTION_STREAM_FILE_NAME 1064 #define OPTION_STREAM_CD_SIZE 1065 #define OPTION_XA 1066 #define OPTION_XA_RATIONALIZED 1067 #define OPTION_SUNX86BOOT 1068 #define OPTION_SUNX86LABEL 1069 #define OPTION_ALLOW_LEADING_DOTS 1070 #define OPTION_PUBLISHER 1071 #ifdef JIGDO_TEMPLATE #define OPTION_JTT_OUTPUT 1101 #define OPTION_JTJ_OUTPUT 1102 #define OPTION_JT_MIN_SIZE 1103 #define OPTION_JT_PATH_MAP 1104 #define OPTION_JT_MD5_LIST 1105 #define OPTION_JT_INCLUDE 1106 #define OPTION_JT_EXCLUDE 1107 #define OPTION_JT_COMPRESS_ALGO 1108 #define OPTION_JT_CHECKSUM_ALGO_ISO 1120 #define OPTION_JT_CHECKSUM_ALGO_TMPL 1121 #endif #define OPTION_BOOTALPHA 1200 #define OPTION_HPPA_CMDLINE 1210 #define OPTION_HPPA_KERNEL_32 1211 #define OPTION_HPPA_KERNEL_64 1212 #define OPTION_HPPA_BOOTLOADER 1213 #define OPTION_HPPA_RAMDISK 1214 #define OPTION_BOOTMIPS 1220 #define OPTION_BOOTMIPSEL 1230 #ifdef UDF #define OPTION_UDF 1500 #endif #ifdef DVD_VIDEO #define OPTION_DVD 1501 #endif #ifdef APPLE_HYB #define OPTION_CAP 2000 #define OPTION_NETA 2001 #define OPTION_DBL 2002 #define OPTION_ESH 2003 #define OPTION_FE 2004 #define OPTION_SGI 2005 #define OPTION_MBIN 2006 #define OPTION_SGL 2007 /* aliases */ #define OPTION_USH 2008 #define OPTION_XIN 2009 #define OPTION_DAVE 2010 #define OPTION_SFM 2011 #define OPTION_XDBL 2012 #define OPTION_XHFS 2013 #define OPTION_PROBE 2020 #define OPTION_MACNAME 2021 #define OPTION_NOMACFILES 2022 #define OPTION_BOOT_HFS_FILE 2023 #define OPTION_MAGIC_FILE 2024 #define OPTION_HFS_LIST 2025 #define OPTION_GEN_PT 2026 #define OPTION_CREATE_DT 2027 #define OPTION_HFS_HIDE 2028 #define OPTION_AUTOSTART 2029 #define OPTION_BSIZE 2030 #define OPTION_HFS_VOLID 2031 #define OPTION_PREP_BOOT 2032 #define OPTION_ICON_POS 2033 #define OPTION_HFS_TYPE 2034 #define OPTION_HFS_CREATOR 2035 #define OPTION_ROOT_INFO 2036 #define OPTION_HFS_INPUT_CHARSET 2037 #define OPTION_HFS_OUTPUT_CHARSET 2038 #define OPTION_HFS_UNLOCK 2039 #define OPTION_HFS_BLESS 2040 #define OPTION_HFS_PARMS 2041 #define OPTION_CHRP_BOOT 2042 #define OPTION_RELOC_ROOT 2043 #define OPTION_RELOC_OLD_ROOT 2044 #define OPTION_MAP_FILE 2045 #define OPTION_ALLOW_LIMITED_SIZE 2046 #endif /* APPLE_HYB */ static int save_pname = 0; static const struct ld_option ld_options[] = { {{"nobak", no_argument, NULL, OPTION_NOBAK}, '\0', NULL, "Do not include backup files", ONE_DASH}, {{"no-bak", no_argument, NULL, OPTION_NOBAK}, '\0', NULL, "Do not include backup files", ONE_DASH}, {{"abstract", required_argument, NULL, OPTION_ABSTRACT}, '\0', "FILE", "Set Abstract filename", ONE_DASH}, {{"appid", required_argument, NULL, 'A'}, 'A', "ID", "Set Application ID", ONE_DASH}, {{"biblio", required_argument, NULL, OPTION_BIBLIO}, '\0', "FILE", "Set Bibliographic filename", ONE_DASH}, {{"cache-inodes", no_argument, NULL, OPTION_CACHE_INODES}, '\0', NULL, "Cache inodes (needed to detect hard links)", ONE_DASH}, {{"no-cache-inodes", no_argument, NULL, OPTION_NOCACHE_INODES}, '\0', NULL, "Do not cache inodes (if filesystem has no unique unides)", ONE_DASH}, {{"check-oldnames", no_argument, NULL, OPTION_CHECK_OLDNAMES}, '\0', NULL, "Check all imported ISO9660 names from old session", ONE_DASH}, {{"check-session", required_argument, NULL, OPTION_CHECK_SESSION}, '\0', "FILE", "Check all ISO9660 names from previous session", ONE_DASH}, {{"copyright", required_argument, NULL, OPTION_COPYRIGHT}, '\0', "FILE", "Set Copyright filename", ONE_DASH}, {{"debug", no_argument, NULL, OPTION_DEBUG}, '\0', NULL, "Set debug flag", ONE_DASH}, {{"eltorito-boot", required_argument, NULL, 'b'}, 'b', "FILE", "Set El Torito boot image name", ONE_DASH}, {{"eltorito-alt-boot", no_argument, NULL, OPTION_ALT_BOOT}, '\0', NULL, "Start specifying alternative El Torito boot parameters", ONE_DASH}, {{"sparc-boot", required_argument, NULL, 'B'}, 'B', "FILES", "Set sparc boot image names", ONE_DASH}, {{"sunx86-boot", required_argument, NULL, OPTION_SUNX86BOOT}, '\0', "FILES", "Set sunx86 boot image names", ONE_DASH}, {{"generic-boot", required_argument, NULL, 'G'}, 'G', "FILE", "Set generic boot image name", ONE_DASH}, {{"sparc-label", required_argument, NULL, OPTION_SPARCLABEL}, '\0', "label text", "Set sparc boot disk label", ONE_DASH}, {{"sunx86-label", required_argument, NULL, OPTION_SUNX86LABEL}, '\0', "label text", "Set sunx86 boot disk label", ONE_DASH}, {{"eltorito-catalog", required_argument, NULL, 'c'}, 'c', "FILE", "Set El Torito boot catalog name", ONE_DASH}, {{"cdrecord-params", required_argument, NULL, 'C'}, 'C', "PARAMS", "Magic paramters from cdrecord", ONE_DASH}, {{"omit-period", no_argument, NULL, 'd'}, 'd', NULL, "Omit trailing periods from filenames (violates ISO9660)", ONE_DASH}, {{"dir-mode", required_argument, NULL, OPTION_DIRMODE}, '\0', "mode", "Make the mode of all directories this mode.", ONE_DASH}, {{"disable-deep-relocation", no_argument, NULL, 'D'}, 'D', NULL, "Disable deep directory relocation (violates ISO9660)", ONE_DASH}, {{"file-mode", required_argument, NULL, OPTION_FILEMODE}, '\0', "mode", "Make the mode of all plain files this mode.", ONE_DASH}, {{"follow-links", no_argument, NULL, 'f'}, 'f', NULL, "Follow symbolic links", ONE_DASH}, {{"gid", required_argument, NULL, OPTION_GID}, '\0', "gid", "Make the group owner of all files this gid.", ONE_DASH}, {{"graft-points", no_argument, NULL, OPTION_USE_GRAFT}, '\0', NULL, "Allow to use graft points for filenames", ONE_DASH}, {{"root", required_argument, NULL, OPTION_RELOC_ROOT}, '\0', "DIR", "Set root directory for all new files and directories", ONE_DASH}, {{"old-root", required_argument, NULL, OPTION_RELOC_OLD_ROOT}, '\0', "DIR", "Set root directory in previous session that is searched for files", ONE_DASH}, {{"help", no_argument, NULL, OPTION_HELP}, '\0', NULL, "Print option help", ONE_DASH}, {{"hide", required_argument, NULL, OPTION_I_HIDE}, '\0', "GLOBFILE", "Hide ISO9660/RR file", ONE_DASH}, {{"hide-list", required_argument, NULL, OPTION_I_LIST}, '\0', "FILE", "File with list of ISO9660/RR files to hide", ONE_DASH}, {{"hidden", required_argument, NULL, OPTION_H_HIDE}, '\0', "GLOBFILE", "Set hidden attribute on ISO9660 file", ONE_DASH}, {{"hidden-list", required_argument, NULL, OPTION_H_LIST}, '\0', "FILE", "File with list of ISO9660 files with hidden attribute", ONE_DASH}, {{"hide-joliet", required_argument, NULL, OPTION_J_HIDE}, '\0', "GLOBFILE", "Hide Joliet file", ONE_DASH}, {{"hide-joliet-list", required_argument, NULL, OPTION_J_LIST}, '\0', "FILE", "File with list of Joliet files to hide", ONE_DASH}, {{"hide-joliet-trans-tbl", no_argument, NULL, OPTION_HIDE_TRANS_TBL}, '\0', NULL, "Hide TRANS.TBL from Joliet tree", ONE_DASH}, {{"hide-rr-moved", no_argument, NULL, OPTION_HIDE_RR_MOVED}, '\0', NULL, "Rename RR_MOVED to .rr_moved in Rock Ridge tree", ONE_DASH}, {{"gui", no_argument, NULL, OPTION_GUI}, '\0', NULL, "Switch behaviour for GUI", ONE_DASH}, {{NULL, required_argument, NULL, 'i'}, 'i', "ADD_FILES", "No longer supported", TWO_DASHES}, {{"input-charset", required_argument, NULL, OPTION_INPUT_CHARSET}, '\0', "CHARSET", "Local input charset for file name conversion", ONE_DASH}, {{"output-charset", required_argument, NULL, OPTION_OUTPUT_CHARSET}, '\0', "CHARSET", "Output charset for file name conversion", ONE_DASH}, {{"iso-level", required_argument, NULL, OPTION_ISO_LEVEL}, '\0', "LEVEL", "Set ISO9660 conformance level (1..3) or 4 for ISO9660 version 2", ONE_DASH}, {{"joliet", no_argument, NULL, 'J'}, 'J', NULL, "Generate Joliet directory information", ONE_DASH}, {{"joliet-long", no_argument, NULL, OPTION_JLONG}, '\0', NULL, "Allow Joliet file names to be 103 Unicode characters", ONE_DASH}, {{"jcharset", required_argument, NULL, OPTION_JCHARSET}, '\0', "CHARSET", "Local charset for Joliet directory information", ONE_DASH}, {{"full-iso9660-filenames", no_argument, NULL, 'l'}, 'l', NULL, "Allow full 31 character filenames for ISO9660 names", ONE_DASH}, {{"max-iso9660-filenames", no_argument, NULL, OPTION_MAX_FILENAMES}, '\0', NULL, "Allow 37 character filenames for ISO9660 names (violates ISO9660)", ONE_DASH}, {{"allow-limited-size", no_argument, NULL, OPTION_ALLOW_LIMITED_SIZE}, '\0', NULL, "Allow different file sizes in ISO9660/UDF on large files", ONE_DASH}, {{"allow-leading-dots", no_argument, NULL, OPTION_ALLOW_LEADING_DOTS}, '\0', NULL, "Allow ISO9660 filenames to start with '.' (violates ISO9660)", ONE_DASH}, {{"ldots", no_argument, NULL, OPTION_ALLOW_LEADING_DOTS}, '\0', NULL, "Allow ISO9660 filenames to start with '.' (violates ISO9660)", ONE_DASH}, {{"allow-leading-dots", no_argument, NULL, 'L'}, 'L', NULL, "Allow ISO9660 filenames to start with '.' (violates ISO9660)", ONE_DASH}, {{"log-file", required_argument, NULL, OPTION_LOG_FILE}, '\0', "LOG_FILE", "Re-direct messages to LOG_FILE", ONE_DASH}, {{"exclude", required_argument, NULL, 'm'}, 'm', "GLOBFILE", "Exclude file name", ONE_DASH}, {{"exclude-list", required_argument, NULL, OPTION_X_LIST}, '\0', "FILE", "File with list of file names to exclude", ONE_DASH}, {{"pad", no_argument, NULL, OPTION_PAD}, 0, NULL, "Pad output to a multiple of 32k (default)", ONE_DASH}, {{"no-pad", no_argument, NULL, OPTION_NOPAD}, 0, NULL, "Do not pad output to a multiple of 32k", ONE_DASH}, {{"prev-session", required_argument, NULL, 'M'}, 'M', "FILE", "Set path to previous session to merge", ONE_DASH}, {{"dev", required_argument, NULL, 'M'}, '\0', "SCSIdev", "Set path to previous session to merge", ONE_DASH}, {{"omit-version-number", no_argument, NULL, 'N'}, 'N', NULL, "Omit version number from ISO9660 filename (violates ISO9660)", ONE_DASH}, {{"new-dir-mode", required_argument, NULL, OPTION_NEW_DIR_MODE}, '\0', "mode", "Mode used when creating new directories.", ONE_DASH}, {{"force-rr", no_argument, NULL, OPTION_FORCE_RR}, 0, NULL, "Inhibit automatic Rock Ridge detection for previous session", ONE_DASH}, {{"no-rr", no_argument, NULL, OPTION_NO_RR}, 0, NULL, "Inhibit reading of Rock Ridge attributes from previous session", ONE_DASH}, {{"no-split-symlink-components", no_argument, NULL, OPTION_NOSPLIT_SL_COMPONENT}, 0, NULL, "Inhibit splitting symlink components", ONE_DASH}, {{"no-split-symlink-fields", no_argument, NULL, OPTION_NOSPLIT_SL_FIELD}, 0, NULL, "Inhibit splitting symlink fields", ONE_DASH}, {{"output", required_argument, NULL, 'o'}, 'o', "FILE", "Set output file name", ONE_DASH}, {{"path-list", required_argument, NULL, OPTION_P_LIST}, '\0', "FILE", "File with list of pathnames to process", ONE_DASH}, {{"preparer", required_argument, NULL, 'p'}, 'p', "PREP", "Set Volume preparer", ONE_DASH}, {{"print-size", no_argument, NULL, OPTION_PRINT_SIZE}, '\0', NULL, "Print estimated filesystem size and exit", ONE_DASH}, {{"publisher", required_argument, NULL, OPTION_PUBLISHER}, '\0', "PUB", "Set Volume publisher", ONE_DASH}, {{"publisher", required_argument, NULL, 'P'}, 'P', "PUB", "Set Volume publisher", ONE_DASH}, {{"quiet", no_argument, NULL, OPTION_QUIET}, '\0', NULL, "Run quietly", ONE_DASH}, {{"rational-rock", no_argument, NULL, 'r'}, 'r', NULL, "Generate rationalized Rock Ridge directory information", ONE_DASH}, {{"rock", no_argument, NULL, 'R'}, 'R', NULL, "Generate Rock Ridge directory information", ONE_DASH}, {{"sectype", required_argument, NULL, 's'}, 's', "TYPE", "Set output sector type to e.g. data/xa1/raw", ONE_DASH}, {{"alpha-boot", required_argument, NULL, OPTION_BOOTALPHA}, '\0', "FILE", "Set alpha boot image name (relative to image root)", ONE_DASH}, {{"hppa-cmdline", required_argument, NULL, OPTION_HPPA_CMDLINE}, '\0', "CMDLINE", "Set hppa boot command line (relative to image root)", ONE_DASH}, {{"hppa-kernel-32", required_argument, NULL, OPTION_HPPA_KERNEL_32}, '\0', "FILE", "Set hppa 32-bit image name (relative to image root)", ONE_DASH}, {{"hppa-kernel-64", required_argument, NULL, OPTION_HPPA_KERNEL_64}, '\0', "FILE", "Set hppa 64-bit image name (relative to image root)", ONE_DASH}, {{"hppa-bootloader", required_argument, NULL, OPTION_HPPA_BOOTLOADER}, '\0', "FILE", "Set hppa boot loader file name (relative to image root)", ONE_DASH}, {{"hppa-ramdisk", required_argument, NULL, OPTION_HPPA_RAMDISK}, '\0', "FILE", "Set hppa ramdisk file name (relative to image root)", ONE_DASH}, {{"mips-boot", required_argument, NULL, OPTION_BOOTMIPS}, '\0', "FILE", "Set mips boot image name (relative to image root)", ONE_DASH}, {{"mipsel-boot", required_argument, NULL, OPTION_BOOTMIPSEL}, '\0', "FILE", "Set mipsel boot image name (relative to image root)", ONE_DASH}, #ifdef JIGDO_TEMPLATE {{"jigdo-jigdo", required_argument, NULL, OPTION_JTJ_OUTPUT}, '\0', "FILE", "Produce a jigdo .jigdo file as well as the .iso", ONE_DASH }, {{"jigdo-template", required_argument, NULL, OPTION_JTT_OUTPUT}, '\0', "FILE", "Produce a jigdo .template file as well as the .iso", ONE_DASH }, {{"jigdo-min-file-size", required_argument, NULL, OPTION_JT_MIN_SIZE}, '\0', "SIZE", "Minimum size for a file to be listed in the jigdo file", ONE_DASH }, {{"jigdo-force-md5", required_argument, NULL, OPTION_JT_INCLUDE}, '\0', "PATTERN", "Pattern(s) where files MUST match an externally-supplied MD5sum", ONE_DASH }, {{"jigdo-exclude", required_argument, NULL, OPTION_JT_EXCLUDE}, '\0', "PATTERN", "Pattern(s) to exclude from the jigdo file", ONE_DASH }, {{"jigdo-map", required_argument, NULL, OPTION_JT_PATH_MAP}, '\0', "PATTERN1=PATTERN2", "Pattern(s) to map paths (e.g. Debian=/mirror/debian)", ONE_DASH }, {{"md5-list", required_argument, NULL, OPTION_JT_MD5_LIST}, '\0', "FILE", "File containing MD5 sums of the files that should be checked", ONE_DASH }, {{"jigdo-template-compress", required_argument, NULL, OPTION_JT_COMPRESS_ALGO}, '\0', "ALGORITHM", "Choose to use gzip or bzip2 compression for template data; default is gzip", ONE_DASH }, {{"checksum_algorithm_iso", required_argument, NULL, OPTION_JT_CHECKSUM_ALGO_ISO}, '\0', "alg1,alg2,...", "Specify the checksum types desired for the output image", ONE_DASH}, {{"checksum_algorithm_template", required_argument, NULL, OPTION_JT_CHECKSUM_ALGO_TMPL}, '\0', "alg1,alg2,...", "Specify the checksum types desired for the output jigdo template", ONE_DASH}, #endif #ifdef SORTING { {"sort", required_argument, NULL, OPTION_SORT}, '\0', "FILE", "Sort file content locations according to rules in FILE", ONE_DASH }, #endif /* SORTING */ {{"split-output", no_argument, NULL, OPTION_SPLIT_OUTPUT}, '\0', NULL, "Split output into files of approx. 1GB size", ONE_DASH}, {{"stream-file-name", required_argument, NULL, OPTION_STREAM_FILE_NAME}, '\0', "FILE_NAME", "Set the stream file ISO9660 name (incl. version)", ONE_DASH}, {{"stream-media-size", required_argument, NULL, OPTION_STREAM_CD_SIZE}, '\0', "#", "Set the size of your CD media in sectors", ONE_DASH}, {{"sysid", required_argument, NULL, OPTION_SYSID}, '\0', "ID", "Set System ID", ONE_DASH}, {{"translation-table", no_argument, NULL, 'T'}, 'T', NULL, "Generate translation tables for systems that don't understand long filenames", ONE_DASH}, {{"table-name", required_argument, NULL, OPTION_TRANS_TBL}, '\0', "TABLE_NAME", "Translation table file name", ONE_DASH}, {{"ucs-level", required_argument, NULL, OPTION_UCS_LEVEL}, '\0', "LEVEL", "Set Joliet UCS level (1..3)", ONE_DASH}, #ifdef UDF {{"udf", no_argument, NULL, OPTION_UDF}, '\0', NULL, "Generate UDF file system", ONE_DASH}, #endif #ifdef DVD_VIDEO {{"dvd-video", no_argument, NULL, OPTION_DVD}, '\0', NULL, "Generate DVD-Video compliant UDF file system", ONE_DASH}, #endif {{"uid", required_argument, NULL, OPTION_UID}, '\0', "uid", "Make the owner of all files this uid.", ONE_DASH}, {{"untranslated-filenames", no_argument, NULL, 'U'}, /* CSTYLED */ 'U', NULL, "Allow Untranslated filenames (for HPUX & AIX - violates ISO9660). Forces -l, -d, -N, -allow-leading-dots, -relaxed-filenames, -allow-lowercase, -allow-multidot", ONE_DASH}, {{"relaxed-filenames", no_argument, NULL, OPTION_RELAXED_FILENAMES}, '\0', NULL, "Allow 7 bit ASCII except lower case characters (violates ISO9660)", ONE_DASH}, {{"no-iso-translate", no_argument, NULL, OPTION_ISO_TRANSLATE}, '\0', NULL, "Do not translate illegal ISO characters '~', '-' and '#' (violates ISO9660)", ONE_DASH}, {{"allow-lowercase", no_argument, NULL, OPTION_ALLOW_LOWERCASE}, '\0', NULL, "Allow lower case characters in addition to the current character set (violates ISO9660)", ONE_DASH}, {{"allow-multidot", no_argument, NULL, OPTION_ALLOW_MULTIDOT}, '\0', NULL, "Allow more than one dot in filenames (e.g. .tar.gz) (violates ISO9660)", ONE_DASH}, {{"use-fileversion", no_argument, NULL, OPTION_USE_FILEVERSION}, '\0', "LEVEL", "Use file version # from filesystem", ONE_DASH}, {{"verbose", no_argument, NULL, 'v'}, 'v', NULL, "Verbose", ONE_DASH}, {{"version", no_argument, NULL, OPTION_PVERSION}, '\0', NULL, "Print the current version", ONE_DASH}, {{"volid", required_argument, NULL, 'V'}, 'V', "ID", "Set Volume ID", ONE_DASH}, {{"volset", required_argument, NULL, OPTION_VOLSET}, '\0', "ID", "Set Volume set ID", ONE_DASH}, {{"volset-size", required_argument, NULL, OPTION_VOLSET_SIZE}, '\0', "#", "Set Volume set size", ONE_DASH}, {{"volset-seqno", required_argument, NULL, OPTION_VOLSET_SEQ_NUM}, '\0', "#", "Set Volume set sequence number", ONE_DASH}, {{"old-exclude", required_argument, NULL, 'x'}, 'x', "FILE", "Exclude file name(depreciated)", ONE_DASH}, {{"hard-disk-boot", no_argument, NULL, OPTION_HARD_DISK_BOOT}, '\0', NULL, "Boot image is a hard disk image", ONE_DASH}, {{"no-emul-boot", no_argument, NULL, OPTION_NO_EMUL_BOOT}, '\0', NULL, "Boot image is 'no emulation' image", ONE_DASH}, {{"no-boot", no_argument, NULL, OPTION_NO_BOOT}, '\0', NULL, "Boot image is not bootable", ONE_DASH}, {{"boot-load-seg", required_argument, NULL, OPTION_BOOT_LOAD_ADDR}, '\0', "#", "Set load segment for boot image", ONE_DASH}, {{"boot-load-size", required_argument, NULL, OPTION_BOOT_LOAD_SIZE}, '\0', "#", "Set numbers of load sectors", ONE_DASH}, {{"boot-info-table", no_argument, NULL, OPTION_BOOT_INFO_TABLE}, '\0', NULL, "Patch boot image with info table", ONE_DASH}, {{"XA", no_argument, NULL, OPTION_XA}, '\0', NULL, "Generate XA directory attruibutes", ONE_DASH}, {{"xa", no_argument, NULL, OPTION_XA_RATIONALIZED}, '\0', NULL, "Generate rationalized XA directory attruibutes", ONE_DASH}, {{"transparent-compression", no_argument, NULL, 'z'}, 'z', NULL, "Enable transparent compression of files", ONE_DASH}, #ifdef APPLE_HYB {{"hfs-type", required_argument, NULL, OPTION_HFS_TYPE}, '\0', "TYPE", "Set HFS default TYPE", ONE_DASH}, {{"hfs-creator", required_argument, NULL, OPTION_HFS_CREATOR}, '\0', "CREATOR", "Set HFS default CREATOR", ONE_DASH}, {{"apple", no_argument, NULL, 'g'}, 'g', NULL, "Add Apple ISO9660 extensions", ONE_DASH}, {{"hfs", no_argument, NULL, 'h'}, 'h', NULL, "Create ISO9660/HFS hybrid", ONE_DASH}, {{"map", required_argument, NULL, OPTION_MAP_FILE}, '\0', "MAPPING_FILE", "Map file extensions to HFS TYPE/CREATOR", ONE_DASH}, {{"map", required_argument, NULL, 'H'}, 'H', "MAPPING_FILE", "Map file extensions to HFS TYPE/CREATOR", ONE_DASH}, {{"magic", required_argument, NULL, OPTION_MAGIC_FILE}, '\0', "FILE", "Magic file for HFS TYPE/CREATOR", ONE_DASH}, {{"probe", no_argument, NULL, OPTION_PROBE}, '\0', NULL, "Probe all files for Apple/Unix file types", ONE_DASH}, {{"mac-name", no_argument, NULL, OPTION_MACNAME}, '\0', NULL, "Use Macintosh name for ISO9660/Joliet/RockRidge file name", ONE_DASH}, {{"no-mac-files", no_argument, NULL, OPTION_NOMACFILES}, '\0', NULL, "Do not look for Unix/Mac files (depreciated)", ONE_DASH}, {{"boot-hfs-file", required_argument, NULL, OPTION_BOOT_HFS_FILE}, '\0', "FILE", "Set HFS boot image name", ONE_DASH}, {{"part", no_argument, NULL, OPTION_GEN_PT}, '\0', NULL, "Generate HFS partition table", ONE_DASH}, {{"cluster-size", required_argument, NULL, OPTION_BSIZE}, '\0', "SIZE", "Cluster size for PC Exchange Macintosh files", ONE_DASH}, {{"auto", required_argument, NULL, OPTION_AUTOSTART}, '\0', "FILE", "Set HFS AutoStart file name", ONE_DASH}, {{"no-desktop", no_argument, NULL, OPTION_CREATE_DT}, '\0', NULL, "Do not create the HFS (empty) Desktop files", ONE_DASH}, {{"hide-hfs", required_argument, NULL, OPTION_HFS_HIDE}, '\0', "GLOBFILE", "Hide HFS file", ONE_DASH}, {{"hide-hfs-list", required_argument, NULL, OPTION_HFS_LIST}, '\0', "FILE", "List of HFS files to hide", ONE_DASH}, {{"hfs-volid", required_argument, NULL, OPTION_HFS_VOLID}, '\0', "HFS_VOLID", "Volume name for the HFS partition", ONE_DASH}, {{"icon-position", no_argument, NULL, OPTION_ICON_POS}, '\0', NULL, "Keep HFS icon position", ONE_DASH}, {{"root-info", required_argument, NULL, OPTION_ROOT_INFO}, '\0', "FILE", "finderinfo for root folder", ONE_DASH}, {{"input-hfs-charset", required_argument, NULL, OPTION_HFS_INPUT_CHARSET}, '\0', "CHARSET", "Local input charset for HFS file name conversion", ONE_DASH}, {{"output-hfs-charset", required_argument, NULL, OPTION_HFS_OUTPUT_CHARSET}, '\0', "CHARSET", "Output charset for HFS file name conversion", ONE_DASH}, {{"hfs-unlock", no_argument, NULL, OPTION_HFS_UNLOCK}, '\0', NULL, "Leave HFS Volume unlocked", ONE_DASH}, {{"hfs-bless", required_argument, NULL, OPTION_HFS_BLESS}, '\0', "FOLDER_NAME", "Name of Folder to be blessed", ONE_DASH}, {{"hfs-parms", required_argument, NULL, OPTION_HFS_PARMS}, '\0', "PARAMETERS", "Comma separated list of HFS parameters", ONE_DASH}, #ifdef PREP_BOOT {{"prep-boot", required_argument, NULL, OPTION_PREP_BOOT}, '\0', "FILE", "PReP boot image file -- up to 4 are allowed", ONE_DASH}, {{"chrp-boot", no_argument, NULL, OPTION_CHRP_BOOT}, '\0', NULL, "Add CHRP boot header", ONE_DASH}, #endif /* PREP_BOOT */ {{"cap", no_argument, NULL, OPTION_CAP}, '\0', NULL, "Look for AUFS CAP Macintosh files", TWO_DASHES}, {{"netatalk", no_argument, NULL, OPTION_NETA}, '\0', NULL, "Look for NETATALK Macintosh files", TWO_DASHES}, {{"double", no_argument, NULL, OPTION_DBL}, '\0', NULL, "Look for AppleDouble Macintosh files", TWO_DASHES}, {{"ethershare", no_argument, NULL, OPTION_ESH}, '\0', NULL, "Look for Helios EtherShare Macintosh files", TWO_DASHES}, {{"exchange", no_argument, NULL, OPTION_FE}, '\0', NULL, "Look for PC Exchange Macintosh files", TWO_DASHES}, {{"sgi", no_argument, NULL, OPTION_SGI}, '\0', NULL, "Look for SGI Macintosh files", TWO_DASHES}, {{"macbin", no_argument, NULL, OPTION_MBIN}, '\0', NULL, "Look for MacBinary Macintosh files", TWO_DASHES}, {{"single", no_argument, NULL, OPTION_SGL}, '\0', NULL, "Look for AppleSingle Macintosh files", TWO_DASHES}, {{"ushare", no_argument, NULL, OPTION_USH}, '\0', NULL, "Look for IPT UShare Macintosh files", TWO_DASHES}, {{"xinet", no_argument, NULL, OPTION_XIN}, '\0', NULL, "Look for XINET Macintosh files", TWO_DASHES}, {{"dave", no_argument, NULL, OPTION_DAVE}, '\0', NULL, "Look for DAVE Macintosh files", TWO_DASHES}, {{"sfm", no_argument, NULL, OPTION_SFM}, '\0', NULL, "Look for SFM Macintosh files", TWO_DASHES}, {{"osx-double", no_argument, NULL, OPTION_XDBL}, '\0', NULL, "Look for MacOS X AppleDouble Macintosh files", TWO_DASHES}, {{"osx-hfs", no_argument, NULL, OPTION_XHFS}, '\0', NULL, "Look for MacOS X HFS Macintosh files", TWO_DASHES}, #endif /* APPLE_HYB */ }; #define OPTION_COUNT (sizeof ld_options / sizeof (ld_options[0])) static void read_rcfile(char *appname); static void susage(int excode); static void usage(int excode); int iso9660_date(char *result, time_t crtime); static void hide_reloc_dir(void); static char *get_pnames(int argc, char **argv, int opt, char *pname, int pnsize, FILE *fp); char *findgequal(char *s); static char *escstrcpy(char *to, char *from); void *e_malloc(size_t size); static int read_one_rcfile(char *filename) { int linum = 0; char linebuffer[256]; FILE *fp; if (!filename) return 0; fp = fopen(filename, "r"); if (!fp) { if (errno == ENOENT) return 0; #ifdef USE_LIBSCHILY errmsg("Cannot open '%s'.\n", filename); #else perror(filename); #endif return 0; } if (verbose > 0) fprintf(stderr, "Using \"%s\"\n", filename); while (fgets(linebuffer, sizeof(linebuffer), fp)) { char *name, *p, *p1; struct rcopts *rco; ++linum; /* skip any leading white space */ for (p = linebuffer; *p == ' ' || *p == '\t'; p++) ; /* Skip comments and blank lines */ if (!*p || *p == '\n' || *p == '\r' || *p == '#') continue; /* * The name should begin in the left margin. Make sure it is * in upper case. Stop when we see white space or a comment. */ name = p; while (*p && (isalpha((unsigned char) *p) || *p == '_')) *p++ = toupper((unsigned char) *p); if (name == p) { fprintf(stderr, "%s:%d: name required\n", filename, linum); continue; } p1 = p; /* Skip past white space after the name */ while (*p == ' ' || *p == '\t') p++; /* silently ignore errors in the rc file. */ if (*p != '=') { fprintf(stderr, "%s:%d: equals sign required after '%.*s'\n", filename, linum, (int)(p1-name), name); continue; } *p1 = 0; /* Skip pas the = sign, and any white space following it */ p++; while (*p == ' ' || *p == '\t') p++; /* Get rid of trailing newline */ for (p1 = p; *p1 && *p1 != '\n' && *p1 != '\r'; p1++) ; *p1 = 0; /* Figure out which option we have */ for (rco = rcopt; rco->tag; rco++) if (strcmp(rco->tag, name) == 0) { /* memleak if we ever do this more than once */ *rco->variable = strdup(p); break; } if (!rco->tag) { fprintf(stderr, "%s:%d: field name '%s' unknown\n", filename, linum, name); } } if (ferror(fp)) { #ifdef USE_LIBSCHILY errmsg("Read error on '%s'.\n", filename); #else perror(filename); #endif fclose(fp); return 0; } fclose(fp); return 1; } #define ETCDIR "/etc" #define RCFILENAME "genisoimagerc" #define OLD_RCFILENAME "mkisofsrc" static void read_rcfile(char *appname) { char *p; char filename[1000]; if (read_one_rcfile(getenv("GENISOIMAGERC"))) return; if (read_one_rcfile(getenv("MKISOFSRC"))) return; if (read_one_rcfile("." RCFILENAME)) return; if (read_one_rcfile("." OLD_RCFILENAME)) return; p = getenv("HOME"); if (p && strlen(p) + 1 + sizeof(RCFILENAME) < sizeof(filename)) { strcpy(filename, p); p = filename + strlen(filename); *p++ = PATH_SEPARATOR; strcpy(p, "." RCFILENAME); if (read_one_rcfile(filename)) return; strcpy(p, "." OLD_RCFILENAME); if (read_one_rcfile(filename)) return; } if (read_one_rcfile(ETCDIR SPATH_SEPARATOR RCFILENAME)) return; if (appname && strlen(appname) + 1 + sizeof(RCFILENAME) < sizeof(filename)) { strcpy(filename, appname); p = strrchr(filename, PATH_SEPARATOR); if (p) { strcpy(p + 1, RCFILENAME); if (read_one_rcfile(filename)) return; } } } char *path_table_l = NULL; char *path_table_m = NULL; char *jpath_table_l = NULL; char *jpath_table_m = NULL; int goof = 0; #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif static void susage(int excode) { const char *program_name = "genisoimage"; fprintf(stderr, "Usage: %s [options] -o file directory ...\n", program_name); fprintf(stderr, "\nUse %s -help\n", program_name); fprintf(stderr, "to get a list of valid options.\n"); fprintf(stderr, "\nReport problems to debburn-devel@lists.alioth.debian.org.\n"); exit(excode); } static void usage(int excode) { const char *program_name = "genisoimage"; int i; /* const char **targets, **pp;*/ fprintf(stderr, "Usage: %s [options] file...\n", program_name); fprintf(stderr, "Options:\n"); for (i = 0; i < (int)OPTION_COUNT; i++) { if (ld_options[i].doc != NULL) { int comma; int len; int j; fprintf(stderr, " "); comma = FALSE; len = 2; j = i; do { if (ld_options[j].shortopt != '\0' && ld_options[j].control != NO_HELP) { fprintf(stderr, "%s-%c", comma ? ", " : "", ld_options[j].shortopt); len += (comma ? 2 : 0) + 2; if (ld_options[j].arg != NULL) { if (ld_options[j].opt.has_arg != optional_argument) { fprintf(stderr, " "); ++len; } fprintf(stderr, "%s", ld_options[j].arg); len += strlen(ld_options[j].arg); } comma = TRUE; } ++j; } while (j < (int)OPTION_COUNT && ld_options[j].doc == NULL); j = i; do { if (ld_options[j].opt.name != NULL && ld_options[j].control != NO_HELP) { fprintf(stderr, "%s-%s%s", comma ? ", " : "", ld_options[j].control == TWO_DASHES ? "-" : "", ld_options[j].opt.name); len += ((comma ? 2 : 0) + 1 + (ld_options[j].control == TWO_DASHES ? 1 : 0) + strlen(ld_options[j].opt.name)); if (ld_options[j].arg != NULL) { fprintf(stderr, " %s", ld_options[j].arg); len += 1 + strlen(ld_options[j].arg); } comma = TRUE; } ++j; } while (j < (int)OPTION_COUNT && ld_options[j].doc == NULL); if (len >= 30) { fprintf(stderr, "\n"); len = 0; } for (; len < 30; len++) fputc(' ', stderr); fprintf(stderr, "%s\n", ld_options[i].doc); } } fprintf(stderr, "\nReport problems to debburn-devel@lists.alioth.debian.org.\n"); exit(excode); } /* * Fill in date in the iso9660 format * * The standards state that the timezone offset is in multiples of 15 * minutes, and is what you add to GMT to get the localtime. The U.S. * is always at a negative offset, from -5h to -8h (can vary a little * with DST, I guess). The Linux iso9660 filesystem has had the sign * of this wrong for ages (genisoimage had it wrong too for the longest time). */ int iso9660_date(char *result, time_t crtime) { struct tm *local; local = localtime(&crtime); result[0] = local->tm_year; result[1] = local->tm_mon + 1; result[2] = local->tm_mday; result[3] = local->tm_hour; result[4] = local->tm_min; result[5] = local->tm_sec; /* * Must recalculate proper timezone offset each time, as some files use * daylight savings time and some don't... */ result[6] = local->tm_yday; /* save yday 'cause gmtime zaps it */ local = gmtime(&crtime); local->tm_year -= result[0]; local->tm_yday -= result[6]; local->tm_hour -= result[3]; local->tm_min -= result[4]; if (local->tm_year < 0) { local->tm_yday = -1; } else { if (local->tm_year > 0) local->tm_yday = 1; } result[6] = -(local->tm_min + 60 * (local->tm_hour + 24 * local->tm_yday)) / 15; return (0); } /* hide "./rr_moved" if all its contents are hidden */ static void hide_reloc_dir() { struct directory_entry *s_entry; for (s_entry = reloc_dir->contents; s_entry; s_entry = s_entry->next) { if (strcmp(s_entry->name, ".") == 0 || strcmp(s_entry->name, "..") == 0) continue; if ((s_entry->de_flags & INHIBIT_ISO9660_ENTRY) == 0) return; } /* all entries are hidden, so hide this directory */ reloc_dir->dir_flags |= INHIBIT_ISO9660_ENTRY; reloc_dir->self->de_flags |= INHIBIT_ISO9660_ENTRY; } /* * get pathnames from the command line, and then from given file */ static char * get_pnames(int argc, char **argv, int opt, char *pname, int pnsize, FILE *fp) { int len; /* we may of already read the first line from the pathnames file */ if (save_pname) { save_pname = 0; return (pname); } if (opt < argc) return (argv[opt]); if (fp == NULL) return ((char *) 0); if (fgets(pname, pnsize, fp)) { /* Discard newline */ len = strlen(pname); if (pname[len - 1] == '\n') { pname[len - 1] = '\0'; } return (pname); } return ((char *) 0); } extern char *cdrecord_data; int main(int argc, char *argv[]) { struct directory_entry de; #ifdef HAVE_SBRK unsigned long mem_start; #endif struct stat statbuf; char *merge_image = NULL; char *reloc_root = NULL; char *reloc_old_root = NULL; struct iso_directory_record *mrootp = NULL; struct output_fragment *opnt; int longind; char shortopts[OPTION_COUNT * 3 + 2]; struct option longopts[OPTION_COUNT + 1]; int c; int n; char *log_file = 0; char *node = NULL; char *pathnames = 0; FILE *pfp = NULL; char pname[2*PATH_MAX + 1 + 1]; /* may be too short */ char *arg; /* if '\\' present */ char nodename[PATH_MAX + 1]; int no_path_names = 1; int warn_violate = 0; int have_cmd_line_pathspec = 0; int rationalize_all = 0; char *mkisofs_call = 0; /* use as pointer and boolean */ #ifdef APPLE_HYB char *afpfile = ""; /* mapping file for TYPE/CREATOR */ int hfs_ct = 0; char *root_info = 0; #endif /* APPLE_HYB */ /* abusing arg */ mkisofs_call=strstr(argv[0], "mkisofs"); if(mkisofs_call && '\0' == mkisofs_call[7]) /* lame cheater detected */ argv[0]="genisoimage"; #ifdef __EMX__ /* This gives wildcard expansion with Non-Posix shells with EMX */ _wildcard(&argc, &argv); #endif save_args(argc, argv); if (argc < 2) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Missing pathspec.\n"); #endif susage(1); } /* Get the defaults from the .genisoimagerc file */ read_rcfile(argv[0]); outfile = NULL; /* * Copy long option initialization from GNU-ld. */ /* * Starting the short option string with '-' is for programs that * expect options and other ARGV-elements in any order and that care * about the ordering of the two. We describe each non-option * ARGV-element as if it were the argument of an option with * character code 1. */ { int i, is, il; shortopts[0] = '-'; is = 1; il = 0; for (i = 0; i < (int)OPTION_COUNT; i++) { if (ld_options[i].shortopt != '\0') { shortopts[is] = ld_options[i].shortopt; ++is; if (ld_options[i].opt.has_arg == required_argument || ld_options[i].opt.has_arg == optional_argument) { shortopts[is] = ':'; ++is; if (ld_options[i].opt.has_arg == optional_argument) { shortopts[is] = ':'; ++is; } } } if (ld_options[i].opt.name != NULL) { longopts[il] = ld_options[i].opt; ++il; } } shortopts[is] = '\0'; longopts[il].name = NULL; } while ((c = getopt_long_only(argc, argv, shortopts, longopts, &longind)) != EOF) switch (c) { case 1: /* A filename that we take as input. */ optind--; have_cmd_line_pathspec = 1; goto parse_input_files; case OPTION_USE_GRAFT: use_graft_ptrs = 1; break; case 'C': /* * This is a temporary hack until cdrecord gets the * proper hooks in it. */ cdrecord_data = optarg; break; case OPTION_GUI: gui++; break; case 'i': #ifdef USE_LIBSCHILY comerrno(EX_BAD, "-i option no longer supported.\n"); #else fprintf(stderr, "-i option no longer supported.\n"); exit(1); #endif break; case OPTION_ISO_LEVEL: iso9660_level = atoi(optarg); switch (iso9660_level) { case 1: /* * Only on file section * 8.3 d or d1 characters for files * 8 d or d1 characters for directories */ break; case 2: /* * Only on file section */ break; case 3: /* * No restrictions */ break; case 4: /* * This is ISO-9660:1988 (ISO-9660 version 2) */ iso9660_namelen = MAX_ISONAME_V2; /* allow 207 chars */ full_iso9660_filenames++; /* 31+ chars */ omit_version_number++; RR_relocation_depth = 32767; /* * From -U ... */ omit_period++; /* trailing dot */ allow_leading_dots++; relaxed_filenames++; /* all chars */ allow_lowercase++; /* even lowcase */ allow_multidot++; /* > 1 dots */ break; default: comerrno(EX_BAD, "Illegal iso9660 Level %d, use 1..3 or 4.\n", iso9660_level); } break; case 'J': use_Joliet++; break; case OPTION_JLONG: use_Joliet++; jlen = JLONGMAX; break; case OPTION_JCHARSET: use_Joliet++; /* FALLTHROUGH */ case OPTION_INPUT_CHARSET: icharset = optarg; break; case OPTION_OUTPUT_CHARSET: ocharset = optarg; break; #ifdef JIGDO_TEMPLATE case OPTION_JTT_OUTPUT: jtemplate_out = optarg; break; case OPTION_JTJ_OUTPUT: jjigdo_out = optarg; break; case OPTION_JT_MD5_LIST: jmd5_list = optarg; break; case OPTION_JT_MIN_SIZE: jte_min_size = atoi(optarg); if (jte_min_size < MIN_JIGDO_FILE_SIZE) { fprintf(stderr, "Jigdo min size %d too small; using default %d instead\n", jte_min_size, MIN_JIGDO_FILE_SIZE); jte_min_size = MIN_JIGDO_FILE_SIZE; } break; case OPTION_JT_INCLUDE: if (jte_add_include(optarg)) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Failed to build jigdo-include list\n"); #else fprintf(stderr, "Failed to build jigdo-include list\n"); exit(1); #endif } break; case OPTION_JT_EXCLUDE: if (jte_add_exclude(optarg)) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Failed to build jigdo-exclude list\n"); #else fprintf(stderr, "Failed to build jigdo-exclude list\n"); exit(1); #endif } break; case OPTION_JT_PATH_MAP: if (jte_add_mapping(optarg)) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Failed to build jigdo mapping list\n"); #else fprintf(stderr, "Failed to build jigdo mapping list\n"); exit(1); #endif } break; case OPTION_JT_COMPRESS_ALGO: if (!strcasecmp(optarg, "gzip")) jte_template_compression = JTE_TEMP_GZIP; else if (!strcasecmp(optarg, "bzip2")) jte_template_compression = JTE_TEMP_BZIP2; else { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Compression algorithm %s unknown\n", optarg); #else fprintf(stderr, "Compression algorithm %s unknown\n", optarg); exit(1); #endif } break; case OPTION_JT_CHECKSUM_ALGO_ISO: if (parse_checksum_algo(optarg, &checksum_algo_iso)) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Problem with ISO checksum choices: %s \n", optarg); #else fprintf(stderr, "Problem with ISO checksum choices: %s\n", optarg); exit(1); #endif } break; case OPTION_JT_CHECKSUM_ALGO_TMPL: if (parse_checksum_algo(optarg, &checksum_algo_tmpl)) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Problem with template checksum choices: %s \n", optarg); #else fprintf(stderr, "Problem with template checksum choices: %s\n", optarg); exit(1); #endif } break; #endif /* JIGDO_TEMPLATE */ case OPTION_NOBAK: all_files = 0; break; case 'b': do_sort++; /* We sort bootcat/botimage */ use_eltorito++; boot_image = optarg; /* pathname of the boot image */ /* on disk */ if (boot_image == NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Required Eltorito boot image pathname missing\n"); #else fprintf(stderr, "Required Eltorito boot image pathname missing\n"); exit(1); #endif } get_boot_entry(); current_boot_entry->boot_image = boot_image; break; case OPTION_ALT_BOOT: /* * Start new boot entry parameter list. */ new_boot_entry(); break; case OPTION_BOOTALPHA: use_alphaboot++; /* list of pathnames of boot images */ add_boot_alpha_filename(optarg); break; case OPTION_HPPA_CMDLINE: use_hppaboot++; add_boot_hppa_cmdline(optarg); break; case OPTION_HPPA_KERNEL_32: use_hppaboot++; add_boot_hppa_kernel_32(optarg); break; case OPTION_HPPA_KERNEL_64: use_hppaboot++; add_boot_hppa_kernel_64(optarg); break; case OPTION_HPPA_BOOTLOADER: use_hppaboot++; add_boot_hppa_bootloader(optarg); break; case OPTION_HPPA_RAMDISK: use_hppaboot++; /* list of pathnames of boot images */ add_boot_hppa_ramdisk(optarg); break; case OPTION_BOOTMIPS: use_mipsboot++; /* list of pathnames of boot images */ add_boot_mips_filename(optarg); break; case OPTION_BOOTMIPSEL: use_mipselboot++; add_boot_mipsel_filename(optarg); break; case 'B': if (use_sunx86boot) comerrno(EX_BAD, "-sparc-boot and -sunx86-boot are mutual exclusive.\n"); use_sparcboot++; /* list of pathnames of boot images */ scan_sparc_boot(optarg); break; case OPTION_SUNX86BOOT: if (use_sparcboot) comerrno(EX_BAD, "-sparc-boot and -sunx86-boot are mutual exclusive.\n"); use_sunx86boot++; /* list of pathnames of boot images */ scan_sunx86_boot(optarg); break; case 'G': use_genboot++; /* pathname of the boot image on disk */ genboot_image = optarg; if (genboot_image == NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Required generic boot image pathname missing\n"); #else fprintf(stderr, "Required generic boot image pathname missing\n"); exit(1); #endif } break; case OPTION_SPARCLABEL: /* Sun disk label string */ sparc_boot_label(optarg); break; case OPTION_SUNX86LABEL: /* Sun disk label string */ sunx86_boot_label(optarg); break; case 'c': use_eltorito++; /* pathname of the boot image on cd */ boot_catalog = optarg; if (boot_catalog == NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Required boot catalog pathname missing\n"); #else fprintf(stderr, "Required boot catalog pathname missing\n"); exit(1); #endif } break; case OPTION_ABSTRACT: abstract = optarg; if (strlen(abstract) > 37) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Abstract filename string too long\n"); #else fprintf(stderr, "Abstract filename string too long\n"); exit(1); #endif } break; case 'A': appid = optarg; if (strlen(appid) > 128) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Application-id string too long\n"); #else fprintf(stderr, "Application-id string too long\n"); exit(1); #endif } break; case OPTION_BIBLIO: biblio = optarg; if (strlen(biblio) > 37) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Bibliographic filename string too long\n"); #else fprintf(stderr, "Bibliographic filename string too long\n"); exit(1); #endif } break; case OPTION_CACHE_INODES: cache_inodes = 1; break; case OPTION_NOCACHE_INODES: cache_inodes = 0; break; case OPTION_CHECK_OLDNAMES: check_oldnames++; break; case OPTION_CHECK_SESSION: check_session++; check_oldnames++; merge_image = optarg; outfile = "/dev/null"; /* * cdrecord_data is handled specially in multi.c * as we cannot write to all strings. * If genisoimage is called with -C xx,yy * our default is overwritten. */ /* cdrecord_data = "0,0";*/ break; case OPTION_COPYRIGHT: copyright = optarg; if (strlen(copyright) > 37) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Copyright filename string too long\n"); #else fprintf(stderr, "Copyright filename string too long\n"); exit(1); #endif } break; case OPTION_DEBUG: debug++; break; case 'd': omit_period++; warn_violate++; break; case 'D': RR_relocation_depth = 32767; break; case 'f': follow_links++; break; case 'l': full_iso9660_filenames++; break; case OPTION_MAX_FILENAMES: iso9660_namelen = MAX_ISONAME_V1; /* allow 37 chars */ full_iso9660_filenames++; omit_version_number++; warn_violate++; break; case 'L': /* FALLTHRU */ case OPTION_ALLOW_LEADING_DOTS: allow_leading_dots++; warn_violate++; break; case OPTION_LOG_FILE: log_file = optarg; break; case 'M': merge_image = optarg; break; case OPTION_RELOC_ROOT: reloc_root = optarg; break; case OPTION_RELOC_OLD_ROOT: reloc_old_root = optarg; break; case 'N': omit_version_number++; warn_violate++; break; case OPTION_FORCE_RR: force_rr++; break; case OPTION_NO_RR: no_rr++; break; case 'o': outfile = optarg; break; case OPTION_PAD: dopad++; break; case OPTION_NOPAD: dopad = 0; break; case OPTION_P_LIST: pathnames = optarg; break; case 'p': preparer = optarg; if (strlen(preparer) > 128) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Preparer string too long\n"); #else fprintf(stderr, "Preparer string too long\n"); exit(1); #endif } break; case OPTION_PRINT_SIZE: print_size++; break; case 'P': /* FALLTHRU */ case OPTION_PUBLISHER: publisher = optarg; if (strlen(publisher) > 128) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Publisher string too long\n"); #else fprintf(stderr, "Publisher string too long\n"); exit(1); #endif } break; case OPTION_QUIET: verbose = 0; break; case 'R': use_RockRidge++; break; case 'r': rationalize_all++; use_RockRidge++; break; case OPTION_XA: use_XA++; break; case OPTION_XA_RATIONALIZED: rationalize_all++; use_XA++; break; case 's': if (strcmp(optarg, "data") == 0) osecsize = 2048; else if (strcmp(optarg, "xa1") == 0) osecsize = 2056; else if (strcmp(optarg, "raw") == 0) { osecsize = 2352; comerrno(EX_BAD, "Unsupported sector type '%s'.\n", optarg); } break; case 'S': #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Option -%c is reserved for future use.\n", c); #else fprintf(stderr, "Option -%c is reserved for future use.\n", c); #endif susage(1); /* NOTREACHED */ case OPTION_NEW_DIR_MODE: rationalize++; { char *end = 0; new_dir_mode = strtol(optarg, &end, 8); if (!end || *end != 0 || new_dir_mode < 0 || new_dir_mode > 07777) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Bad mode for -new-dir-mode\n"); #else fprintf(stderr, "Bad mode for -new-dir-mode\n"); exit(1); #endif } break; } case OPTION_UID: rationalize++; use_RockRidge++; rationalize_uid++; { char *end = 0; uid_to_use = strtol(optarg, &end, 0); if (!end || *end != 0) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Bad value for -uid\n"); #else fprintf(stderr, "Bad value for -uid\n"); exit(1); #endif } break; } case OPTION_GID: rationalize++; use_RockRidge++; rationalize_gid++; { char *end = 0; gid_to_use = strtol(optarg, &end, 0); if (!end || *end != 0) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Bad value for -gid\n"); #else fprintf(stderr, "Bad value for -gid\n"); exit(1); #endif } break; } case OPTION_FILEMODE: rationalize++; use_RockRidge++; rationalize_filemode++; { char *end = 0; filemode_to_use = strtol(optarg, &end, 8); if (!end || *end != 0 || filemode_to_use < 0 || filemode_to_use > 07777) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Bad mode for -file-mode\n"); #else fprintf(stderr, "Bad mode for -file-mode\n"); exit(1); #endif } break; } case OPTION_DIRMODE: rationalize++; use_RockRidge++; rationalize_dirmode++; { char *end = 0; dirmode_to_use = strtol(optarg, &end, 8); if (!end || *end != 0 || dirmode_to_use < 0 || dirmode_to_use > 07777) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Bad mode for -dir-mode\n"); #else fprintf(stderr, "Bad mode for -dir-mode\n"); exit(1); #endif } break; } #ifdef SORTING case OPTION_SORT: do_sort++; add_sort_list(optarg); break; #endif /* SORTING */ case OPTION_SPLIT_OUTPUT: split_output++; break; case OPTION_STREAM_FILE_NAME: stream_filename = optarg; break; case OPTION_STREAM_CD_SIZE: stream_media_size = atoi(optarg); break; case OPTION_SYSID: system_id = optarg; if (strlen(system_id) > 32) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "System ID string too long\n"); #else fprintf(stderr, "System ID string too long\n"); exit(1); #endif } break; case OPTION_TRANS_TBL: trans_tbl = optarg; /* FALLTHRU */ case 'T': generate_tables++; break; case OPTION_UCS_LEVEL: ucs_level = atoi(optarg); if (ucs_level < 1 || ucs_level > 3) comerrno(EX_BAD, "Illegal UCS Level %d, use 1..3.\n", ucs_level); break; #ifdef UDF case OPTION_UDF: use_udf++; break; #endif #ifdef DVD_VIDEO case OPTION_DVD: use_udf++; dvd_video++; break; #endif case OPTION_USE_FILEVERSION: use_fileversion++; break; case 'U': /* * Minimal (only truncation of 31+ characters) * translation of filenames. * * Forces -l, -d, -N, -allow-leading-dots, * -relaxed-filenames, * -allow-lowercase, -allow-multidot * * This is for HP-UX, which does not recognize ANY * extentions (Rock Ridge, Joliet), causing pain when * loading software. pfs_mount can be used to read the * extensions, but the untranslated filenames can be * read by the "native" cdfs mounter. Completely * violates iso9660. */ full_iso9660_filenames++; /* 31 chars */ omit_period++; /* trailing dot */ allow_leading_dots++; omit_version_number++; relaxed_filenames++; /* all chars */ allow_lowercase++; /* even lowcase */ allow_multidot++; /* > 1 dots */ warn_violate++; break; case OPTION_RELAXED_FILENAMES: relaxed_filenames++; warn_violate++; break; case OPTION_ALLOW_LOWERCASE: allow_lowercase++; warn_violate++; break; case OPTION_ALLOW_MULTIDOT: allow_multidot++; warn_violate++; break; case OPTION_ISO_TRANSLATE: iso_translate = 0; warn_violate++; break; case 'V': volume_id = optarg; if (strlen(volume_id) > 32) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Volume ID string too long\n"); #else fprintf(stderr, "Volume ID string too long\n"); exit(1); #endif } break; case OPTION_VOLSET: volset_id = optarg; if (strlen(volset_id) > 128) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Volume set ID string too long\n"); #else fprintf(stderr, "Volume set ID string too long\n"); exit(1); #endif } break; case OPTION_VOLSET_SIZE: volume_set_size = atoi(optarg); if (volume_set_size <= 0) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Illegal Volume Set Size %s\n", optarg); #else fprintf(stderr, "Illegal Volume Set Size %s\n", optarg); exit(1); #endif } if (volume_set_size > 1) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Volume Set Size > 1 not yet supported\n"); #else fprintf(stderr, "Volume Set Size > 1 not yet supported\n"); exit(1); #endif } break; case OPTION_VOLSET_SEQ_NUM: volume_sequence_number = atoi(optarg); if (volume_sequence_number > volume_set_size) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Volume set sequence number too big\n"); #else fprintf(stderr, "Volume set sequence number too big\n"); exit(1); #endif } break; case 'v': verbose++; break; case 'z': #ifdef VMS #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Transparent compression not supported with VMS\n"); #else fprintf(stderr, "Transparent compression not supported with VMS\n"); exit(1); #endif #else transparent_compression++; #endif break; case 'x': case 'm': /* * Somehow two options to do basically the same thing * got added somewhere along the way. The 'match' * code supports limited globbing, so this is the one * that got selected. Unfortunately the 'x' switch is * probably more intuitive. */ add_match(optarg); break; case OPTION_X_LIST: add_list(optarg); break; case OPTION_I_HIDE: i_add_match(optarg); break; case OPTION_I_LIST: i_add_list(optarg); break; case OPTION_H_HIDE: h_add_match(optarg); break; case OPTION_H_LIST: h_add_list(optarg); break; case OPTION_J_HIDE: j_add_match(optarg); break; case OPTION_J_LIST: j_add_list(optarg); break; case OPTION_HIDE_TRANS_TBL: jhide_trans_tbl++; break; case OPTION_HIDE_RR_MOVED: hide_rr_moved++; break; case OPTION_HELP: usage(0); break; case OPTION_PVERSION: if(mkisofs_call) printf("mkisofs 2.01 is not what you see here. This line is only a fake for too clever\n" "GUIs and other frontend applications. In fact, this program is:\n"); printf("%s (%s)\n", version_string, HOST_SYSTEM); exit(0); break; case OPTION_NOSPLIT_SL_COMPONENT: split_SL_component = 0; break; case OPTION_NOSPLIT_SL_FIELD: split_SL_field = 0; break; case OPTION_HARD_DISK_BOOT: use_eltorito++; hard_disk_boot++; get_boot_entry(); current_boot_entry->hard_disk_boot = 1; break; case OPTION_NO_EMUL_BOOT: use_eltorito++; no_emul_boot++; get_boot_entry(); current_boot_entry->no_emul_boot = 1; break; case OPTION_NO_BOOT: use_eltorito++; not_bootable++; get_boot_entry(); current_boot_entry->not_bootable = 1; break; case OPTION_BOOT_LOAD_ADDR: use_eltorito++; { long val; char *ptr; val = strtol(optarg, &ptr, 0); if (*ptr || val < 0 || val >= 0x10000) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Boot image load address invalid.\n"); #else fprintf(stderr, "Boot image load address invalid.\n"); exit(1); #endif } load_addr = val; } get_boot_entry(); current_boot_entry->load_addr = load_addr; break; case OPTION_BOOT_LOAD_SIZE: use_eltorito++; { long val; char *ptr; val = strtol(optarg, &ptr, 0); if (*ptr || val < 0 || val >= 0x10000) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Boot image load size invalid.\n"); #else fprintf(stderr, "Boot image load size invalid.\n"); exit(1); #endif } load_size = val; } get_boot_entry(); current_boot_entry->load_size = load_size; break; case OPTION_BOOT_INFO_TABLE: use_eltorito++; boot_info_table++; get_boot_entry(); current_boot_entry->boot_info_table = 1; break; #ifdef APPLE_HYB case OPTION_HFS_TYPE: deftype = optarg; hfs_ct++; if (strlen(deftype) != 4) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "HFS default TYPE string has illegal length.\n"); #else fprintf(stderr, "HFS default TYPE string has illegal length.\n"); exit(1); #endif } break; case OPTION_HFS_CREATOR: defcreator = optarg; hfs_ct++; if (strlen(defcreator) != 4) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "HFS default CREATOR string has illegal length.\n"); #else fprintf(stderr, "HFS default CREATOR string has illegal length.\n"); exit(1); #endif } break; case 'H': /* FALLTHRU */ case OPTION_MAP_FILE: afpfile = optarg; hfs_last = MAP_LAST; break; case 'h': apple_hyb = 1; break; case 'g': apple_ext = 1; break; case OPTION_PROBE: probe = 1; break; case OPTION_MACNAME: use_mac_name = 1; break; case OPTION_NOMACFILES: #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Warning: -no-mac-files no longer used ... ignoring\n"); #else fprintf(stderr, "Warning: -no-mac-files no longer used ... ignoring\n"); #endif break; case OPTION_BOOT_HFS_FILE: hfs_boot_file = optarg; /* FALLTHRU */ case OPTION_GEN_PT: gen_pt = 1; break; case OPTION_MAGIC_FILE: #ifndef USE_MAGIC fprintf(stderr, "This program has been compiled without magic library support.\n" "Ignoring the -magic option.\n"); #endif magic_filename = optarg; hfs_last = MAG_LAST; break; case OPTION_AUTOSTART: autoname = optarg; /* gen_pt = 1; */ break; case OPTION_BSIZE: afe_size = atoi(optarg); hfs_select |= DO_FEU; hfs_select |= DO_FEL; break; case OPTION_HFS_VOLID: hfs_volume_id = optarg; break; case OPTION_ROOT_INFO: root_info = optarg; /* FALLTHRU */ case OPTION_ICON_POS: icon_pos = 1; break; /* Mac/Unix types to include */ case OPTION_CAP: hfs_select |= DO_CAP; break; case OPTION_NETA: hfs_select |= DO_NETA; break; case OPTION_DBL: hfs_select |= DO_DBL; break; case OPTION_ESH: case OPTION_USH: hfs_select |= DO_ESH; break; case OPTION_FE: hfs_select |= DO_FEU; hfs_select |= DO_FEL; break; case OPTION_SGI: case OPTION_XIN: hfs_select |= DO_SGI; break; case OPTION_MBIN: hfs_select |= DO_MBIN; break; case OPTION_SGL: hfs_select |= DO_SGL; break; case OPTION_DAVE: hfs_select |= DO_DAVE; break; case OPTION_SFM: hfs_select |= DO_SFM; break; case OPTION_XDBL: hfs_select |= DO_XDBL; break; case OPTION_XHFS: #ifdef IS_MACOS_X hfs_select |= DO_XHFS; #else /* IS_MACOS_X */ #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Warning: --osx-hfs only works on MacOS X ... ignoring\n"); #else /* USE_LIBSCHILY */ fprintf(stderr, "Warning: --osx-hfs only works on MacOS X ... ignoring\n"); #endif /* USE_LIBSCHILY */ #endif /* IS_MACOS_X */ break; case OPTION_CREATE_DT: create_dt = 0; break; case OPTION_HFS_HIDE: hfs_add_match(optarg); break; case OPTION_HFS_LIST: hfs_add_list(optarg); break; case OPTION_HFS_INPUT_CHARSET: use_mac_name = 1; hfs_icharset = optarg; break; case OPTION_HFS_OUTPUT_CHARSET: hfs_ocharset = optarg; break; case OPTION_HFS_UNLOCK: hfs_lock = 0; break; case OPTION_HFS_BLESS: hfs_bless = optarg; break; case OPTION_HFS_PARMS: hfs_parms = strdup(optarg); break; #ifdef PREP_BOOT case OPTION_PREP_BOOT: use_prep_boot++; if (use_prep_boot > 4 - use_chrp_boot) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Maximum of 4 PRep+CHRP partition entries are allowed\n"); #else fprintf(stderr, "Maximum of 4 PRep+CHRP partition entries are allowed\n"); #endif exit(1); } /* pathname of the boot image on cd */ prep_boot_image[use_prep_boot - 1] = optarg; if (prep_boot_image[use_prep_boot - 1] == NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Required PReP boot image pathname missing\n"); #else fprintf(stderr, "Required PReP boot image pathname missing\n"); #endif exit(1); } break; case OPTION_CHRP_BOOT: if (use_chrp_boot) break; /* silently allow duplicates */ use_chrp_boot = 1; if (use_prep_boot > 3) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Maximum of 4 PRep+CHRP partition entries are allowed\n"); #else fprintf(stderr, "Maximum of 4 PRep+CHRP partition entries are allowed\n"); #endif exit(1); } break; #endif /* PREP_BOOT */ #endif /* APPLE_HYB */ case OPTION_ALLOW_LIMITED_SIZE: allow_limited_size++; use_udf++; break; default: susage(1); } /* * "--" was found, the next argument is a pathspec */ if (argc != optind) have_cmd_line_pathspec = 1; parse_input_files: path_ind = optind; /* * XXX This is a hack until we have a decent separate name handling * XXX for UDF filenames. */ if (dvd_video && use_Joliet) { use_Joliet = 0; fprintf(stderr, "Warning: Disabling Joliet support for DVD-Video.\n"); } if (use_udf && !use_Joliet) jlen = 255; if (preparer) { if (strlen(preparer) > 128) { comerrno(EX_BAD, "Preparer string too long\n"); } } if (publisher) { if (strlen(publisher) > 128) { comerrno(EX_BAD, "Publisher string too long\n"); } } if (stream_filename) { if (strlen(stream_filename) > MAX_ISONAME) comerrno(EX_BAD, "stream-file-name too long (%d), max is %d.\n", (int)strlen(stream_filename), (int)MAX_ISONAME); if (strchr(stream_filename, '/')) comerrno(EX_BAD, "Illegal character '/' in stream-file-name.\n"); iso9660_level = 4; } else { stream_filename = "STREAM.IMG;1"; } if (system_id) { if (strlen(system_id) > 32) { comerrno(EX_BAD, "System ID string too long\n"); } } if (use_RockRidge && (iso9660_namelen > MAX_ISONAME_V2_RR)) iso9660_namelen = MAX_ISONAME_V2_RR; if (warn_violate) /* this one is enough for quiet mode, print others warnings only in more verbose modes */ fprintf(stderr, "Warning: creating filesystem that does not conform to ISO-9660.\n"); if (iso9660_level > 3 && verbose>0) fprintf(stderr, "Warning: Creating ISO-9660:1999 (version 2) filesystem.\n"); if (iso9660_namelen > LEN_ISONAME && verbose>0) fprintf(stderr, "Warning: ISO-9660 filenames longer than %d may cause buffer overflows in the OS.\n", LEN_ISONAME); if (use_Joliet && !use_RockRidge && verbose>0) { fprintf(stderr, "Warning: creating filesystem with Joliet extensions but without Rock Ridge\n" " extensions. It is highly recommended to add Rock Ridge.\n"); } if (transparent_compression && verbose>0) { fprintf(stderr, "Warning: using transparent compression. This is a nonstandard Rock Ridge\n"); fprintf(stderr, " extension. The resulting filesystem can only be transparently\n"); fprintf(stderr, " read on Linux. On other operating systems you need to call\n"); fprintf(stderr, " mkzftree by hand to decompress the files.\n"); } if (transparent_compression && !use_RockRidge && verbose>0) { fprintf(stderr, "Warning: transparent decompression is a Linux Rock Ridge extension, but\n"); fprintf(stderr, " creating filesystem without Rock Ridge attributes; files\n"); fprintf(stderr, " will not be transparently decompressed.\n"); } if(follow_links && verbose>0) fprintf(stderr, "Warning: -follow-links does not always work correctly; be careful.\n"); init_unls(); /* Initialize UNICODE tables */ /* initialize code tables from a file - if they exists */ init_unls_file(icharset); init_unls_file(ocharset); #ifdef APPLE_HYB init_unls_file(hfs_icharset); init_unls_file(hfs_ocharset); #endif /* APPLE_HYB */ #ifdef USE_ICONV iconv_possible = !(iso9660_level >= 4 || ((ocharset && strcmp(ocharset, icharset ? icharset : "")) && use_RockRidge) || apple_ext || apple_hyb); setlocale(LC_CTYPE, ""); if (icharset == NULL && iconv_possible) { char *charset = nl_langinfo(CODESET); /* set to detected value but only if it is not pure US-ASCII */ if(charset) { /* workaround for SunOS, iconv is case-sensitive */ char *t; charset = strdup(charset); for(t=charset;*t!='\0';t++) *t=tolower(*t); } if(strcmp(charset, "ansi_x3.4-1968") != 0) icharset = charset; if(icharset && verbose > 0) fprintf(stderr, "I: -input-charset not specified, using %s (detected in locale settings)\n", icharset); } if(iconv_possible) { /* * don't care if initialization fails */ init_nls_iconv(icharset); init_nls_iconv(ocharset); } #endif if (icharset == NULL) { #if (defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__DJGPP__)) && !defined(IS_CYGWIN_1) in_nls = load_unls("cp437"); #else in_nls = load_unls("iso8859-1"); #endif } else { if (strcmp(icharset, "default") == 0) in_nls = load_unls_default(); else in_nls = load_unls(icharset); } /* * set the output charset to the same as the input or the given output * charset */ if (ocharset == NULL) { out_nls = in_nls; } else { if (strcmp(ocharset, "default") == 0) out_nls = load_unls_default(); else out_nls = load_unls(ocharset); } if (in_nls == NULL || out_nls == NULL) { /* Unknown charset specified */ fprintf(stderr, "Unknown charset\nKnown charsets are:\n"); list_unls(); /* List all known charset names */ #ifdef USE_ICONV fprintf(stderr, "\nAdditional input charsets are available for Joliet through the iconv support." "\nRun \"iconv -l\" to display them. Iconv charsets cannot be used with HFS, Apple" "\nextension, ISO9660 version 2 or Rock Ridge.\n"); #endif exit(1); } #ifdef APPLE_HYB if (hfs_icharset == NULL || strcmp(hfs_icharset, "mac-roman")) { hfs_inls = load_unls("cp10000"); } else { if (strcmp(hfs_icharset, "default") == 0) hfs_inls = load_unls_default(); else hfs_inls = load_unls(hfs_icharset); } if (hfs_ocharset == NULL) { hfs_onls = hfs_inls; } else { if (strcmp(hfs_ocharset, "default") == 0) hfs_onls = load_unls_default(); else if (strcmp(hfs_ocharset, "mac-roman") == 0) hfs_onls = load_unls("cp10000"); else hfs_onls = load_unls(hfs_ocharset); } if (hfs_inls == NULL || hfs_onls == NULL) { fprintf(stderr, "Unknown HFS charset\nKnown charsets are:\n"); list_unls(); exit(1); } #endif /* APPLE_HYB */ if (merge_image != NULL) { if (open_merge_image(merge_image) < 0) { /* Complain and die. */ #ifdef USE_LIBSCHILY comerr("Unable to open previous session image '%s'.\n", merge_image); #else fprintf(stderr, "Unable to open previous session image '%s'.\n", merge_image); exit(1); #endif } } /* We don't need root privilleges anymore. */ #ifdef HAVE_SETREUID if (setreuid(-1, getuid()) < 0) #else #ifdef HAVE_SETEUID if (seteuid(getuid()) < 0) #else if (setuid(getuid()) < 0) #endif #endif #ifdef USE_LIBSCHILY comerr("Panic cannot set back effective uid.\n"); #else { perror("Panic cannot set back effective uid."); exit(1); } #endif #ifdef no_more_needed #ifdef __NetBSD__ { int resource; struct rlimit rlp; if (getrlimit(RLIMIT_DATA, &rlp) == -1) perror("Warning: getrlimit failed"); else { rlp.rlim_cur = 33554432; if (setrlimit(RLIMIT_DATA, &rlp) == -1) perror("Warning: setrlimit failed"); } } #endif #endif /* no_more_needed */ #ifdef HAVE_SBRK mem_start = (unsigned long) sbrk(0); #endif /* * if the -hide-joliet option has been given, set the Joliet option */ if (!use_Joliet && j_ishidden()) use_Joliet++; #ifdef APPLE_HYB if (apple_hyb && apple_ext) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have both -apple and -hfs options"); #else fprintf(stderr, "Can't have both -apple and -hfs options"); exit(1); #endif } /* * if -probe, -macname, any hfs selection and/or mapping file is given, * but no HFS option, then select apple_hyb */ if (!apple_hyb && !apple_ext) { if (*afpfile || probe || use_mac_name || hfs_select || hfs_boot_file || magic_filename || hfs_ishidden() || gen_pt || autoname || afe_size || icon_pos || hfs_ct || hfs_icharset || hfs_ocharset) { apple_hyb = 1; } } if (apple_ext && hfs_boot_file) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have -hfs-boot-file with -apple\n"); #else fprintf(stderr, "Can't have -hfs-boot-file with -apple\n"); exit(1); #endif } if (apple_ext && autoname) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have -auto with -apple\n"); #else fprintf(stderr, "Can't have -auto with -apple\n"); exit(1); #endif } if (apple_hyb && (use_sparcboot || use_sunx86boot)) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have -hfs with -sparc-boot/-sunx86-boot\n"); #else fprintf(stderr, "Can't have -hfs with -sparc-boot/-sunx86-boot\n"); exit(1); #endif } if (apple_hyb && use_genboot) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have -hfs with -generic-boot\n"); #else fprintf(stderr, "Can't have -hfs with -generic-boot\n"); exit(1); #endif } #ifdef PREP_BOOT if (apple_ext && use_prep_boot) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have -prep-boot with -apple\n"); #else fprintf(stderr, "Can't have -prep-boot with -apple\n"); exit(1); #endif } #endif /* PREP_BOOT */ if (apple_hyb || apple_ext) apple_both = 1; if (probe) /* we need to search for all types of Apple/Unix files */ hfs_select = ~0; if (apple_both && verbose && !(hfs_select || *afpfile || magic_filename)) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Warning: no Apple/Unix files will be decoded/mapped\n"); #else fprintf(stderr, "Warning: no Apple/Unix files will be decoded/mapped\n"); #endif } if (apple_both && verbose && !afe_size && (hfs_select & (DO_FEU | DO_FEL))) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Warning: assuming PC Exchange cluster size of 512 bytes\n"); #else fprintf(stderr, "Warning: assuming PC Exchange cluster size of 512 bytes\n"); #endif afe_size = 512; } if (apple_both) { /* set up the TYPE/CREATOR mappings */ hfs_init(afpfile, 0, hfs_select); } if (apple_ext && !use_RockRidge) { #ifdef nonono /* use RockRidge to set the SystemUse field ... */ use_RockRidge++; rationalize_all++; #else /* EMPTY */ #endif } if (apple_ext && !(use_XA || use_RockRidge)) { comerrno(EX_BAD, "Need either -XA/-xa or -R/-r for -apple to become active.\n"); } #endif /* APPLE_HYB */ if (rationalize_all) { rationalize++; rationalize_uid++; rationalize_gid++; rationalize_filemode++; rationalize_dirmode++; } if (verbose > 1) { fprintf(stderr, "%s (%s)\n", version_string, HOST_SYSTEM); } if (cdrecord_data == NULL && !check_session && merge_image != NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Multisession usage bug: Must specify -C if -M is used.\n"); #else fprintf(stderr, "Multisession usage bug: Must specify -C if -M is used.\n"); exit(1); #endif } if (cdrecord_data != NULL && merge_image == NULL) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Warning: -C specified without -M: old session data will not be merged.\n"); #else fprintf(stderr, "Warning: -C specified without -M: old session data will not be merged.\n"); #endif } #ifdef APPLE_HYB if (merge_image != NULL && apple_hyb) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Warning: files from previous sessions will not be included in the HFS volume.\n"); #else fprintf(stderr, "Warning: files from previous sessions will not be included in the HFS volume.\n"); #endif } #endif /* APPLE_HYB */ /* * see if we have a list of pathnames to process */ if (pathnames) { /* "-" means take list from the standard input */ if (strcmp(pathnames, "-")) { if ((pfp = fopen(pathnames, "r")) == NULL) { #ifdef USE_LIBSCHILY comerr("Unable to open pathname list %s.\n", pathnames); #else fprintf(stderr, "Unable to open pathname list %s.\n", pathnames); exit(1); #endif } } else pfp = stdin; } /* The first step is to scan the directory tree, and take some notes */ if ((arg = get_pnames(argc, argv, optind, pname, sizeof (pname), pfp)) == NULL) { if (check_session == 0 && !stream_media_size) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Missing pathspec.\n"); #endif susage(1); } } /* * if we don't have a pathspec, then save the pathspec found * in the pathnames file (stored in pname) - we don't want * to skip this pathspec when we read the pathnames file again */ if (!have_cmd_line_pathspec && !stream_media_size) { save_pname = 1; } if (stream_media_size) { if (use_XA || use_RockRidge || use_udf || use_Joliet) comerrno(EX_BAD, "Cannot use XA, Rock Ridge, UDF or Joliet with -stream-media-size\n"); if (merge_image) comerrno(EX_BAD, "Cannot use multi session with -stream-media-size\n"); if (use_eltorito || use_sparcboot || use_sunx86boot || use_genboot || use_prep_boot || hfs_boot_file) comerrno(EX_BAD, "Cannot use boot options with -stream-media-size\n"); if (apple_hyb) comerrno(EX_BAD, "Cannot use Apple hybrid options with -stream-media-size\n"); } if (use_RockRidge) { /* BEGIN CSTYLED */ #if 1 extension_record = generate_rr_extension_record("RRIP_1991A", "THE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICS", "PLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION.", &extension_record_size); #else extension_record = generate_rr_extension_record("IEEE_P1282", "THE IEEE P1282 PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICS", "PLEASE CONTACT THE IEEE STANDARDS DEPARTMENT, PISCATAWAY, NJ, USA FOR THE P1282 SPECIFICATION.", &extension_record_size); #endif /* END CSTYLED */ } if (log_file) { FILE *lfp; int i; /* open log file - test that we can open OK */ if ((lfp = fopen(log_file, "w")) == NULL) { #ifdef USE_LIBSCHILY comerr("Can't open logfile: '%s'.\n", log_file); #else fprintf(stderr, "Can't open logfile: '%s'.\n", log_file); exit(1); #endif } fclose(lfp); /* redirect all stderr message to log_file */ fprintf(stderr, "re-directing all messages to %s\n", log_file); fflush(stderr); /* associate stderr with the log file */ if (freopen(log_file, "w", stderr) == NULL) { #ifdef USE_LIBSCHILY comerr("Can't open logfile: '%s'.\n", log_file); #else fprintf(stderr, "Can't open logfile: '%s'.\n", log_file); exit(1); #endif } if (verbose > 1) { for (i = 0; i < argc; i++) fprintf(stderr, "%s ", argv[i]); fprintf(stderr, "\n%s (%s)\n", version_string, HOST_SYSTEM); } } /* Find name of root directory. */ if (arg != NULL) node = findgequal(arg); if (!use_graft_ptrs) node = NULL; if (node == NULL) { if (use_graft_ptrs && arg != NULL) node = escstrcpy(nodename, arg); else node = arg; } else { /* * Remove '\\' escape chars which are located * before '\\' and '=' chars */ node = escstrcpy(nodename, ++node); } /* * See if boot catalog file exists in root directory, if not we will * create it. */ if (use_eltorito) init_boot_catalog(node); /* * Find the device and inode number of the root directory. Record this * in the hash table so we don't scan it more than once. */ stat_filter(node, &statbuf); add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); memset(&de, 0, sizeof (de)); /* * PO: * Isn't root NULL at this time anyway? * I think it is created by the first call to * find_or_create_directory() below. */ de.filedir = root; /* We need this to bootstrap */ if (cdrecord_data != NULL && merge_image == NULL) { /* * in case we want to add a new session, but don't want to * merge old one */ get_session_start(NULL); } if (merge_image != NULL) { char sector[SECTOR_SIZE]; errno = 0; mrootp = merge_isofs(merge_image); if (mrootp == NULL) { /* Complain and die. */ #ifdef USE_LIBSCHILY if (errno == 0) errno = -1; comerr("Unable to find previous session PVD '%s'.\n", merge_image); #else fprintf(stderr, "Unable to find previous session PVD '%s'.\n", merge_image); exit(1); #endif } memcpy(de.isorec.extent, mrootp->extent, 8); /* * Look for RR Attributes in '.' entry of root dir. * This is the first ISO directory entry in the root dir. */ c = isonum_733((unsigned char *)mrootp->extent); #ifdef USE_SCG readsecs(c, sector, 1); #else lseek(fileno(in_image), c*2048, SEEK_SET); read(fileno(in_image), sector, sizeof (sector)); #endif c = rr_flags((struct iso_directory_record *)sector); if (c & RR_FLAG_XA) fprintf(stderr, "XA signatures found\n"); if (c & RR_FLAG_AA) fprintf(stderr, "AA signatures found\n"); if (c & ~(RR_FLAG_XA|RR_FLAG_AA)) { if (c & RR_FLAG_SP) { fprintf(stderr, "Rock Ridge signatures found\n"); } else { fprintf(stderr, "Bad Rock Ridge signatures found (SU record missing)\n"); if (!force_rr) no_rr++; } } else { fprintf(stderr, "NO Rock Ridge present\n"); if ((c & (RR_FLAG_XA|RR_FLAG_AA)) == 0) { if (!force_rr) no_rr++; } } if (no_rr) fprintf(stderr, "Disabling Rock Ridge / XA / AA\n"); } /* * Create an empty root directory. If we ever scan it for real, * we will fill in the contents. */ find_or_create_directory(NULL, "", &de, TRUE, NULL); #ifdef APPLE_HYB /* may need to set window layout of the volume */ if (root_info) set_root_info(root_info); #endif /* APPLE_HYB */ if(optind < argc-1) merge_warn_msg="NOTE: multiple source directories have been specified and merged into the root\n" "of the filesystem. Check your program arguments. genisoimage is not tar.\n"; /* * Scan the actual directory (and any we find below it) for files to * write out to the output image. Note - we take multiple source * directories and keep merging them onto the image. */ if (check_session == 0) while ((arg = get_pnames(argc, argv, optind, pname, sizeof (pname), pfp)) != NULL) { struct directory *graft_dir; struct stat st; char *short_name; int status; char graft_point[PATH_MAX + 1]; /* * We would like a syntax like: * * /tmp=/usr/tmp/xxx * * where the user can specify a place to graft each component * of the tree. To do this, we may have to create directories * along the way, of course. Secondly, I would like to allow * the user to do something like: * * /home/baz/RMAIL=/u3/users/baz/RMAIL * * so that normal files could also be injected into the tree * at an arbitrary point. * * The idea is that the last component of whatever is being * entered would take the name from the last component of * whatever the user specifies. * * The default will be that the file is injected at the root of * the image tree. */ node = findgequal(arg); if (!use_graft_ptrs) node = NULL; /* * Remove '\\' escape chars which are located * before '\\' and '=' chars ---> below in escstrcpy() */ short_name = NULL; if (node != NULL || reloc_root) { char *pnt; char *xpnt; size_t len; int node_is_dir; /* insert -root prefix */ if (reloc_root != NULL) { strcpy(graft_point, reloc_root); len = strlen(graft_point); if (graft_point[len] != '/') { graft_point[len++] = '/'; graft_point[len] = '\0'; } } else { len = 0; } if (node) { *node = '\0'; escstrcpy(&graft_point[len], arg); *node = '='; } /* * Remove unwanted "./" & "/" sequences from start... */ do { xpnt = graft_point; while (xpnt[0] == '.' && xpnt[1] == '/') xpnt += 2; while (*xpnt == PATH_SEPARATOR) { xpnt++; } memmove(graft_point, xpnt, strlen(xpnt)+1); } while (xpnt > graft_point); if (node) { node = escstrcpy(nodename, ++node); } else { node = arg; } graft_dir = root; xpnt = graft_point; /* * If "node" points to a directory, then graft_point * needs to point to a directory too. */ if (follow_links) status = stat_filter(node, &st); else status = lstat_filter(node, &st); node_is_dir = S_ISDIR(st.st_mode); if (status == 0 && node_is_dir) { len = strlen(graft_point); if ((len <= (sizeof (graft_point) -1)) && graft_point[len-1] != '/') { graft_point[len++] = '/'; graft_point[len] = '\0'; } } if (debug) fprintf(stderr, "GRAFT:'%s'\n", xpnt); /* * Loop down deeper and deeper until we find the * correct insertion spot. * Canonicalize the filename while parsing it. */ for (;;) { struct stat* stat_template; do { while (xpnt[0] == '.' && xpnt[1] == '/') xpnt += 2; while (xpnt[0] == '/') xpnt += 1; if (xpnt[0] == '.' && xpnt[1] == '.' && xpnt[2] == '/') { if (graft_dir && graft_dir != root) { graft_dir = graft_dir->parent; xpnt += 2; } } } while ((xpnt[0] == '/') || (xpnt[0] == '.' && xpnt[1] == '/')); pnt = strchr(xpnt, PATH_SEPARATOR); if (pnt == NULL) { if (*xpnt != '\0') { short_name = xpnt; } break; } *pnt = '\0'; if (debug) { fprintf(stderr, "GRAFT Point:'%s' in '%s : %s' (%s)\n", xpnt, graft_dir->whole_name, graft_dir->de_name, graft_point); } /* * If the node being grafted is a * directory, then we want the last * directory in this graft chain to have * the ownership and permissions of the * source node. Other directories in the * chain get default ownership and * permissions. */ stat_template = (pnt[1] == '\0' && node_is_dir) ? &st : 0; graft_dir = find_or_create_directory(graft_dir, graft_point, NULL, TRUE, stat_template); *pnt = PATH_SEPARATOR; xpnt = pnt + 1; } } else { graft_dir = root; if (use_graft_ptrs) node = escstrcpy(nodename, arg); else node = arg; } /* * Get information on the node */ if (follow_links) status = stat_filter(node, &st); else status = lstat_filter(node, &st); if (status != 0) { /* * This is a fatal error - the user won't be getting * what they want if we were to proceed. */ #ifdef USE_LIBSCHILY comerr("Invalid node - '%s'.\n", node); #else fprintf(stderr, "Invalid node - '%s'.\n", node); exit(1); #endif } else { /* * Now see whether the user wants to add a regular * file or a directory at this point. */ if (S_ISDIR(st.st_mode)) { if (debug) { fprintf(stderr, "graft_dir: '%s : %s', node: '%s', (scan)\n", graft_dir->whole_name, graft_dir->de_name, node); } if (!scan_directory_tree(graft_dir, node, &de)) { exit(1); } if (debug) { fprintf(stderr, "scan done\n"); } } else { if (short_name == NULL) { short_name = strrchr(node, PATH_SEPARATOR); if (short_name == NULL || short_name < node) { short_name = node; } else { short_name++; } } if (debug) { fprintf(stderr, "graft_dir: '%s : %s', node: '%s', short_name: '%s'\n", graft_dir->whole_name, graft_dir->de_name, node, short_name); } #ifdef APPLE_HYB if (!insert_file_entry(graft_dir, node, short_name, 0)) #else if (!insert_file_entry(graft_dir, node, short_name)) #endif /* APPLE_HYB */ { /* * Should we ignore this? */ /* exit(1);*/ /* EMPTY */ } } } optind++; no_path_names = 0; } if (pfp && pfp != stdin) fclose(pfp); /* * exit if we don't have any pathnames to process * - not going to happen at the moment as we have to have at least one * path on the command line */ if (no_path_names && !check_session && !stream_media_size) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "No pathnames found.\n"); #endif susage(1); } /* * Now merge in any previous sessions. This is driven on the source * side, since we may need to create some additional directories. */ if (merge_image != NULL) { if (merge_previous_session(root, mrootp, reloc_root, reloc_old_root) < 0) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Cannot merge previous session.\n"); #else fprintf(stderr, "Cannot merge previous session.\n"); exit(1); #endif } close_merge_image(); /* * set up parent_dir and filedir in relocated entries which * were read from previous session so that * finish_cl_pl_entries can do its job */ match_cl_re_entries(); } #ifdef APPLE_HYB /* free up any HFS filename mapping memory */ if (apple_both) clean_hfs(); #endif /* APPLE_HYB */ /* hide "./rr_moved" if all its contents have been hidden */ if (reloc_dir && i_ishidden()) hide_reloc_dir(); /* insert the boot catalog if required */ if (use_eltorito) insert_boot_cat(); /* * Free up any matching memory */ for (n = 0; n < MAX_MAT; n++) gen_del_match(n); #ifdef SORTING del_sort(); #endif /* SORTING */ /* * Sort the directories in the required order (by ISO9660). Also, * choose the names for the 8.3 filesystem if required, and do any * other post-scan work. */ goof += sort_tree(root); if (goof) { fprintf(stderr, "ISO9660/Rock Ridge tree sort failed.\n"); if(merge_warn_msg) fprintf(stderr, merge_warn_msg); exit(1); } #ifdef UDF if (use_Joliet || use_udf) { #else if (use_Joliet) { #endif goof += joliet_sort_tree(root); } if (goof) { fprintf(stderr, "Joliet tree sort failed. The -joliet-long switch may help you.\n"); if(merge_warn_msg) fprintf(stderr, merge_warn_msg); exit(1); } /* * Fix a couple of things in the root directory so that everything is * self consistent. Fix this up so that the path tables get done right. */ root->self = root->contents; /* OK, ready to write the file. Open it up, and generate the thing. */ if (print_size) { discimage = fopen("/dev/null", "wb"); if (!discimage) { #ifdef USE_LIBSCHILY comerr("Unable to open /dev/null\n"); #else fprintf(stderr, "Unable to open /dev/null\n"); exit(1); #endif } } else if (outfile && (strcmp (outfile, "-")) != 0) { discimage = fopen(outfile, "wb"); if (!discimage) { #ifdef USE_LIBSCHILY comerr("Unable to open disc image file '%s'.\n", outfile); #else fprintf(stderr, "Unable to open disc image file '%s'.\n", outfile); exit(1); #endif } if (jtemplate_out || jjigdo_out) { if (!jtemplate_out || !jjigdo_out || !jmd5_list) { #ifdef USE_LIBSCHILY comerr("Bad options - need to specify output names for jigdo and template file, and also the md5-list input file!\n"); #else fprintf(stderr, "Bad options - need to specify output names for jigdo and template file, and also the md5-list input file!\n"); exit(1); #endif } jtjigdo = fopen(jjigdo_out, "wb"); jttemplate = fopen(jtemplate_out, "wb"); if (!jtjigdo || !jttemplate) { #ifdef USE_LIBSCHILY comerr("Unable to open jigdo template image file\n"); #else fprintf(stderr, "Unable to open jigdo template image file\n"); exit(1); #endif } write_jt_header(jttemplate, jtjigdo); } } else if ((outfile == NULL) && isatty (fileno (stdout))) { /* FIXME: a cleaner way to override this check? */ fputs (("image not written to a terminal.\n" "Use -o - to force the output.\n"), stderr); exit (1); } else { discimage = stdout; #ifdef NEED_O_BINARY setmode(fileno(stdout), O_BINARY); #endif } /* Now assign addresses on the disc for the path table. */ path_blocks = ISO_BLOCKS(path_table_size); if (path_blocks & 1) path_blocks++; jpath_blocks = ISO_BLOCKS(jpath_table_size); if (jpath_blocks & 1) jpath_blocks++; /* * Start to set up the linked list that we use to track the contents * of the disc. */ #ifdef APPLE_HYB #ifdef PREP_BOOT if (apple_hyb || use_prep_boot || use_chrp_boot) #else /* PREP_BOOT */ if (apple_hyb) #endif /* PREP_BOOT */ outputlist_insert(&hfs_desc); #endif /* APPLE_HYB */ if (use_sparcboot || use_sunx86boot) outputlist_insert(&sunlabel_desc); if (use_alphaboot) outputlist_insert(&alphaboot_desc); if (use_hppaboot) outputlist_insert(&hppaboot_desc); if (use_alphaboot || use_hppaboot) outputlist_insert(&alpha_hppa_boot_desc); if (use_mipsboot) outputlist_insert(&mipsboot_desc); if (use_mipselboot) outputlist_insert(&mipselboot_desc); if (use_genboot) outputlist_insert(&genboot_desc); outputlist_insert(&startpad_desc); /* PVD for disc. */ outputlist_insert(&voldesc_desc); /* SVD for El Torito. MUST be immediately after the PVD! */ if (use_eltorito) { outputlist_insert(&torito_desc); } /* Enhanced PVD for disc. neded if we write ISO-9660:1999 */ if (iso9660_level > 3) outputlist_insert(&xvoldesc_desc); /* SVD for Joliet. */ if (use_Joliet) { outputlist_insert(&joliet_desc); } /* Finally the last volume descriptor. */ outputlist_insert(&end_vol); #ifdef UDF if (use_udf) { outputlist_insert(&udf_vol_recognition_area_frag); } #endif /* Insert the version descriptor. */ outputlist_insert(&version_desc); #ifdef UDF if (use_udf) { /* * Most of the space before sector 256 is wasted when * UDF is turned on. The waste could be reduced by * putting the ISO9660/Joliet structures before the * pad_to_sector_256; the problem is that they might * overshoot sector 256, so there would have to be some * ugly logic to detect this case and rearrange things * appropriately. I don't know if it's worth it. */ outputlist_insert(&udf_pad_to_sector_32_frag); outputlist_insert(&udf_main_seq_frag); outputlist_insert(&udf_main_seq_copy_frag); outputlist_insert(&udf_integ_seq_frag); outputlist_insert(&udf_pad_to_sector_256_frag); outputlist_insert(&udf_anchor_vol_desc_frag); outputlist_insert(&udf_file_set_desc_frag); outputlist_insert(&udf_dirtree_frag); outputlist_insert(&udf_file_entries_frag); } #endif /* Now start with path tables and directory tree info. */ if (!stream_media_size) outputlist_insert(&pathtable_desc); else outputlist_insert(&strpath_desc); if (use_Joliet) { outputlist_insert(&jpathtable_desc); } if (!stream_media_size) outputlist_insert(&dirtree_desc); if (use_Joliet) { outputlist_insert(&jdirtree_desc); } outputlist_insert(&dirtree_clean); if (extension_record) { outputlist_insert(&extension_desc); } if (!stream_media_size) { outputlist_insert(&files_desc); } else { outputlist_insert(&strfile_desc); outputlist_insert(&strdir_desc); } /* * Allow room for the various headers we will be writing. * There will always be a primary and an end volume descriptor. */ last_extent = session_start; /* * Calculate the size of all of the components of the disc, and assign * extent numbers. */ for (opnt = out_list; opnt; opnt = opnt->of_next) { opnt->of_start_extent = last_extent; if (opnt->of_size != NULL) { (*opnt->of_size) (last_extent); } } /* * Generate the contents of any of the sections that we want to * generate. Not all of the fragments will do anything here * - most will generate the data on the fly when we get to the write * pass. */ for (opnt = out_list; opnt; opnt = opnt->of_next) { if (opnt->of_generate != NULL) { (*opnt->of_generate) (); } } /* * Padding just after the ISO-9660 filesystem. * * files_desc does not have an of_size function. For this * reason, we must insert us after the files content has been * generated. */ #ifdef UDF if (use_udf) { /* Single anchor volume descriptor pointer at end */ outputlist_insert(&udf_end_anchor_vol_desc_frag); if (udf_end_anchor_vol_desc_frag.of_size != NULL) { (*udf_end_anchor_vol_desc_frag.of_size) (last_extent); } if (dopad) { /* * Pad with anchor volume descriptor pointer * blocks instead of zeroes. */ outputlist_insert(&udf_padend_avdp_frag); if (udf_padend_avdp_frag.of_size != NULL) { (*udf_padend_avdp_frag.of_size) (last_extent); } } } else #endif if (dopad && !(use_sparcboot || use_sunx86boot)) { outputlist_insert(&endpad_desc); if (endpad_desc.of_size != NULL) { (*endpad_desc.of_size) (last_extent); } } c = 0; if (use_sparcboot) { if (dopad) { /* Padding before the boot partitions. */ outputlist_insert(&interpad_desc); if (interpad_desc.of_size != NULL) { (*interpad_desc.of_size) (last_extent); } } c = make_sun_label(); last_extent += c; outputlist_insert(&sunboot_desc); if (dopad) { outputlist_insert(&endpad_desc); if (endpad_desc.of_size != NULL) { (*endpad_desc.of_size) (last_extent); } } } else if (use_sunx86boot) { if (dopad) { /* Padding before the boot partitions. */ outputlist_insert(&interpad_desc); if (interpad_desc.of_size != NULL) { (*interpad_desc.of_size) (last_extent); } } c = make_sunx86_label(); last_extent += c; outputlist_insert(&sunboot_desc); if (dopad) { outputlist_insert(&endpad_desc); if (endpad_desc.of_size != NULL) { (*endpad_desc.of_size) (last_extent); } } } if (print_size > 0) { if (verbose > 0) fprintf(stderr, "Total extents scheduled to be written = %u\n", (last_extent - session_start)); printf("%u\n", (last_extent - session_start)); exit(0); } /* * Now go through the list of fragments and write the data that * corresponds to each one. */ for (opnt = out_list; opnt; opnt = opnt->of_next) { Uint oext; oext = last_extent_written; if (opnt->of_start_extent != 0 && opnt->of_start_extent != last_extent_written) { /* * Consistency check. * XXX Should make sure that all entries have * XXXX of_start_extent set up correctly. */ comerrno(EX_BAD, "Implementation botch: %s should start at %u but starts at %u.\n", opnt->of_name, opnt->of_start_extent, last_extent_written); } if (opnt->of_write != NULL) { if (verbose > 1) fprintf(stderr, "Writing: %-40sStart Block %u\n", opnt->of_name, last_extent_written); (*opnt->of_write) (discimage); if (verbose > 1) fprintf(stderr, "Done with: %-40sBlock(s) %u\n", opnt->of_name, last_extent_written-oext); } } if (last_extent != last_extent_written) { comerrno(EX_BAD, "Implementation botch: FS should end at %u but ends at %u.\n", last_extent, last_extent_written); } if (jttemplate) { write_jt_footer(); fclose(jttemplate); } if (jtjigdo) fclose(jtjigdo); if (verbose > 0) { #ifdef HAVE_SBRK fprintf(stderr, "Max brk space used %x\n", (unsigned int)(((unsigned long) sbrk(0)) - mem_start)); #endif fprintf(stderr, "%u extents written (%u MB)\n", last_extent, last_extent >> 9); } #ifdef VMS return (1); #else return (0); #endif } /* * Find unescaped equal sign in graft pointer string. */ char * findgequal(char *s) { char *p = s; while ((p = strchr(p, '=')) != NULL) { if (p > s && p[-1] != '\\') return (p); p++; } return (NULL); } /* * Find unescaped equal sign in string. */ static char * escstrcpy(char *to, char *from) { char *p = to; if (debug) fprintf(stderr, "FROM: '%s'\n", from); while ((*p = *from++) != '\0') { if (*p == '\\') { if ((*p = *from++) == '\0') break; if (*p != '\\' && *p != '=') { p[1] = p[0]; *p++ = '\\'; } } p++; } if (debug) fprintf(stderr, "ESC: '%s'\n", to); return (to); } void * e_malloc(size_t size) { void *pt = 0; if ((size > 0) && ((pt = malloc(size)) == NULL)) { #ifdef USE_LIBSCHILY comerr("Not enough memory\n"); #else fprintf(stderr, "Not enough memory\n"); exit(1); #endif } /* * Not all code is clean yet. * Filling all allocated data with zeroes will help * to avoid core dumps. */ if (size > 0) /* a workaround for gcc bug gcc.gnu.org/PR25639 */ memset(pt, 0, size); return (pt); } cdrkit-1.1.11/genisoimage/more.mapping0000644000372500001440000004367710531367430016755 0ustar steveusers# # Mapping file converted from Internet Config # by Bob Nestor # # EXTN Xlate Creator Type Application - description (mime type) # .1st Ascii 'ttxt' 'TEXT' "SimpleText - Text Readme (application/text)" .669 Raw 'SNPL' '6669' "PlayerPro - 669 MOD Music" .8med Raw 'SCPL' 'STrk' "SoundApp - Amiga OctaMed music" .8svx Raw 'SCPL' '8SVX' "SoundApp - Amiga 8-bit sound" .a Ascii 'MPS ' 'TEXT' "MPW Shell - Assembly Source" .aif Raw 'SCPL' 'AIFF' "SoundApp - AIFF Sound (audio/x-aiff)" .aifc Raw 'SCPL' 'AIFC' "SoundApp - AIFF Sound Compressed (audio/x-aiff)" .aiff Raw 'SCPL' 'AIFF' "SoundApp - AIFF Sound (audio/x-aiff)" .al Raw 'SCPL' 'ALAW' "SoundApp - ALAW Sound" .ani Raw 'GKON' 'ANIi' "GraphicConverter - Animated NeoChrome" .apd Ascii 'ALD3' 'TEXT' "Aldus PageMaker - Aldus Printer Description" .arc Raw 'arc*' 'mArc' "ArcMac - PC ARChive" .arj Raw 'DArj' 'BINA' "DeArj - ARJ Archive" .arr Raw 'GKON' 'ARR ' "GraphicConverter - Amber ARR image" .art Raw 'GKON' 'ART ' "GraphicConverter - First Publisher" .asc Ascii 'ttxt' 'TEXT' "SimpleText - ASCII Text (text/plain)" .ascii Ascii 'ttxt' 'TEXT' "SimpleText - ASCII Text (text/plain)" .asm Ascii 'MPS ' 'TEXT' "MPW Shell - Assembly Source" .au Raw 'SCPL' 'ULAW' "SoundApp - Sun Sound (audio/basic)" .avi Raw 'AVIC' 'VfW ' "AVI to QT Utility - AVI Movie (video/avi)" .bar Raw 'S691' 'BARF' "SunTar - Unix BAR Archive" .bas Ascii 'TBB6' 'TEXT' "TexEdit - BASIC Source" .bat Ascii 'ttxt' 'TEXT' "SimpleText - MS-DOS Batch File" .bga Raw 'JVWR' 'BMPp' "JPEGView - OS/2 Bitmap" .bib Ascii '*TEX' 'TEXT' "Textures - BibTex Bibliography" .bin Raw 'MB2P' 'BINA' "MacBinary II+ - MacBinary (application/macbinary)" .binary Raw 'hDmp' 'BINA' "HexEdit - Untyped Binary Data (application/octet-stream)" .bmp Raw 'JVWR' 'BMPp' "JPEGView - Windows Bitmap" .boo Ascii 'TBB6' 'TEXT' "TexEdit - BOO encoded" .bst Ascii '*TEX' 'TEXT' "Textures - BibTex Style" .bw Raw 'GKON' 'SGI ' "GraphicConverter - SGI Image" .c Ascii 'CWIE' 'TEXT' "CodeWarrior - C Source" .cgm Raw 'GKON' 'CGMm' "GraphicConverter - Computer Graphics Meta" .class Raw 'CWIE' 'Clss' "CodeWarrior - Java Class File" .clp Raw 'GKON' 'CLPp' "GraphicConverter - Windows Clipboard" .cmd Ascii 'ttxt' 'TEXT' "SimpleText - OS/2 Batch File" .com Raw 'SWIN' 'PCFA' "SoftWindows - MS-DOS Executable" .cp Ascii 'CWIE' 'TEXT' "CodeWarrior - C++ Source" .cpp Ascii 'CWIE' 'TEXT' "CodeWarrior - C++ Source" .cpt Raw 'CPCT' 'PACT' "Compact Pro - Compact Pro Archive" .csv Ascii 'XCEL' 'TEXT' "Excel - Comma Separated Vars" .ct Raw 'GKON' '..CT' "GraphicConverter - Scitex-CT" .cut Raw 'GKON' 'Halo' "GraphicConverter - Dr Halo Image" .cvs Raw 'DAD2' 'drw2' "Canvas - Canvas Drawing" .dbf Raw 'FOX+' 'COMP' "FoxBase+ - DBase Document" .dcx Raw 'GKON' 'DCXx' "GraphicConverter - Some PCX Images" .dif Ascii 'XCEL' 'TEXT' "Excel - Data Interchange Format" .diz Ascii 'TBB6' 'TEXT' "TexEdit - BBS Descriptive Text" .dl Raw 'AnVw' 'DL ' "MacAnim Viewer - DL Animation" .dll Raw 'SWIN' 'PCFL' "SoftWindows - Windows DLL" .doc Raw 'MSWD' 'WDBN' "Microsoft Word - Word Document (application/msword)" .dot Raw 'MSWD' 'sDBN' "Microsoft Word - Word for Windows Template" .dvi Raw 'OTEX' 'ODVI' "OzTeX - TeX DVI Document (application/x-dvi)" .dxf Ascii 'SWVL' 'TEXT' "Swivel Pro - AutoCAD 3D Data" .eps Raw 'vgrd' 'EPSF' "LaserWriter 8 - Postscript (application/postscript)" .epsf Raw 'vgrd' 'EPSF' "LaserWriter 8 - Postscript (application/postscript)" .etx Ascii 'ezVu' 'TEXT' "Easy View - SEText (text/x-setext)" .evy Raw 'ENVY' 'EVYD' "Envoy - Envoy Document" .exe Raw 'SWIN' 'PCFA' "SoftWindows - MS-DOS Executable" .faq Ascii 'TBB6' 'TEXT' "TexEdit - ASCII Text (text/x-usenet-faq)" .fit Raw 'GKON' 'FITS' "GraphicConverter - Flexible Image Transport (image/x-fits)" .flc Raw 'AnVw' 'FLI ' "MacAnim Viewer - FLIC Animation" .fli Raw 'AnVw' 'FLI ' "MacAnim Viewer - FLI Animation" .fm Raw 'FMPR' 'FMPR' "FileMaker Pro - FileMaker Pro Database" .for Ascii 'MPS ' 'TEXT' "MPW Shell - Fortran Source" .fts Raw 'GKON' 'FITS' "GraphicConverter - Flexible Image Transport" .gem Raw 'GKON' 'GEM-' "GraphicConverter - GEM Metafile" .gif Raw 'JVWR' 'GIFf' "JPEGView - GIF Picture (image/gif)" .gl Raw 'AnVw' 'GL ' "MacAnim Viewer - GL Animation" .grp Raw 'GKON' 'GRPp' "GraphicConverter - GRP Image" .gz Raw 'Gzip' 'Gzip' "MacGzip - Gnu ZIP Archive (application/x-gzip)" .h Ascii 'CWIE' 'TEXT' "CodeWarrior - C Include File" .hcom Raw 'SCPL' 'FSSD' "SoundApp - SoundEdit Sound ex SOX" .hp Ascii 'CWIE' 'TEXT' "CodeWarrior - C Include File" .hpgl Raw 'GKON' 'HPGL' "GraphicConverter - HP GL/2" .hpp Ascii 'CWIE' 'TEXT' "CodeWarrior - C Include File" .hqx Ascii 'TBB6' 'TEXT' "TexEdit - BinHex (application/mac-binhex40)" .htm Ascii 'Um6' 'TEXT' "HTML Pro - HyperText (text/html)" .html Ascii 'Um6' 'TEXT' "HTML Pro - HyperText (text/html)" .i3 Ascii 'TBB6' 'TEXT' "TexEdit - Modula 3 Interface" .ic1 Raw 'GKON' 'IMAG' "GraphicConverter - Atari Image" .ic2 Raw 'GKON' 'IMAG' "GraphicConverter - Atari Image" .ic3 Raw 'GKON' 'IMAG' "GraphicConverter - Atari Image" .icn Raw 'GKON' 'ICO ' "GraphicConverter - Windows Icon" .ico Raw 'GKON' 'ICO ' "GraphicConverter - Windows Icon" .ief Raw 'GKON' 'IEF ' "GraphicConverter - IEF image (image/ief)" .iff Raw 'GKON' 'ILBM' "GraphicConverter - Amiga IFF Image" .ilbm Raw 'GKON' 'ILBM' "GraphicConverter - Amiga ILBM Image" .image Raw 'dCpy' 'dImg' "DiskCopy - Apple DiskCopy Image" .img Raw 'GKON' 'IMGg' "GraphicConverter - GEM bit image/XIMG" .img Raw 'GKON' 'KONT' "GraphicConverter - KONTRON Image" .ini Ascii 'ttxt' 'TEXT' "SimpleText - Windows INI File" .java Ascii 'CWIE' 'TEXT' "CodeWarrior - Java Source File" .jfif Raw 'JVWR' 'JFIF' "JPEGView - JFIF Image" .jpe Raw 'JVWR' 'JPEG' "JPEGView - JPEG Picture (image/jpeg)" .jpeg Raw 'JVWR' 'JPEG' "JPEGView - JPEG Picture (image/jpeg)" .jpg Raw 'JVWR' 'JPEG' "JPEGView - JPEG Picture (image/jpeg)" .latex Ascii 'OTEX' 'TEXT' "OzTex - Latex (application/x-latex)" .lbm Raw 'GKON' 'ILBM' "GraphicConverter - Amiga IFF Image" .lha Raw 'LARC' 'LHA ' "MacLHA - LHArc Archive" .lzh Raw 'LARC' 'LHA ' "MacLHA - LHArc Archive" .m1a Raw 'KAU1' 'MPEG' "MPEG/CD - MPEG-1 audiostream (audio/x-mpeg)" .m1s Raw 'MPsp' 'MPEG' "MPEGSplitter - MPEG-1 systemstream" .m1v Raw 'mMPG' 'M1V ' "Sparkle - MPEG-1 IPB videostream (video/mpeg)" .m2 Ascii 'TBB6' 'TEXT' "TexEdit - Modula 2 Source" .m2v Raw 'MPG2' 'MPG2' "MPEG2decoder - MPEG-2 IPB videostream" .m3 Ascii 'TBB6' 'TEXT' "TexEdit - Modula 3 Source" .mac Raw 'ttxt' 'PICT' "SimpleText - PICT Picture (image/x-pict)" .mak Ascii 'TBB6' 'TEXT' "TexEdit - Makefile" .mcw Raw 'MSWD' 'WDBN' "Microsoft Word - Mac Word Document" .me Ascii 'ttxt' 'TEXT' "SimpleText - Text Readme" .med Raw 'SCPL' 'STrk' "SoundApp - Amiga MED Sound" .mf Ascii '*MF*' 'TEXT' "Metafont - Metafont" .mid Raw 'ttxt' 'Midi' "SimpleText - MIDI Music" .midi Raw 'ttxt' 'Midi' "SimpleText - MIDI Music" .mif Ascii 'Fram' 'TEXT' "FrameMaker - FrameMaker MIF (application/x-mif)" .mif Ascii 'Fram' 'TEXT' "FrameMaker - FrameMaker MIF (application/x-framemaker)" .mime Ascii 'mPAK' 'TEXT' "Mpack - MIME Message (message/rfc822)" .ml Ascii 'TBB6' 'TEXT' "TexEdit - ML Source" .mod Raw 'SCPL' 'STrk' "SoundApp - MOD Music" .mol Ascii 'RSML' 'TEXT' "RasMac - MDL Molfile" .moov Raw 'ttxt' 'MooV' "SimpleText - QuickTime Movie (video/quicktime)" .mov Raw 'ttxt' 'MooV' "SimpleText - QuickTime Movie (video/quicktime)" .mp2 Raw 'KAU1' 'MPEG' "MPEG/CD - MPEG-1 audiostream (audio/x-mpeg)" .mpa Raw 'KAU1' 'MPEG' "MPEG/CD - MPEG-1 audiostream (audio/x-mpeg)" .mpe Raw 'mMPG' 'MPEG' "Sparkle - MPEG Movie of some sort (video/mpeg)" .mpeg Raw 'mMPG' 'MPEG' "Sparkle - MPEG Movie of some sort (video/mpeg)" .mpg Raw 'mMPG' 'MPEG' "Sparkle - MPEG Movie of some sort (video/mpeg)" .msp Raw 'GKON' 'MSPp' "GraphicConverter - Microsoft Paint" .mtm Raw 'SNPL' 'MTM ' "PlayerPro - MultiMOD Music" .mw Raw 'MWII' 'MW2D' "MacWrite II - MacWrite Document (application/macwriteii)" .mwii Raw 'MWII' 'MW2D' "MacWrite II - MacWrite Document (application/macwriteii)" .neo Raw 'GKON' 'NeoC' "GraphicConverter - Atari NeoChrome" .nfo Ascii 'ttxt' 'TEXT' "SimpleText - Info Text (application/text)" .nst Raw 'SCPL' 'STrk' "SoundApp - MOD Music" .obj Raw 'SWIN' 'PCFL' "SoftWindows - Object (DOS/Windows)" .oda Raw 'ODA ' 'ODIF' "MacODA XTND Translator - ODA Document (application/oda)" .okt Raw 'SCPL' 'OKTA' "SoundApp - Oktalyser MOD Music" .out Raw 'hDmp' 'BINA' "HexEdit - Output File" .ovl Raw 'SWIN' 'PCFL' "SoftWindows - Overlay (DOS/Windows)" .p Ascii 'CWIE' 'TEXT' "CodeWarrior - Pascal Source" .pac Raw 'GKON' 'STAD' "GraphicConverter - Atari STAD Image" .pas Ascii 'CWIE' 'TEXT' "CodeWarrior - Pascal Source" .pbm Raw 'GKON' 'PPGM' "GraphicConverter - Portable Bitmap (image/x-pbm)" .pbm Raw 'GKON' 'PPGM' "GraphicConverter - Portable Bitmap (image/x-portable-bitmap)" .pc1 Raw 'GKON' 'Dega' "GraphicConverter - Atari Degas Image" .pc2 Raw 'GKON' 'Dega' "GraphicConverter - Atari Degas Image" .pc3 Raw 'GKON' 'Dega' "GraphicConverter - Atari Degas Image" .pcs Raw 'GKON' 'PICS' "GraphicConverter - Animated PICTs" .pct Raw 'ttxt' 'PICT' "SimpleText - PICT Picture (image/x-pict)" .pcx Raw 'GKON' 'PCXx' "GraphicConverter - PC PaintBrush" .pdb Ascii 'RSML' 'TEXT' "RasMac - Brookhaven PDB file" .pdf Raw 'CARO' 'PDF ' "Acrobat Reader - Portable Document Format (application/pdf)" .pdx Ascii 'ALD5' 'TEXT' "PageMaker - Printer Description" .pgm Raw 'GKON' 'PPGM' "GraphicConverter - Portable Graymap (image/x-pgm)" .pgm Raw 'GKON' 'PPGM' "GraphicConverter - Portable Graymap (image/x-portable-graymap)" .pi1 Raw 'GKON' 'Dega' "GraphicConverter - Atari Degas Image" .pi2 Raw 'GKON' 'Dega' "GraphicConverter - Atari Degas Image" .pi3 Raw 'GKON' 'Dega' "GraphicConverter - Atari Degas Image" .pic Raw 'ttxt' 'PICT' "SimpleText - PICT Picture (image/x-pict)" .pict Raw 'ttxt' 'PICT' "SimpleText - PICT Picture (image/x-macpict)" .pit Raw 'SITx' 'PIT ' "StuffIt Expander - PackIt Archive" .pkg Raw 'GEOL' 'HBSF' "AppleLink - AppleLink Package" .pl Ascii 'McPL' 'TEXT' "MacPerl - Perl Source" .plt Raw 'GKON' 'HPGL' "GraphicConverter - HP GL/2" .pm Raw 'GKON' 'PMpm' "GraphicConverter - Bitmap from xv" .pm3 Raw 'ALD3' 'ALB3' "PageMaker - PageMaker 3 Document" .pm4 Raw 'ALD4' 'ALB4' "PageMaker - PageMaker 4 Document" .pm5 Raw 'ALD5' 'ALB5' "PageMaker - PageMaker 5 Document" .png Raw 'GKON' 'PNG ' "GraphicConverter - Portable Network Graphic" .pntg Raw 'GKON' 'PNTG' "GraphicConverter - Macintosh Painting" .ppd Ascii 'ALD5' 'TEXT' "PageMaker - Printer Description" .ppm Raw 'GKON' 'PPGM' "GraphicConverter - Portable Pixmap (image/x-ppm)" .ppm Raw 'GKON' 'PPGM' "GraphicConverter - Portable Pixmap (image/x-portable-pixmap)" .prn Ascii 'TBB6' 'TEXT' "TexEdit - Printer Output File" .ps Ascii 'vgrd' 'TEXT' "LaserWriter 8 - PostScript (application/postscript)" .psd Raw '8BIM' '8BPS' "Photoshop - PhotoShop Document" .pt4 Raw 'ALD4' 'ALT4' "PageMaker - PageMaker 4 Template" .pt5 Raw 'ALD5' 'ALT5' "PageMaker - PageMaker 5 Template" .pxr Raw '8BIM' 'PXR ' "Photoshop - Pixar Image" .qdv Raw 'GKON' 'QDVf' "GraphicConverter - QDV image" .qt Raw 'ttxt' 'MooV' "SimpleText - QuickTime Movie (video/quicktime)" .qxd Raw 'XPR3' 'XDOC' "QuarkXpress - QuarkXpress Document" .qxt Raw 'XPR3' 'XTMP' "QuarkXpress - QuarkXpress Template" .ram Ascii '????' 'TEXT' "Unknown - Real Audio (audio/x-pn-realaudio)" .raw Raw 'GKON' 'BINA' "GraphicConverter - Raw Image" .readme Ascii 'TBB6' 'TEXT' "TexEdit - Text Readme (application/text)" .rgb Raw 'GKON' 'SGI ' "GraphicConverter - SGI Image (image/x-rgb)" .rgba Raw 'GKON' 'SGI ' "GraphicConverter - SGI Image (image/x-rgb)" .rib Ascii 'RINI' 'TEXT' "Renderman - Renderman 3D Data" .rif Raw 'GKON' 'RIFF' "GraphicConverter - RIFF Graphic" .rle Raw 'GKON' 'RLE ' "GraphicConverter - RLE image" .rme Ascii 'ttxt' 'TEXT' "SimpleText - Text Readme" .rpl Raw 'REP!' 'FRL!' "Replica - Replica Document" .rsc Raw 'RSED' 'rsrc' "ResEdit - Resource File" .rsrc Raw 'RSED' 'rsrc' "ResEdit - Resource File" .rtf Ascii 'MSWD' 'TEXT' "Microsoft Word - Rich Text Format (application/rtf)" .rtx Ascii 'TBB6' 'TEXT' "TexEdit - Rich Text (text/richtext)" .s3m Raw 'SNPL' 'S3M ' "PlayerPro - ScreamTracker 3 MOD" .scc Raw 'GKON' 'MSX ' "GraphicConverter - MSX pitcure" .usal Raw 'GKON' 'RIX3' "GraphicConverter - ColoRIX" .sci Raw 'GKON' 'RIX3' "GraphicConverter - ColoRIX" .scp Raw 'GKON' 'RIX3' "GraphicConverter - ColoRIX" .scr Raw 'GKON' 'RIX3' "GraphicConverter - ColoRIX" .scu Raw 'GKON' 'RIX3' "GraphicConverter - ColoRIX" .sea Raw '????' 'APPL' "Self Extracting Archive - Self-Extracting Archive" .sf Raw 'SDHK' 'IRCM' "SoundHack - IRCAM Sound" .sgi Raw 'GKON' 'SGI ' "GraphicConverter - SGI Image" .sha Ascii 'UnSh' 'TEXT' "UnShar - Unix Shell Archive (application/x-shar)" .shar Ascii 'UnSh' 'TEXT' "UnShar - Unix Shell Archive (application/x-shar)" .shp Raw 'GKON' 'SHPp' "GraphicConverter - Printmaster Icon Library" .sit Raw 'SIT!' 'SITD' "StuffIt - StuffIt Archive" .sithqx Ascii 'TBB6' 'TEXT' "TexEdit - BinHexed StuffIt Archive (application/mac-binhex40)" .six Raw 'GKON' 'SIXE' "GraphicConverter - SIXEL image" .slk Ascii 'XCEL' 'TEXT' "Excel - SYLK Spreadsheet" .snd Raw 'SCPL' 'BINA' "SoundApp - Sound of various types" .spc Raw 'GKON' 'Spec' "GraphicConverter - Atari Spectrum 512" .sr Raw 'GKON' 'SUNn' "GraphicConverter - Sun Raster Image" .sty Ascii '*TEX' 'TEXT' "Textures - TeX Style" .sun Raw 'GKON' 'SUNn' "GraphicConverter - Sun Raster Image" .sup Raw 'GKON' 'SCRN' "GraphicConverter - StartupScreen" .svx Raw 'SCPL' '8SVX' "SoundApp - Amiga IFF Sound" .syk Ascii 'XCEL' 'TEXT' "Excel - SYLK Spreadsheet" .sylk Ascii 'XCEL' 'TEXT' "Excel - SYLK Spreadsheet" .tar Raw 'S691' 'TARF' "SunTar - Unix Tape ARchive (application/x-tar)" .targa Raw 'GKON' 'TPIC' "GraphicConverter - Truevision Image" .taz Raw 'SITx' 'ZIVU' "StuffIt Expander - Compressed Tape ARchive (application/x-compress)" .tex Ascii 'OTEX' 'TEXT' "OzTeX - TeX Document (application/x-tex)" .texi Ascii 'OTEX' 'TEXT' "OzTeX - TeX Document" .texinfo Ascii 'OTEX' 'TEXT' "OzTeX - TeX Document (application/x-texinfo)" .text Ascii 'ttxt' 'TEXT' "SimpleText - ASCII Text (text/plain)" .tga Raw 'GKON' 'TPIC' "GraphicConverter - Truevision Image" .tgz Raw 'Gzip' 'Gzip' "MacGzip - Gnu ZIPed Tape ARchive (application/x-gzip)" .tif Raw 'JVWR' 'TIFF' "JPEGView - TIFF Picture (image/tiff)" .tiff Raw 'JVWR' 'TIFF' "JPEGView - TIFF Picture (image/tiff)" .tny Raw 'GKON' 'TINY' "GraphicConverter - Atari TINY Bitmap" .tsv Ascii 'XCEL' 'TEXT' "Excel - Tab Separated Values (text/tab-separated-values)" .tx8 Ascii 'ttxt' 'TEXT' "SimpleText - 8-bit ASCII Text" .txt Ascii 'ttxt' 'TEXT' "SimpleText - ASCII Text (text/plain)" .ul Raw 'SCPL' 'ULAW' "SoundApp - Mu-Law Sound (audio/basic)" .url Raw 'Arch' 'AURL' "Anarchie - URL Bookmark (message/external-body)" .uu Ascii 'TBB6' 'TEXT' "TexEdit - UUEncode" .uue Ascii 'TBB6' 'TEXT' "TexEdit - UUEncode" .vff Raw 'GKON' 'VFFf' "GraphicConverter - DESR VFF Greyscale Image" .vga Raw 'JVWR' 'BMPp' "JPEGView - OS/2 Bitmap" .voc Raw 'SCPL' 'VOC ' "SoundApp - VOC Sound" .w51 Raw 'WPC2' '.WP5' "WordPerfect - WordPerfect PC 5.1 Doc (application/wordperfect5.1)" .wav Raw 'SCPL' 'WAVE' "SoundApp - Windows WAV Sound (audio/x-wav)" .wk1 Raw 'XCEL' 'XLBN' "Excel - Lotus Spreadsheet r2.1" .wks Raw 'XCEL' 'XLBN' "Excel - Lotus Spreadsheet r1.x" .wmf Raw 'GKON' 'WMF ' "GraphicConverter - Windows Metafile" .wp Raw 'WPC2' '.WP5' "WordPerfect - WordPerfect PC 5.1 Doc (application/wordperfect5.1)" .wp4 Raw 'WPC2' '.WP4' "WordPerfect - WordPerfect PC 4.2 Doc" .wp5 Raw 'WPC2' '.WP5' "WordPerfect - WordPerfect PC 5.x Doc (application/wordperfect5.1)" .wp6 Raw 'WPC2' '.WP6' "WordPerfect - WordPerfect PC 6.x Doc" .wpg Raw 'GKON' 'WPGf' "GraphicConverter - WordPerfect Graphic" .wpm Raw 'WPC2' 'WPD1' "WordPerfect - WordPerfect Mac" .wri Raw 'MSWD' 'WDBN' "Microsoft Word - MS Write/Windows" .wve Raw 'SCPL' 'BINA' "SoundApp - PSION sound" .x10 Raw 'GKON' 'XWDd' "GraphicConverter - X-Windows Dump (image/x-xwd)" .x11 Raw 'GKON' 'XWDd' "GraphicConverter - X-Windows Dump (image/x-xwd)" .xbm Raw 'GKON' 'XBM ' "GraphicConverter - X-Windows Bitmap (image/x-xbm)" .xbm Raw 'GKON' 'XBM ' "GraphicConverter - X-Windows Bitmap (image/x-xbitmap)" .xl Raw 'XCEL' 'XLS ' "Excel - Excel Spreadsheet" .xlc Raw 'XCEL' 'XLC ' "Excel - Excel Chart" .xlm Raw 'XCEL' 'XLM ' "Excel - Excel Macro" .xls Raw 'XCEL' 'XLS ' "Excel - Excel Spreadsheet" .xlw Raw 'XCEL' 'XLW ' "Excel - Excel Workspace" .xm Raw 'SNPL' 'XM ' "PlayerPro - FastTracker MOD Music" .xpm Raw 'GKON' 'XPM ' "GraphicConverter - X-Windows Pixmap (image/x-xpm)" .xpm Raw 'GKON' 'XPM ' "GraphicConverter - X-Windows Pixmap (image/x-xpixmap)" .xwd Raw 'GKON' 'XWDd' "GraphicConverter - X-Windows Dump (image/x-xwd)" # # Add the default translation for anything not recognized # * Ascii 'ttxt' 'TEXT' "SimpleText - Text file" cdrkit-1.1.11/genisoimage/apple.c0000644000372500001440000020363210605453656015700 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)apple.c 1.19 04/03/02 joerg, Copyright 1997, 1998, 1999, 2000 James Pearson */ /* * Copyright (c) 1997, 1998, 1999, 2000 James Pearson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * Unix-HFS file interface including maping file extensions to TYPE/CREATOR * * Adapted from mkhfs routines for mkhybrid * * James Pearson 1/5/97 * Bug fix JCP 4/12/97 * Updated for 1.12 and added more Unix HFS filetypes. JCP 21/1/98 * Tidy up to use Finfo and Dinfo for all formats where * possible JCP 25/4/2000 * * Things still to de done: * * Check file size = finder + rsrc [+ data] is needed */ #ifdef APPLE_HYB #include #include "genisoimage.h" #include #include #include #include #include #include "apple.h" #include #ifdef USE_MAGIC #include magic_t magic_state = NULL; #ifndef MAGIC_ERROR /* workaround for older ´API */ #define MAGIC_ERROR 0 #endif #endif /* USE_MAGIC */ /* tidy up genisoimage definition ... */ typedef struct directory_entry dir_ent; /* routines for getting HFS names and info */ #ifndef HAVE_STRCASECMP static int strcasecmp(const char *s1, const char *s2); #endif static int get_none_dir(char *, char *, dir_ent *, int); static int get_none_info(char *, char *, dir_ent *, int); static int get_cap_dir(char *, char *, dir_ent *, int); static int get_cap_info(char *, char *, dir_ent *, int); static int get_es_dir(char *, char *, dir_ent *, int); static int get_es_info(char *, char *, dir_ent *, int); static int get_dbl_dir(char *, char *, dir_ent *, int); static int get_dbl_info(char *, char *, dir_ent *, int); static int get_mb_info(char *, char *, dir_ent *, int); static int get_sgl_info(char *, char *, dir_ent *, int); static int get_fe_dir(char *, char *, dir_ent *, int); static int get_fe_info(char *, char *, dir_ent *, int); static int get_sgi_dir(char *, char *, dir_ent *, int); static int get_sgi_info(char *, char *, dir_ent *, int); static int get_sfm_info(char *, char *, dir_ent *, int); #ifdef IS_MACOS_X static int get_xhfs_dir(char *, char *, dir_ent *, int); static int get_xhfs_info(char *, char *, dir_ent *, int); #else #define get_xhfs_dir get_none_dir #define get_xhfs_info get_none_info #endif /* IS_MACOS_X */ static void set_ct(hfsdirent *, char *, char *); static void set_Dinfo(byte *, hfsdirent *); static void set_Finfo(byte *, hfsdirent *); static void cstrncpy(char *, char *, int); static unsigned char dehex(char); static unsigned char hex2char(char *); static void hstrncpy(unsigned char *, char *, int); static int read_info_file(char *, void *, int); /*static unsigned short calc_mb_crc __PR((unsigned char *, long, unsigned short));*/ static struct hfs_info *get_hfs_fe_info(struct hfs_info *, char *); static struct hfs_info *get_hfs_sgi_info(struct hfs_info *, char *); static struct hfs_info *match_key(struct hfs_info *, char *); static int get_hfs_itype(char *, char *, char *); static void map_ext(char *, char **, char **, short *, char *); static afpmap **map; /* list of mappings */ static afpmap *defmap; /* the default mapping */ static int last_ent; /* previous mapped entry */ static int map_num; /* number of mappings */ static int mlen; /* min extension length */ static char tmp[PATH_MAX]; /* tmp working buffer */ static int hfs_num; /* number of file types */ static char p_buf[PATH_MAX]; /* info working buffer */ static FILE *p_fp = NULL; /* probe File pointer */ static int p_num = 0; /* probe bytes read */ static unsigned int hselect; /* type of HFS file selected */ struct hfs_type { /* Types of various HFS Unix files */ int type; /* type of file */ int flags; /* special flags */ char *info; /* finderinfo name */ char *rsrc; /* resource fork name */ int (*get_info)(char *, char *, dir_ent *, int); /* finderinfo */ /* function */ int (*get_dir)(char *, char *, dir_ent *, int); /* directory */ /* name */ /* function */ char *desc; /* description */ }; /* Above filled in */ static struct hfs_type hfs_types[] = { {TYPE_NONE, INSERT, "", "", get_none_info, get_none_dir, "None"}, {TYPE_CAP, INSERT, ".finderinfo/", ".resource/", get_cap_info, get_cap_dir, "CAP"}, {TYPE_NETA, INSERT, ".AppleDouble/", ".AppleDouble/", get_dbl_info, get_dbl_dir, "Netatalk"}, {TYPE_DBL, INSERT, "%", "%", get_dbl_info, get_dbl_dir, "AppleDouble"}, {TYPE_ESH, INSERT, ".rsrc/", ".rsrc/", get_es_info, get_es_dir, "EtherShare/UShare"}, {TYPE_FEU, NOPEND, "FINDER.DAT", "RESOURCE.FRK/", get_fe_info, get_fe_dir, "Exchange"}, {TYPE_FEL, NOPEND, "finder.dat", "resource.frk/", get_fe_info, get_fe_dir, "Exchange"}, {TYPE_SGI, NOPEND, ".HSancillary", ".HSResource/", get_sgi_info, get_sgi_dir, "XINET/SGI"}, {TYPE_MBIN, PROBE, "", "", get_mb_info, get_none_dir, "MacBinary"}, {TYPE_SGL, PROBE, "", "", get_sgl_info, get_none_dir, "AppleSingle"}, {TYPE_DAVE, INSERT, "resource.frk/", "resource.frk/", get_dbl_info, get_dbl_dir, "DAVE"}, {TYPE_SFM, APPEND | NORSRC, ":Afp_AfpInfo", ":Afp_Resource", get_sfm_info, get_none_dir, "SFM"}, {TYPE_XDBL, INSERT, "._", "._", get_dbl_info, get_dbl_dir, "MacOS X AppleDouble"}, {TYPE_XHFS, APPEND | NOINFO, "/rsrc", "/rsrc", get_xhfs_info, get_xhfs_dir, "MacOS X HFS"} }; /* used by get_magic_match() return */ static char tmp_type[CT_SIZE + 1], tmp_creator[CT_SIZE + 1]; #ifdef __used__ /* * An array useful for CRC calculations that use 0x1021 as the "seed" * taken from mcvert.c modified by Jim Van Verth. */ static unsigned short mb_magic[] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 }; #endif /* __used__ */ #ifndef HAVE_STRCASECMP static int strcasecmp(const char *s1, const char *s2) { while (tolower(*s1) == tolower(*s2)) { if (*s1 == 0) return (0); s1++; s2++; } return (tolower(*s1) - tolower(*s2)); } #endif /* * set_ct: set CREATOR and TYPE in hfs_ent * * CREATOR and TYPE are padded with spaces if not CT_SIZE long */ static void set_ct(hfsdirent *hfs_ent, char *c, char *t) { memset(hfs_ent->u.file.type, ' ', CT_SIZE); memset(hfs_ent->u.file.creator, ' ', CT_SIZE); strncpy(hfs_ent->u.file.type, t, MIN(CT_SIZE, strlen(t))); strncpy(hfs_ent->u.file.creator, c, MIN(CT_SIZE, strlen(c))); hfs_ent->u.file.type[CT_SIZE] = '\0'; hfs_ent->u.file.creator[CT_SIZE] = '\0'; } /* * cstrncopy: Cap Unix name to HFS name * * ':' is replaced by '%' and string is terminated with '\0' */ static void cstrncpy(char *t, char *f, int c) { while (c-- && *f) { switch (*f) { case ':': *t = '%'; break; default: *t = *f; break; } t++; f++; } *t = '\0'; } /* * dehex() * * Given a hexadecimal digit in ASCII, return the integer representation. * * Taken from linux/fs/hfs/trans.c by Paul H. Hargrove */ static unsigned char dehex(char c) { if ((c >= '0') && (c <= '9')) { return (c - '0'); } if ((c >= 'a') && (c <= 'f')) { return (c - 'a' + 10); } if ((c >= 'A') && (c <= 'F')) { return (c - 'A' + 10); } /* return (0xff); */ return (0); } static unsigned char hex2char(char *s) { unsigned char i1; unsigned char i2; unsigned char o; if (strlen(++s) < 2) return (0); i1 = (unsigned char) s[0]; i2 = (unsigned char) s[1]; if (!isxdigit(i1) || !isxdigit(i2)) return (0); o = (dehex(i1) << 4) & 0xf0; o |= (dehex(i2) & 0xf); return (o); } /* * hstrncpy: Unix name to HFS name with special character * translation. * * "%xx" or ":xx" is assumed to be a "special" character and * replaced by character code given by the hex characters "xx" * * if "xx" is not a hex number, then it is left alone - except * that ":" is replaced by "%" * */ static void hstrncpy(unsigned char *t, char *f, int c) { unsigned char o; while (c-- && *f) { switch (*f) { case ':': case '%': if ((o = hex2char(f)) == 0) { *t = conv_charset('%', in_nls, hfs_onls); } else { *t = o; f += 2; } break; default: *t = conv_charset(*f, in_nls, hfs_onls); break; } t++; f++; } *t = '\0'; } /* * basename: find just the filename with any directory component */ /* not used at the moment ... static char basename(a) char *a; { char *b; if ((b = strchr(a, '/'))) return (++b); else return (a); } */ /* * set_Dinfo: set directory info */ static void set_Dinfo(byte *ptr, hfsdirent *ent) { Dinfo *dinfo = (Dinfo *)ptr; /* finder flags */ ent->fdflags = d_getw((unsigned char *) dinfo->frFlags); if (icon_pos) { ent->u.dir.rect.top = d_getw((unsigned char *) dinfo->frRect[0]); ent->u.dir.rect.left = d_getw((unsigned char *) dinfo->frRect[1]); ent->u.dir.rect.bottom = d_getw((unsigned char *) dinfo->frRect[2]); ent->u.dir.rect.right = d_getw((unsigned char *) dinfo->frRect[3]); ent->fdlocation.v = d_getw((unsigned char *) dinfo->frLocation[0]); ent->fdlocation.h = d_getw((unsigned char *) dinfo->frLocation[1]); ent->u.dir.view = d_getw((unsigned char *) dinfo->frView); ent->u.dir.frscroll.v = d_getw((unsigned char *) dinfo->frScroll[0]); ent->u.dir.frscroll.h = d_getw((unsigned char *) dinfo->frScroll[1]); } else { /* * clear HFS_FNDR_HASBEENINITED to have tidy desktop ?? */ ent->fdflags &= 0xfeff; } } /* * set_Finfo: set file info */ static void set_Finfo(byte *ptr, hfsdirent *ent) { Finfo *finfo = (Finfo *)ptr; /* type and creator from finder info */ set_ct(ent, finfo->fdCreator, finfo->fdType); /* finder flags */ ent->fdflags = d_getw((unsigned char *) finfo->fdFlags); if (icon_pos) { ent->fdlocation.v = d_getw((unsigned char *) finfo->fdLocation[0]); ent->fdlocation.h = d_getw((unsigned char *) finfo->fdLocation[1]); } else { /* * clear HFS_FNDR_HASBEENINITED to have tidy desktop ?? */ ent->fdflags &= 0xfeff; } } /* * get_none_dir: ordinary Unix directory */ static int get_none_dir(char *hname, char *dname, dir_ent *s_entry, int ret) { /* just copy the given name */ hstrncpy((unsigned char *) (s_entry->hfs_ent->name), dname, HFS_MAX_FLEN); return (ret); } /* * get_none_info: ordinary Unix file - try to map extension */ static int get_none_info(char *hname, char *dname, dir_ent *s_entry, int ret) { char *t, *c; hfsdirent *hfs_ent = s_entry->hfs_ent; map_ext(dname, &t, &c, &s_entry->hfs_ent->fdflags, s_entry->whole_name); /* just copy the given name */ hstrncpy((unsigned char *) (hfs_ent->name), dname, HFS_MAX_FLEN); set_ct(hfs_ent, c, t); return (ret); } /* * read_info_file: open and read a finderinfo file for an HFS file * or directory */ static int read_info_file(char *name, /* finderinfo filename */ void *info, /* info buffer */ int len /* length of above */) { FILE *fp; int num; /* clear out any old finderinfo stuf */ memset(info, 0, len); if ((fp = fopen(name, "rb")) == NULL) return (-1); /* read and ignore if the file is short - checked later */ num = fread(info, 1, len, fp); fclose(fp); return (num); } /* * get_cap_dir: get the CAP name for a directory */ static int get_cap_dir(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { FileInfo info; /* finderinfo struct */ int num = -1; /* bytes read */ hfsdirent *hfs_ent = s_entry->hfs_ent; num = read_info_file(hname, &info, sizeof (FileInfo)); /* check finder info is OK */ if (num > 0 && info.fi_magic1 == FI_MAGIC1 && info.fi_magic == FI_MAGIC && info.fi_bitmap & FI_BM_MACINTOSHFILENAME) { /* use the finderinfo name if it exists */ cstrncpy((char *) (hfs_ent->name), (char *) (info.fi_macfilename), HFS_MAX_FLEN); set_Dinfo(info.finderinfo, hfs_ent); return (ret); } else { /* otherwise give it it's Unix name */ hstrncpy((unsigned char *) (s_entry->hfs_ent->name), dname, HFS_MAX_FLEN); return (TYPE_NONE); } } /* ** get_cap_info: get CAP finderinfo for a file */ static int get_cap_info(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { FileInfo info; /* finderinfo struct */ int num = -1; /* bytes read */ hfsdirent *hfs_ent = s_entry->hfs_ent; num = read_info_file(hname, &info, sizeof (info)); /* check finder info is OK */ if (num > 0 && info.fi_magic1 == FI_MAGIC1 && info.fi_magic == FI_MAGIC) { if (info.fi_bitmap & FI_BM_MACINTOSHFILENAME) { /* use the finderinfo name if it exists */ cstrncpy((char *) (hfs_ent->name), (char *) (info.fi_macfilename), HFS_MAX_FLEN); } else { /* use Unix name */ hstrncpy((unsigned char *) (hfs_ent->name), dname, HFS_MAX_FLEN); } set_Finfo(info.finderinfo, hfs_ent); #ifdef USE_MAC_DATES /* * set created/modified dates - these date should have already * been set from the Unix data fork dates. The finderinfo dates * are in Mac format - but we have to convert them back to Unix * for the time being */ if ((info.fi_datemagic & FI_CDATE)) { /* use libhfs routines to get correct byte order */ hfs_ent->crdate = d_toutime(d_getl(info.fi_ctime)); } if (info.fi_datemagic & FI_MDATE) { hfs_ent->mddate = d_toutime(d_getl(info.fi_mtime)); } #endif /* USE_MAC_DATES */ } else { /* failed to open/read finderinfo - so try afpfile mapping */ if (verbose > 2) { fprintf(stderr, "warning: %s doesn't appear to be a %s file\n", s_entry->whole_name, hfs_types[ret].desc); } ret = get_none_info(hname, dname, s_entry, TYPE_NONE); } return (ret); } /* * get_es_dir: get EtherShare/UShare finderinfo for a directory * * based on code from Jens-Uwe Mager (jum@helios.de) and Phil Sylvester * */ static int get_es_dir(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { es_FileInfo *einfo; /* EtherShare info struct */ us_FileInfo *uinfo; /* UShare info struct */ char info[ES_INFO_SIZE]; /* finderinfo buffer */ int num = -1; /* bytes read */ hfsdirent *hfs_ent = s_entry->hfs_ent; /* * the EtherShare and UShare file layout is the same, but they store * finderinfo differently */ einfo = (es_FileInfo *) info; uinfo = (us_FileInfo *) info; num = read_info_file(hname, info, sizeof (info)); /* check finder info for EtherShare finderinfo */ if (num >= (int)sizeof (es_FileInfo) && d_getl(einfo->magic) == ES_MAGIC && d_getw(einfo->version) == ES_VERSION) { set_Dinfo(einfo->finderinfo, hfs_ent); } else if (num >= (int)sizeof (us_FileInfo)) { /* * UShare has no magic number, so we assume that this is a valid * info/resource file ... */ set_Dinfo(uinfo->finderinfo, hfs_ent); } else { /* failed to open/read finderinfo - so try afpfile mapping */ if (verbose > 2) { fprintf(stderr, "warning: %s doesn't appear to be a %s file\n", s_entry->whole_name, hfs_types[ret].desc); } ret = get_none_dir(hname, dname, s_entry, TYPE_NONE); return (ret); } /* set name */ hstrncpy((unsigned char *) (hfs_ent->name), dname, HFS_MAX_FLEN); return (ret); } /* * get_es_info: get EtherShare/UShare finderinfo for a file * * based on code from Jens-Uwe Mager (jum@helios.de) and Phil Sylvester * */ static int get_es_info(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { es_FileInfo *einfo; /* EtherShare info struct */ us_FileInfo *uinfo; /* UShare info struct */ char info[ES_INFO_SIZE]; /* finderinfo buffer */ int num = -1; /* bytes read */ hfsdirent *hfs_ent = s_entry->hfs_ent; dir_ent *s_entry1; /* * the EtherShare and UShare file layout is the same, but they store * finderinfo differently */ einfo = (es_FileInfo *) info; uinfo = (us_FileInfo *) info; num = read_info_file(hname, info, sizeof (info)); /* check finder info for EtherShare finderinfo */ if (num >= (int)sizeof (es_FileInfo) && d_getl(einfo->magic) == ES_MAGIC && d_getw(einfo->version) == ES_VERSION) { set_Finfo(einfo->finderinfo, hfs_ent); /* * set create date - modified date set from the Unix * data fork date */ hfs_ent->crdate = d_getl(einfo->createTime); } else if (num >= (int)sizeof (us_FileInfo)) { /* * UShare has no magic number, so we assume that this is a valid * info/resource file ... */ set_Finfo(uinfo->finderinfo, hfs_ent); /* set create and modified date - if they exist */ if (uinfo->ctime) hfs_ent->crdate = d_getl(uinfo->ctime); if (uinfo->mtime) hfs_ent->mddate = d_getl(uinfo->mtime); } else { /* failed to open/read finderinfo - so try afpfile mapping */ if (verbose > 2) { fprintf(stderr, "warning: %s doesn't appear to be a %s file\n", s_entry->whole_name, hfs_types[ret].desc); } ret = get_none_info(hname, dname, s_entry, TYPE_NONE); return (ret); } /* this should exist ... */ if ((s_entry1 = s_entry->assoc) == NULL) perr("TYPE_ESH error - shouldn't happen!"); /* set name */ hstrncpy((unsigned char *) (hfs_ent->name), dname, HFS_MAX_FLEN); /* real rsrc file starts ES_INFO_SIZE bytes into the file */ if (s_entry1->size <= ES_INFO_SIZE) { s_entry1->size = 0; hfs_ent->u.file.rsize = 0; } else { s_entry1->size -= ES_INFO_SIZE; hfs_ent->u.file.rsize = s_entry1->size; s_entry1->hfs_off = ES_INFO_SIZE; } set_733((char *) s_entry1->isorec.size, s_entry1->size); return (ret); } /* * calc_crc() -- * Compute the MacBinary II-style CRC for the data pointed to by p, with the * crc seeded to seed. * * Modified by Jim Van Verth to use the magic array for efficiency. */ #ifdef __used__ static unsigned short calc_mb_crc(unsigned char *p, long len, unsigned short seed) { unsigned short hold; /* crc computed so far */ long i; /* index into data */ hold = seed; /* start with seed */ for (i = 0; i < len; i++, p++) { hold ^= (*p << 8); hold = (hold << 8) ^ mb_magic[(unsigned char) (hold >> 8)]; } return (hold); }/* calc_mb_crc() */ #endif /* __used__ */ static int get_mb_info(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { mb_info *info; /* finderinfo struct */ char *c; char *t; hfsdirent *hfs_ent; dir_ent *s_entry1; int i; #ifdef TEST_CODE unsigned short crc_file, crc_calc; #endif info = (mb_info *) p_buf; /* * routine called twice for each file - first to check that it is a * valid MacBinary file, second to fill in the HFS info. p_buf holds * the required raw data and it *should* remain the same between the * two calls */ if (s_entry == 0) { /* * test that the CRC is OK - not set for MacBinary I files (and * incorrect in some MacBinary II files!). If this fails, then * perform some other checks */ #ifdef TEST_CODE /* leave this out for the time being ... */ if (p_num >= MB_SIZE && info->version == 0 && info->zero1 == 0) { crc_calc = calc_mb_crc((unsigned char *) info, 124, 0); crc_file = d_getw(info->crc); #ifdef DEBUG fprintf(stderr, "%s: file %d, calc %d\n", hname, crc_file, crc_calc); #endif /* DEBUG */ if (crc_file == crc_calc) return (ret); } #endif /* TEST_CODE */ /* * check some of the fields for a valid MacBinary file not * zero1 and zero2 SHOULD be zero - but some files incorrect */ /* if (p_num < MB_SIZE || info->nlen > 63 || info->zero2 || */ if (p_num < MB_SIZE || info->zero1 || info->zero2 || info->nlen > 63 || info->version || info->nlen == 0 || *info->name == 0) return (TYPE_NONE); /* check that the filename is OKish */ for (i = 0; i < (int)info->nlen; i++) if (info->name[i] == 0) return (TYPE_NONE); /* check CREATOR and TYPE are valid */ for (i = 0; i < 4; i++) if (info->type[i] == 0 || info->auth[i] == 0) return (TYPE_NONE); } else { /* we have a vaild MacBinary file, so fill in the bits */ /* this should exist ... */ if ((s_entry1 = s_entry->assoc) == NULL) perr("TYPE_MBIN error - shouldn't happen!"); hfs_ent = s_entry->hfs_ent; /* type and creator from finder info */ t = (char *) (info->type); c = (char *) (info->auth); set_ct(hfs_ent, c, t); /* finder flags */ hfs_ent->fdflags = ((info->flags << 8) & 0xff00) | info->flags2; if (icon_pos) { hfs_ent->fdlocation.v = d_getw((unsigned char *) info->icon_vert); hfs_ent->fdlocation.h = d_getw((unsigned char *) info->icon_horiz); } else { /* * clear HFS_FNDR_HASBEENINITED to have tidy desktop ?? */ hfs_ent->fdflags &= 0xfeff; } /* * set created/modified dates - these date should have already * been set from the Unix data fork dates. The finderinfo dates * are in Mac format - but we have to convert them back to Unix * for the time being */ hfs_ent->crdate = d_toutime(d_getl(info->cdate)); hfs_ent->mddate = d_toutime(d_getl(info->mdate)); /* set name */ hstrncpy((unsigned char *) (hfs_ent->name), (char *) (info->name), MIN(HFS_MAX_FLEN, info->nlen)); /* set correct fork sizes */ hfs_ent->u.file.dsize = d_getl(info->dflen); hfs_ent->u.file.rsize = d_getl(info->rflen); /* update directory entries for data fork */ s_entry->size = hfs_ent->u.file.dsize; s_entry->hfs_off = MB_SIZE; set_733((char *) s_entry->isorec.size, s_entry->size); /* * real rsrc file starts after data fork (must be a multiple of * MB_SIZE) */ s_entry1->size = hfs_ent->u.file.rsize; s_entry1->hfs_off = MB_SIZE + ROUND_UP(hfs_ent->u.file.dsize, MB_SIZE); set_733((char *) s_entry1->isorec.size, s_entry1->size); } return (ret); } /* * get_dbl_dir: get Apple double finderinfo for a directory * * Based on code from cvt2cap.c (c) May 1988, Paul Campbell */ static int get_dbl_dir(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { FileInfo info; /* finderinfo struct */ a_hdr *hp; a_entry *ep; int num = -1; /* bytes read */ int nentries; FILE *fp; hfsdirent *hfs_ent = s_entry->hfs_ent; char name[64]; int i; int fail = 0; int len = 0; hp = (a_hdr *) p_buf; memset(hp, 0, A_HDR_SIZE); memset(name, 0, sizeof (name)); /* open and read the info/rsrc file (it's the same file) */ if ((fp = fopen(hname, "rb")) != NULL) num = fread(hp, 1, A_HDR_SIZE, fp); /* * check finder info is OK - some Netatalk files don't have magic * or version set - ignore if it's a netatalk file */ if (num == A_HDR_SIZE && ((ret == TYPE_NETA) || (d_getl(hp->magic) == APPLE_DOUBLE && (d_getl(hp->version) == A_VERSION1 || d_getl(hp->version) == A_VERSION2)))) { /* read TOC of the AppleDouble file */ nentries = (int) d_getw(hp->nentries); if (fread(hp->entries, A_ENTRY_SIZE, nentries, fp) < 1) { fail = 1; nentries = 0; } /* extract what is needed */ for (i = 0, ep = hp->entries; i < nentries; i++, ep++) { switch ((int)d_getl(ep->id)) { case ID_FINDER: /* get the finder info */ fseek(fp, (off_t)d_getl(ep->offset), SEEK_SET); if (fread(&info, d_getl(ep->length), 1, fp) < 1) { fail = 1; } break; case ID_NAME: /* get Mac file name */ fseek(fp, (off_t)d_getl(ep->offset), SEEK_SET); if (fread(name, d_getl(ep->length), 1, fp) < 1) *name = '\0'; len = d_getl(ep->length); break; default: break; } } fclose(fp); /* skip this if we had a problem */ if (!fail) { set_Dinfo(info.finderinfo, hfs_ent); /* use stored name if it exists */ if (*name) { /* * In some cases the name is stored in the * Pascal string format - first char is the * length, the rest is the actual string. * The following *should* be OK */ if (len == 32 && (int) name[0] < 32) { cstrncpy(hfs_ent->name, &name[1], MIN(name[0], HFS_MAX_FLEN)); } else { cstrncpy(hfs_ent->name, name, HFS_MAX_FLEN); } } else { hstrncpy((unsigned char *) (hfs_ent->name), dname, HFS_MAX_FLEN); } } } else { /* failed to open/read finderinfo */ fail = 1; if (fp) fclose(fp); } if (fail) { /* problem with the file - try mapping/magic */ if (verbose > 2) { fprintf(stderr, "warning: %s doesn't appear to be a %s file\n", s_entry->whole_name, hfs_types[ret].desc); } ret = get_none_dir(hname, dname, s_entry, TYPE_NONE); } return (ret); } /* * Depending on the version, AppleDouble/Single stores dates * relative to 1st Jan 1904 (v1) or 1st Jan 2000 (v2) * * The d_toutime() function uses 1st Jan 1904 to convert to * Unix time (1st Jan 1970). * * The d_dtoutime() function uses 1st Jan 2000 to convert to * Unix time (1st Jan 1970). * * However, NetaTalk files seem to do their own thing - older * Netatalk files don't have a magic number of version and * store dates in ID=7 (don't know how). Newer Netatalk files * claim to be version 1, but store dates in ID=7 as if they * were version 2 files. */ /* * get_dbl_info: get Apple double finderinfo for a file * * Based on code from cvt2cap.c (c) May 1988, Paul Campbell */ static int get_dbl_info(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { FileInfo info; /* finderinfo struct */ a_hdr *hp; a_entry *ep; int num = -1; /* bytes read */ int nentries; FILE *fp; hfsdirent *hfs_ent = s_entry->hfs_ent; dir_ent *s_entry1; char name[64]; int i; int fail = 0; int len = 0; unsigned char dates[A_DATE]; int ver = 0, dlen; hp = (a_hdr *) p_buf; memset(hp, 0, A_HDR_SIZE); memset(name, 0, sizeof (name)); memset(dates, 0, sizeof (dates)); /* get the rsrc file info - should exist ... */ if ((s_entry1 = s_entry->assoc) == NULL) perr("TYPE_DBL error - shouldn't happen!"); /* open and read the info/rsrc file (it's the same file) */ if ((fp = fopen(hname, "rb")) != NULL) num = fread(hp, 1, A_HDR_SIZE, fp); /* * check finder info is OK - some Netatalk files don't have magic * or version set - ignore if it's a netatalk file */ ver = d_getl(hp->version); if (num == A_HDR_SIZE && ((ret == TYPE_NETA) || (d_getl(hp->magic) == APPLE_DOUBLE && (ver == A_VERSION1 || ver == A_VERSION2)))) { /* read TOC of the AppleDouble file */ nentries = (int) d_getw(hp->nentries); if (fread(hp->entries, A_ENTRY_SIZE, nentries, fp) < 1) { fail = 1; nentries = 0; } /* extract what is needed */ for (i = 0, ep = hp->entries; i < nentries; i++, ep++) { switch ((int)d_getl(ep->id)) { case ID_FINDER: /* get the finder info */ fseek(fp, (off_t)d_getl(ep->offset), SEEK_SET); if (fread(&info, d_getl(ep->length), 1, fp) < 1) { fail = 1; } break; case ID_RESOURCE: /* set the offset and correct rsrc fork size */ s_entry1->size = d_getl(ep->length); hfs_ent->u.file.rsize = s_entry1->size; /* offset to start of real rsrc fork */ s_entry1->hfs_off = d_getl(ep->offset); set_733((char *) s_entry1->isorec.size, s_entry1->size); break; case ID_NAME: /* get Mac file name */ fseek(fp, (off_t)d_getl(ep->offset), SEEK_SET); if (fread(name, d_getl(ep->length), 1, fp) < 1) *name = '\0'; len = d_getl(ep->length); break; case ID_FILEI: /* Workround for NetaTalk files ... */ if (ret == TYPE_NETA && ver == A_VERSION1) ver = A_VERSION2; /* fall through */ case ID_FILEDATESI: /* get file info */ fseek(fp, d_getl(ep->offset), 0); dlen = MIN(d_getl(ep->length), A_DATE); if (fread(dates, dlen, 1, fp) < 1) { fail = 1; } else { /* get the correct Unix time */ switch (ver) { case (A_VERSION1): hfs_ent->crdate = d_toutime(d_getl(dates)); hfs_ent->mddate = d_toutime(d_getl(dates+4)); break; case (A_VERSION2): hfs_ent->crdate = d_dtoutime(d_getl(dates)); hfs_ent->mddate = d_dtoutime(d_getl(dates+4)); break; default: /* Use Unix dates */ break; } } break; default: break; } } fclose(fp); /* skip this if we had a problem */ if (!fail) { set_Finfo(info.finderinfo, hfs_ent); /* use stored name if it exists */ if (*name) { /* * In some cases the name is stored in the * Pascal string format - first char is the * length, the rest is the actual string. * The following *should* be OK */ if (len == 32 && (int) name[0] < 32) { cstrncpy(hfs_ent->name, &name[1], MIN(name[0], HFS_MAX_FLEN)); } else { cstrncpy(hfs_ent->name, name, HFS_MAX_FLEN); } } else { hstrncpy((unsigned char *) (hfs_ent->name), dname, HFS_MAX_FLEN); } } } else { /* failed to open/read finderinfo */ fail = 1; if (fp) fclose(fp); } if (fail) { /* problem with the file - try mapping/magic */ if (verbose > 2) { fprintf(stderr, "warning: %s doesn't appear to be a %s file\n", s_entry->whole_name, hfs_types[ret].desc); } ret = get_none_info(hname, dname, s_entry, TYPE_NONE); } return (ret); } /* * get_sgl_info: get Apple single finderinfo for a file * * Based on code from cvt2cap.c (c) May 1988, Paul Campbell */ static int get_sgl_info(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { FileInfo *info = 0; /* finderinfo struct */ a_hdr *hp; static a_entry *entries; a_entry *ep; int nentries; hfsdirent *hfs_ent; dir_ent *s_entry1; char name[64]; int i; int len = 0; unsigned char *dates; int ver = 0; /* * routine called twice for each file * - first to check that it is a valid * AppleSingle file, second to fill in the HFS info. * p_buf holds the required * raw data and it *should* remain the same between the two calls */ hp = (a_hdr *) p_buf; if (s_entry == 0) { if (p_num < A_HDR_SIZE || d_getl(hp->magic) != APPLE_SINGLE || (d_getl(hp->version) != A_VERSION1 && d_getl(hp->version) != A_VERSION2)) return (TYPE_NONE); /* check we have TOC for the AppleSingle file */ nentries = (int) d_getw(hp->nentries); if (p_num < (int)(A_HDR_SIZE + nentries * A_ENTRY_SIZE)) return (TYPE_NONE); /* save the TOC */ entries = (a_entry *) e_malloc(nentries * A_ENTRY_SIZE); memcpy(entries, (p_buf + A_HDR_SIZE), nentries * A_ENTRY_SIZE); } else { /* have a vaild AppleSingle File */ memset(name, 0, sizeof (name)); /* get the rsrc file info - should exist ... */ if ((s_entry1 = s_entry->assoc) == NULL) perr("TYPE_SGL error - shouldn't happen!"); hfs_ent = s_entry->hfs_ent; nentries = (int) d_getw(hp->nentries); ver = d_getl(hp->version); /* extract what is needed */ for (i = 0, ep = entries; i < nentries; i++, ep++) { switch ((int)d_getl(ep->id)) { case ID_FINDER: /* get the finder info */ info = (FileInfo *) (p_buf + d_getl(ep->offset)); break; case ID_DATA: /* set the offset and correct data fork size */ hfs_ent->u.file.dsize = s_entry->size = d_getl(ep->length); /* offset to start of real data fork */ s_entry->hfs_off = d_getl(ep->offset); set_733((char *) s_entry->isorec.size, s_entry->size); break; case ID_RESOURCE: /* set the offset and correct rsrc fork size */ hfs_ent->u.file.rsize = s_entry1->size = d_getl(ep->length); /* offset to start of real rsrc fork */ s_entry1->hfs_off = d_getl(ep->offset); set_733((char *) s_entry1->isorec.size, s_entry1->size); break; case ID_NAME: /* get Mac file name */ strncpy(name, (p_buf + d_getl(ep->offset)), d_getl(ep->length)); len = d_getl(ep->length); break; case ID_FILEI: /* get file info - ignore at the moment*/ break; case ID_FILEDATESI: /* get file info */ dates = (unsigned char *)p_buf + d_getl(ep->offset); /* get the correct Unix time */ if (ver == A_VERSION1) { hfs_ent->crdate = d_toutime(d_getl(dates)); hfs_ent->mddate = d_toutime(d_getl(dates+4)); } else { hfs_ent->crdate = d_dtoutime(d_getl(dates)); hfs_ent->mddate = d_dtoutime(d_getl(dates+4)); } break; default: break; } } free(entries); if (info == NULL) { /* * failed to open/read finderinfo * - so try afpfile mapping */ if (verbose > 2) { fprintf(stderr, "warning: %s doesn't appear to be a %s file\n", s_entry->whole_name, hfs_types[ret].desc); } ret = get_none_info(hname, dname, s_entry, TYPE_NONE); return (ret); } set_Finfo(info->finderinfo, hfs_ent); /* use stored name if it exists */ if (*name) { /* * In some cases the name is stored in the Pascal string * format - first char is the length, the rest is the * actual string. The following *should* be OK */ if (len == 32 && (int) name[0] < 32) { cstrncpy(hfs_ent->name, &name[1], MIN(name[0], HFS_MAX_FLEN)); } else { cstrncpy(hfs_ent->name, name, HFS_MAX_FLEN); } } else { hstrncpy((unsigned char *) (hfs_ent->name), dname, HFS_MAX_FLEN); } } return (ret); } /* * get_hfs_fe_info: read in the whole finderinfo for a PC Exchange * directory - saves on reading this many times for each file. * * Based of information provided by Mark Weinstein * * Note: the FINDER.DAT file layout depends on the FAT cluster size * therefore, files should only be read directly from the FAT media * * Only tested with PC Exchange v2.1 - don't know if it will work * with v2.2 and above. */ static struct hfs_info * get_hfs_fe_info(struct hfs_info *hfs_info, char *name) { FILE *fp; int fe_num, fe_pad; fe_info info; int c = 0; struct hfs_info *hfs_info1 = NULL; char keyname[12]; char *s, *e, *k; int i; if ((fp = fopen(name, "rb")) == NULL) return (NULL); /* * no longer attempt to find out FAT cluster * - rely on command line parameter */ if (afe_size <= 0) return (NULL); fe_num = afe_size / FE_SIZE; fe_pad = afe_size % FE_SIZE; while (fread(&info, 1, FE_SIZE, fp) != 0) { /* the Mac name may be NULL - so ignore this entry */ if (info.nlen != 0) { hfs_info1 = (struct hfs_info *)e_malloc(sizeof (struct hfs_info)); /* add this entry to the list */ hfs_info1->next = hfs_info; hfs_info = hfs_info1; /* * get the bits we need * - ignore [cm]time for the moment */ cstrncpy(hfs_info->name, (char *) (info.name), info.nlen); memcpy(hfs_info->finderinfo, info.finderinfo, INFOLEN); s = (char *) (info.sname); e = (char *) (info.ext); k = keyname; /* * short (Unix) name is stored in PC format, * so needs to be mangled a bit */ /* name part */ for (i = 0; i < 8; i++, s++, k++) { if (*s == ' ') break; else *k = *s; } /* extension - if it exists */ if (strncmp((const char *) (info.ext), " ", 3)) { *k = '.'; k++; for (i = 0; i < 3; i++, e++, k++) { if (*e == ' ') break; else *k = *e; } } *k = '\0'; hfs_info1->keyname = strdup(keyname); } /* * each record is FE_SIZE long, and there are FE_NUM * per each "cluster size", so we may need to skip the padding */ if (++c == fe_num) { c = 0; fseek(fp, (off_t)fe_pad, SEEK_CUR); } } fclose(fp); return (hfs_info); } /* * get_hfs_sgi_info: read in the whole finderinfo for a SGI (XINET) * directory - saves on reading this many times for each * file. */ static struct hfs_info * get_hfs_sgi_info(struct hfs_info *hfs_info, char *name) { FILE *fp; sgi_info info; struct hfs_info *hfs_info1 = NULL; if ((fp = fopen(name, "rb")) == NULL) return (NULL); while (fread(&info, 1, SGI_SIZE, fp) != 0) { hfs_info1 = (struct hfs_info *)e_malloc(sizeof (struct hfs_info)); /* add this entry to the list */ hfs_info1->next = hfs_info; hfs_info = hfs_info1; /* get the bits we need - ignore [cm]time for the moment */ cstrncpy(hfs_info->name, (char *)info.name, HFS_MAX_FLEN); memcpy(hfs_info->finderinfo, info.finderinfo, INFOLEN); /* use the HFS name as the key */ hfs_info1->keyname = hfs_info->name; } fclose(fp); return (hfs_info); } /* * del_hfs_info: delete the info list and recover memory */ void del_hfs_info(struct hfs_info *hfs_info) { struct hfs_info *hfs_info1; while (hfs_info) { hfs_info1 = hfs_info; hfs_info = hfs_info->next; /* key may be the same as the HFS name - so don't free it */ *hfs_info1->name = '\0'; if (*hfs_info1->keyname) free(hfs_info1->keyname); free(hfs_info1); } } /* * match_key: find the correct hfs_ent using the Unix filename * as the key */ static struct hfs_info * match_key(struct hfs_info *hfs_info, char *key) { while (hfs_info) { if (strcasecmp(key, hfs_info->keyname) == 0) return (hfs_info); hfs_info = hfs_info->next; } return (NULL); } /* * get_fe_dir: get PC Exchange directory name * * base on probing with od ... */ static int get_fe_dir(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { struct hfs_info *hfs_info; hfsdirent *hfs_ent = s_entry->hfs_ent; /* cached finderinfo stored with parent directory */ hfs_info = s_entry->filedir->hfs_info; /* if we have no cache, then make one and store it */ if (hfs_info == NULL) { if ((hfs_info = get_hfs_fe_info(hfs_info, hname)) == NULL) ret = TYPE_NONE; else s_entry->filedir->hfs_info = hfs_info; } if (ret != TYPE_NONE) { /* see if we can find the details of this file */ if ((hfs_info = match_key(hfs_info, dname)) != NULL) { strcpy(hfs_ent->name, hfs_info->name); set_Dinfo(hfs_info->finderinfo, hfs_ent); return (ret); } } /* can't find the entry, so use the Unix name */ hstrncpy((unsigned char *)(hfs_ent->name), dname, HFS_MAX_FLEN); return (TYPE_NONE); } /* * get_fe_info: get PC Exchange file details. * * base on probing with od and details from Mark Weinstein * */ static int get_fe_info(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { struct hfs_info *hfs_info; hfsdirent *hfs_ent = s_entry->hfs_ent; /* cached finderinfo stored with parent directory */ hfs_info = s_entry->filedir->hfs_info; /* if we have no cache, then make one and store it */ if (hfs_info == NULL) { if ((hfs_info = get_hfs_fe_info(hfs_info, hname)) == NULL) ret = TYPE_NONE; else s_entry->filedir->hfs_info = hfs_info; } if (ret != TYPE_NONE) { char *dn = dname; #ifdef _WIN32_TEST /* * may have a problem here - v2.2 has long filenames, * but we need to key on the short filename, * so we need do go a bit of win32 stuff * ... */ char sname[1024]; char lname[1024]; cygwin32_conv_to_full_win32_path(s_entry->whole_name, lname); if (GetShortPathName(lname, sname, sizeof (sname))) { if (dn = strrchr(sname, '\\')) dn++; else dn = sname; } #endif /* _WIN32 */ /* see if we can find the details of this file */ if ((hfs_info = match_key(hfs_info, dn)) != NULL) { strcpy(hfs_ent->name, hfs_info->name); set_Finfo(hfs_info->finderinfo, hfs_ent); return (ret); } } /* no entry found - use extension mapping */ if (verbose > 2) { fprintf(stderr, "warning: %s doesn't appear to be a %s file\n", s_entry->whole_name, hfs_types[ret].desc); } ret = get_none_info(hname, dname, s_entry, TYPE_NONE); return (TYPE_NONE); } /* * get_sgi_dir: get SGI (XINET) HFS directory name * * base on probing with od ... */ static int get_sgi_dir(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { struct hfs_info *hfs_info; hfsdirent *hfs_ent = s_entry->hfs_ent; /* cached finderinfo stored with parent directory */ hfs_info = s_entry->filedir->hfs_info; /* if we haven't got a cache, then make one */ if (hfs_info == NULL) { if ((hfs_info = get_hfs_sgi_info(hfs_info, hname)) == NULL) ret = TYPE_NONE; else s_entry->filedir->hfs_info = hfs_info; } /* find the matching entry in the cache */ if (ret != TYPE_NONE) { /* key is (hopefully) the real Mac name */ cstrncpy(tmp, dname, strlen(dname)); if ((hfs_info = match_key(hfs_info, tmp)) != NULL) { strcpy(hfs_ent->name, hfs_info->name); set_Dinfo(hfs_info->finderinfo, hfs_ent); return (ret); } } /* no entry found - use Unix name */ hstrncpy((unsigned char *)(hfs_ent->name), dname, HFS_MAX_FLEN); return (TYPE_NONE); } /* * get_sgi_info: get SGI (XINET) HFS finder info * * base on probing with od ... */ static int get_sgi_info(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { struct hfs_info *hfs_info; hfsdirent *hfs_ent = s_entry->hfs_ent; /* cached finderinfo stored with parent directory */ hfs_info = s_entry->filedir->hfs_info; /* if we haven't got a cache, then make one */ if (hfs_info == NULL) { if ((hfs_info = get_hfs_sgi_info(hfs_info, hname)) == NULL) ret = TYPE_NONE; else s_entry->filedir->hfs_info = hfs_info; } if (ret != TYPE_NONE) { /* * tmp is the same as hname here, but we don't need hname * anymore in this function ... see if we can find the * details of this file using the Unix name as the key */ cstrncpy(tmp, dname, strlen(dname)); if ((hfs_info = match_key(hfs_info, tmp)) != NULL) { strcpy(hfs_ent->name, hfs_info->name); set_Finfo(hfs_info->finderinfo, hfs_ent); return (ret); } } /* no entry found, so try file extension */ if (verbose > 2) { fprintf(stderr, "warning: %s doesn't appear to be a %s file\n", s_entry->whole_name, hfs_types[ret].desc); } ret = get_none_info(hname, dname, s_entry, TYPE_NONE); return (TYPE_NONE); } /* * get_sfm_info: get SFM finderinfo for a file */ static byte sfm_magic[4] = {0x41, 0x46, 0x50, 0x00}; static byte sfm_version[4] = {0x00, 0x00, 0x01, 0x00}; static int get_sfm_info(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { sfm_info info; /* finderinfo struct */ int num = -1; /* bytes read */ hfsdirent *hfs_ent = s_entry->hfs_ent; num = read_info_file(hname, &info, sizeof (info)); /* check finder info is OK */ if (num == sizeof (info) && !memcmp((char *)info.afpi_Signature, (char *)sfm_magic, 4) && !memcmp((char *)info.afpi_Version, (char *)sfm_version, 4)) { /* use Unix name */ hstrncpy((unsigned char *)(hfs_ent->name), dname, HFS_MAX_FLEN); set_Finfo(info.finderinfo, hfs_ent); } else { /* failed to open/read finderinfo - so try afpfile mapping */ if (verbose > 2) { fprintf(stderr, "warning: %s doesn't appear to be a %s file\n", s_entry->whole_name, hfs_types[ret].desc); } ret = get_none_info(hname, dname, s_entry, TYPE_NONE); } return (ret); } #ifdef IS_MACOS_X /* * get_xhfs_dir: get MacOS X HFS finderinfo for a directory * * Code ideas from 'hfstar' by Marcel Weiher marcel@metaobject.com * and another GNU hfstar by Torres Vedras paulotex@yahoo.com * * Here we are dealing with actual HFS files - not some encoding * we have to use a system call to get the finderinfo * * The file name here is the pseudo name for the resource fork */ static int get_xhfs_dir(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { int err; hfsdirent *hfs_ent = s_entry->hfs_ent; attrinfo ainfo; struct attrlist attrs; int i; memset(&attrs, 0, sizeof (attrs)); /* set flags we need to get info from getattrlist() */ attrs.bitmapcount = ATTR_BIT_MAP_COUNT; attrs.commonattr = ATTR_CMN_CRTIME | ATTR_CMN_MODTIME | ATTR_CMN_FNDRINFO; /* get the info */ err = getattrlist(hname, &attrs, &ainfo, sizeof (ainfo), 0); if (err == 0) { /* * If the Finfo is blank then we assume it's not a * 'true' HFS directory ... */ err = 1; for (i = 0; i < sizeof (ainfo.info); i++) { if (ainfo.info[i] != 0) { err = 0; break; } } } /* check finder info is OK */ if (err == 0) { hstrncpy((unsigned char *) (s_entry->hfs_ent->name), dname, HFS_MAX_FLEN); set_Dinfo(ainfo.info, hfs_ent); return (ret); } else { /* otherwise give it it's Unix name */ hstrncpy((unsigned char *) (s_entry->hfs_ent->name), dname, HFS_MAX_FLEN); return (TYPE_NONE); } } /* * get_xhfs_info: get MacOS X HFS finderinfo for a file * * Code ideas from 'hfstar' by Marcel Weiher marcel@metaobject.com, * another GNU hfstar by Torres Vedras paulotex@yahoo.com and * hfspax by Howard Oakley howard@quercus.demon.co.uk * * Here we are dealing with actual HFS files - not some encoding * we have to use a system call to get the finderinfo * * The file name here is the pseudo name for the resource fork */ static int get_xhfs_info(char *hname, /* whole path */ char *dname, /* this dir name */ dir_ent *s_entry, /* directory entry */ int ret) { int err; hfsdirent *hfs_ent = s_entry->hfs_ent; attrinfo ainfo; struct attrlist attrs; int i; int size; memset(&attrs, 0, sizeof (attrs)); /* set flags we need to get info from getattrlist() */ attrs.bitmapcount = ATTR_BIT_MAP_COUNT; attrs.commonattr = ATTR_CMN_CRTIME | ATTR_CMN_MODTIME | ATTR_CMN_FNDRINFO; /* get the info */ err = getattrlist(hname, &attrs, &ainfo, sizeof (ainfo), 0); /* check finder info is OK */ if (err == 0) { /* * If the Finfo is blank and the resource file is empty, * then we assume it's not a 'true' HFS file ... * There will be not associated file if the resource fork * is empty */ if (s_entry->assoc == NULL) { err = 1; for (i = 0; i < sizeof (ainfo.info); i++) { if (ainfo.info[i] != 0) { err = 0; break; } } } if (err == 0) { /* use Unix name */ hstrncpy((unsigned char *) (hfs_ent->name), dname, HFS_MAX_FLEN); set_Finfo(ainfo.info, hfs_ent); /* * dates have already been set - but we will * set them here as well from the HFS info * shouldn't need to check for byte order, as * the source is HFS ... but we will just in case */ hfs_ent->crdate = d_getl((byte *)&ainfo.ctime.tv_sec); hfs_ent->mddate = d_getl((byte *)&ainfo.mtime.tv_sec); } } if (err) { /* not a 'true' HFS file - so try afpfile mapping */ #if 0 /* * don't print a warning as we will get lots on HFS * file systems ... */ if (verbose > 2) { fprintf(stderr, "warning: %s doesn't appear to be a %s file\n", s_entry->whole_name, hfs_types[ret].desc); } #endif ret = get_none_info(hname, dname, s_entry, TYPE_NONE); } return (ret); } #endif /* IS_MACOS_X */ /* * get_hfs_itype: get the type of HFS info for a file */ static int get_hfs_itype(char *wname, char *dname, char *htmp) { int wlen, i; int no_type = TYPE_NONE; wlen = strlen(wname) - strlen(dname); /* search through the known types looking for matches */ for (i = 1; i < hfs_num; i++) { /* skip the ones that we don't care about */ if ((hfs_types[i].flags & PROBE) || *(hfs_types[i].info) == TYPE_NONE) { continue; } strcpy(htmp, wname); /* * special case - if the info file doesn't exist * for a requested type, then remember the type - * we don't return here, as we _may_ find another type * so we save the type here in case - we will have * problems if more than one of this type ever exists ... */ if (hfs_types[i].flags & NOINFO) { no_type = i; } else { /* append or insert finderinfo filename part */ if (hfs_types[i].flags & APPEND) strcat(htmp, hfs_types[i].info); else sprintf(htmp + wlen, "%s%s", hfs_types[i].info, (hfs_types[i].flags & NOPEND) ? "" : dname); /* hack time ... Netatalk is a special case ... */ if (i == TYPE_NETA) { strcpy(htmp, wname); strcat(htmp, "/.AppleDouble/.Parent"); } if (!access(htmp, R_OK)) return (hfs_types[i].type); } } return (no_type); } /* * set_root_info: set the root folder hfs_ent from given file */ void set_root_info(char *name) { dir_ent *s_entry; hfsdirent *hfs_ent; int i; s_entry = root->self; hfs_ent = (hfsdirent *) e_malloc(sizeof (hfsdirent)); memset(hfs_ent, 0, sizeof (hfsdirent)); /* make sure root has a valid hfs_ent */ s_entry->hfs_ent = root->hfs_ent = hfs_ent; /* search for correct type of root info data */ for (i = 1; i < hfs_num; i++) { if ((hfs_types[i].flags & PROBE) || (hfs_types[i].get_info == get_none_info)) continue; if ((*(hfs_types[i].get_dir))(name, "", s_entry, i) == i) return; } } /* * get_hfs_dir: set the HFS directory name */ int get_hfs_dir(char *wname, char *dname, dir_ent *s_entry) { int type; /* get the HFS file type from the info file (if it exists) */ type = get_hfs_itype(wname, dname, tmp); /* try to get the required info */ type = (*(hfs_types[type].get_dir)) (tmp, dname, s_entry, type); return (type); } /* * get_hfs_info: set the HFS info for a file */ int get_hfs_info(char *wname, char *dname, dir_ent *s_entry) { int type, wlen, i; wlen = strlen(wname) - strlen(dname); /* we may already know the type of Unix/HFS file - so process */ if (s_entry->hfs_type != TYPE_NONE) { type = s_entry->hfs_type; strcpy(tmp, wname); /* append or insert finderinfo filename part */ if (hfs_types[type].flags & APPEND) strcat(tmp, hfs_types[type].info); else sprintf(tmp + wlen, "%s%s", hfs_types[type].info, (hfs_types[type].flags & NOPEND) ? "" : dname); type = (*(hfs_types[type].get_info))(tmp, dname, s_entry, type); /* if everything is as expected, then return */ if (s_entry->hfs_type == type) return (type); } /* we don't know what type we have so, find out */ for (i = 1; i < hfs_num; i++) { if ((hfs_types[i].flags & PROBE) || *(hfs_types[i].info) == TYPE_NONE) { continue; } strcpy(tmp, wname); /* append or insert finderinfo filename part */ if (hfs_types[i].flags & APPEND) { strcat(tmp, hfs_types[i].info); } else { sprintf(tmp + wlen, "%s%s", hfs_types[i].info, (hfs_types[i].flags & NOPEND) ? "" : dname); } /* if the file exists - and not a type we've already tried */ if (!access(tmp, R_OK) && i != s_entry->hfs_type) { type = (*(hfs_types[i].get_info))(tmp, dname, s_entry, i); s_entry->hfs_type = type; return (type); } } /* nothing found, so just a Unix file */ type = (*(hfs_types[TYPE_NONE].get_info))(wname, dname, s_entry, TYPE_NONE); return (type); } /* * get_hfs_rname: set the name of the Unix rsrc file for a file * * For the time being we ignore the 'NOINFO' flag - the only case * at the moment is for MacOS X HFS files - for files the resource * fork exists - so testing the "filename/rsrc" pseudo file as * the 'info' filename is OK ... */ int get_hfs_rname(char *wname, char *dname, char *rname) { int wlen, type, i; int p_fd = -1; wlen = strlen(wname) - strlen(dname); /* try to find what sort of Unix HFS file type we have */ for (i = 1; i < hfs_num; i++) { /* skip if don't want to probe the files - (default) */ if (hfs_types[i].flags & PROBE) continue; strcpy(rname, wname); /* if we have a different info file, the find out it's type */ if (*(hfs_types[i].rsrc) && *(hfs_types[i].info)) { /* first test the Info file */ /* append or insert finderinfo filename part */ if (hfs_types[i].flags & APPEND) { strcat(rname, hfs_types[i].info); } else { sprintf(rname + wlen, "%s%s", hfs_types[i].info, (hfs_types[i].flags & NOPEND) ? "" : dname); } /* if it exists, then check the Rsrc file */ if (!access(rname, R_OK)) { if (hfs_types[i].flags & APPEND) { sprintf(rname + wlen, "%s%s", dname, hfs_types[i].rsrc); } else { sprintf(rname + wlen, "%s%s", hfs_types[i].rsrc, dname); } /* * for some types, a rsrc fork may not exist, * so just return the current type * in these cases */ if (hfs_types[i].flags & NORSRC || !access(rname, R_OK)) return (hfs_types[i].type); } } else { /* * if we are probing, * then have a look at the contents to find type */ if (p_fd < 0) { /* open file, if not already open */ if ((p_fd = open(wname, O_RDONLY | O_BINARY)) < 0) { /* can't open it, then give up */ return (TYPE_NONE); } else { if ((p_num = read(p_fd, p_buf, sizeof (p_buf))) <= 0) { /* * can't read, or zero length * - give up */ close(p_fd); return (TYPE_NONE); } /* get file pointer and close file */ p_fp = fdopen(p_fd, "rb"); close(p_fd); if (p_fp == NULL) return (TYPE_NONE); } } /* * call routine to do the work * - use the given dname as this * is the name we may use on the CD */ type = (*(hfs_types[i].get_info)) (rname, dname, 0, i); if (type != 0) { fclose(p_fp); return (type); } if (p_fp) { /* * close file * - just use contents of buffer next time */ fclose(p_fp); p_fp = NULL; } } } return (0); } /* * hfs_exclude: file/directory names that hold finder/resource * information that we want to exclude from the tree. * These files/directories are processed later ... */ int hfs_exclude(char *d_name) { /* we don't exclude "." and ".." */ if (strcmp(d_name, ".") == 0) return (0); if (strcmp(d_name, "..") == 0) return (0); /* do not add the following to our list of dir entries */ if (DO_CAP & hselect) { /* CAP */ if (strcmp(d_name, ".finderinfo") == 0) return (1); if (strcmp(d_name, ".resource") == 0) return (1); if (strcmp(d_name, ".ADeskTop") == 0) return (1); if (strcmp(d_name, ".IDeskTop") == 0) return (1); if (strcmp(d_name, "Network Trash Folder") == 0) return (1); /* * special case when HFS volume is mounted using Linux's hfs_fs * Brad Midgley */ if (strcmp(d_name, ".rootinfo") == 0) return (1); } if (DO_ESH & hselect) { /* Helios EtherShare files */ if (strcmp(d_name, ".rsrc") == 0) return (1); if (strcmp(d_name, ".Desktop") == 0) return (1); if (strcmp(d_name, ".DeskServer") == 0) return (1); if (strcmp(d_name, ".Label") == 0) return (1); } if (DO_DBL & hselect) { /* Apple Double */ /* * special case when HFS volume is mounted using Linux's hfs_fs */ if (strcmp(d_name, "%RootInfo") == 0) return (1); /* * have to be careful here - a filename starting with '%' * may be vaild if the next two letters are a hex character - * unfortunately '%' 'digit' 'digit' may be a valid resource * file name ... */ if (*d_name == '%') if (hex2char(d_name) == 0) return (1); } if (DO_NETA & hselect) { if (strcmp(d_name, ".AppleDouble") == 0) return (1); if (strcmp(d_name, ".AppleDesktop") == 0) return (1); } if ((DO_FEU & hselect) || (DO_FEL & hselect)) { /* PC Exchange */ if (strcmp(d_name, "RESOURCE.FRK") == 0) return (1); if (strcmp(d_name, "FINDER.DAT") == 0) return (1); if (strcmp(d_name, "DESKTOP") == 0) return (1); if (strcmp(d_name, "FILEID.DAT") == 0) return (1); if (strcmp(d_name, "resource.frk") == 0) return (1); if (strcmp(d_name, "finder.dat") == 0) return (1); if (strcmp(d_name, "desktop") == 0) return (1); if (strcmp(d_name, "fileid.dat") == 0) return (1); } if (DO_SGI & hselect) { /* SGI */ if (strcmp(d_name, ".HSResource") == 0) return (1); if (strcmp(d_name, ".HSancillary") == 0) return (1); } if (DO_DAVE & hselect) { /* DAVE */ if (strcmp(d_name, "resource.frk") == 0) return (1); if (strcmp(d_name, "DesktopFolderDB") == 0) return (1); } #ifndef _WIN32 /* * NTFS streams are not "seen" as files, * so WinNT will not see these files - * so ignore - used for testing under Unix */ if (DO_SFM & hselect) { /* SFM */ char *dn = strrchr(d_name, ':'); if (dn) { if (strcmp(dn, ":Afp_Resource") == 0) return (1); if (strcmp(dn, ":Comments") == 0) return (1); if (strcmp(dn, ":Afp_AfpInfo") == 0) return (1); } } #endif /* _WIN32 */ if (DO_XDBL & hselect) { /* XDB */ if (strncmp(d_name, "._", 2) == 0) return (1); } return (0); } /* * print_hfs_info: print info about the HFS files. * */ void print_hfs_info(dir_ent *s_entry) { fprintf(stderr, "Name: %s\n", s_entry->whole_name); fprintf(stderr, "\tFile type: %s\n", hfs_types[s_entry->hfs_type].desc); fprintf(stderr, "\tHFS Name: %s\n", s_entry->hfs_ent->name); fprintf(stderr, "\tISO Name: %s\n", s_entry->isorec.name); fprintf(stderr, "\tCREATOR: %s\n", s_entry->hfs_ent->u.file.creator); fprintf(stderr, "\tTYPE: %s\n", s_entry->hfs_ent->u.file.type); } /* * hfs_init: sets up the mapping list from the afpfile as well * the default mapping (with or without) an afpfile */ void hfs_init(char *name, Ushort fdflags, Uint hfs_select) { FILE *fp; /* File pointer */ int count = NUMMAP; /* max number of entries */ char buf[PATH_MAX]; /* working buffer */ afpmap *amap; /* mapping entry */ char *c, *t, *e; int i; /* setup number of Unix/HFS filetype - we may wish to not bother */ if (hfs_select) { hfs_num = sizeof (hfs_types) / sizeof (struct hfs_type); /* * code below needs to be tidied up * - most can be made redundant */ for (i = 0; i < hfs_num; i++) hfs_types[i].flags &= ~1; /* 0xfffffffe */ for (i = 1; i < hfs_num; i++) if (!((1 << i) & hfs_select)) hfs_types[i].flags |= PROBE; hselect = hfs_select; } else hfs_num = hselect = 0; #ifdef DEBUG for (i = 0; i < hfs_num; i++) fprintf(stderr, "type = %d flags = %d\n", i, hfs_types[i].flags); #endif /* DEBUG */ /* min length set to max to start with */ mlen = PATH_MAX; #ifdef USE_MAGIC /* initialise magic state */ if (magic_filename) { magic_state = magic_open(MAGIC_ERROR); if (magic_state == NULL) perr("failed to initialise libmagic"); if (magic_load(magic_state, magic_filename) == -1) { fprintf(stderr, "failed to open magic file: %s\n", magic_error(magic_state)); exit(1); } } #endif /* USE_MAGIC */ /* set defaults */ map_num = last_ent = 0; /* allocate memory for the default entry */ defmap = (afpmap *) e_malloc(sizeof (afpmap)); /* set default values */ defmap->extn = DEFMATCH; /* make sure creator and type are 4 chars long */ strcpy(defmap->type, BLANK); strcpy(defmap->creator, BLANK); e = deftype; t = defmap->type; while (*e && (e - deftype) < CT_SIZE) *t++ = *e++; e = defcreator; c = defmap->creator; while (*e && (e - defcreator) < CT_SIZE) *c++ = *e++; /* length is not important here */ defmap->elen = 0; /* no flags */ defmap->fdflags = fdflags; /* no afpfile - no mappings */ if (*name == '\0') { map = NULL; return; } if ((fp = fopen(name, "r")) == NULL) perr("unable to open mapping file"); map = (afpmap **) e_malloc(NUMMAP * sizeof (afpmap *)); /* read afpfile line by line */ while (fgets(buf, PATH_MAX, fp) != NULL) { /* ignore any comment lines */ c = tmp; *c = '\0'; if (sscanf(buf, "%1s", c) == EOF || *c == '#') continue; /* increase list size if needed */ if (map_num == count) { count += NUMMAP; map = (afpmap **)realloc(map, count * sizeof (afpmap *)); if (map == NULL) perr("not enough memory"); } /* allocate memory for this entry */ amap = (afpmap *) e_malloc(sizeof (afpmap)); t = amap->type; c = amap->creator; /* extract the info */ if (sscanf(buf, "%s%*s%*1s%c%c%c%c%*1s%*1s%c%c%c%c%*1s", tmp, c, c + 1, c + 2, c + 3, t, t + 1, t + 2, t + 3) != 9) { fprintf(stderr, "error scanning afpfile %s - continuing", name); free(amap); continue; } /* copy the extension found */ if ((amap->extn = (char *) strdup(tmp)) == NULL) perr("not enough memory"); /* set end-of-string */ *(t + 4) = *(c + 4) = '\0'; /* find the length of the extension */ amap->elen = strlen(amap->extn); /* set flags */ amap->fdflags = fdflags; /* see if we have the default creator/type */ if (strcmp(amap->extn, DEFMATCH) == 0) { /* get rid of the old default */ free(defmap); /* make this the default */ defmap = amap; continue; } /* update the smallest extension length */ mlen = MIN(mlen, amap->elen); /* add entry to the list */ map[map_num++] = amap; } /* free up some memory */ if (map_num != count) { map = (afpmap **) realloc(map, map_num * sizeof (afpmap *)); if (map == NULL) perr("not enough memory"); } } #ifdef USE_MAGIC static int try_map_magic(char *whole_name, char **type, /* set type */ char **creator /* set creator */) { const char * ret = magic_file(magic_state, whole_name); #ifdef DEBUG fprintf(stderr, "magic_file(magic_state, \"%s\"): %s\n", whole_name, ret ? ret : "NULL"); #endif /* * check that we found a match; ignore results in the * wrong format (probably due to libmagic's built-in rules) */ if (ret && strcspn(ret, " ") == CT_SIZE && ret[CT_SIZE] == ' ' && strcspn(ret + CT_SIZE + 1, " ") == CT_SIZE) { memcpy(tmp_type, ret, CT_SIZE); tmp_type[CT_SIZE] = 0; memcpy(tmp_creator, ret + CT_SIZE + 1, CT_SIZE); tmp_creator[CT_SIZE] = 0; #ifdef DEBUG fprintf(stderr, "tmp_type = \"%s\"; tmp_creator = \"%s\"\n", tmp_type, tmp_creator); #endif *type = tmp_type; *creator = tmp_creator; return (1); } return (0); } #endif /* USE_MAGIC */ /* * map_ext: map a files extension with the list to get type/creator */ static void map_ext(char *name, /* filename */ char **type, /* set type */ char **creator, /* set creator */ short *fdflags, /* set finder flags */ char *whole_name) { int i; /* loop counter */ int len; /* filename length */ afpmap *amap; /* mapping entry */ const char *ret; /* we don't take fdflags from the map or magic file */ *fdflags = defmap->fdflags; #ifdef USE_MAGIC /* * if we have a magic file and we want to search it first, * then try to get a match */ if (magic_state && hfs_last == MAP_LAST && try_map_magic(whole_name, type, creator)) return; #endif /* USE_MAGIC */ len = strlen(name); /* have an afpfile and filename if long enough */ if (map && len >= mlen) { /* * search through the list - we start where we left off * last time in case this file is of the same type as the * last one */ for (i = 0; i < map_num; i++) { amap = map[last_ent]; /* compare the end of the filename */ /* if (strcmp((name+len - amap->elen), amap->extn) == 0) { */ if (strcasecmp((name+len - amap->elen), amap->extn) == 0) { /* set the required info */ *type = amap->type; *creator = amap->creator; *fdflags = amap->fdflags; return; } /* * move on to the next entry - wrapping round * if neccessary */ last_ent++; last_ent %= map_num; } } /* * if no matches are found, file name too short, or no afpfile, * then take defaults */ *type = defmap->type; *creator = defmap->creator; #ifdef USE_MAGIC /* * if we have a magic file and we haven't searched yet, * then try to get a match */ if (magic_state && hfs_last == MAG_LAST) try_map_magic(whole_name, type, creator); #endif /* USE_MAGIC */ } void delete_rsrc_ent(dir_ent *s_entry) { dir_ent *s_entry1 = s_entry->next; if (s_entry1 == NULL) return; s_entry->next = s_entry1->next; s_entry->assoc = NULL; free(s_entry1->name); free(s_entry1->whole_name); free(s_entry1); } void clean_hfs() { if (map) free(map); if (defmap) free(defmap); #ifdef USE_MAGIC if (magic_state) { magic_close(magic_state); magic_state = NULL; } #endif /* USE_MAGIC */ } #endif /* APPLE_HYB */ void perr(char *a) { #ifdef USE_LIBSCHILY if (a) comerr("%s\n", a); else comerr("\n"); #else if (a) fprintf(stderr, "mkhybrid: %s\n", a); perror("mkhybrid"); exit(1); #endif } cdrkit-1.1.11/genisoimage/genisoimage.h0000644000372500001440000006055411016351607017065 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)genisoimage.h 1.95 05/05/01 joerg */ /* * Header file genisoimage.h - assorted structure definitions and typecasts. * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999,2000-2003 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 23/2/2000 */ #define APPID_DEFAULT "GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM" #include /* Must be before stdio.h for LARGEFILE support */ #include #include #include #include /* Needed for for LARGEFILE support */ #include #include #include #include #include #include "scsi.h" #ifdef JIGDO_TEMPLATE #include "jte.h" #endif #ifdef DVD_VIDEO #ifndef UDF #define UDF #endif #endif /*#if _LFS_LARGEFILE*/ #ifdef HAVE_LARGEFILES /* * XXX Hack until fseeko()/ftello() are available everywhere or until * XXX we know a secure way to let autoconf ckeck for fseeko()/ftello() * XXX without defining FILE_OFFSETBITS to 64 in confdefs.h */ # define fseek fseeko # define ftell ftello #endif #ifndef HAVE_LSTAT #ifndef VMS #define lstat stat #endif #endif #include "iso9660.h" #include "defaults.h" #include extern struct unls_table *in_nls; /* input UNICODE conversion table */ extern struct unls_table *out_nls; /* output UNICODE conversion table */ extern struct unls_table *hfs_inls; /* input HFS UNICODE conversion table */ extern struct unls_table *hfs_onls; /* output HFS UNICODE conversion table */ #ifdef APPLE_HYB #include "mactypes.h" #include "hfs.h" struct hfs_info { unsigned char finderinfo[32]; char name[HFS_MAX_FLEN + 1]; /* should have fields for dates here as well */ char *keyname; struct hfs_info *next; }; #endif /* APPLE_HYB */ struct directory_entry { struct directory_entry *next; struct directory_entry *jnext; struct iso_directory_record isorec; unsigned int starting_block; off_t size; unsigned short priority; unsigned char jreclen; /* Joliet record len */ char *name; char *table; char *whole_name; struct directory *filedir; struct directory_entry *parent_rec; unsigned int de_flags; ino_t inode; /* Used in the hash table */ dev_t dev; /* Used in the hash table */ unsigned char *rr_attributes; unsigned int rr_attr_size; unsigned int total_rr_attr_size; unsigned int got_rr_name; #ifdef APPLE_HYB struct directory_entry *assoc; /* entry has a resource fork */ hfsdirent *hfs_ent; /* HFS parameters */ off_t hfs_off; /* offset to real start of fork */ int hfs_type; /* type of HFS Unix file */ #endif /* APPLE_HYB */ #ifdef SORTING int sort; /* sort weight for entry */ #endif /* SORTING */ #ifdef UDF int udf_file_entry_sector; /* also used as UDF unique ID */ #endif uint64_t realsize; }; struct file_hash { struct file_hash *next; ino_t inode; /* Used in the hash table */ dev_t dev; /* Used in the hash table */ nlink_t nlink; /* Used to compute new link count */ unsigned int starting_block; off_t size; #ifdef SORTING struct directory_entry *de; #endif /* SORTING */ }; /* * This structure is used to control the output of fragments to the cdrom * image. Everything that will be written to the output image will eventually * go through this structure. There are two pieces - first is the sizing where * we establish extent numbers for everything, and the second is when we actually * generate the contents and write it to the output image. * * This makes it trivial to extend genisoimage to write special things in the image. * All you need to do is hook an additional structure in the list, and the rest * works like magic. * * The three passes each do the following: * * The 'size' pass determines the size of each component and assigns the extent number * for that component. * * The 'generate' pass will adjust the contents and pointers as required now that extent * numbers are assigned. In some cases, the contents of the record are also generated. * * The 'write' pass actually writes the data to the disc. */ struct output_fragment { struct output_fragment *of_next; int (*of_size)(int); int (*of_generate)(void); int (*of_write)(FILE *); char *of_name; /* Textual description */ unsigned int of_start_extent; /* For consist check */ }; extern struct output_fragment *out_list; extern struct output_fragment *out_tail; extern struct output_fragment startpad_desc; extern struct output_fragment voldesc_desc; extern struct output_fragment xvoldesc_desc; extern struct output_fragment joliet_desc; extern struct output_fragment torito_desc; extern struct output_fragment end_vol; extern struct output_fragment version_desc; extern struct output_fragment pathtable_desc; extern struct output_fragment jpathtable_desc; extern struct output_fragment dirtree_desc; extern struct output_fragment dirtree_clean; extern struct output_fragment jdirtree_desc; extern struct output_fragment extension_desc; extern struct output_fragment files_desc; extern struct output_fragment interpad_desc; extern struct output_fragment endpad_desc; extern struct output_fragment sunboot_desc; extern struct output_fragment sunlabel_desc; extern struct output_fragment genboot_desc; extern struct output_fragment strfile_desc; extern struct output_fragment strdir_desc; extern struct output_fragment strpath_desc; extern struct output_fragment alphaboot_desc; extern struct output_fragment hppaboot_desc; extern struct output_fragment alpha_hppa_boot_desc; extern struct output_fragment mipsboot_desc; extern struct output_fragment mipselboot_desc; #ifdef APPLE_HYB extern struct output_fragment hfs_desc; #endif /* APPLE_HYB */ #ifdef DVD_VIDEO /* * This structure holds the information necessary to create a valid * DVD-Video image. Basically it's how much to pad the files so the * file offsets described in the video_ts.ifo and vts_xx_0.ifo are * the correct one in the image that we create. */ typedef struct { int realsize_ifo; int realsize_menu; int realsize_bup; int size_ifo; int size_menu; int size_title; int size_bup; int pad_ifo; int pad_menu; int pad_title; int pad_bup; int number_of_vob_files; int realsize_vob[10]; } title_set_t; typedef struct { int num_titles; title_set_t *title_set; } title_set_info_t; #endif /* DVD_VIDEO */ /* * This structure describes one complete directory. It has pointers * to other directories in the overall tree so that it is clear where * this directory lives in the tree, and it also must contain pointers * to the contents of the directory. Note that subdirectories of this * directory exist twice in this stucture. Once in the subdir chain, * and again in the contents chain. */ struct directory { struct directory *next; /* Next directory at same level as this one */ struct directory *subdir; /* First subdirectory in this directory */ struct directory *parent; struct directory_entry *contents; struct directory_entry *jcontents; struct directory_entry *self; char *whole_name; /* Entire path */ char *de_name; /* Entire path */ unsigned int ce_bytes; /* Number of bytes of CE entries read */ /* for this dir */ unsigned int depth; unsigned int size; unsigned int extent; unsigned int jsize; unsigned int jextent; unsigned int path_index; unsigned int jpath_index; unsigned short dir_flags; unsigned short dir_nlink; #ifdef APPLE_HYB hfsdirent *hfs_ent; /* HFS parameters */ struct hfs_info *hfs_info; /* list of info for all entries in dir */ #endif /* APPLE_HYB */ #ifdef SORTING int sort; /* sort weight for child files */ #endif /* SORTING */ }; struct deferred_write { struct deferred_write *next; char *table; unsigned int extent; off_t size; char *name; struct directory_entry *s_entry; unsigned int pad; off_t off; }; struct eltorito_boot_entry_info { struct eltorito_boot_entry_info *next; char *boot_image; int not_bootable; int no_emul_boot; int hard_disk_boot; int boot_info_table; int load_size; int load_addr; }; extern int goof; extern struct directory *root; extern struct directory *reloc_dir; extern unsigned int next_extent; extern unsigned int last_extent; extern unsigned int last_extent_written; extern unsigned int session_start; extern unsigned int path_table_size; extern unsigned int path_table[4]; extern unsigned int path_blocks; extern char *path_table_l; extern char *path_table_m; extern unsigned int jpath_table_size; extern unsigned int jpath_table[4]; extern unsigned int jpath_blocks; extern char *jpath_table_l; extern char *jpath_table_m; extern struct iso_directory_record root_record; extern struct iso_directory_record jroot_record; extern int check_oldnames; extern int check_session; extern int use_eltorito; extern int hard_disk_boot; extern int not_bootable; extern int no_emul_boot; extern int load_addr; extern int load_size; extern int boot_info_table; extern int use_RockRidge; extern int osecsize; extern int use_XA; extern int use_Joliet; extern int rationalize; extern int rationalize_uid; extern int rationalize_gid; extern int rationalize_filemode; extern int rationalize_dirmode; extern uid_t uid_to_use; extern gid_t gid_to_use; extern int filemode_to_use; extern int dirmode_to_use; extern int new_dir_mode; extern int follow_links; extern int cache_inodes; extern int verbose; extern int debug; extern int gui; extern int all_files; extern int generate_tables; extern int print_size; extern int split_output; extern int use_graft_ptrs; extern int jhide_trans_tbl; extern int hide_rr_moved; extern int omit_period; extern int omit_version_number; extern int no_rr; extern int transparent_compression; extern Uint RR_relocation_depth; extern int iso9660_level; extern int iso9660_namelen; extern int full_iso9660_filenames; extern int relaxed_filenames; extern int allow_lowercase; extern int allow_multidot; extern int iso_translate; extern int allow_leading_dots; extern int use_fileversion; extern int split_SL_component; extern int split_SL_field; extern char *trans_tbl; char *outfile; #define JMAX 64 /* maximum Joliet file name length (spec) */ #define JLONGMAX 103 /* out of spec Joliet file name length */ extern int jlen; /* selected maximum Joliet file name length */ #ifdef DVD_VIDEO extern int dvd_video; #endif /* DVD_VIDEO */ #ifdef APPLE_HYB extern int apple_hyb; /* create HFS hybrid */ extern int apple_ext; /* use Apple extensions */ extern int apple_both; /* common flag (for above) */ extern int hfs_extra; /* extra ISO extents (hfs_ce_size) */ extern hce_mem *hce; /* libhfs/genisoimage extras */ extern int use_mac_name; /* use Mac name for ISO9660/Joliet/RR */ extern int create_dt; /* create the Desktp files */ extern char *hfs_boot_file; /* name of HFS boot file */ extern char *magic_filename; /* magic file for CREATOR/TYPE matching */ extern int hfs_last; /* order in which to process map/magic files */ extern char *deftype; /* default Apple TYPE */ extern char *defcreator; /* default Apple CREATOR */ extern int gen_pt; /* generate HFS partition table */ extern char *autoname; /* Autostart filename */ extern int afe_size; /* Apple File Exchange block size */ extern char *hfs_volume_id; /* HFS volume ID */ extern int icon_pos; /* Keep Icon position */ extern int hfs_lock; /* lock HFS volume (read-only) */ extern char *hfs_bless; /* name of folder to 'bless' (System Folder) */ extern char *hfs_parms; /* low level HFS parameters */ #define MAP_LAST 1 /* process magic then map file */ #define MAG_LAST 2 /* process map then magic file */ #ifndef PREP_BOOT #define PREP_BOOT #endif /* PREP_BOOT */ #ifdef PREP_BOOT extern char *prep_boot_image[4]; extern int use_prep_boot; extern int use_chrp_boot; #endif /* PREP_BOOT */ #endif /* APPLE_HYB */ #ifdef SORTING extern int do_sort; #endif /* SORTING */ /* tree.c */ extern int stat_filter(char *, struct stat *); extern int lstat_filter(char *, struct stat *); extern int sort_tree(struct directory *); extern struct directory * find_or_create_directory(struct directory *, const char *, struct directory_entry *self, int, struct stat *stat_template); extern void finish_cl_pl_entries(void); extern int scan_directory_tree(struct directory *this_dir, char *path, struct directory_entry *self); #ifdef APPLE_HYB extern int insert_file_entry(struct directory *, char *, char *, int); #else extern int insert_file_entry(struct directory *, char *, char *); #endif /* APPLE_HYB */ extern void generate_iso9660_directories(struct directory *, FILE *); extern void dump_tree(struct directory * node); extern struct directory_entry * search_tree_file(struct directory * node, char *filename); extern void update_nlink_field(struct directory * node); extern void init_fstatbuf(void); extern struct stat root_statbuf; extern struct stat fstatbuf; /* eltorito.c */ extern void init_boot_catalog(const char *path); extern void insert_boot_cat(void); extern void get_boot_entry(void); extern void new_boot_entry(void); /* boot.c */ extern void sparc_boot_label(char *label); extern void sunx86_boot_label(char *label); extern void scan_sparc_boot(char *files); extern void scan_sunx86_boot(char *files); extern int make_sun_label(void); extern int make_sunx86_label(void); /* boot-alpha.c */ extern int add_boot_alpha_filename(char *filename); /* boot-hppa.c */ extern int add_boot_hppa_cmdline(char *cmdline); extern int add_boot_hppa_kernel_32(char *filename); extern int add_boot_hppa_kernel_64(char *filename); extern int add_boot_hppa_bootloader(char *filename); extern int add_boot_hppa_ramdisk(char *filename); /* boot-mips.c */ extern int add_boot_mips_filename(char *filename); /* boot-mipsel.c */ extern int add_boot_mipsel_filename(char *filename); /* rsync.c */ extern unsigned long long rsync64(unsigned char *mem, size_t size); /* write.c */ extern int get_731(char *); extern int get_732(char *); extern int get_733(char *); extern int isonum_733(unsigned char *); extern void set_723(char *, unsigned int); extern void set_731(char *, unsigned int); extern void set_721(char *, unsigned int); extern void set_733(char *, unsigned int); extern int sort_directory(struct directory_entry **, int); extern void generate_one_directory(struct directory *, FILE *); extern void memcpy_max(char *, char *, int); extern int oneblock_size(int starting_extent); extern struct iso_primary_descriptor vol_desc; extern void xfwrite(void *buffer, int size, int count, FILE *file, int submode, BOOL islast); extern void set_732(char *pnt, unsigned int i); extern void set_722(char *pnt, unsigned int i); extern void outputlist_insert(struct output_fragment * frag); #ifdef APPLE_HYB extern Ulong get_adj_size(int Csize); extern int adj_size(int Csize, int start_extent, int extra); extern void adj_size_other(struct directory * dpnt); extern int insert_padding_file(int size); extern int gen_mac_label(struct deferred_write *); #ifdef PREP_BOOT extern void gen_prepboot_label(unsigned char *); #endif /* PREP_BOOT */ #endif /* APPLE_HYB */ /* multi.c */ extern FILE *in_image; extern int open_merge_image(char *path); extern int close_merge_image(void); extern struct iso_directory_record * merge_isofs(char *path); extern unsigned char *parse_xa(unsigned char *pnt, int *lenp, struct directory_entry *dpnt); extern int rr_flags(struct iso_directory_record *idr); extern int merge_previous_session(struct directory *, struct iso_directory_record *, char *, char *); extern int get_session_start(int *); /* joliet.c */ #ifdef UDF # ifdef USE_ICONV extern size_t convert_to_unicode (unsigned char *buffer, int size, char *source, struct unls_table *inls); # else extern void convert_to_unicode (unsigned char *buffer, int size, char *source, struct unls_table *inls); # endif extern int joliet_strlen (const char *string, struct unls_table *inls); #endif extern unsigned char conv_charset(unsigned char, struct unls_table *, struct unls_table *); extern int joliet_sort_tree(struct directory * node); /* match.c */ extern int matches(char *); extern int add_match(char *); /* files.c */ struct dirent *readdir_add_files(char **, char *, DIR *); /* name.c */ extern void iso9660_check(struct iso_directory_record *idr, struct directory_entry *ndr); extern int iso9660_file_length(const char *name, struct directory_entry *sresult, int flag); /* various */ extern int iso9660_date(char *, time_t); extern void add_hash(struct directory_entry *); extern struct file_hash *find_hash(dev_t, ino_t); extern void flush_hash(void); extern void add_directory_hash(dev_t, ino_t); extern struct file_hash *find_directory_hash(dev_t, ino_t); extern void flush_file_hash(void); extern int delete_file_hash(struct directory_entry *); extern struct directory_entry *find_file_hash(char *); extern void add_file_hash(struct directory_entry *); extern int generate_xa_rr_attributes(char *, char *, struct directory_entry *, struct stat *, struct stat *, int deep_flag); extern char *generate_rr_extension_record(char *id, char *descriptor, char *source, int *size); extern int check_prev_session(struct directory_entry **, int len, struct directory_entry *, struct stat *, struct stat *, struct directory_entry **); extern void match_cl_re_entries(void); extern void finish_cl_pl_for_prev_session(void); extern char *find_rr_attribute(unsigned char *pnt, int len, char *attr_type); #ifdef APPLE_HYB /* volume.c */ extern int make_mac_volume(struct directory * dpnt, int start_extent); extern int write_fork(hfsfile * hfp, long tot); /* apple.c */ extern void del_hfs_info(struct hfs_info *); extern int get_hfs_dir(char *, char *, struct directory_entry *); extern int get_hfs_info(char *, char *, struct directory_entry *); extern int get_hfs_rname(char *, char *, char *); extern int hfs_exclude(char *); extern void print_hfs_info(struct directory_entry *); extern void hfs_init(char *, unsigned short, unsigned int); extern void delete_rsrc_ent(struct directory_entry *); extern void clean_hfs(void); extern void perr(char *); extern void set_root_info(char *); /* desktop.c */ extern int make_desktop(hfsvol *, int); /* mac_label.c */ #ifdef _MAC_LABEL_H #ifdef PREP_BOOT extern void gen_prepboot_label(MacLabel * mac_label); #endif extern int gen_mac_label(defer *); #endif extern int autostart(void); /* libfile */ extern char *get_magic_match(const char *); extern void clean_magic(void); #endif /* APPLE_HYB */ extern char *extension_record; extern int extension_record_extent; extern int n_data_extents; /* * These are a few goodies that can be specified on the command line, and are * filled into the root record */ extern char *preparer; extern char *publisher; extern char *copyright; extern char *biblio; extern char *abstract; extern char *appid; extern char *volset_id; extern char *system_id; extern char *volume_id; extern char *boot_catalog; extern char *boot_image; extern char *genboot_image; extern int ucs_level; extern int volume_set_size; extern int volume_sequence_number; extern struct eltorito_boot_entry_info *first_boot_entry; extern struct eltorito_boot_entry_info *last_boot_entry; extern struct eltorito_boot_entry_info *current_boot_entry; extern char *findgequal(char *); extern void *e_malloc(size_t); /* * Note: always use these macros to avoid problems. * * ISO_ROUND_UP(X) may cause an integer overflow and thus give * incorrect results. So avoid it if possible. * * ISO_BLOCKS(X) is overflow safe. Prefer this when ever it is possible. */ #define SECTOR_SIZE (2048) #define ISO_ROUND_UP(X) (((X) + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1)) #define ISO_BLOCKS(X) (((X) / SECTOR_SIZE) + (((X)%SECTOR_SIZE)?1:0)) #define ROUND_UP(X, Y) (((X + (Y - 1)) / Y) * Y) #ifdef APPLE_HYB /* * ISO blocks == 2048, HFS blocks == 512 */ #define HFS_BLK_CONV (SECTOR_SIZE/HFS_BLOCKSZ) #define HFS_ROUND_UP(X) ISO_ROUND_UP(((X)*HFS_BLOCKSZ)) /* XXX ??? */ #define HFS_BLOCKS(X) (ISO_BLOCKS(X) * HFS_BLK_CONV) #define USE_MAC_NAME(E) (use_mac_name && ((E)->hfs_ent != NULL) && (E)->hfs_type) #endif /* APPLE_HYB */ /* * Rock Ridge defines */ #define NEED_RE 1 /* Need Relocated Direcotry */ #define NEED_PL 2 /* Need Parent link */ #define NEED_CL 4 /* Need Child link */ #define NEED_CE 8 /* Need Continuation Area */ #define NEED_SP 16 /* Need SUSP record */ #define RR_FLAG_PX 1 /* POSIX attributes */ #define RR_FLAG_PN 2 /* POSIX device number */ #define RR_FLAG_SL 4 /* Symlink */ #define RR_FLAG_NM 8 /* Alternate Name */ #define RR_FLAG_CL 16 /* Child link */ #define RR_FLAG_PL 32 /* Parent link */ #define RR_FLAG_RE 64 /* Relocated Direcotry */ #define RR_FLAG_TF 128 /* Time stamp */ #define RR_FLAG_SP 1024 /* SUSP record */ #define RR_FLAG_AA 2048 /* Apple Signature record */ #define RR_FLAG_XA 4096 /* XA signature record */ #define RR_FLAG_CE 8192 /* SUSP Continuation aerea */ #define RR_FLAG_ER 16384 /* Extension record for RR signature */ #define RR_FLAG_RR 32768 /* RR Signature in every file */ #define RR_FLAG_ZF 65535 /* Linux compression extension */ #define PREV_SESS_DEV (sizeof (dev_t) >= 4 ? 0x7ffffffd : 0x7ffd) #define TABLE_INODE (sizeof (ino_t) >= 4 ? 0x7ffffffe : 0x7ffe) #define UNCACHED_INODE (sizeof (ino_t) >= 4 ? 0x7fffffff : 0x7fff) #define UNCACHED_DEVICE (sizeof (dev_t) >= 4 ? 0x7fffffff : 0x7fff) #ifdef VMS #define STAT_INODE(X) (X.st_ino[0]) #define PATH_SEPARATOR ']' #define SPATH_SEPARATOR "" #else #define STAT_INODE(X) (X.st_ino) #define PATH_SEPARATOR '/' #define SPATH_SEPARATOR "/" #endif /* * When using multi-session, indicates that we can reuse the * TRANS.TBL information for this directory entry. If this flag * is set for all entries in a directory, it means we can just * reuse the TRANS.TBL and not generate a new one. */ #define SAFE_TO_REUSE_TABLE_ENTRY 0x01 /* de_flags only */ #define DIR_HAS_DOT 0x02 /* dir_flags only */ #define DIR_HAS_DOTDOT 0x04 /* dir_flags only */ #define INHIBIT_JOLIET_ENTRY 0x08 #define INHIBIT_RR_ENTRY 0x10 /* not used */ #define RELOCATED_DIRECTORY 0x20 /* de_flags only */ #define INHIBIT_ISO9660_ENTRY 0x40 #define MEMORY_FILE 0x80 /* de_flags only */ #define HIDDEN_FILE 0x100 /* de_flags only */ #define DIR_WAS_SCANNED 0x200 /* dir_flags only */ /* * Volume sequence number to use in all of the iso directory records. */ #define DEF_VSN 1 /* * Make sure we have a definition for this. If not, take a very conservative * guess. * POSIX requires the max pathname component lenght to be defined in limits.h * If variable, it may be undefined. If undefined, there should be * a definition for _POSIX_NAME_MAX in limits.h or in unistd.h * As _POSIX_NAME_MAX is defined to 14, we cannot use it. * XXX Eric's wrong comment: * XXX From what I can tell SunOS is the only one with this trouble. */ #ifdef HAVE_LIMITS_H #include #endif #ifndef NAME_MAX #ifdef FILENAME_MAX #define NAME_MAX FILENAME_MAX #else #define NAME_MAX 256 #endif #endif #ifndef PATH_MAX #ifdef FILENAME_MAX #define PATH_MAX FILENAME_MAX #else #define PATH_MAX 1024 #endif #endif /* * XXX JS: Some structures have odd lengths! * Some compilers (e.g. on Sun3/mc68020) padd the structures to even length. * For this reason, we cannot use sizeof (struct iso_path_table) or * sizeof (struct iso_directory_record) to compute on disk sizes. * Instead, we use offsetof(..., name) and add the name size. * See iso9660.h */ #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif /* * EB: various shared stuff */ extern char *merge_warn_msg; cdrkit-1.1.11/genisoimage/diag/0000755000372500001440000000000011456674322015331 5ustar steveuserscdrkit-1.1.11/genisoimage/diag/README0000644000372500001440000000656710531414032016206 0ustar steveusers# @(#)README 1.1 97/02/23 eric # I am enclosing 3 test programs that I use to verify the integrity of an iso9660 disc. The first one (isodump) is pretty simple - it dumps to the screen the contents of the various directories. The second one (isovfy) goes through and looks for problems of one kind or another. To use, type something like "./isodump /dev/ramdisk" or "./isodump /dev/scd0", depending upon where the iso9660 disc is. It starts by displaying the files in the first sector of the root directory. It has some pretty simple one letter commands that you can use to traverse the directory tree. a - move back one sector. b - move forward one sector. g - go to new logical sector. q - quit The a and b commands do not try and stop you from going past the beginning or end of a sector, and the g command does not have any way of knowing whether the sector you request is actually a directory or not. The output is displayed in several columns. The first column is the total length of the directory record for the file. The second column (in [] brackets) is the volume number. Next comes the starting extent number (in hex), and then comes the file size in bytes. Then cones the filename (not the Rock Ridge version), and this is preceeded by an "*" if the file is a directory. After this is a summary of the Rock Ridge fields present along with a display of the translation of the symbolic link name if the SL Rock Ridge record is present. I tailored this program for debugging some of the problems that I was having earlier. The idea is that you can tailor it to test for problems that you might be having, so it is not intended as a be-all and end-all dump program. If you move to a sector that does not contain directory information, the results are unpredictable. The second program, isovfy, is run in the same way as isodump, except that you do not have to do much except let it run. I have it written to verify all kinds of different things, and as people find other sorts of problems other tests could be added. The third program, dump.c, basically does a hexdump of the cd. This is screen oriented, and there are some simple commands: a - move back one sector. b - move forward one sector. f - enter new search string. + - search forward for search string. g - go to new logical sector. q - quit Note that with the 'g' command, sectors are always given in hex, and represent 2048 byte sectors (as on the cdrom). If you know how to decode a raw iso9660 directory, you can pick out the starting extent number from the hexdump and know where to go from there. The starting extent appears something like 30 bytes prior to the start of the iso9660 (not Rock Ridge) filename, and it appears in a 7.3.3 format (meaning that it occupies 8 bytes, 4 in little endian format, and 4 in big endian format). Thus you should see a mirror image of the bytes when looking at the extent number. The isovfy program can also dump the contents of the path tables, but this capability is commented out right now. Feel free to enable this to see what is in the tables. Ultimately I may fix it so that this checks the integrity of the tables as well. The isovfy program gives warnings about things like files that have a size of 0 but have an extent number assigned. The genisoimage program should never do this, but the YM software does leave these around. I think it is probably harmless in the YM case.~ cdrkit-1.1.11/genisoimage/diag/isoinfo.10000644000372500001440000002240710640016332017047 0ustar steveusers.\" .\" @(#)isoinfo.8 1.7 04/06/01 joerg .\" .\" Modified for cdrkit in 12/2006 .\" .\" -*- nroff -*- .if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a .if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o .if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u .if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A .if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O .if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U .if t .ds s \\(*b .if t .ds S SS .if n .ds a ae .if n .ds o oe .if n .ds u ue .if n .ds s sz .TH ISOINFO 1 "04/06/01" "Version 2.0" .SH NAME devdump, isoinfo, isovfy, isodump \- Utility programs for dumping and verifying iso9660 images. .SH SYNOPSIS .B devdump .I isoimage .PP .B isodump .I isoimage .PP .B isoinfo [ .B \-d ] [ .B \-h ] [ .B \-R ] [ .B \-J ] [ .B \-j .I charset ] [ .B \-f ] [ .B \-l ] [ .B \-p ] [ .B \-T .I sector ] [ .B \-N .I sector ] [ .B \-i .I isoimage ] [ .B \-x .I path ] .PP .B isovfy .I isoimage .SH DESCRIPTION .B devdump is a crude utility to interactively display the contents of device or filesystem images. The initial screen is a display of the first 256 bytes of the first 2048 byte sector. The commands are the same as with .BR isodump . .PP .B isodump is a crude utility to interactively display the contents of iso9660 images in order to verify directory integrity. The initial screen is a display of the first part of the root directory, and the prompt shows you the extent number and offset in the extent. .RS .PP You can use the 'a' and 'b' commands to move backwards and forwards within the image. The 'g' command allows you to goto an arbitrary extent, and the 'f' command specifies a search string to be used. The '+' command searches forward for the next instance of the search string, and the 'q' command exits .B devdump or .BR isodump . .RE .PP .B isoinfo is a utility to perform directory like listings of iso9660 images. .PP .B isovfy is a utility to verify the integrity of an iso9660 image. Most of the tests in .B isovfy were added after bugs were discovered in early versions of .B genisoimage. It isn't all that clear how useful this is anymore, but it doesn't hurt to have this around. .SH OPTIONS The options common to all programs are .BR \-help , \-h , \-version , .BI i =name, dev =name. The .B isoinfo program has additional command line options. The options are: .TP .B \-help .TP .B \-h print a summary of all options. .TP .B \-d Print information from the primary volume descriptor (PVD) of the iso9660 image. This includes information about Rock Ridge, Joliet extensions and Eltorito boot information if present. .TP .B \-f generate output as if a 'find . -print' command had been run on the iso9660 image. You should not use the .B -l image with the .B -f option. .TP .B \-i iso_image Specifies the path of the iso9660 image that we wish to examine. The options .B \-i and .BI dev= target are mutual exclusive. .TP .BI dev= target Sets the SCSI target for the drive, see notes above. A typical device specification is .BI dev= 6,0 \&. If a filename must be provided together with the numerical target specification, the filename is implementation specific. The correct filename in this case can be found in the system specific manuals of the target operating system. On a .I FreeBSD system without .I CAM support, you need to use the control device (e.g. .IR /dev/rcd0.ctl ). A correct device specification in this case may be .BI dev= /dev/rcd0.ctl:@ \&. .sp On Linux, drives connected to a parallel port adapter are mapped to a virtual SCSI bus. Different adapters are mapped to different targets on this virtual SCSI bus. .sp If no .I dev option is present, the program will try to get the device from the .B CDR_DEVICE environment. .sp If the argument to the .B dev= option does not contain the characters ',', '/', '@' or ':', it is interpreted as an label name that may be found in the file /etc/wodim.conf (see FILES section). .sp The options .B \-i and .BI dev= target are mutual exclusive. .TP .B \-l generate output as if a 'ls -lR' command had been run on the iso9660 image. You should not use the .B -f image with the .B -l option. .TP .B \-N sector Quick hack to help examine single session disc files that are to be written to a multi-session disc. The sector number specified is the sector number at which the iso9660 image should be written when send to the cd-writer. Not used for the first session on the disc. .TP .B \-p Print path table information. .TP .B \-R Extract information from Rock Ridge extensions (if present) for permissions, file names and ownerships. .TP .B \-J Extract information from Joliet extensions (if present) for file names. .TP .B \-j charset Convert Joliet file names (if present) to the supplied charset. See .BR genisoimage (8) for details. .TP .B \-T sector Quick hack to help examine multi-session images that have already been burned to a multi-session disc. The sector number specified is the sector number for the start of the session we wish to display. .TP .B \-x pathname Extract specified file to stdout. .SH AUTHOR The author of the original sources (1993 .\|.\|. 1998) is Eric Youngdale or is to blame for these shoddy hacks. J\*org Schilling wrote the SCSI transport library and its adaptation layer to the programs and newer parts (starting from 1999) of the utilities, this makes them Copyright (C) 1999-2004 J\*org Schilling. Patches to improve general usability would be gladly accepted. .PP This manpage describes the program implementation of .B isoinfo as shipped by the cdrkit distribution. See .B http://alioth.debian.org/projects/debburn/ for details. It is a spinoff from the original program distributed in the cdrtools package [1]. However, the cdrtools developers are not involved in the development of this spinoff and therefore shall not be made responsible for any problem caused by it. Do not try to get support for this program by contacting the original author(s). .PP If you have support questions, send them to .PP .B debburn-devel@lists.alioth.debian.org .br .PP If you have definitely found a bug, send a mail to this list or to .PP .B submit@bugs.debian.org .br .PP writing at least a short description into the Subject and "Package: cdrkit" into the first line of the mail body. .SH BUGS The user interface really sucks. .SH FUTURE IMPROVEMENTS These utilities are really quick hacks, which are very useful for debugging problems in genisoimage or in an iso9660 filesystem. In the long run, it would be nice to have a daemon that would NFS export a iso9660 image. .PP The isoinfo program is probably the program that is of the most use to the general user. .SH AVAILABILITY These utilities come with the .B cdrkit package, and the primary download site is http://debburn.alioth.debian.org/ and FTP mirrors of distributions. Despite the name, the software is not beta. .SH ENVIRONMENT .TP .B CDR_DEVICE This may either hold a device identifier that is suitable to the open call of the SCSI transport library or a label in the file /etc/wodim.conf. .TP .B RSH If the .B RSH environment is present, the remote connection will not be created via .BR rcmd (3) but by calling the program pointed to by .BR RSH . Use e.g. .BR RSH= /usr/bin/ssh to create a secure shell connection. .sp Note that this forces the program to create a pipe to the .B rsh(1) program and disallows the program to directly access the network socket to the remote server. This makes it impossible to set up performance parameters and slows down the connection compared to a .B root initiated .B rcmd(3) connection. .TP .B RSCSI If the .B RSCSI environment is present, the remote SCSI server will not be the program .B /opt/schily/sbin/rscsi but the program pointed to by .BR RSCSI . Note that the remote SCSI server program name will be ignored if you log in using an account that has been created with a remote SCSI server program as login shell. .SH FILES .TP /etc/wodim.conf Default values can be set for the following options in /etc/wodim.conf. .RS .TP CDR_DEVICE This may either hold a device identifier that is suitable to the open call of the SCSI transport library or a label in the file /etc/wodim.conf that allows to identify a specific drive on the system. .TP Any other label is an identifier for a specific drive on the system. Such an identifier may not contain the characters ',', '/', '@' or ':'. .sp Each line that follows a label contains a TAB separated list of items. Currently, four items are recognized: the SCSI ID of the drive, the default speed that should be used for this drive, the default FIFO size that should be used for this drive and drive specific options. The values for .I speed and .I fifosize may be set to -1 to tell the program to use the global defaults. The value for driveropts may be set to "" if no driveropts are used. A typical line may look this way: .sp teac1= 0,5,0 4 8m "" .sp yamaha= 1,6,0 -1 -1 burnfree .sp This tells the program that a drive named .I teac1 is at scsibus 0, target 5, lun 0 and should be used with speed 4 and a FIFO size of 8 MB. A second drive may be found at scsibus 1, target 6, lun 0 and uses the default speed and the default FIFO size. .RE .SH SEE ALSO .BR genisoimage (1), .BR wodim (1), .BR readcd (1), .BR ssh (1). .RE .SH SOURCES .PP .br [1] Cdrtools 2.01.01a08 from May 2006, http://cdrecord.berlios.de cdrkit-1.1.11/genisoimage/diag/dump.c0000644000372500001440000002301210760743311016430 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)dump.c 1.24 05/05/15 joerg */ /* * File dump.c - dump a file/device both in hex and in ASCII. * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999-2004 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "../scsi.h" #include "../../wodim/defaults.h" /* * Note: always use these macros to avoid problems. * * ISO_ROUND_UP(X) may cause an integer overflow and thus give * incorrect results. So avoid it if possible. * * ISO_BLOCKS(X) is overflow safe. Prefer this when ever it is possible. */ #define SECTOR_SIZE (2048) #define ISO_ROUND_UP(X) (((X) + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1)) #define ISO_BLOCKS(X) (((X) / SECTOR_SIZE) + (((X)%SECTOR_SIZE)?1:0)) #define infile in_image FILE *infile = NULL; static off_t file_addr; static off_t sec_addr = (off_t)-1; static Uchar sector[2048]; #define PAGE 256 static Uchar buffer[PAGE]; static Uchar search[64]; #ifdef USE_V7_TTY static struct sgttyb savetty; static struct sgttyb newtty; #else static struct termios savetty; static struct termios newtty; #endif static void reset_tty(void); static void set_tty(void); static void onsusp(int sig); static void crsr2(int row, int col); static void readblock(void); static void showblock(int flag); static int getbyte(void); static void usage(int excode); static void reset_tty() { #ifdef USE_V7_TTY if (ioctl(STDIN_FILENO, TIOCSETN, &savetty) == -1) { #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &savetty) == -1) { #else if (ioctl(STDIN_FILENO, TCSETAF, &savetty) == -1) { #endif #endif #ifdef USE_LIBSCHILY comerr("Cannot put tty into normal mode\n"); #else printf("Cannot put tty into normal mode\n"); exit(1); #endif } } static void set_tty() { #ifdef USE_V7_TTY if (ioctl(STDIN_FILENO, TIOCSETN, &newtty) == -1) { #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &newtty) == -1) { #else if (ioctl(STDIN_FILENO, TCSETAF, &newtty) == -1) { #endif #endif #ifdef USE_LIBSCHILY comerr("Cannot put tty into raw mode\n"); #else printf("Cannot put tty into raw mode\n"); exit(1); #endif } } /* * Come here when we get a suspend signal from the terminal */ static void onsusp(int sig) { #ifdef SIGTTOU /* ignore SIGTTOU so we don't get stopped if csh grabs the tty */ signal(SIGTTOU, SIG_IGN); #endif reset_tty(); fflush(stdout); #ifdef SIGTTOU signal(SIGTTOU, SIG_DFL); /* Send the TSTP signal to suspend our process group */ signal(SIGTSTP, SIG_DFL); /* sigsetmask(0);*/ kill(0, SIGTSTP); /* Pause for station break */ /* We're back */ signal(SIGTSTP, onsusp); #endif set_tty(); } static void crsr2(int row, int col) { printf("\033[%d;%dH", row, col); } static void readblock() { off_t dpos = file_addr - sec_addr; if (sec_addr < 0 || dpos < 0 || (dpos + sizeof (buffer)) > sizeof (sector)) { sec_addr = file_addr & ~2047; #ifdef USE_SCG readsecs(sec_addr/2048, sector, ISO_BLOCKS(sizeof (sector))); #else lseek(fileno(infile), sec_addr, SEEK_SET); read(fileno(infile), sector, sizeof (sector)); #endif dpos = file_addr - sec_addr; } movebytes(§or[dpos], buffer, sizeof (buffer)); } static void showblock(int flag) { unsigned int k; int i; int j; readblock(); if (flag) { for (i = 0; i < 16; i++) { crsr2(i+3, 1); if (sizeof (file_addr) > sizeof (long)) { printf("%16.16llx ", (Llong)file_addr+(i<<4)); } else { printf("%8.8lx ", (long)file_addr+(i<<4)); } for (j = 15; j >= 0; j--) { printf("%2.2x", buffer[(i<<4)+j]); if (!(j & 0x3)) printf(" "); } for (j = 0; j < 16; j++) { k = buffer[(i << 4) + j]; if (k >= ' ' && k < 0x80) printf("%c", k); else printf("."); } } } crsr2(20, 1); if (sizeof (file_addr) > sizeof (long)) { printf(" Zone, zone offset: %14llx %12.12llx ", (Llong)file_addr>>11, (Llong)file_addr & 0x7ff); } else { printf(" Zone, zone offset: %6lx %4.4lx ", (long)(file_addr>>11), (long)(file_addr & 0x7ff)); } fflush(stdout); } static int getbyte() { char c1; c1 = buffer[file_addr & (PAGE-1)]; file_addr++; if ((file_addr & (PAGE-1)) == 0) showblock(0); return (c1); } static void usage(int excode) { errmsgno(EX_BAD, "Usage: %s [options] [image]\n", get_progname()); fprintf(stderr, "Options:\n"); fprintf(stderr, "\t-help, -h Print this help\n"); fprintf(stderr, "\t-version Print version info and exit\n"); fprintf(stderr, "\t-i filename Filename to read ISO-9660 image from\n"); fprintf(stderr, "\tdev=target SCSI target to use as CD/DVD-Recorder\n"); fprintf(stderr, "\nIf neither -i nor dev= are speficied, is needed.\n"); exit(excode); } int main(int argc, char *argv[]) { int cac; char * const *cav; char *opts = "help,h,version,i*,dev*"; BOOL help = FALSE; BOOL prvers = FALSE; char *filename = NULL; char *devname = NULL; char c; int i; int j; save_args(argc, argv); cac = argc - 1; cav = argv + 1; if (getallargs(&cac, &cav, opts, &help, &help, &prvers, &filename, &devname) < 0) { errmsgno(EX_BAD, "Bad Option: '%s'\n", cav[0]); usage(EX_BAD); } if (help) usage(0); if (prvers) { printf("devdump %s (%s)\n", CDRKIT_VERSION, HOST_SYSTEM); exit(0); } cac = argc - 1; cav = argv + 1; if (filename == NULL && devname == NULL) { if (getfiles(&cac, &cav, opts) != 0) { filename = cav[0]; cac--, cav++; } } if (getfiles(&cac, &cav, opts) != 0) { errmsgno(EX_BAD, "Bad Argument: '%s'\n", cav[0]); usage(EX_BAD); } if (filename != NULL && devname != NULL) { errmsgno(EX_BAD, "Only one of -i or dev= allowed\n"); usage(EX_BAD); } #ifdef USE_SCG if (filename == NULL && devname == NULL) cdr_defaults(&devname, NULL, NULL, NULL); #endif if (filename == NULL && devname == NULL) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "ISO-9660 image not specified\n"); #else fprintf(stderr, "ISO-9660 image not specified\n"); #endif usage(EX_BAD); } if (filename != NULL) infile = fopen(filename, "rb"); else filename = devname; if (infile != NULL) { /* EMPTY */; #ifdef USE_SCG } else if (scsidev_open(filename) < 0) { #else } else { #endif #ifdef USE_LIBSCHILY comerr("Cannot open '%s'\n", filename); #else fprintf(stderr, "Cannot open '%s'\n", filename); exit(1); #endif } for (i = 0; i < 30; i++) printf("\n"); file_addr = (off_t)0; /* * Now setup the keyboard for single character input. */ #ifdef USE_V7_TTY if (ioctl(STDIN_FILENO, TIOCGETP, &savetty) == -1) { #else #ifdef TCSANOW if (tcgetattr(STDIN_FILENO, &savetty) == -1) { #else if (ioctl(STDIN_FILENO, TCGETA, &savetty) == -1) { #endif #endif #ifdef USE_LIBSCHILY comerr("Stdin must be a tty\n"); #else printf("Stdin must be a tty\n"); exit(1); #endif } newtty = savetty; #ifdef USE_V7_TTY newtty.sg_flags &= ~(ECHO|CRMOD); newtty.sg_flags |= CBREAK; #else newtty.c_lflag &= ~ICANON; newtty.c_lflag &= ~ECHO; newtty.c_cc[VMIN] = 1; #endif set_tty(); #ifdef SIGTSTP signal(SIGTSTP, onsusp); #endif on_comerr((void(*)(int, void *))reset_tty, NULL); do { if (file_addr < (off_t)0) file_addr = (off_t)0; showblock(1); read(STDIN_FILENO, &c, 1); /* FIXME: check return value */ if (c == 'a') file_addr -= PAGE; if (c == 'b') file_addr += PAGE; if (c == 'g') { crsr2(20, 1); printf("Enter new starting block (in hex):"); if (sizeof (file_addr) > sizeof (long)) { Llong ll; scanf("%llx", &ll); /* FIXME: check return value */ file_addr = (off_t)ll; } else { long l; scanf("%lx", &l); /* FIXME: check return value */ file_addr = (off_t)l; } file_addr = file_addr << 11; crsr2(20, 1); printf(" "); } if (c == 'f') { crsr2(20, 1); printf("Enter new search string:"); fgets((char *)search, sizeof (search), stdin); /* FIXME: check return value */ while (search[strlen((char *)search)-1] == '\n') search[strlen((char *)search)-1] = 0; crsr2(20, 1); printf(" "); } if (c == '+') { while (1 == 1) { int slen; while (1 == 1) { c = getbyte(); if (c == search[0]) break; } slen = (int)strlen((char *)search); for (j = 1; j < slen; j++) { if (search[j] != getbyte()) break; } if (j == slen) break; } file_addr &= ~(PAGE-1); showblock(1); } if (c == 'q') break; } while (1 == 1); reset_tty(); if (infile != NULL) fclose(infile); return (0); } cdrkit-1.1.11/genisoimage/diag/isoinfo.c0000644000372500001440000010213410760743311017134 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)isoinfo.c 1.50 05/05/15 joerg */ /* * File isodump.c - dump iso9660 directory information. * * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999-2004 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Simple program to dump contents of iso9660 image in more usable format. * * Usage: * To list contents of image (with or without RR): * isoinfo -l [-R] -i imagefile * To extract file from image: * isoinfo -i imagefile -x xtractfile > outfile * To generate a "find" like list of files: * isoinfo -f -i imagefile */ #include #include #include #include #include #include #include #include #include #include #include #include #include "../iso9660.h" #include "../scsi.h" #include "../../wodim/defaults.h" #include #if defined(__CYGWIN32__) || defined(__EMX__) || defined(__DJGPP__) #include /* for setmode() prototype */ #endif /* * Make sure we have a definition for this. If not, take a very conservative * guess. * POSIX requires the max pathname component lenght to be defined in limits.h * If variable, it may be undefined. If undefined, there should be * a definition for _POSIX_NAME_MAX in limits.h or in unistd.h * As _POSIX_NAME_MAX is defined to 14, we cannot use it. * XXX Eric's wrong comment: * XXX From what I can tell SunOS is the only one with this trouble. */ #ifdef HAVE_LIMITS_H #include #endif #ifndef NAME_MAX #ifdef FILENAME_MAX #define NAME_MAX FILENAME_MAX #else #define NAME_MAX 256 #endif #endif #ifndef PATH_MAX #ifdef FILENAME_MAX #define PATH_MAX FILENAME_MAX #else #define PATH_MAX 1024 #endif #endif /* * XXX JS: Some structures have odd lengths! * Some compilers (e.g. on Sun3/mc68020) padd the structures to even length. * For this reason, we cannot use sizeof (struct iso_path_table) or * sizeof (struct iso_directory_record) to compute on disk sizes. * Instead, we use offsetof(..., name) and add the name size. * See iso9660.h */ #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif #ifndef S_ISLNK #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) #endif #ifndef S_ISSOCK #ifdef S_IFSOCK # define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) #else # define S_ISSOCK(m) (0) #endif #endif /* * Note: always use these macros to avoid problems. * * ISO_ROUND_UP(X) may cause an integer overflow and thus give * incorrect results. So avoid it if possible. * * ISO_BLOCKS(X) is overflow safe. Prefer this when ever it is possible. */ #define SECTOR_SIZE (2048) #define ISO_ROUND_UP(X) (((X) + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1)) #define ISO_BLOCKS(X) (((X) / SECTOR_SIZE) + (((X)%SECTOR_SIZE)?1:0)) #define infile in_image FILE *infile = NULL; int use_rock = 0; int use_joliet = 0; int do_listing = 0; int do_find = 0; int do_sectors = 0; int do_pathtab = 0; int do_pvd = 0; BOOL debug = FALSE; char *xtract = 0; int su_version = 0; int aa_version = 0; int ucs_level = 0; struct stat fstat_buf; int found_rr; char name_buf[256]; char xname[2048]; unsigned char date_buf[9]; /* * Use sector_offset != 0 (-N #) if we have an image file * of a single session and we need to list the directory contents. * This is the session block (sector) number of the start * of the session when it would be on disk. */ unsigned int sector_offset = 0; unsigned char buffer[2048]; struct unls_table *unls; #define PAGE sizeof (buffer) #define ISODCL(from, to) (to - from + 1) int isonum_721(char * p); int isonum_723(char * p); int isonum_731(char * p); int isonum_732(char * p); int isonum_733(unsigned char * p); void printchars(char *s, int n); char *sdate(char *dp); void dump_pathtab(int block, int size); int parse_rr(unsigned char * pnt, int len, int cont_flag); void find_rr(struct iso_directory_record * idr, Uchar **pntp, int *lenp); int dump_rr(struct iso_directory_record * idr); void dump_stat(struct iso_directory_record * idr, int extent); void extract_file(struct iso_directory_record * idr); void parse_dir(char * rootname, int extent, int len); void usage(int excode); static void printf_bootinfo(FILE *f, int bootcat_offset); static char *arch_name(int val); static char *boot_name(int val); static char *bootmedia_name(int val); int isonum_721(char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); } int isonum_723(char *p) { #if 0 if (p[0] != p[3] || p[1] != p[2]) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "invalid format 7.2.3 number\n"); #else fprintf(stderr, "invalid format 7.2.3 number\n"); exit(1); #endif } #endif return (isonum_721(p)); } int isonum_731(char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8) | ((p[2] & 0xff) << 16) | ((p[3] & 0xff) << 24)); } int isonum_732(char *p) { return ((p[3] & 0xff) | ((p[2] & 0xff) << 8) | ((p[1] & 0xff) << 16) | ((p[0] & 0xff) << 24)); } int isonum_733(unsigned char *p) { return (isonum_731((char *)p)); } void printchars(char *s, int n) { int i; char *p; for (; n > 0 && *s; n--) { if (*s == ' ') { p = s; i = n; while (--i >= 0 && *p++ == ' ') ; if (i <= 0) break; } putchar(*s++); } } /* * Print date info from PVD */ char * sdate(char *dp) { static char d[30]; 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); } void dump_pathtab(int block, int size) { unsigned char *buf; int offset; int idx; int extent; int pindex; int j; int len; int jlen; char namebuf[255]; unsigned char uh, ul, uc, *up; 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'; for (j = 0; j < jlen; j++) { uh = buf[offset + 8 + j*2]; ul = buf[offset + 8 + j*2+1]; up = unls->unls_uni2cs[uh]; if (up == NULL) uc = '\0'; else uc = up[ul]; namebuf[j] = uc ? uc : '_'; } printf("%4d: %4d %x %.*s\n", idx, pindex, extent, jlen, 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); } int parse_rr(unsigned char *pnt, int len, int cont_flag) { int slen; int xlen; int ncount; int extent; int cont_extent, cont_offset, cont_size; int flag1, flag2; unsigned char *pnts; char symlinkname[1024]; int goof; symlinkname[0] = 0; cont_extent = cont_offset = cont_size = 0; ncount = 0; flag1 = flag2 = 0; while (len >= 4) { if (pnt[3] != 1 && pnt[3] != 2) { printf("**BAD RRVERSION (%d)\n", pnt[3]); return (0); /* JS ??? Is this right ??? */ } ncount++; if (pnt[0] == 'R' && pnt[1] == 'R') flag1 = pnt[4] & 0xff; if (strncmp((char *)pnt, "PX", 2) == 0) flag2 |= 1; /* POSIX attributes */ if (strncmp((char *)pnt, "PN", 2) == 0) flag2 |= 2; /* POSIX device number */ if (strncmp((char *)pnt, "SL", 2) == 0) flag2 |= 4; /* Symlink */ if (strncmp((char *)pnt, "NM", 2) == 0) flag2 |= 8; /* Alternate Name */ if (strncmp((char *)pnt, "CL", 2) == 0) flag2 |= 16; /* Child link */ if (strncmp((char *)pnt, "PL", 2) == 0) flag2 |= 32; /* Parent link */ if (strncmp((char *)pnt, "RE", 2) == 0) flag2 |= 64; /* Relocated Direcotry */ if (strncmp((char *)pnt, "TF", 2) == 0) flag2 |= 128; /* Time stamp */ if (strncmp((char *)pnt, "SP", 2) == 0) { flag2 |= 1024; /* SUSP record */ su_version = pnt[3] & 0xff; } if (strncmp((char *)pnt, "AA", 2) == 0) { flag2 |= 2048; /* Apple Signature record */ aa_version = pnt[3] & 0xff; } if (strncmp((char *)pnt, "PX", 2) == 0) { /* POSIX attributes */ fstat_buf.st_mode = isonum_733(pnt+4); fstat_buf.st_nlink = isonum_733(pnt+12); fstat_buf.st_uid = isonum_733(pnt+20); fstat_buf.st_gid = isonum_733(pnt+28); } if (strncmp((char *)pnt, "NM", 2) == 0) { /* Alternate Name */ int l = strlen(name_buf); if (!found_rr) l = 0; strncpy(&name_buf[l], (char *)(pnt+5), pnt[2] - 5); name_buf[l + pnt[2] - 5] = 0; found_rr = 1; } if (strncmp((char *)pnt, "CE", 2) == 0) { /* Continuation Area */ cont_extent = isonum_733(pnt+4); cont_offset = isonum_733(pnt+12); cont_size = isonum_733(pnt+20); } if (strncmp((char *)pnt, "PL", 2) == 0 || strncmp((char *)pnt, "CL", 2) == 0) { extent = isonum_733(pnt+4); } if (strncmp((char *)pnt, "SL", 2) == 0) { /* Symlink */ int cflag; cflag = pnt[4]; pnts = pnt+5; slen = pnt[2] - 5; while (slen >= 1) { switch (pnts[0] & 0xfe) { case 0: strncat(symlinkname, (char *)(pnts+2), pnts[1]); symlinkname[pnts[1]] = 0; break; case 2: strcat(symlinkname, "."); break; case 4: strcat(symlinkname, ".."); break; case 8: strcat(symlinkname, "/"); break; case 16: strcat(symlinkname, "/mnt"); printf("Warning - mount point requested"); break; case 32: strcat(symlinkname, "kafka"); printf("Warning - host_name requested"); break; default: printf("Reserved bit setting in symlink"); goof++; break; } if ((pnts[0] & 0xfe) && pnts[1] != 0) { printf("Incorrect length in symlink component"); } if (xname[0] == 0) strcpy(xname, "-> "); strcat(xname, symlinkname); symlinkname[0] = 0; xlen = strlen(xname); if ((pnts[0] & 1) == 0 && xname[xlen-1] != '/') strcat(xname, "/"); slen -= (pnts[1] + 2); pnts += (pnts[1] + 2); } symlinkname[0] = 0; } len -= pnt[2]; pnt += pnt[2]; if (len <= 3 && cont_extent) { unsigned char sector[2048]; #ifdef USE_SCG readsecs(cont_extent - sector_offset, sector, ISO_BLOCKS(sizeof (sector))); #else lseek(fileno(infile), ((off_t)(cont_extent - sector_offset)) << 11, SEEK_SET); read(fileno(infile), sector, sizeof (sector)); #endif flag2 |= parse_rr(§or[cont_offset], cont_size, 1); } } /* * for symbolic links, strip out the last '/' */ if (xname[0] != 0 && xname[strlen(xname)-1] == '/') { xname[strlen(xname)-1] = '\0'; } return (flag2); } void find_rr(struct iso_directory_record *idr, Uchar **pntp, int *lenp) { struct iso_xa_dir_record *xadp; int len; unsigned char * pnt; len = idr->length[0] & 0xff; len -= offsetof(struct iso_directory_record, name[0]); len -= idr->name_len[0]; pnt = (unsigned char *) idr; pnt += offsetof(struct iso_directory_record, name[0]); pnt += idr->name_len[0]; if ((idr->name_len[0] & 1) == 0) { pnt++; len--; } if (len >= 14) { xadp = (struct iso_xa_dir_record *)pnt; if (xadp->signature[0] == 'X' && xadp->signature[1] == 'A' && xadp->reserved[0] == '\0') { len -= 14; pnt += 14; } } *pntp = pnt; *lenp = len; } int dump_rr(struct iso_directory_record *idr) { int len; unsigned char * pnt; find_rr(idr, &pnt, &len); return (parse_rr(pnt, len, 0)); } struct todo { struct todo *next; char *name; int extent; int length; }; struct todo *todo_idr = NULL; char *months[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; void dump_stat(struct iso_directory_record *idr, int extent) { int i; char outline[80]; memset(outline, ' ', sizeof (outline)); if (S_ISREG(fstat_buf.st_mode)) outline[0] = '-'; else if (S_ISDIR(fstat_buf.st_mode)) outline[0] = 'd'; else if (S_ISLNK(fstat_buf.st_mode)) outline[0] = 'l'; else if (S_ISCHR(fstat_buf.st_mode)) outline[0] = 'c'; else if (S_ISBLK(fstat_buf.st_mode)) outline[0] = 'b'; else if (S_ISFIFO(fstat_buf.st_mode)) outline[0] = 'f'; else if (S_ISSOCK(fstat_buf.st_mode)) outline[0] = 's'; else outline[0] = '?'; memset(outline+1, '-', 9); if (fstat_buf.st_mode & S_IRUSR) outline[1] = 'r'; if (fstat_buf.st_mode & S_IWUSR) outline[2] = 'w'; if (fstat_buf.st_mode & S_IXUSR) outline[3] = 'x'; if (fstat_buf.st_mode & S_IRGRP) outline[4] = 'r'; if (fstat_buf.st_mode & S_IWGRP) outline[5] = 'w'; if (fstat_buf.st_mode & S_IXGRP) outline[6] = 'x'; if (fstat_buf.st_mode & S_IROTH) outline[7] = 'r'; if (fstat_buf.st_mode & S_IWOTH) outline[8] = 'w'; if (fstat_buf.st_mode & S_IXOTH) outline[9] = 'x'; /* * XXX This is totally ugly code from Eric. * XXX If one field is wider than expected then it is truncated. */ sprintf(outline+11, "%3ld", (long)fstat_buf.st_nlink); sprintf(outline+15, "%4lo", (unsigned long)fstat_buf.st_uid); sprintf(outline+20, "%4lo", (unsigned long)fstat_buf.st_gid); sprintf(outline+30, "%10lld", (Llong)fstat_buf.st_size); if (do_sectors == 0) { sprintf(outline+30, "%10lld", (Llong)fstat_buf.st_size); } else { sprintf(outline+30, "%10lld", (Llong)((fstat_buf.st_size+PAGE-1)/PAGE)); } if (date_buf[1] >= 1 && date_buf[1] <= 12) { memcpy(outline+41, months[date_buf[1]-1], 3); } sprintf(outline+45, "%2d", date_buf[2]); outline[63] = 0; sprintf(outline+48, "%4d", date_buf[0]+1900); sprintf(outline+53, "[%7d", extent); /* XXX up to 20 GB */ sprintf(outline+61, " %02X]", idr->flags[0]); for (i = 0; i < 66; i++) { if (outline[i] == 0) outline[i] = ' '; } outline[66] = 0; printf("%s %s %s\n", outline, name_buf, xname); } void extract_file(struct iso_directory_record *idr) { int extent, len, tlen; unsigned char buff[2048]; #if defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__EMX__) || defined(__DJGPP__) setmode(fileno(stdout), O_BINARY); #endif extent = isonum_733((unsigned char *)idr->extent); len = isonum_733((unsigned char *)idr->size); while (len > 0) { #ifdef USE_SCG readsecs(extent - sector_offset, buff, ISO_BLOCKS(sizeof (buff))); tlen = (len > sizeof (buff) ? sizeof (buff) : len); #else lseek(fileno(infile), ((off_t)(extent - sector_offset)) << 11, SEEK_SET); tlen = (len > sizeof (buff) ? sizeof (buff) : len); read(fileno(infile), buff, tlen); #endif len -= tlen; extent++; write(STDOUT_FILENO, buff, tlen); /* FIXME: check return value */ } } void parse_dir(char *rootname, int extent, int len) { char testname[PATH_MAX+1]; struct todo *td; int i; struct iso_directory_record * idr; unsigned char uh, ul, uc, *up; if (do_listing) printf("\nDirectory listing of %s\n", rootname); while (len > 0) { #ifdef USE_SCG readsecs(extent - sector_offset, buffer, ISO_BLOCKS(sizeof (buffer))); #else lseek(fileno(infile), ((off_t)(extent - sector_offset)) << 11, SEEK_SET); read(fileno(infile), buffer, sizeof (buffer)); #endif len -= sizeof (buffer); extent++; i = 0; while (1 == 1) { idr = (struct iso_directory_record *) &buffer[i]; if (idr->length[0] == 0) break; memset(&fstat_buf, 0, sizeof (fstat_buf)); found_rr = 0; name_buf[0] = xname[0] = 0; fstat_buf.st_size = (off_t)(unsigned)isonum_733((unsigned char *)idr->size); if (idr->flags[0] & 2) fstat_buf.st_mode |= S_IFDIR; else fstat_buf.st_mode |= S_IFREG; if (idr->name_len[0] == 1 && idr->name[0] == 0) strcpy(name_buf, "."); else if (idr->name_len[0] == 1 && idr->name[0] == 1) strcpy(name_buf, ".."); else { switch (ucs_level) { case 3: case 2: case 1: /* * Unicode name. Convert as best we can. */ { int j; name_buf[0] = '\0'; for (j = 0; j < (int)idr->name_len[0] / 2; j++) { uh = idr->name[j*2]; ul = idr->name[j*2+1]; up = unls->unls_uni2cs[uh]; if (up == NULL) uc = '\0'; else uc = up[ul]; name_buf[j] = uc ? uc : '_'; } name_buf[idr->name_len[0]/2] = '\0'; } break; case 0: /* * Normal non-Unicode name. */ strncpy(name_buf, idr->name, idr->name_len[0]); name_buf[idr->name_len[0]] = 0; break; default: /* * Don't know how to do these yet. Maybe they are the same * as one of the above. */ exit(1); } } memcpy(date_buf, idr->date, 9); if (use_rock) dump_rr(idr); if ((idr->flags[0] & 2) != 0 && (idr->name_len[0] != 1 || (idr->name[0] != 0 && idr->name[0] != 1))) { /* * Add this directory to the todo list. */ td = todo_idr; if (td != NULL) { while (td->next != NULL) td = td->next; td->next = (struct todo *) malloc(sizeof (*td)); td = td->next; } else { todo_idr = td = (struct todo *) malloc(sizeof (*td)); } td->next = NULL; td->extent = isonum_733((unsigned char *)idr->extent); td->length = isonum_733((unsigned char *)idr->size); td->name = (char *) malloc(strlen(rootname) + strlen(name_buf) + 2); strcpy(td->name, rootname); strcat(td->name, name_buf); strcat(td->name, "/"); } else { strcpy(testname, rootname); strcat(testname, name_buf); if (xtract && strcmp(xtract, testname) == 0) { extract_file(idr); } } if (do_find && (idr->name_len[0] != 1 || (idr->name[0] != 0 && idr->name[0] != 1))) { strcpy(testname, rootname); strcat(testname, name_buf); printf("%s\n", testname); } if (do_listing) dump_stat(idr, isonum_733((unsigned char *)idr->extent)); i += buffer[i]; if (i > 2048 - offsetof(struct iso_directory_record, name[0])) break; } } } void usage(int excode) { errmsgno(EX_BAD, "Usage: %s [options] -i filename\n", get_progname()); fprintf(stderr, "Options:\n"); fprintf(stderr, "\t-help,-h Print this help\n"); fprintf(stderr, "\t-version Print version info and exit\n"); fprintf(stderr, "\t-debug Print additional debug info\n"); fprintf(stderr, "\t-d Print information from the primary volume descriptor\n"); fprintf(stderr, "\t-f Generate output similar to 'find . -print'\n"); fprintf(stderr, "\t-J Print information from Joliet extensions\n"); fprintf(stderr, "\t-j charset Use charset to display Joliet file names\n"); fprintf(stderr, "\t-l Generate output similar to 'ls -lR'\n"); fprintf(stderr, "\t-p Print Path Table\n"); fprintf(stderr, "\t-R Print information from Rock Ridge extensions\n"); fprintf(stderr, "\t-s Print file size infos in multiples of sector size (%ld bytes).\n", (long)PAGE); fprintf(stderr, "\t-N sector Sector number where ISO image should start on CD\n"); fprintf(stderr, "\t-T sector Sector number where actual session starts on CD\n"); fprintf(stderr, "\t-i filename Filename to read ISO-9660 image from\n"); fprintf(stderr, "\tdev=target SCSI target to use as CD/DVD-Recorder\n"); fprintf(stderr, "\t-x pathname Extract specified file to stdout\n"); exit(excode); } int main(int argc, char *argv[]) { int cac; char * const *cav; int c; char * filename = NULL; char * devname = NULL; /* * Use toc_offset != 0 (-T #) if we have a complete multi-session * disc that we want/need to play with. * Here we specify the offset where we want to * start searching for the TOC. */ int toc_offset = 0; int extent; struct todo * td; struct iso_primary_descriptor ipd; struct iso_primary_descriptor jpd; struct eltorito_boot_descriptor bpd; struct iso_directory_record * idr; char *charset = NULL; char *opts = "help,h,version,debug,d,p,i*,dev*,J,R,l,x*,f,s,N#l,T#l,j*"; BOOL help = FALSE; BOOL prvers = FALSE; BOOL found_eltorito = FALSE; int bootcat_offset = 0; save_args(argc, argv); cac = argc - 1; cav = argv + 1; if (getallargs(&cac, &cav, opts, &help, &help, &prvers, &debug, &do_pvd, &do_pathtab, &filename, &devname, &use_joliet, &use_rock, &do_listing, &xtract, &do_find, &do_sectors, §or_offset, &toc_offset, &charset) < 0) { errmsgno(EX_BAD, "Bad Option: '%s'\n", cav[0]); usage(EX_BAD); } if (help) usage(0); if (prvers) { printf("isoinfo %s (%s)\n", CDRKIT_VERSION, HOST_SYSTEM); exit(0); } cac = argc - 1; cav = argv + 1; if (getfiles(&cac, &cav, opts) != 0) { errmsgno(EX_BAD, "Bad Argument: '%s'\n", cav[0]); usage(EX_BAD); } init_unls(); /* Initialize UNICODE tables */ init_unls_file(charset); if (charset == NULL) { #if (defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(__DJGPP__)) && !defined(IS_CYGWIN_1) unls = load_unls("cp437"); #else unls = load_unls("iso8859-1"); #endif } else { if (strcmp(charset, "default") == 0) unls = load_unls_default(); else unls = load_unls(charset); } if (unls == NULL) { /* Unknown charset specified */ fprintf(stderr, "Unknown charset: %s\nKnown charsets are:\n", charset); list_unls(); /* List all known charset names */ exit(1); } if (filename != NULL && devname != NULL) { errmsgno(EX_BAD, "Only one of -i or dev= allowed\n"); usage(EX_BAD); } #ifdef USE_SCG if (filename == NULL && devname == NULL) cdr_defaults(&devname, NULL, NULL, NULL); #endif if (filename == NULL && devname == NULL) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "ISO-9660 image not specified\n"); #else fprintf(stderr, "ISO-9660 image not specified\n"); #endif usage(EX_BAD); } if (filename != NULL) infile = fopen(filename, "rb"); else filename = devname; if (infile != NULL) { /* EMPTY */; #ifdef USE_SCG } else if (scsidev_open(filename) < 0) { #else } else { #endif #ifdef USE_LIBSCHILY comerr("Unable to open %s\n", filename); #else fprintf(stderr, "Unable to open %s\n", filename); exit(1); #endif } /* * Absolute sector offset, so don't subtract sector_offset here. */ #ifdef USE_SCG readsecs(16 + toc_offset, &ipd, ISO_BLOCKS(sizeof (ipd))); #else lseek(fileno(infile), ((off_t)(16 + toc_offset)) <<11, SEEK_SET); read(fileno(infile), &ipd, sizeof (ipd)); #endif idr = (struct iso_directory_record *)ipd.root_directory_record; if (do_pvd) { /* * High sierra: * * DESC TYPE == 1 (VD_SFS) offset 8 len 1 * STR ID == "CDROM" offset 9 len 5 * STD_VER == 1 offset 14 len 1 */ if ((((char *)&ipd)[8] == 1) && (strncmp(&((char *)&ipd)[9], "CDROM", 5) == 0) && (((char *)&ipd)[14] == 1)) { printf("CD-ROM is in High Sierra format\n"); exit(0); } /* * ISO 9660: * * DESC TYPE == 1 (VD_PVD) offset 0 len 1 * STR ID == "CD001" offset 1 len 5 * STD_VER == 1 offset 6 len 1 */ if ((ipd.type[0] != ISO_VD_PRIMARY) || (strncmp(ipd.id, ISO_STANDARD_ID, sizeof (ipd.id)) != 0) || (ipd.version[0] != 1)) { printf("CD-ROM is NOT in ISO 9660 format\n"); exit(1); } printf("CD-ROM is in ISO 9660 format\n"); printf("System id: "); printchars(ipd.system_id, 32); putchar('\n'); printf("Volume id: "); printchars(ipd.volume_id, 32); putchar('\n'); printf("Volume set id: "); printchars(ipd.volume_set_id, 128); putchar('\n'); printf("Publisher id: "); printchars(ipd.publisher_id, 128); putchar('\n'); printf("Data preparer id: "); printchars(ipd.preparer_id, 128); putchar('\n'); printf("Application id: "); printchars(ipd.application_id, 128); putchar('\n'); printf("Copyright File id: "); printchars(ipd.copyright_file_id, 37); putchar('\n'); printf("Abstract File id: "); printchars(ipd.abstract_file_id, 37); putchar('\n'); printf("Bibliographic File id: "); printchars(ipd.bibliographic_file_id, 37); putchar('\n'); printf("Volume set size is: %d\n", isonum_723(ipd.volume_set_size)); printf("Volume set sequence number is: %d\n", isonum_723(ipd.volume_sequence_number)); printf("Logical block size is: %d\n", isonum_723(ipd.logical_block_size)); printf("Volume size is: %d\n", isonum_733((unsigned char *)ipd.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 *)ipd.path_table_size)); printf("L Path table start: %d\n", isonum_731(ipd.type_l_path_table)); printf("L Path opt table start: %d\n", isonum_731(ipd.opt_type_l_path_table)); printf("M Path table start: %d\n", isonum_732(ipd.type_m_path_table)); printf("M Path opt table start: %d\n", isonum_732(ipd.opt_type_m_path_table)); printf("Creation Date: %s\n", sdate(ipd.creation_date)); printf("Modification Date: %s\n", sdate(ipd.modification_date)); printf("Expiration Date: %s\n", sdate(ipd.expiration_date)); printf("Effective Date: %s\n", sdate(ipd.effective_date)); printf("File structure version: %d\n", ipd.file_structure_version[0]); } { int block = 16; movebytes(&ipd, &jpd, sizeof (ipd)); while ((Uchar)jpd.type[0] != ISO_VD_END) { if (debug && (Uchar) jpd.type[0] == ISO_VD_SUPPLEMENTARY) fprintf(stderr, "Joliet escape sequence 0: '%c' 1: '%c' 2: '%c' 3: '%c'\n", jpd.escape_sequences[0], jpd.escape_sequences[1], jpd.escape_sequences[2], jpd.escape_sequences[3]); /* * If Joliet UCS escape sequence found, we may be wrong */ if (jpd.escape_sequences[0] == '%' && jpd.escape_sequences[1] == '/' && (jpd.escape_sequences[3] == '\0' || jpd.escape_sequences[3] == ' ') && (jpd.escape_sequences[2] == '@' || jpd.escape_sequences[2] == 'C' || jpd.escape_sequences[2] == 'E')) { if (jpd.version[0] == 1) goto nextblock; } if (jpd.type[0] == 0) { movebytes(&jpd, &bpd, sizeof (bpd)); if (strncmp(bpd.system_id, EL_TORITO_ID, sizeof (EL_TORITO_ID)) == 0) { bootcat_offset = (Uchar)bpd.bootcat_ptr[0] + (Uchar)bpd.bootcat_ptr[1] * 256 + (Uchar)bpd.bootcat_ptr[2] * 65536 + (Uchar)bpd.bootcat_ptr[3] * 16777216; found_eltorito = TRUE; printf("El Torito VD version %d found, boot catalog is in sector %d\n", bpd.version[0], bootcat_offset); } } if (jpd.version[0] == 2) { printf("CD-ROM uses ISO 9660:1999 relaxed format\n"); break; } nextblock: block++; #ifdef USE_SCG readsecs(block + toc_offset, &jpd, ISO_BLOCKS(sizeof (jpd))); #else lseek(fileno(infile), ((off_t)(block + toc_offset)) <<11, SEEK_SET); read(fileno(infile), &jpd, sizeof (jpd)); #endif } } } /* * ISO 9660: * * DESC TYPE == 1 (VD_PVD) offset 0 len 1 * STR ID == "CD001" offset 1 len 5 * STD_VER == 1 offset 6 len 1 */ if ((ipd.type[0] != ISO_VD_PRIMARY) || (strncmp(ipd.id, ISO_STANDARD_ID, sizeof (ipd.id)) != 0) || (ipd.version[0] != 1)) { printf("CD-ROM is NOT in ISO 9660 format\n"); exit(1); } if (use_joliet || do_pvd) { int block = 16; movebytes(&ipd, &jpd, sizeof (ipd)); while ((unsigned char) jpd.type[0] != ISO_VD_END) { if (debug && (unsigned char) jpd.type[0] == ISO_VD_SUPPLEMENTARY) fprintf(stderr, "Joliet escape sequence 0: '%c' 1: '%c' 2: '%c' 3: '%c'\n", jpd.escape_sequences[0], jpd.escape_sequences[1], jpd.escape_sequences[2], jpd.escape_sequences[3]); /* * Find the UCS escape sequence. */ if (jpd.escape_sequences[0] == '%' && jpd.escape_sequences[1] == '/' && (jpd.escape_sequences[3] == '\0' || jpd.escape_sequences[3] == ' ') && (jpd.escape_sequences[2] == '@' || jpd.escape_sequences[2] == 'C' || jpd.escape_sequences[2] == 'E')) { break; } block++; #ifdef USE_SCG readsecs(block + toc_offset, &jpd, ISO_BLOCKS(sizeof (jpd))); #else lseek(fileno(infile), ((off_t)(block + toc_offset)) <<11, SEEK_SET); read(fileno(infile), &jpd, sizeof (jpd)); #endif } if (use_joliet && ((unsigned char) jpd.type[0] == ISO_VD_END)) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Unable to find Joliet SVD\n"); #else fprintf(stderr, "Unable to find Joliet SVD\n"); exit(1); #endif } switch (jpd.escape_sequences[2]) { case '@': ucs_level = 1; break; case 'C': ucs_level = 2; break; case 'E': ucs_level = 3; break; } if (ucs_level > 3) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Don't know what ucs_level == %d means\n", ucs_level); #else fprintf(stderr, "Don't know what ucs_level == %d means\n", ucs_level); exit(1); #endif } if (jpd.escape_sequences[3] == ' ') errmsgno(EX_BAD, "Warning: Joliet escape sequence uses illegal space at offset 3\n"); } if (do_pvd) { if (ucs_level > 0) printf("Joliet with UCS level %d found\n", ucs_level); else printf("NO Joliet present\n"); extent = isonum_733((unsigned char *)idr->extent); #ifdef USE_SCG readsecs(extent - sector_offset, buffer, ISO_BLOCKS(sizeof (buffer))); #else lseek(fileno(infile), ((off_t)(extent - sector_offset)) <<11, SEEK_SET); read(fileno(infile), buffer, sizeof (buffer)); #endif idr = (struct iso_directory_record *) buffer; if ((c = dump_rr(idr)) != 0) { /* printf("RR %X %d\n", c, c);*/ if (c & 1024) { printf( "Rock Ridge signatures version %d found\n", su_version); } else { printf( "Bad Rock Ridge signatures found (SU record missing)\n"); } /* * This is currently a no op! * We need to check the first plain file instead of * the '.' entry in the root directory. */ if (c & 2048) { printf("Apple signatures version %d found\n", aa_version); } } else { printf("NO Rock Ridge present\n"); } if (found_eltorito) printf_bootinfo(infile, bootcat_offset); exit(0); } if (use_joliet) idr = (struct iso_directory_record *)jpd.root_directory_record; if (do_pathtab) { if (use_joliet) { dump_pathtab(isonum_731(jpd.type_l_path_table), isonum_733((unsigned char *)jpd.path_table_size)); } else { dump_pathtab(isonum_731(ipd.type_l_path_table), isonum_733((unsigned char *)ipd.path_table_size)); } } parse_dir("/", isonum_733((unsigned char *)idr->extent), isonum_733((unsigned char *)idr->size)); td = todo_idr; while (td) { parse_dir(td->name, td->extent, td->length); td = td->next; } if (infile != NULL) fclose(infile); return (0); } #include static void printf_bootinfo(FILE *f, int bootcat_offset) { struct eltorito_validation_entry *evp; struct eltorito_defaultboot_entry *ebe; #ifdef USE_SCG readsecs(bootcat_offset, buffer, ISO_BLOCKS(sizeof (buffer))); #else lseek(fileno(f), ((off_t)bootcat_offset) <<11, SEEK_SET); read(fileno(f), buffer, sizeof (buffer)); #endif evp = (struct eltorito_validation_entry *)buffer; ebe = (struct eltorito_defaultboot_entry *)&buffer[32]; printf("Eltorito validation header:\n"); printf(" Hid %d\n", (Uchar)evp->headerid[0]); printf(" Arch %d (%s)\n", (Uchar)evp->arch[0], arch_name((Uchar)evp->arch[0])); printf(" ID '%.23s'\n", evp->id); printf(" Key %X %X\n", (Uchar)evp->key1[0], (Uchar)evp->key2[0]); printf(" Eltorito defaultboot header:\n"); printf(" Bootid %X (%s)\n", (Uchar)ebe->boot_id[0], boot_name((Uchar)ebe->boot_id[0])); printf(" Boot media %X (%s)\n", (Uchar)ebe->boot_media[0], bootmedia_name((Uchar)ebe->boot_media[0])); printf(" Load segment %X\n", la_to_2_byte(ebe->loadseg)); printf(" Sys type %X\n", (Uchar)ebe->sys_type[0]); printf(" Nsect %X\n", la_to_2_byte(ebe->nsect)); printf(" Bootoff %lX %ld\n", la_to_4_byte(ebe->bootoff), la_to_4_byte(ebe->bootoff)); } static char * arch_name(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"); } } static char * boot_name(int val) { switch (val) { case EL_TORITO_BOOTABLE: return ("bootable"); case EL_TORITO_NOT_BOOTABLE: return ("not bootable"); default: return ("Illegal"); } } static char * bootmedia_name(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"); } } cdrkit-1.1.11/genisoimage/diag/isovfy.10000644000372500001440000000005410536101176016717 0ustar steveusers.so man1/isoinfo.1 .\" %Z%%M% %I% %E% joerg cdrkit-1.1.11/genisoimage/diag/isovfy.c0000644000372500001440000005175110760743311017015 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)isovfy.c 1.26 05/05/15 joerg */ /* * File isovfy.c - verify consistency of iso9660 filesystem. * * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999-2004 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include "../scsi.h" #include "../../wodim/defaults.h" /* * XXX JS: Some structures have odd lengths! * Some compilers (e.g. on Sun3/mc68020) padd the structures to even length. * For this reason, we cannot use sizeof (struct iso_path_table) or * sizeof (struct iso_directory_record) to compute on disk sizes. * Instead, we use offsetof(..., name) and add the name size. * See iso9660.h */ #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif /* * Note: always use these macros to avoid problems. * * ISO_ROUND_UP(X) may cause an integer overflow and thus give * incorrect results. So avoid it if possible. * * ISO_BLOCKS(X) is overflow safe. Prefer this when ever it is possible. */ #define SECTOR_SIZE (2048) #define ISO_ROUND_UP(X) (((X) + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1)) #define ISO_BLOCKS(X) (((X) / SECTOR_SIZE) + (((X)%SECTOR_SIZE)?1:0)) #define infile in_image FILE *infile = NULL; int blocksize; #define PAGE sizeof (buffer) #define ISODCL(from, to) (to - from + 1) struct iso_primary_descriptor { unsigned char type [ISODCL(1, 1)]; /* 711 */ unsigned char id [ISODCL(2, 6)]; unsigned char version [ISODCL(7, 7)]; /* 711 */ unsigned char unused1 [ISODCL(8, 8)]; unsigned char system_id [ISODCL(9, 40)]; /* aunsigned chars */ unsigned char volume_id [ISODCL(41, 72)]; /* dunsigned chars */ unsigned char unused2 [ISODCL(73, 80)]; unsigned char volume_space_size [ISODCL(81, 88)]; /* 733 */ unsigned char unused3 [ISODCL(89, 120)]; unsigned char volume_set_size [ISODCL(121, 124)]; /* 723 */ unsigned char volume_sequence_number [ISODCL(125, 128)]; /* 723 */ unsigned char logical_block_size [ISODCL(129, 132)]; /* 723 */ unsigned char path_table_size [ISODCL(133, 140)]; /* 733 */ unsigned char type_l_path_table [ISODCL(141, 144)]; /* 731 */ unsigned char opt_type_l_path_table [ISODCL(145, 148)]; /* 731 */ unsigned char type_m_path_table [ISODCL(149, 152)]; /* 732 */ unsigned char opt_type_m_path_table [ISODCL(153, 156)]; /* 732 */ unsigned char root_directory_record [ISODCL(157, 190)]; /* 9.1 */ unsigned char volume_set_id [ISODCL(191, 318)]; /* dunsigned chars */ unsigned char publisher_id [ISODCL(319, 446)]; /* achars */ unsigned char preparer_id [ISODCL(447, 574)]; /* achars */ unsigned char application_id [ISODCL(575, 702)]; /* achars */ unsigned char copyright_file_id [ISODCL(703, 739)]; /* 7.5 dchars */ unsigned char abstract_file_id [ISODCL(740, 776)]; /* 7.5 dchars */ unsigned char bibliographic_file_id [ISODCL(777, 813)]; /* 7.5 dchars */ unsigned char creation_date [ISODCL(814, 830)]; /* 8.4.26.1 */ unsigned char modification_date [ISODCL(831, 847)]; /* 8.4.26.1 */ unsigned char expiration_date [ISODCL(848, 864)]; /* 8.4.26.1 */ unsigned char effective_date [ISODCL(865, 881)]; /* 8.4.26.1 */ unsigned char file_structure_version [ISODCL(882, 882)]; /* 711 */ unsigned char unused4 [ISODCL(883, 883)]; unsigned char application_data [ISODCL(884, 1395)]; unsigned char unused5 [ISODCL(1396, 2048)]; }; struct iso_directory_record { unsigned char length [ISODCL(1, 1)]; /* 711 */ unsigned char ext_attr_length [ISODCL(2, 2)]; /* 711 */ unsigned char extent [ISODCL(3, 10)]; /* 733 */ unsigned char size [ISODCL(11, 18)]; /* 733 */ unsigned char date [ISODCL(19, 25)]; /* 7 by 711 */ unsigned char flags [ISODCL(26, 26)]; unsigned char file_unit_size [ISODCL(27, 27)]; /* 711 */ unsigned char interleave [ISODCL(28, 28)]; /* 711 */ unsigned char volume_sequence_number [ISODCL(29, 32)]; /* 723 */ unsigned char name_len [ISODCL(33, 33)]; /* 711 */ unsigned char name [38]; }; static int isonum_721(char * p); static int isonum_723(char * p); static int isonum_711(char * p); static int isonum_731(char * p); static int isonum_722(char * p); static int isonum_732(char * p); static int isonum_733(unsigned char * p); static int parse_rr(unsigned char * pnt, int len, int cont_flag); static int dump_rr(struct iso_directory_record * idr); static void check_tree(off_t file_addr, int file_size, off_t parent_addr); static void check_path_tables(int typel_extent, int typem_extent, int path_table_size); static void usage(int excode); static int isonum_721(char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); } static int isonum_723(char *p) { #if 0 if (p[0] != p[3] || p[1] != p[2]) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "invalid format 7.2.3 number\n"); #else fprintf(stderr, "invalid format 7.2.3 number\n"); exit(1); #endif } #endif return (isonum_721(p)); } static int isonum_711(char *p) { return (*p & 0xff); } static int isonum_731(char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8) | ((p[2] & 0xff) << 16) | ((p[3] & 0xff) << 24)); } static int isonum_722(char *p) { return ((p[1] & 0xff) | ((p[0] & 0xff) << 8)); } static int isonum_732(char *p) { return ((p[3] & 0xff) | ((p[2] & 0xff) << 8) | ((p[1] & 0xff) << 16) | ((p[0] & 0xff) << 24)); } static int isonum_733(unsigned char *p) { return (isonum_731((char *)p)); } char lbuffer[1024]; int iline; int rr_goof; static int parse_rr(unsigned char *pnt, int len, int cont_flag) { int slen; int ncount; int flag1; int flag2; int extent; unsigned char *pnts; off_t cont_extent; int cont_offset; int cont_size; char symlinkname[1024]; sprintf(lbuffer+iline, " RRlen=%d ", len); iline += strlen(lbuffer+iline); cont_extent = (off_t)0; cont_offset = cont_size = 0; symlinkname[0] = 0; ncount = 0; flag1 = flag2 = 0; while (len >= 4) { if (ncount) sprintf(lbuffer+iline, ","); else sprintf(lbuffer+iline, "["); iline += strlen(lbuffer + iline); sprintf(lbuffer+iline, "%c%c", pnt[0], pnt[1]); iline += strlen(lbuffer + iline); if (pnt[0] < 'A' || pnt[0] > 'Z' || pnt[1] < 'A' || pnt[1] > 'Z') { sprintf(lbuffer+iline, "**BAD SUSP %d %d]", pnt[0], pnt[1]); rr_goof++; iline += strlen(lbuffer + iline); return (flag2); } if (pnt[3] != 1 && pnt[3] != 2) { sprintf(lbuffer+iline, "**BAD RRVERSION (%d)\n", pnt[3]); rr_goof++; iline += strlen(lbuffer + iline); return (flag2); } ncount++; if (pnt[0] == 'R' && pnt[1] == 'R') flag1 = pnt[4] & 0xff; if (strncmp((char *)pnt, "PX", 2) == 0) flag2 |= 1; if (strncmp((char *)pnt, "PN", 2) == 0) flag2 |= 2; if (strncmp((char *)pnt, "SL", 2) == 0) flag2 |= 4; if (strncmp((char *)pnt, "NM", 2) == 0) flag2 |= 8; if (strncmp((char *)pnt, "CL", 2) == 0) flag2 |= 16; if (strncmp((char *)pnt, "PL", 2) == 0) flag2 |= 32; if (strncmp((char *)pnt, "RE", 2) == 0) flag2 |= 64; if (strncmp((char *)pnt, "TF", 2) == 0) flag2 |= 128; if (strncmp((char *)pnt, "CE", 2) == 0) { cont_extent = (off_t)isonum_733(pnt+4); cont_offset = isonum_733(pnt+12); cont_size = isonum_733(pnt+20); sprintf(lbuffer+iline, "=[%x,%x,%d]", (int)cont_extent, cont_offset, cont_size); iline += strlen(lbuffer + iline); } if (strncmp((char *)pnt, "PL", 2) == 0 || strncmp((char *)pnt, "CL", 2) == 0) { extent = isonum_733(pnt+4); sprintf(lbuffer+iline, "=%x", extent); iline += strlen(lbuffer + iline); if (extent == 0) rr_goof++; } if (strncmp((char *)pnt, "SL", 2) == 0) { pnts = pnt+5; slen = pnt[2] - 5; while (slen >= 1) { switch (pnts[0] & 0xfe) { case 0: strncat(symlinkname, (char *)(pnts+2), pnts[1]); break; case 2: strcat(symlinkname, "."); break; case 4: strcat(symlinkname, ".."); break; case 8: strcat(symlinkname, "/"); break; case 16: strcat(symlinkname, "/mnt"); sprintf(lbuffer+iline, "Warning - mount point requested"); iline += strlen(lbuffer + iline); break; case 32: strcat(symlinkname, "kafka"); sprintf(lbuffer+iline, "Warning - host_name requested"); iline += strlen(lbuffer + iline); break; default: sprintf(lbuffer+iline, "Reserved bit setting in symlink"); rr_goof++; iline += strlen(lbuffer + iline); break; } if ((pnts[0] & 0xfe) && pnts[1] != 0) { sprintf(lbuffer+iline, "Incorrect length in symlink component"); iline += strlen(lbuffer + iline); } if ((pnts[0] & 1) == 0) strcat(symlinkname, "/"); slen -= (pnts[1] + 2); pnts += (pnts[1] + 2); } if (symlinkname[0] != 0) { sprintf(lbuffer+iline, "=%s", symlinkname); iline += strlen(lbuffer + iline); symlinkname[0] = 0; } } len -= pnt[2]; pnt += pnt[2]; if (len <= 3 && cont_extent) { unsigned char sector[2048]; #ifdef USE_SCG readsecs(cont_extent * blocksize / 2048, sector, ISO_BLOCKS(sizeof (sector))); #else lseek(fileno(infile), cont_extent * blocksize, SEEK_SET); read(fileno(infile), sector, sizeof (sector)); #endif flag2 |= parse_rr(§or[cont_offset], cont_size, 1); } } if (ncount) { sprintf(lbuffer+iline, "]"); iline += strlen(lbuffer + iline); } if (!cont_flag && flag1 && flag1 != flag2) { sprintf(lbuffer+iline, "Flag %x != %x", flag1, flag2); rr_goof++; iline += strlen(lbuffer + iline); } return (flag2); } static int dump_rr(struct iso_directory_record *idr) { int len; char * pnt; len = idr->length[0] & 0xff; len -= offsetof(struct iso_directory_record, name[0]); len -= idr->name_len[0]; pnt = (char *) idr; pnt += offsetof(struct iso_directory_record, name[0]); pnt += idr->name_len[0]; if ((idr->name_len[0] & 1) == 0) { pnt++; len--; } rr_goof = 0; parse_rr((unsigned char *)pnt, len, 0); return (rr_goof); } static int dir_count = 0; static int dir_size_count = 0; static int ngoof = 0; static void check_tree(off_t file_addr, int file_size, off_t parent_addr) { unsigned char buffer[2048]; unsigned int k; int rflag = 0; int i; int i1; int j; int goof; int extent; int size; off_t orig_file_addr; off_t parent_file_addr; struct iso_directory_record *idr; i1 = 0; orig_file_addr = file_addr / blocksize; /* Actual extent of this directory */ parent_file_addr = parent_addr / blocksize; if ((dir_count % 100) == 0) printf("[%d %d]\n", dir_count, dir_size_count); #if 0 if (sizeof (file_addr) > sizeof (long)) { printf("Starting directory %ld %d %lld\n", file_addr, file_size, (Llong)parent_addr); } else { printf("Starting directory %ld %d %ld\n", file_addr, file_size, parent_addr); } #endif dir_count++; dir_size_count += file_size / blocksize; if (file_size & 0x3ff) printf("********Directory has unusual size\n"); for (k = 0; k < (file_size / sizeof (buffer)); k++) { #ifdef USE_SCG readsecs(file_addr / 2048, buffer, ISO_BLOCKS(sizeof (buffer))); #else lseek(fileno(infile), file_addr, SEEK_SET); read(fileno(infile), buffer, sizeof (buffer)); #endif i = 0; while (1 == 1) { goof = iline = 0; idr = (struct iso_directory_record *) &buffer[i]; if (idr->length[0] == 0) break; sprintf(&lbuffer[iline], "%3d ", idr->length[0]); iline += strlen(lbuffer + iline); extent = isonum_733(idr->extent); size = isonum_733(idr->size); sprintf(&lbuffer[iline], "%5x ", extent); iline += strlen(lbuffer + iline); sprintf(&lbuffer[iline], "%8d ", size); iline += strlen(lbuffer + iline); sprintf(&lbuffer[iline], "%c", (idr->flags[0] & 2) ? '*' : ' '); iline += strlen(lbuffer + iline); if (idr->name_len[0] > 33) { sprintf(&lbuffer[iline], "File name length=(%d)", idr->name_len[0]); goof++; iline += strlen(lbuffer + iline); } else if (idr->name_len[0] == 1 && idr->name[0] == 0) { sprintf(&lbuffer[iline], ". "); iline += strlen(lbuffer + iline); rflag = 0; if (orig_file_addr != (off_t)(isonum_733(idr->extent) + isonum_711((char *) idr->ext_attr_length))) { sprintf(&lbuffer[iline], "***** Directory has null extent."); goof++; iline += strlen(lbuffer + iline); } if (i1) { sprintf(&lbuffer[iline], "***** . not first entry."); rr_goof++; iline += strlen(lbuffer + iline); } } else if (idr->name_len[0] == 1 && idr->name[0] == 1) { sprintf(&lbuffer[iline], ".. "); iline += strlen(lbuffer + iline); rflag = 0; if (parent_file_addr != (off_t)(isonum_733(idr->extent) + isonum_711((char *) idr->ext_attr_length))) { sprintf(&lbuffer[iline], "***** Directory has null extent."); goof++; iline += strlen(lbuffer + iline); } if (i1 != 1) { sprintf(&lbuffer[iline], "***** .. not second entry."); rr_goof++; iline += strlen(lbuffer + iline); } } else { if (i1 < 2) { sprintf(&lbuffer[iline], " Improper sorting."); rr_goof++; } for (j = 0; j < (int)idr->name_len[0]; j++) { sprintf(&lbuffer[iline], "%c", idr->name[j]); } for (j = 0; j < (14 - (int) idr->name_len[0]); j++) { sprintf(&lbuffer[iline], " "); iline += strlen(lbuffer + iline); } rflag = 1; } if (size && extent == 0) { sprintf(&lbuffer[iline], "****Extent==0, size != 0"); goof++; iline += strlen(lbuffer + iline); } #if 0 /* This is apparently legal. */ if (size == 0 && extent) { sprintf(&lbuffer[iline], "****Extent!=0, size == 0"); goof++; iline += strlen(lbuffer + iline); } #endif if (idr->flags[0] & 0xf5) { sprintf(&lbuffer[iline], "Flags=(%x) ", idr->flags[0]); goof++; iline += strlen(lbuffer + iline); } if (idr->interleave[0]) { sprintf(&lbuffer[iline], "Interleave=(%d) ", idr->interleave[0]); goof++; iline += strlen(lbuffer + iline); } if (idr->file_unit_size[0]) { sprintf(&lbuffer[iline], "File unit size=(%d) ", idr->file_unit_size[0]); goof++; iline += strlen(lbuffer + iline); } if (idr->volume_sequence_number[0] != 1) { sprintf(&lbuffer[iline], "Volume sequence number=(%d) ", idr->volume_sequence_number[0]); goof++; iline += strlen(lbuffer + iline); } goof += dump_rr(idr); sprintf(&lbuffer[iline], "\n"); iline += strlen(lbuffer + iline); if (goof) { ngoof++; lbuffer[iline++] = 0; if (sizeof (orig_file_addr) > sizeof (long)) { printf("%llx: %s", (Llong)orig_file_addr, lbuffer); } else { printf("%lx: %s", (long)orig_file_addr, lbuffer); } } if (rflag && (idr->flags[0] & 2)) check_tree((off_t)(isonum_733(idr->extent) + isonum_711((char *)idr->ext_attr_length)) * blocksize, isonum_733(idr->size), orig_file_addr * blocksize); i += buffer[i]; i1++; if (i > 2048 - offsetof(struct iso_directory_record, name[0])) break; } file_addr += sizeof (buffer); } fflush(stdout); } /* * This function simply dumps the contents of the path tables. No * consistency checking takes place, although this would proably be a good * idea. */ struct path_table_info { char *name; unsigned int extent; unsigned short index; unsigned short parent; }; static void check_path_tables(int typel_extent, int typem_extent, int path_table_size) { int count; int j; char *pnt; char *typel; char *typem; /* Now read in the path tables */ typel = (char *) malloc(ISO_ROUND_UP(path_table_size)); #ifdef USE_SCG readsecs(typel_extent * blocksize / 2048, typel, ISO_BLOCKS(path_table_size)); #else lseek(fileno(infile), (off_t)((off_t)typel_extent) * blocksize, SEEK_SET); read(fileno(infile), typel, path_table_size); /* FIXME: check return value */ #endif typem = (char *) malloc(path_table_size); lseek(fileno(infile), (off_t)((off_t)typem_extent) * blocksize, SEEK_SET); read(fileno(infile), typem, path_table_size); /* FIXME: check return value */ j = path_table_size; pnt = typel; count = 1; while (j) { int namelen; int extent; int idx; char name[32]; namelen = *pnt++; pnt++; extent = isonum_731(pnt); pnt += 4; idx = isonum_721(pnt); pnt += 2; j -= 8 + namelen; memset(name, 0, sizeof (name)); strncpy(name, pnt, namelen); pnt += namelen; if (j & 1) { j--; pnt++; } printf("%4.4d %4.4d %8.8x %s\n", count++, idx, extent, name); } j = path_table_size; pnt = typem; count = 1; while (j) { int namelen; int extent; int idx; char name[32]; namelen = *pnt++; pnt++; extent = isonum_732(pnt); pnt += 4; idx = isonum_722(pnt); pnt += 2; j -= 8+namelen; memset(name, 0, sizeof (name)); strncpy(name, pnt, namelen); pnt += namelen; if (j & 1) { j--; pnt++; } printf("%4.4d %4.4d %8.8x %s\n", count++, idx, extent, name); } } static void usage(int excode) { errmsgno(EX_BAD, "Usage: %s [options] image\n", get_progname()); fprintf(stderr, "Options:\n"); fprintf(stderr, "\t-help, -h Print this help\n"); fprintf(stderr, "\t-version Print version info and exit\n"); fprintf(stderr, "\t-i filename Filename to read ISO-9660 image from\n"); fprintf(stderr, "\tdev=target SCSI target to use as CD/DVD-Recorder\n"); fprintf(stderr, "\nIf neither -i nor dev= are speficied, is needed.\n"); exit(excode); } int main(int argc, char *argv[]) { int cac; char * const *cav; char *opts = "help,h,version,i*,dev*"; BOOL help = FALSE; BOOL prvers = FALSE; char *filename = NULL; char *devname = NULL; off_t file_addr; int file_size; struct iso_primary_descriptor ipd; struct iso_directory_record *idr; int typel_extent; int typem_extent; int path_table_size; save_args(argc, argv); cac = argc - 1; cav = argv + 1; if (getallargs(&cac, &cav, opts, &help, &help, &prvers, &filename, &devname) < 0) { errmsgno(EX_BAD, "Bad Option: '%s'\n", cav[0]); usage(EX_BAD); } if (help) usage(0); if (prvers) { printf("isovfy %s (%s)\n", CDRKIT_VERSION, HOST_SYSTEM); exit(0); } cac = argc - 1; cav = argv + 1; if (filename == NULL && devname == NULL) { if (getfiles(&cac, &cav, opts) != 0) { filename = cav[0]; cac--, cav++; } } if (getfiles(&cac, &cav, opts) != 0) { errmsgno(EX_BAD, "Bad Argument: '%s'\n", cav[0]); usage(EX_BAD); } if (filename != NULL && devname != NULL) { errmsgno(EX_BAD, "Only one of -i or dev= allowed\n"); usage(EX_BAD); } #ifdef USE_SCG if (filename == NULL && devname == NULL) cdr_defaults(&devname, NULL, NULL, NULL); #endif if (filename == NULL && devname == NULL) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "ISO-9660 image not specified\n"); #else fprintf(stderr, "ISO-9660 image not specified\n"); #endif usage(EX_BAD); } if (filename != NULL) infile = fopen(filename, "rb"); else filename = devname; if (infile != NULL) { /* EMPTY */; #ifdef USE_SCG } else if (scsidev_open(filename) < 0) { #else } else { #endif #ifdef USE_LIBSCHILY comerr("Cannot open '%s'\n", filename); #else fprintf(stderr, "Cannot open '%s'\n", filename); exit(1); #endif } file_addr = (off_t)32768; #ifdef USE_SCG readsecs(file_addr / 2048, &ipd, ISO_BLOCKS(sizeof (ipd))); #else lseek(fileno(infile), file_addr, SEEK_SET); read(fileno(infile), &ipd, sizeof (ipd)); #endif idr = (struct iso_directory_record *)ipd.root_directory_record; blocksize = isonum_723((char *)ipd.logical_block_size); if (blocksize != 512 && blocksize != 1024 && blocksize != 2048) { blocksize = 2048; } file_addr = (off_t)isonum_733(idr->extent) + isonum_711((char *)idr->ext_attr_length); file_size = isonum_733(idr->size); if (sizeof (file_addr) > sizeof (long)) { printf("Root at extent %llx, %d bytes\n", (Llong)file_addr, file_size); } else { printf("Root at extent %lx, %d bytes\n", (long)file_addr, file_size); } file_addr = file_addr * blocksize; check_tree(file_addr, file_size, file_addr); typel_extent = isonum_731((char *)ipd.type_l_path_table); typem_extent = isonum_732((char *)ipd.type_m_path_table); path_table_size = isonum_733(ipd.path_table_size); /* Enable this to get the dump of the path tables */ #if 0 check_path_tables(typel_extent, typem_extent, path_table_size); #endif if (infile != NULL) fclose(infile); if (!ngoof) printf("No errors found\n"); return (0); } cdrkit-1.1.11/genisoimage/diag/isodump.c0000644000372500001440000004362210760743311017154 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)isodump.c 1.27 05/05/15 joerg */ /* * File isodump.c - dump iso9660 directory information. * * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999-2004 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "../scsi.h" #include "../../wodim/defaults.h" /* * XXX JS: Some structures have odd lengths! * Some compilers (e.g. on Sun3/mc68020) padd the structures to even length. * For this reason, we cannot use sizeof (struct iso_path_table) or * sizeof (struct iso_directory_record) to compute on disk sizes. * Instead, we use offsetof(..., name) and add the name size. * See iso9660.h */ #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif /* * Note: always use these macros to avoid problems. * * ISO_ROUND_UP(X) may cause an integer overflow and thus give * incorrect results. So avoid it if possible. * * ISO_BLOCKS(X) is overflow safe. Prefer this when ever it is possible. */ #define SECTOR_SIZE (2048) #define ISO_ROUND_UP(X) (((X) + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1)) #define ISO_BLOCKS(X) (((X) / SECTOR_SIZE) + (((X)%SECTOR_SIZE)?1:0)) #define infile in_image FILE *infile = NULL; off_t file_addr; unsigned char buffer[2048]; unsigned char search[64]; int blocksize; #define PAGE sizeof (buffer) #define ISODCL(from, to) (to - from + 1) struct iso_primary_descriptor { unsigned char type [ISODCL(1, 1)]; /* 711 */ unsigned char id [ISODCL(2, 6)]; unsigned char version [ISODCL(7, 7)]; /* 711 */ unsigned char unused1 [ISODCL(8, 8)]; unsigned char system_id [ISODCL(9, 40)]; /* aunsigned chars */ unsigned char volume_id [ISODCL(41, 72)]; /* dunsigned chars */ unsigned char unused2 [ISODCL(73, 80)]; unsigned char volume_space_size [ISODCL(81, 88)]; /* 733 */ unsigned char unused3 [ISODCL(89, 120)]; unsigned char volume_set_size [ISODCL(121, 124)]; /* 723 */ unsigned char volume_sequence_number [ISODCL(125, 128)]; /* 723 */ unsigned char logical_block_size [ISODCL(129, 132)]; /* 723 */ unsigned char path_table_size [ISODCL(133, 140)]; /* 733 */ unsigned char type_l_path_table [ISODCL(141, 144)]; /* 731 */ unsigned char opt_type_l_path_table [ISODCL(145, 148)]; /* 731 */ unsigned char type_m_path_table [ISODCL(149, 152)]; /* 732 */ unsigned char opt_type_m_path_table [ISODCL(153, 156)]; /* 732 */ unsigned char root_directory_record [ISODCL(157, 190)]; /* 9.1 */ unsigned char volume_set_id [ISODCL(191, 318)]; /* dunsigned chars */ unsigned char publisher_id [ISODCL(319, 446)]; /* achars */ unsigned char preparer_id [ISODCL(447, 574)]; /* achars */ unsigned char application_id [ISODCL(575, 702)]; /* achars */ unsigned char copyright_file_id [ISODCL(703, 739)]; /* 7.5 dchars */ unsigned char abstract_file_id [ISODCL(740, 776)]; /* 7.5 dchars */ unsigned char bibliographic_file_id [ISODCL(777, 813)]; /* 7.5 dchars */ unsigned char creation_date [ISODCL(814, 830)]; /* 8.4.26.1 */ unsigned char modification_date [ISODCL(831, 847)]; /* 8.4.26.1 */ unsigned char expiration_date [ISODCL(848, 864)]; /* 8.4.26.1 */ unsigned char effective_date [ISODCL(865, 881)]; /* 8.4.26.1 */ unsigned char file_structure_version [ISODCL(882, 882)]; /* 711 */ unsigned char unused4 [ISODCL(883, 883)]; unsigned char application_data [ISODCL(884, 1395)]; unsigned char unused5 [ISODCL(1396, 2048)]; }; struct iso_directory_record { unsigned char length [ISODCL(1, 1)]; /* 711 */ unsigned char ext_attr_length [ISODCL(2, 2)]; /* 711 */ unsigned char extent [ISODCL(3, 10)]; /* 733 */ unsigned char size [ISODCL(11, 18)]; /* 733 */ unsigned char date [ISODCL(19, 25)]; /* 7 by 711 */ unsigned char flags [ISODCL(26, 26)]; unsigned char file_unit_size [ISODCL(27, 27)]; /* 711 */ unsigned char interleave [ISODCL(28, 28)]; /* 711 */ unsigned char volume_sequence_number [ISODCL(29, 32)]; /* 723 */ unsigned char name_len [ISODCL(33, 33)]; /* 711 */ unsigned char name [1]; }; static int isonum_731(char * p); static int isonum_72(char * p); static int isonum_723(char * p); static int isonum_733(unsigned char * p); static void reset_tty(void); static void set_tty(void); static void onsusp(int signo); static void crsr2(int row, int col); static int parse_rr(unsigned char * pnt, int len, int cont_flag); static void dump_rr(struct iso_directory_record * idr); static void showblock(int flag); static int getbyte(void); static void usage(int excode); static int isonum_731(char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8) | ((p[2] & 0xff) << 16) | ((p[3] & 0xff) << 24)); } static int isonum_721(char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); } static int isonum_723(char *p) { #if 0 if (p[0] != p[3] || p[1] != p[2]) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "invalid format 7.2.3 number\n"); #else fprintf(stderr, "invalid format 7.2.3 number\n"); exit(1); #endif } #endif return (isonum_721(p)); } static int isonum_733(unsigned char *p) { return (isonum_731((char *)p)); } #ifdef USE_V7_TTY static struct sgttyb savetty; static struct sgttyb newtty; #else static struct termios savetty; static struct termios newtty; #endif static void reset_tty() { #ifdef USE_V7_TTY if (ioctl(STDIN_FILENO, TIOCSETN, &savetty) == -1) { #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &savetty) == -1) { #else if (ioctl(STDIN_FILENO, TCSETAF, &savetty) == -1) { #endif #endif #ifdef USE_LIBSCHILY comerr("Cannot put tty into normal mode\n"); #else printf("Cannot put tty into normal mode\n"); exit(1); #endif } } static void set_tty() { #ifdef USE_V7_TTY if (ioctl(STDIN_FILENO, TIOCSETN, &newtty) == -1) { #else #ifdef TCSANOW if (tcsetattr(STDIN_FILENO, TCSANOW, &newtty) == -1) { #else if (ioctl(STDIN_FILENO, TCSETAF, &newtty) == -1) { #endif #endif #ifdef USE_LIBSCHILY comerr("Cannot put tty into raw mode\n"); #else printf("Cannot put tty into raw mode\n"); exit(1); #endif } } /* Come here when we get a suspend signal from the terminal */ static void onsusp(int signo) { #ifdef SIGTTOU /* ignore SIGTTOU so we don't get stopped if csh grabs the tty */ signal(SIGTTOU, SIG_IGN); #endif reset_tty(); fflush(stdout); #ifdef SIGTTOU signal(SIGTTOU, SIG_DFL); /* Send the TSTP signal to suspend our process group */ signal(SIGTSTP, SIG_DFL); /* sigsetmask(0);*/ kill(0, SIGTSTP); /* Pause for station break */ /* We're back */ signal(SIGTSTP, onsusp); #endif set_tty(); } static void crsr2(int row, int col) { printf("\033[%d;%dH", row, col); } static int parse_rr(unsigned char *pnt, int len, int cont_flag) { int slen; int ncount; int extent; off_t cont_extent; int cont_offset; int cont_size; int flag1; int flag2; unsigned char *pnts; char symlinkname[1024]; char name[1024]; int goof; /* printf(" RRlen=%d ", len); */ symlinkname[0] = 0; cont_extent = (off_t)0; cont_offset = cont_size = 0; ncount = 0; flag1 = flag2 = 0; while (len >= 4) { if (ncount) printf(","); else printf("["); printf("%c%c", pnt[0], pnt[1]); if (pnt[3] != 1 && pnt[3] != 2) { printf("**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); return (0); /* JS ??? Is this right ??? */ } else if (pnt[0] == 'R' && pnt[1] == 'R') { printf("=%d", pnt[3]); } ncount++; if (pnt[0] == 'R' && pnt[1] == 'R') flag1 = pnt[4] & 0xff; if (strncmp((char *)pnt, "PX", 2) == 0) flag2 |= 1; if (strncmp((char *)pnt, "PN", 2) == 0) flag2 |= 2; if (strncmp((char *)pnt, "SL", 2) == 0) flag2 |= 4; if (strncmp((char *)pnt, "NM", 2) == 0) { slen = pnt[2] - 5; pnts = pnt+5; if ((pnt[4] & 6) != 0) { printf("*"); } memset(name, 0, sizeof (name)); memcpy(name, pnts, slen); printf("=%s", name); flag2 |= 8; } if (strncmp((char *)pnt, "CL", 2) == 0) flag2 |= 16; if (strncmp((char *)pnt, "PL", 2) == 0) flag2 |= 32; if (strncmp((char *)pnt, "RE", 2) == 0) flag2 |= 64; if (strncmp((char *)pnt, "TF", 2) == 0) flag2 |= 128; if (strncmp((char *)pnt, "PX", 2) == 0) { extent = isonum_733(pnt+12); printf("=%x", extent); } if (strncmp((char *)pnt, "CE", 2) == 0) { cont_extent = (off_t)isonum_733(pnt+4); cont_offset = isonum_733(pnt+12); cont_size = isonum_733(pnt+20); printf("=[%x,%x,%d]", (int)cont_extent, cont_offset, cont_size); } if (strncmp((char *)pnt, "PL", 2) == 0 || strncmp((char *)pnt, "CL", 2) == 0) { extent = isonum_733(pnt+4); printf("=%x", extent); } if (strncmp((char *)pnt, "SL", 2) == 0) { int cflag; cflag = pnt[4]; pnts = pnt+5; slen = pnt[2] - 5; while (slen >= 1) { switch (pnts[0] & 0xfe) { case 0: strncat(symlinkname, (char *)(pnts+2), pnts[1]); break; case 2: strcat(symlinkname, "."); break; case 4: strcat(symlinkname, ".."); break; case 8: if ((pnts[0] & 1) == 0) strcat(symlinkname, "/"); break; case 16: strcat(symlinkname, "/mnt"); printf("Warning - mount point requested"); break; case 32: strcat(symlinkname, "kafka"); printf("Warning - host_name requested"); break; default: printf("Reserved bit setting in symlink"); goof++; break; } if ((pnts[0] & 0xfe) && pnts[1] != 0) { printf("Incorrect length in symlink component"); } if ((pnts[0] & 1) == 0) strcat(symlinkname, "/"); slen -= (pnts[1] + 2); pnts += (pnts[1] + 2); } if (cflag) strcat(symlinkname, "+"); printf("=%s", symlinkname); symlinkname[0] = 0; } len -= pnt[2]; pnt += pnt[2]; if (len <= 3 && cont_extent) { unsigned char sector[2048]; #ifdef USE_SCG readsecs(cont_extent * blocksize / 2048, sector, ISO_BLOCKS(sizeof (sector))); #else lseek(fileno(infile), cont_extent * blocksize, SEEK_SET); read(fileno(infile), sector, sizeof (sector)); #endif flag2 |= parse_rr(§or[cont_offset], cont_size, 1); } } if (ncount) printf("]"); if (!cont_flag && flag1 != flag2) { printf("Flag %x != %x", flag1, flag2); goof++; } return (flag2); } static void dump_rr(struct iso_directory_record *idr) { int len; unsigned char *pnt; len = idr->length[0] & 0xff; len -= offsetof(struct iso_directory_record, name[0]); len -= idr->name_len[0]; pnt = (unsigned char *) idr; pnt += offsetof(struct iso_directory_record, name[0]); pnt += idr->name_len[0]; if ((idr->name_len[0] & 1) == 0) { pnt++; len--; } parse_rr(pnt, len, 0); } static void showblock(int flag) { int i; int j; int line; struct iso_directory_record *idr; #ifdef USE_SCG readsecs(file_addr / 2048, buffer, ISO_BLOCKS(sizeof (buffer))); #else lseek(fileno(infile), file_addr, SEEK_SET); read(fileno(infile), buffer, sizeof (buffer)); #endif for (i = 0; i < 60; i++) printf("\n"); fflush(stdout); i = line = 0; if (flag) { while (1 == 1) { crsr2(line+3, 1); idr = (struct iso_directory_record *) &buffer[i]; if (idr->length[0] == 0) break; printf("%3d ", idr->length[0]); printf("[%2d] ", idr->volume_sequence_number[0]); printf("%5x ", isonum_733(idr->extent)); printf("%8d ", isonum_733(idr->size)); printf("%02x/", idr->flags[0]); printf((idr->flags[0] & 2) ? "*" : " "); if (idr->name_len[0] == 1 && idr->name[0] == 0) printf(". "); else if (idr->name_len[0] == 1 && idr->name[0] == 1) printf(".. "); else { for (j = 0; j < (int)idr->name_len[0]; j++) printf("%c", idr->name[j]); for (j = 0; j < (14 - (int)idr->name_len[0]); j++) printf(" "); } dump_rr(idr); printf("\n"); i += buffer[i]; if (i > 2048 - offsetof(struct iso_directory_record, name[0])) break; line++; } } printf("\n"); if (sizeof (file_addr) > sizeof (long)) { printf(" Zone, zone offset: %14llx %12.12llx ", (Llong)file_addr / blocksize, (Llong)file_addr & (Llong)(blocksize - 1)); } else { printf(" Zone, zone offset: %6lx %4.4lx ", (long) (file_addr / blocksize), (long) file_addr & (blocksize - 1)); } fflush(stdout); } static int getbyte() { char c1; c1 = buffer[file_addr & (blocksize-1)]; file_addr++; if ((file_addr & (blocksize-1)) == 0) showblock(0); return (c1); } static void usage(int excode) { errmsgno(EX_BAD, "Usage: %s [options] image\n", get_progname()); fprintf(stderr, "Options:\n"); fprintf(stderr, "\t-help, -h Print this help\n"); fprintf(stderr, "\t-version Print version info and exit\n"); fprintf(stderr, "\t-i filename Filename to read ISO-9660 image from\n"); fprintf(stderr, "\tdev=target SCSI target to use as CD/DVD-Recorder\n"); fprintf(stderr, "\nIf neither -i nor dev= are speficied, is needed.\n"); exit(excode); } int main(int argc, char *argv[]) { int cac; char * const *cav; char *opts = "help,h,version,i*,dev*"; BOOL help = FALSE; BOOL prvers = FALSE; char *filename = NULL; char *devname = NULL; char c; int i; struct iso_primary_descriptor ipd; struct iso_directory_record *idr; save_args(argc, argv); cac = argc - 1; cav = argv + 1; if (getallargs(&cac, &cav, opts, &help, &help, &prvers, &filename, &devname) < 0) { errmsgno(EX_BAD, "Bad Option: '%s'\n", cav[0]); usage(EX_BAD); } if (help) usage(0); if (prvers) { printf("isodump %s (%s)\n", CDRKIT_VERSION, HOST_SYSTEM); exit(0); } cac = argc - 1; cav = argv + 1; if (filename == NULL && devname == NULL) { if (getfiles(&cac, &cav, opts) != 0) { filename = cav[0]; cac--, cav++; } } if (getfiles(&cac, &cav, opts) != 0) { errmsgno(EX_BAD, "Bad Argument: '%s'\n", cav[0]); usage(EX_BAD); } if (filename != NULL && devname != NULL) { errmsgno(EX_BAD, "Only one of -i or dev= allowed\n"); usage(EX_BAD); } #ifdef USE_SCG if (filename == NULL && devname == NULL) cdr_defaults(&devname, NULL, NULL, NULL); #endif if (filename == NULL && devname == NULL) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "ISO-9660 image not specified\n"); #else fprintf(stderr, "ISO-9660 image not specified\n"); #endif usage(EX_BAD); } if (filename != NULL) infile = fopen(filename, "rb"); else filename = devname; if (infile != NULL) { /* EMPTY */; #ifdef USE_SCG } else if (scsidev_open(filename) < 0) { #else } else { #endif #ifdef USE_LIBSCHILY comerr("Cannot open '%s'\n", filename); #else fprintf(stderr, "Cannot open '%s'\n", filename); exit(1); #endif } file_addr = (off_t) (16 << 11); #ifdef USE_SCG readsecs(file_addr / 2048, &ipd, ISO_BLOCKS(sizeof (ipd))); #else lseek(fileno(infile), file_addr, SEEK_SET); read(fileno(infile), &ipd, sizeof (ipd)); #endif idr = (struct iso_directory_record *)ipd.root_directory_record; blocksize = isonum_723((char *)ipd.logical_block_size); if (blocksize != 512 && blocksize != 1024 && blocksize != 2048) { blocksize = 2048; } file_addr = (off_t)isonum_733(idr->extent); file_addr = file_addr * blocksize; /* Now setup the keyboard for single character input. */ #ifdef USE_V7_TTY if (ioctl(STDIN_FILENO, TIOCGETP, &savetty) == -1) { #else #ifdef TCSANOW if (tcgetattr(STDIN_FILENO, &savetty) == -1) { #else if (ioctl(STDIN_FILENO, TCGETA, &savetty) == -1) { #endif #endif #ifdef USE_LIBSCHILY comerr("Stdin must be a tty\n"); #else printf("Stdin must be a tty\n"); exit(1); #endif } newtty = savetty; #ifdef USE_V7_TTY newtty.sg_flags &= ~(ECHO|CRMOD); newtty.sg_flags |= CBREAK; #else newtty.c_lflag &= ~ICANON; newtty.c_lflag &= ~ECHO; newtty.c_cc[VMIN] = 1; #endif set_tty(); #ifdef SIGTSTP signal(SIGTSTP, onsusp); #endif on_comerr((void(*)(int, void *))reset_tty, NULL); do { if (file_addr < 0) file_addr = (off_t)0; showblock(1); read(STDIN_FILENO, &c, 1); /* FIXME: check return value */ if (c == 'a') file_addr -= blocksize; if (c == 'b') file_addr += blocksize; if (c == 'g') { crsr2(20, 1); printf("Enter new starting block (in hex):"); if (sizeof (file_addr) > sizeof (long)) { Llong ll; scanf("%llx", &ll); /* FIXME: check return value */ file_addr = (off_t)ll; } else { long l; scanf("%lx", &l); /* FIXME: check return value */ file_addr = (off_t)l; } file_addr = file_addr * blocksize; crsr2(20, 1); printf(" "); } if (c == 'f') { crsr2(20, 1); printf("Enter new search string:"); fgets((char *)search, sizeof (search), stdin); /* FIXME: check return value */ while (search[strlen((char *)search)-1] == '\n') search[strlen((char *)search)-1] = 0; crsr2(20, 1); printf(" "); } if (c == '+') { while (1 == 1) { int slen; while (1 == 1) { c = getbyte(); if (c == search[0]) break; } slen = (int)strlen((char *)search); for (i = 1; i < slen; i++) { if (search[i] != getbyte()) break; } if (i == slen) break; } file_addr &= ~(blocksize-1); showblock(1); } if (c == 'q') break; } while (1 == 1); reset_tty(); if (infile != NULL) fclose(infile); return (0); } cdrkit-1.1.11/genisoimage/diag/isodump.10000644000372500001440000000005410536101176017060 0ustar steveusers.so man1/isoinfo.1 .\" %Z%%M% %I% %E% joerg cdrkit-1.1.11/genisoimage/diag/isodebug.c0000644000372500001440000001633110536265343017277 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)isodebug.c 1.10 05/05/01 Copyright 1996-2004 J. Schilling */ /* * Copyright (c) 1996-2004 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "../scsi.h" #include "../../wodim/defaults.h" #define _delta(from, to) ((to) - (from) + 1) #define VD_BOOT 0 #define VD_PRIMARY 1 #define VD_SUPPLEMENT 2 #define VD_PARTITION 3 #define VD_TERM 255 #define VD_ID "CD001" struct iso9660_voldesc { char vd_type [_delta(1, 1)]; char vd_id [_delta(2, 6)]; char vd_version [_delta(7, 7)]; char vd_fill [_delta(8, 2048)]; }; struct iso9660_boot_voldesc { char vd_type [_delta(1, 1)]; char vd_id [_delta(2, 6)]; char vd_version [_delta(7, 7)]; char vd_bootsys [_delta(8, 39)]; char vd_bootid [_delta(40, 71)]; char vd_bootcode [_delta(72, 2048)]; }; struct iso9660_pr_voldesc { char vd_type [_delta(1, 1)]; char vd_id [_delta(2, 6)]; char vd_version [_delta(7, 7)]; char vd_unused1 [_delta(8, 8)]; char vd_system_id [_delta(9, 40)]; char vd_volume_id [_delta(41, 72)]; char vd_unused2 [_delta(73, 80)]; char vd_volume_space_size [_delta(81, 88)]; char vd_unused3 [_delta(89, 120)]; char vd_volume_set_size [_delta(121, 124)]; char vd_volume_seq_number [_delta(125, 128)]; char vd_lbsize [_delta(129, 132)]; char vd_path_table_size [_delta(133, 140)]; char vd_pos_path_table_l [_delta(141, 144)]; char vd_opt_pos_path_table_l [_delta(145, 148)]; char vd_pos_path_table_m [_delta(149, 152)]; char vd_opt_pos_path_table_m [_delta(153, 156)]; char vd_root_dir [_delta(157, 190)]; char vd_volume_set_id [_delta(191, 318)]; char vd_publisher_id [_delta(319, 446)]; char vd_data_preparer_id [_delta(447, 574)]; char vd_application_id [_delta(575, 702)]; char vd_copyr_file_id [_delta(703, 739)]; char vd_abstr_file_id [_delta(740, 776)]; char vd_bibl_file_id [_delta(777, 813)]; char vd_create_time [_delta(814, 830)]; char vd_mod_time [_delta(831, 847)]; char vd_expiry_time [_delta(848, 864)]; char vd_effective_time [_delta(865, 881)]; char vd_file_struct_vers [_delta(882, 882)]; char vd_reserved1 [_delta(883, 883)]; char vd_application_use [_delta(884, 1395)]; char vd_fill [_delta(1396, 2048)]; }; #define GET_UBYTE(a) a_to_u_byte(a) #define GET_SBYTE(a) a_to_byte(a) #define GET_SHORT(a) a_to_u_2_byte(&((unsigned char *) (a))[0]) #define GET_BSHORT(a) a_to_u_2_byte(&((unsigned char *) (a))[2]) #define GET_INT(a) a_to_4_byte(&((unsigned char *) (a))[0]) #define GET_LINT(a) la_to_4_byte(&((unsigned char *) (a))[0]) #define GET_BINT(a) a_to_4_byte(&((unsigned char *) (a))[4]) #define infile in_image FILE *infile = NULL; static void usage(int excode); static char *isodinfo(FILE *f); static void usage(int excode) { errmsgno(EX_BAD, "Usage: %s [options] image\n", get_progname()); fprintf(stderr, "Options:\n"); fprintf(stderr, "\t-help,-h Print this help\n"); fprintf(stderr, "\t-version Print version info and exit\n"); fprintf(stderr, "\t-i filename Filename to read ISO-9660 image from\n"); fprintf(stderr, "\tdev=target SCSI target to use as CD/DVD-Recorder\n"); fprintf(stderr, "\nIf neither -i nor dev= are speficied, is needed.\n"); exit(excode); } static char * isodinfo(FILE *f) { static struct iso9660_voldesc vd; struct iso9660_pr_voldesc *vp; #ifndef USE_SCG struct stat sb; mode_t mode; #endif BOOL found = FALSE; off_t sec_off = 16L; #ifndef USE_SCG /* * First check if a bad guy tries to call isosize() * with an unappropriate file descriptor. * return -1 in this case. */ if (isatty(fileno(f))) return (NULL); if (fstat(fileno(f), &sb) < 0) return (NULL); mode = sb.st_mode & S_IFMT; if (!S_ISREG(mode) && !S_ISBLK(mode) && !S_ISCHR(mode)) return (NULL); #endif vp = (struct iso9660_pr_voldesc *) &vd; do { #ifdef USE_SCG readsecs(sec_off, &vd, 1); #else if (lseek(fileno(f), (off_t)(sec_off * 2048L), SEEK_SET) == -1) return (NULL); read(fileno(f), &vd, sizeof (vd)); #endif sec_off++; if (GET_UBYTE(vd.vd_type) == VD_PRIMARY) { found = TRUE; /* break;*/ } } while (GET_UBYTE(vd.vd_type) != VD_TERM); if (GET_UBYTE(vd.vd_type) != VD_TERM) return (NULL); #ifdef USE_SCG readsecs(sec_off, &vd, 1); #else if (lseek(fileno(f), (off_t)(sec_off * 2048L), SEEK_SET) == -1) return (NULL); read(fileno(f), &vd, sizeof (vd)); #endif sec_off++; return ((char *)&vd); } int main(int argc, char *argv[]) { int cac; char * const *cav; char *opts = "help,h,version,i*,dev*"; BOOL help = FALSE; BOOL prvers = FALSE; char *filename = NULL; char *devname = NULL; char *p; char *eol; save_args(argc, argv); cac = argc - 1; cav = argv + 1; if (getallargs(&cac, &cav, opts, &help, &help, &prvers, &filename, &devname) < 0) { errmsgno(EX_BAD, "Bad Option: '%s'\n", cav[0]); usage(EX_BAD); } if (help) usage(0); if (prvers) { printf("isodebug %s (%s)\n", CDRKIT_VERSION, HOST_SYSTEM); exit(0); } cac = argc - 1; cav = argv + 1; if (filename == NULL && devname == NULL) { if (getfiles(&cac, &cav, opts) != 0) { filename = cav[0]; cac--, cav++; } } if (getfiles(&cac, &cav, opts) != 0) { errmsgno(EX_BAD, "Bad Argument: '%s'\n", cav[0]); usage(EX_BAD); } if (filename != NULL && devname != NULL) { errmsgno(EX_BAD, "Only one of -i or dev= allowed\n"); usage(EX_BAD); } #ifdef USE_SCG if (filename == NULL && devname == NULL) cdr_defaults(&devname, NULL, NULL, NULL); #endif if (filename == NULL && devname == NULL) { errmsgno(EX_BAD, "ISO-9660 image not specified\n"); usage(EX_BAD); } if (filename != NULL) infile = fopen(filename, "rb"); else filename = devname; if (infile != NULL) { /* EMPTY */; #ifdef USE_SCG } else if (scsidev_open(filename) < 0) { #else } else { #endif comerr("Cannot open '%s'\n", filename); } p = isodinfo(infile); if (p == NULL) { printf("No ISO-9660 image debug info.\n"); } else if (strncmp(p, "MKI ", 4) == 0) { eol = strchr(p, '\n'); if (eol) *eol = '\0'; printf("ISO-9660 image created at %s\n", &p[4]); if (eol) { printf("\nCmdline: '%s'\n", &eol[1]); } } return (0); } cdrkit-1.1.11/genisoimage/diag/devdump.10000644000372500001440000000005410536101176017044 0ustar steveusers.so man1/isoinfo.1 .\" %Z%%M% %I% %E% joerg cdrkit-1.1.11/genisoimage/diag/isodebug.10000644000372500001440000000461710536101176017212 0ustar steveusers.\" @(#)isodebug.8 1.1 06/02/08 Copyr 2006 J. Schilling .\" Manual page for isodebug .\" Modified for cdrkit distribution by E.Bloch .\" .if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a .if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o .if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u .if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A .if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O .if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U .if t .ds s \\(*b .if t .ds S SS .if n .ds a ae .if n .ds o oe .if n .ds u ue .if n .ds s sz .TH ISODEBUG 1 "06/02/08" "J\*org Schilling" "Schily\'s USER COMMANDS" .SH NAME isodebug \- print genisoimage debug info from ISO-9660 image .SH SYNOPSIS .B isodebug [ .I options ] [ .I file ] .SH DESCRIPTION .B Isodebug reads the debug info written by .BR genisoimage (8) from within a ISO-9660 file system image and prints them. . \" .SH RETURNS . \" .SH ERRORS .SH OPTIONS .TP .B \-help Prints a short summary of the .B isodebug options and exists. .TP .B \-version Prints the .B isodebug version number string and exists. .TP .BI \-i " filename Filename to read ISO-9660 image from. .TP .BI dev= target SCSI target to use as CD/DVD-Recorder. See .BR wodim (1) for more information on now to use this option. .SH FILES .SH "SEE ALSO" .BR wodim (1), .BR genisoimage (1). .SH AUTHOR .nf J\*org Schilling Seestr. 110 D-13353 Berlin Germany .fi .PP .SH AUTHOR .nf J\*org Schilling Seestr. 110 D-13353 Berlin Germany .fi .PP This manpage describes the program implementation of .B isodebug as shipped by the cdrkit distribution. See .B http://alioth.debian.org/projects/debburn/ for details. It is a spinoff from the original program distributed in the cdrtools package [1]. However, the cdrtools developers are not involved in the development of this spinoff and therefore shall not be made responsible for any problem caused by it. Do not try to get support for this program by contacting the original author(s). .PP If you have support questions, send them to .PP .B debburn-devel@lists.alioth.debian.org .br .PP If you have definitely found a bug, send a mail to this list or to .PP .B submit@bugs.debian.org .br .PP writing at least a short description into the Subject and "Package: cdrkit" into the first line of the mail body. .PP .br [1] Cdrtools 2.01.01a08 from May 2006, http://cdrecord.berlios.de cdrkit-1.1.11/genisoimage/rock.c0000644000372500001440000005370010536265343015531 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)rock.c 1.43 05/05/01 joerg */ /* * File rock.c - generate RRIP records for iso9660 filesystems. * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999,2000-2003 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "genisoimage.h" #include #include #define SU_VERSION 1 #define SL_ROOT 8 #define SL_PARENT 4 #define SL_CURRENT 2 #define SL_CONTINUE 1 #define CE_SIZE 28 /* SUSP Continuation aerea */ #define CL_SIZE 12 /* RR Child Link for deep dir relocation */ #define ER_SIZE 8 /* RR Extension record for RR signature */ #define NM_SIZE 5 /* RR Real name */ #define PL_SIZE 12 /* RR Paren Link for deep dir relocation */ #define PN_SIZE 20 /* RR POSIX device modes (Major/Minor) */ #define PX_SIZE 36 /* RR POSIX Extensions (mode/nlink(uid/gid) */ #define RE_SIZE 4 /* RR Relocated directory */ #define RR_SIZE 5 /* RR RR Signature in every file */ #define SL_SIZE 20 /* RR Symlink */ #define ZF_SIZE 16 /* RR* Linux compression extension */ #ifdef APPLE_HYB #define AA_SIZE 14 /* size of Apple extension */ #endif /* APPLE_HYB */ #if defined(__QNX__) && !defined(__QNXNTO__) /* Not on Neutrino! never OK? */ #define TF_SIZE (5 + 4 * 7) /* RR Time field */ #else #define TF_SIZE (5 + 3 * 7) #endif static void rstrncpy(char *t, char *f, int c, struct unls_table *inls, struct unls_table *onls); static void add_CE_entry(char *field, int line); static int gen_xa_attr(mode_t attr); static void gen_xa(struct stat *lstatbuf); int generate_xa_rr_attributes(char *whole_name, char *name, struct directory_entry *s_entry, struct stat *statbuf, struct stat *lstatbuf, int deep_opt); char *generate_rr_extension_record(char *id, char *descriptor, char *source, int *size); /* * If we need to store this number of bytes, make sure we * do not box ourselves in so that we do not have room for * a CE entry for the continuation record */ #define RR_CUR_USE (CE_SIZE + currlen + (ipnt - recstart)) #define MAYBE_ADD_CE_ENTRY(BYTES) \ (((int)(BYTES)) + CE_SIZE + currlen + (ipnt - recstart) > reclimit ? 1 : 0) /* * Buffer to build RR attributes */ static Uchar Rock[16384]; static Uchar symlink_buff[PATH_MAX+1]; static int ipnt = 0; /* Current "write" offset in Rock[] */ static int recstart = 0; /* Start offset in Rock[] for this area */ static int currlen = 0; /* # of non RR bytes used in this area */ static int mainrec = 0; /* # of RR bytes use in main dir area */ static int reclimit; /* Max. # of bytes usable in this area */ /* if we are using converted filenames, we don't want the '/' character */ static void rstrncpy(char *t, char *f, int c, struct unls_table *inls, struct unls_table *onls) { while (c-- && *f) { *t = conv_charset(*f, inls, onls); if (*t == '/') { *t = '_'; } t++; f++; } } static void add_CE_entry(char *field, int line) { if (MAYBE_ADD_CE_ENTRY(0)) { errmsgno(EX_BAD, "Panic: no space, cannot add RR CE entry (%d bytes mising) for %s line %d.\n", (CE_SIZE + currlen + (ipnt - recstart) - reclimit), field, line); errmsgno(EX_BAD, "currlen: %d ipnt: %d, recstart: %d\n", currlen, ipnt, recstart); errmsgno(EX_BAD, "Send bug report to the maintainer.\n"); comerrno(EX_BAD, "Aborting.\n"); } if (recstart) set_733((char *) Rock + recstart - 8, ipnt + 28 - recstart); Rock[ipnt++] = 'C'; Rock[ipnt++] = 'E'; Rock[ipnt++] = CE_SIZE; Rock[ipnt++] = SU_VERSION; set_733((char *) Rock + ipnt, 0); ipnt += 8; set_733((char *) Rock + ipnt, 0); ipnt += 8; set_733((char *) Rock + ipnt, 0); ipnt += 8; recstart = ipnt; currlen = 0; if (!mainrec) mainrec = ipnt; reclimit = SECTOR_SIZE - 8; /* Limit to one sector */ } static int gen_xa_attr(mode_t attr) { int ret = 0; if (attr & S_IRUSR) ret |= XA_O_READ; if (attr & S_IXUSR) ret |= XA_O_EXEC; if (attr & S_IRGRP) ret |= XA_G_READ; if (attr & S_IXGRP) ret |= XA_G_EXEC; if (attr & S_IROTH) ret |= XA_W_READ; if (attr & S_IXOTH) ret |= XA_W_EXEC; ret |= XA_FORM1; if (S_ISDIR(attr)) ret |= XA_DIR; return (ret); } static void gen_xa(struct stat *lstatbuf) { /* * Group ID */ set_722((char *) Rock + ipnt, lstatbuf->st_gid); ipnt += 2; /* * User ID */ set_722((char *) Rock + ipnt, lstatbuf->st_uid); ipnt += 2; /* * Attributes */ set_722((char *) Rock + ipnt, gen_xa_attr(lstatbuf->st_mode)); ipnt += 2; Rock[ipnt++] = 'X'; /* XA Signature */ Rock[ipnt++] = 'A'; Rock[ipnt++] = 0; /* File number (we always use '0' */ Rock[ipnt++] = 0; /* Reserved (5 Byte) */ Rock[ipnt++] = 0; Rock[ipnt++] = 0; Rock[ipnt++] = 0; Rock[ipnt++] = 0; } int generate_xa_rr_attributes(char *whole_name, char *name, struct directory_entry *s_entry, struct stat *statbuf, struct stat *lstatbuf, int deep_opt) { int flagpos; int flagval; int need_ce; statbuf = statbuf; /* this shuts up unreferenced compiler */ /* warnings */ mainrec = recstart = ipnt = 0; if (use_XA) { gen_xa(lstatbuf); } /* reclimit = 0xf8; XXX we now use 254 == 0xfe */ reclimit = MAX_ISODIR; /* no need to fill in the RR stuff if we won't see the file */ if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) return (0); /* * Obtain the amount of space that is currently used for the directory * record. We may safely use the current name length; because if name * confilcts force us to change the ISO-9660 name later, the name will * never become longer than now. */ if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) { s_entry->isorec.name_len[0] = 1; } else { s_entry->isorec.name_len[0] = strlen(s_entry->isorec.name); } currlen = s_entry->isorec.length[0] = s_entry->isorec.name_len[0] + offsetof(struct iso_directory_record, name[0]); if (currlen & 1) s_entry->isorec.length[0] = ++currlen; if (currlen < 33+37) { /* * If the ISO-9660 name length is less than 37, we may use * ISO-9660:1988 name rules and for this reason, the name len * may later increase from adding e.g. ".;1"; in this case * just use the upper limit. */ currlen = 33+37; } #ifdef APPLE_HYB /* if we have regular file, then add Apple extensions */ if (S_ISREG(lstatbuf->st_mode) && apple_ext && s_entry->hfs_ent) { if (MAYBE_ADD_CE_ENTRY(AA_SIZE)) add_CE_entry("AA", __LINE__); Rock[ipnt++] = 'A'; /* AppleSignature */ Rock[ipnt++] = 'A'; Rock[ipnt++] = AA_SIZE; /* includes AppleSignature bytes */ Rock[ipnt++] = 0x02; /* SystemUseID */ Rock[ipnt++] = s_entry->hfs_ent->u.file.type[0]; Rock[ipnt++] = s_entry->hfs_ent->u.file.type[1]; Rock[ipnt++] = s_entry->hfs_ent->u.file.type[2]; Rock[ipnt++] = s_entry->hfs_ent->u.file.type[3]; Rock[ipnt++] = s_entry->hfs_ent->u.file.creator[0]; Rock[ipnt++] = s_entry->hfs_ent->u.file.creator[1]; Rock[ipnt++] = s_entry->hfs_ent->u.file.creator[2]; Rock[ipnt++] = s_entry->hfs_ent->u.file.creator[3]; Rock[ipnt++] = (s_entry->hfs_ent->fdflags >> 8) & 0xff; Rock[ipnt++] = s_entry->hfs_ent->fdflags & 0xff; } #endif /* APPLE_HYB */ if (!use_RockRidge) goto xa_only; /* Identify that we are using the SUSP protocol */ if (deep_opt & NEED_SP) { /* * We may not use a CE record here but we never will need to * do so, as this SP record is only used for the "." entry * of the root directory. */ Rock[ipnt++] = 'S'; Rock[ipnt++] = 'P'; Rock[ipnt++] = 7; Rock[ipnt++] = SU_VERSION; Rock[ipnt++] = 0xbe; Rock[ipnt++] = 0xef; if (use_XA) Rock[ipnt++] = sizeof (struct iso_xa_dir_record); else Rock[ipnt++] = 0; } /* First build the posix name field */ if (MAYBE_ADD_CE_ENTRY(RR_SIZE)) add_CE_entry("RR", __LINE__); Rock[ipnt++] = 'R'; Rock[ipnt++] = 'R'; Rock[ipnt++] = 5; Rock[ipnt++] = SU_VERSION; flagpos = ipnt; flagval = 0; Rock[ipnt++] = 0; /* We go back and fix this later */ if (strcmp(name, ".") && strcmp(name, "..")) { char *npnt; int remain; /* Remaining name length */ int use; /* Current name part used */ #ifdef APPLE_HYB /* use the HFS name if it exists */ if (USE_MAC_NAME(s_entry)) { remain = strlen(s_entry->hfs_ent->name); npnt = s_entry->hfs_ent->name; } else { #endif /* APPLE_HYB */ remain = strlen(name); npnt = name; #ifdef APPLE_HYB } #endif /* APPLE_HYB */ if (MAYBE_ADD_CE_ENTRY(NM_SIZE+1)) add_CE_entry("NM", __LINE__); while (remain) { use = remain; need_ce = 0; /* Can we fit this SUSP and a CE entry? */ if (MAYBE_ADD_CE_ENTRY(NM_SIZE+use)) { use = reclimit - NM_SIZE - RR_CUR_USE; need_ce++; } /* Only room for 256 per SUSP field */ if (use > 0xf8) { use = 0xf8; need_ce++; } if (use < 0) { comerrno(EX_BAD, "Negative RR name length residual: %d\n", use); } /* First build the posix name field */ Rock[ipnt++] = 'N'; Rock[ipnt++] = 'M'; Rock[ipnt++] = NM_SIZE + use; Rock[ipnt++] = SU_VERSION; Rock[ipnt++] = (remain != use ? 1 : 0); flagval |= (1 << 3); /* convert charsets as required */ #ifdef APPLE_HYB if (USE_MAC_NAME(s_entry)) rstrncpy((char *) &Rock[ipnt], npnt, use, hfs_inls, out_nls); else #endif /* APPLE_HYB */ rstrncpy((char *) &Rock[ipnt], npnt, use, in_nls, out_nls); npnt += use; ipnt += use; remain -= use; if (remain && need_ce) add_CE_entry("NM", __LINE__); } } /* Add the posix modes */ if (MAYBE_ADD_CE_ENTRY(PX_SIZE)) add_CE_entry("PX", __LINE__); Rock[ipnt++] = 'P'; Rock[ipnt++] = 'X'; Rock[ipnt++] = PX_SIZE; Rock[ipnt++] = SU_VERSION; flagval |= (1 << 0); set_733((char *) Rock + ipnt, lstatbuf->st_mode); ipnt += 8; set_733((char *) Rock + ipnt, lstatbuf->st_nlink); ipnt += 8; set_733((char *) Rock + ipnt, lstatbuf->st_uid); ipnt += 8; set_733((char *) Rock + ipnt, lstatbuf->st_gid); ipnt += 8; /* Check for special devices */ #if defined(S_IFCHR) || defined(S_IFBLK) /* * The code in this if statement used to be #ifdef'd with NON_UNIXFS. * But as statdefs.h always provides the macros S_ISCHR() & S_ISBLK() * and device.h always provides major()/minor() it is not needed * anymore. */ if (S_ISCHR(lstatbuf->st_mode) || S_ISBLK(lstatbuf->st_mode)) { if (MAYBE_ADD_CE_ENTRY(PN_SIZE)) add_CE_entry("PN", __LINE__); Rock[ipnt++] = 'P'; Rock[ipnt++] = 'N'; Rock[ipnt++] = PN_SIZE; Rock[ipnt++] = SU_VERSION; flagval |= (1 << 1); #if 1 /* This is the new and only code which uses */ set_733((char *) Rock + ipnt, major(lstatbuf->st_rdev)); ipnt += 8; set_733((char *) Rock + ipnt, minor(lstatbuf->st_rdev)); ipnt += 8; #else /* * If we don't have sysmacros.h, then we have to guess as to * how best to pick apart the device number for major/minor. * Note: this may very well be wrong for many systems, so it * is always best to use the major/minor macros if the system * supports it. */ if (sizeof (dev_t) <= 2) { set_733((char *)Rock + ipnt, (lstatbuf->st_rdev >> 8)); ipnt += 8; set_733((char *)Rock + ipnt, lstatbuf->st_rdev & 0xff); ipnt += 8; } else if (sizeof (dev_t) <= 4) { set_733((char *)Rock + ipnt, (lstatbuf->st_rdev >> 8) >> 8); ipnt += 8; set_733((char *)Rock + ipnt, lstatbuf->st_rdev & 0xffff); ipnt += 8; } else { set_733((char *)Rock + ipnt, (lstatbuf->st_rdev >> 16)>>16); ipnt += 8; set_733((char *)Rock + ipnt, lstatbuf->st_rdev); ipnt += 8; } #endif } #endif /* defined(S_IFCHR) || defined(S_IFBLK) */ /* Check for and symbolic links. VMS does not have these. */ #ifdef S_IFLNK if (S_ISLNK(lstatbuf->st_mode)) { int lenpos; int lenval; int j0; int j1; int nchar; Uchar *cpnt; Uchar *cpnt1; #ifdef HAVE_READLINK nchar = readlink(whole_name, (char *)symlink_buff, sizeof (symlink_buff)-1); #else nchar = -1; #endif /* HAVE_READLINK */ symlink_buff[nchar < 0 ? 0 : nchar] = 0; nchar = strlen((char *) symlink_buff); set_733(s_entry->isorec.size, 0); cpnt = &symlink_buff[0]; flagval |= (1 << 2); if (!split_SL_field) { int sl_bytes = 0; for (cpnt1 = cpnt; *cpnt1 != '\0'; cpnt1++) { if (*cpnt1 == '/') { sl_bytes += 4; } else { sl_bytes += 1; } } if (sl_bytes > 250) { /* * the symbolic link won't fit into one * SL System Use Field print an error message * and continue with splited one */ fprintf(stderr, "symbolic link ``%s'' to long for one SL System Use Field, splitting", cpnt); } if (MAYBE_ADD_CE_ENTRY(SL_SIZE + sl_bytes)) add_CE_entry("SL+", __LINE__); } while (nchar) { if (MAYBE_ADD_CE_ENTRY(SL_SIZE)) add_CE_entry("SL", __LINE__); Rock[ipnt++] = 'S'; Rock[ipnt++] = 'L'; lenpos = ipnt; Rock[ipnt++] = SL_SIZE; Rock[ipnt++] = SU_VERSION; Rock[ipnt++] = 0; /* Flags */ lenval = 5; while (*cpnt) { cpnt1 = (Uchar *) strchr((char *)cpnt, '/'); if (cpnt1) { nchar--; *cpnt1 = 0; } /* * We treat certain components in a special * way. */ if (cpnt[0] == '.' && cpnt[1] == '.' && cpnt[2] == 0) { if (MAYBE_ADD_CE_ENTRY(2)) { add_CE_entry("SL-parent", __LINE__); if (cpnt1) { *cpnt1 = '/'; nchar++; /* * A kluge so that we * can restart properly */ cpnt1 = NULL; } break; } Rock[ipnt++] = SL_PARENT; Rock[ipnt++] = 0; /* length is zero */ lenval += 2; nchar -= 2; } else if (cpnt[0] == '.' && cpnt[1] == 0) { if (MAYBE_ADD_CE_ENTRY(2)) { add_CE_entry("SL-current", __LINE__); if (cpnt1) { *cpnt1 = '/'; nchar++; /* * A kluge so that we * can restart properly */ cpnt1 = NULL; } break; } Rock[ipnt++] = SL_CURRENT; Rock[ipnt++] = 0; /* length is zero */ lenval += 2; nchar -= 1; } else if (cpnt[0] == 0) { if (MAYBE_ADD_CE_ENTRY(2)) { add_CE_entry("SL-root", __LINE__); if (cpnt1) { *cpnt1 = '/'; nchar++; /* * A kluge so that we * can restart properly */ cpnt1 = NULL; } break; } Rock[ipnt++] = SL_ROOT; Rock[ipnt++] = 0; /* length is zero */ lenval += 2; } else { /* * If we do not have enough room for a * component, start a new continuations * segment now */ if (split_SL_component ? MAYBE_ADD_CE_ENTRY(6) : MAYBE_ADD_CE_ENTRY(6 + strlen((char *) cpnt))) { add_CE_entry("SL++", __LINE__); if (cpnt1) { *cpnt1 = '/'; nchar++; /* * A kluge so that we * can restart properly */ cpnt1 = NULL; } break; } j0 = strlen((char *) cpnt); while (j0) { j1 = j0; if (j1 > 0xf8) j1 = 0xf8; need_ce = 0; if (j1 + currlen + 2 + CE_SIZE + (ipnt - recstart) > reclimit) { j1 = reclimit - (currlen + 2) - CE_SIZE - (ipnt - recstart); need_ce++; } Rock[ipnt++] = (j1 != j0 ? SL_CONTINUE : 0); Rock[ipnt++] = j1; strncpy((char *)Rock + ipnt, (char *) cpnt, j1); ipnt += j1; lenval += j1 + 2; cpnt += j1; /* * Number we processed * this time */ nchar -= j1; j0 -= j1; if (need_ce) { add_CE_entry( "SL-path-split", __LINE__); if (cpnt1) { *cpnt1 = '/'; nchar++; /* * A kluge so * that we can * restart * properly */ cpnt1 = NULL; } break; } } } if (cpnt1) { cpnt = cpnt1 + 1; } else break; } Rock[lenpos] = lenval; if (nchar) { /* We need another SL entry */ Rock[lenpos + 2] = SL_CONTINUE; } } /* while nchar */ } /* Is a symbolic link */ #endif /* S_IFLNK */ /* Add in the Rock Ridge TF time field */ if (MAYBE_ADD_CE_ENTRY(TF_SIZE)) add_CE_entry("TF", __LINE__); Rock[ipnt++] = 'T'; Rock[ipnt++] = 'F'; Rock[ipnt++] = TF_SIZE; Rock[ipnt++] = SU_VERSION; #if defined(__QNX__) && !defined(__QNXNTO__) /* Not on Neutrino! never OK? */ Rock[ipnt++] = 0x0f; #else Rock[ipnt++] = 0x0e; #endif flagval |= (1 << 7); #if defined(__QNX__) && !defined(__QNXNTO__) /* Not on Neutrino! never OK? */ iso9660_date((char *) &Rock[ipnt], lstatbuf->st_ftime); ipnt += 7; #endif iso9660_date((char *) &Rock[ipnt], lstatbuf->st_mtime); ipnt += 7; iso9660_date((char *) &Rock[ipnt], lstatbuf->st_atime); ipnt += 7; iso9660_date((char *) &Rock[ipnt], lstatbuf->st_ctime); ipnt += 7; /* Add in the Rock Ridge RE (relocated dir) field */ if (deep_opt & NEED_RE) { if (MAYBE_ADD_CE_ENTRY(RE_SIZE)) add_CE_entry("RE", __LINE__); Rock[ipnt++] = 'R'; Rock[ipnt++] = 'E'; Rock[ipnt++] = RE_SIZE; Rock[ipnt++] = SU_VERSION; flagval |= (1 << 6); } /* Add in the Rock Ridge PL record, if required. */ if (deep_opt & NEED_PL) { if (MAYBE_ADD_CE_ENTRY(PL_SIZE)) add_CE_entry("PL", __LINE__); Rock[ipnt++] = 'P'; Rock[ipnt++] = 'L'; Rock[ipnt++] = PL_SIZE; Rock[ipnt++] = SU_VERSION; set_733((char *) Rock + ipnt, 0); ipnt += 8; flagval |= (1 << 5); } /* Add in the Rock Ridge CL field, if required. */ if (deep_opt & NEED_CL) { if (MAYBE_ADD_CE_ENTRY(CL_SIZE)) add_CE_entry("CL", __LINE__); Rock[ipnt++] = 'C'; Rock[ipnt++] = 'L'; Rock[ipnt++] = CL_SIZE; Rock[ipnt++] = SU_VERSION; set_733((char *) Rock + ipnt, 0); ipnt += 8; flagval |= (1 << 4); } #ifndef VMS /* * If transparent compression was requested, fill in the correct field * for this file, if (and only if) it is actually a compressed file! * This relies only on magic number, but it should in general not * be an issue since if you're using -z odds are most of your * files are already compressed. * * In the future it would be nice if genisoimage actually did the * compression. */ if (transparent_compression && S_ISREG(lstatbuf->st_mode)) { static const Uchar zisofs_magic[8] = { 0x37, 0xE4, 0x53, 0x96, 0xC9, 0xDB, 0xD6, 0x07 }; FILE *zffile; unsigned int file_size; Uchar header[16]; int OK_flag; int blocksize; int headersize; /* * First open file and verify that the correct algorithm was * used */ file_size = 0; OK_flag = 1; memset(header, 0, sizeof (header)); zffile = fopen(whole_name, "rb"); if (zffile != NULL) { if (fread(header, 1, sizeof (header), zffile) != sizeof (header)) OK_flag = 0; /* Check magic number */ if (memcmp(header, zisofs_magic, sizeof (zisofs_magic))) OK_flag = 0; /* Get the real size of the file */ file_size = get_731((char *)header+8); /* Get the header size (>> 2) */ headersize = header[12]; /* Get the block size (log2) */ blocksize = header[13]; fclose(zffile); } else { OK_flag = 0; blocksize = headersize = 0; /* Make silly GCC quiet */ } if (OK_flag) { if (MAYBE_ADD_CE_ENTRY(ZF_SIZE)) add_CE_entry("ZF", __LINE__); Rock[ipnt++] = 'Z'; Rock[ipnt++] = 'F'; Rock[ipnt++] = ZF_SIZE; Rock[ipnt++] = SU_VERSION; Rock[ipnt++] = 'p'; /* Algorithm: "paged zlib" */ Rock[ipnt++] = 'z'; /* 2 bytes for algorithm-specific information */ Rock[ipnt++] = headersize; Rock[ipnt++] = blocksize; set_733((char *) Rock + ipnt, file_size); /* Real file size */ ipnt += 8; } } #endif /* * Add in the Rock Ridge CE field, if required. We use this for the * extension record that is stored in the root directory. */ if (deep_opt & NEED_CE) add_CE_entry("ER", __LINE__); /* * Done filling in all of the fields. Now copy it back to a buffer * for the file in question. */ /* Now copy this back to the buffer for the file */ Rock[flagpos] = flagval; /* If there was a CE, fill in the size field */ if (recstart) set_733((char *) Rock + recstart - 8, ipnt - recstart); xa_only: s_entry->rr_attributes = (Uchar *) e_malloc(ipnt); s_entry->total_rr_attr_size = ipnt; s_entry->rr_attr_size = (mainrec ? mainrec : ipnt); memcpy(s_entry->rr_attributes, Rock, ipnt); return (ipnt); } /* * Guaranteed to return a single sector with the relevant info */ char * generate_rr_extension_record(char *id, char *descriptor, char *source, int *size) { int lipnt = 0; char *pnt; int len_id; int len_des; int len_src; len_id = strlen(id); len_des = strlen(descriptor); len_src = strlen(source); Rock[lipnt++] = 'E'; Rock[lipnt++] = 'R'; Rock[lipnt++] = ER_SIZE + len_id + len_des + len_src; Rock[lipnt++] = 1; Rock[lipnt++] = len_id; Rock[lipnt++] = len_des; Rock[lipnt++] = len_src; Rock[lipnt++] = 1; memcpy(Rock + lipnt, id, len_id); lipnt += len_id; memcpy(Rock + lipnt, descriptor, len_des); lipnt += len_des; memcpy(Rock + lipnt, source, len_src); lipnt += len_src; if (lipnt > SECTOR_SIZE) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Extension record too long\n"); #else fprintf(stderr, "Extension record too long\n"); exit(1); #endif } pnt = (char *) e_malloc(SECTOR_SIZE); memset(pnt, 0, SECTOR_SIZE); memcpy(pnt, Rock, lipnt); *size = lipnt; return (pnt); } cdrkit-1.1.11/genisoimage/checksum.c0000644000372500001440000003337711202672414016375 0ustar steveusers/* * checksum.c * * Copyright (c) 2008- Steve McIntyre * * Implementation of a generic checksum interface, used in JTE. * * GNU GPL v2 */ #include #include "genisoimage.h" #include #include #include #include #include #include #include "md5.h" #include "sha1.h" #include "sha256.h" #include "sha512.h" #include "checksum.h" #ifdef THREADED_CHECKSUMS # include #endif static void md5_init(void *context) { mk_MD5Init(context); } static void md5_update(void *context, unsigned char const *buf, unsigned int len) { mk_MD5Update(context, buf, len); } static void md5_final(unsigned char *digest, void *context) { mk_MD5Final(digest, context); } static void sha1_init(void *context) { sha1_init_ctx(context); } static void sha1_update(void *context, unsigned char const *buf, unsigned int len) { sha1_process_bytes(buf, len, context); } static void sha1_final(unsigned char *digest, void *context) { sha1_finish_ctx(context, digest); } static void sha256_init(void *context) { sha256_init_ctx(context); } static void sha256_update(void *context, unsigned char const *buf, unsigned int len) { sha256_process_bytes(buf, len, context); } static void sha256_final(unsigned char *digest, void *context) { sha256_finish_ctx(context, digest); } static void sha512_init(void *context) { sha512_init_ctx(context); } static void sha512_update(void *context, unsigned char const *buf, unsigned int len) { sha512_process_bytes(buf, len, context); } static void sha512_final(unsigned char *digest, void *context) { sha512_finish_ctx(context, digest); } struct checksum_details { char *name; char *prog; int digest_size; int context_size; void (*init)(void *context); void (*update)(void *context, unsigned char const *buf, unsigned int len); void (*final)(unsigned char *digest, void *context); }; static const struct checksum_details algorithms[] = { { "MD5", "md5sum", 16, sizeof(struct mk_MD5Context), md5_init, md5_update, md5_final }, { "SHA1", "sha1sum", 20, sizeof(struct sha1_ctx), sha1_init, sha1_update, sha1_final }, { "SHA256", "sha256sum", 32, sizeof(struct sha256_ctx), sha256_init, sha256_update, sha256_final }, { "SHA512", "sha512sum", 64, sizeof(struct sha512_ctx), sha512_init, sha512_update, sha512_final } }; struct algo_context { void *context; unsigned char *digest; int enabled; int finalised; char *hexdump; #ifdef THREADED_CHECKSUMS unsigned char const *buf; unsigned int len; int which; pthread_t thread; struct _checksum_context *parent; pthread_mutex_t start_mutex; pthread_cond_t start_cv; #endif }; struct _checksum_context { #ifdef THREADED_CHECKSUMS unsigned int index; unsigned int threads_running; unsigned int threads_desired; pthread_mutex_t done_mutex; pthread_cond_t done_cv; #endif char *owner; struct algo_context algo[NUM_CHECKSUMS]; }; struct checksum_info *checksum_information(enum checksum_types which) { return (struct checksum_info *)&algorithms[which]; } /* Dump a buffer in hex */ static void hex_dump_to_buffer(char *output_buffer, unsigned char *buf, size_t buf_size) { unsigned int i; char *p = output_buffer; memset(output_buffer, 0, 1 + (2*buf_size)); for (i = 0; i < buf_size ; i++) p += sprintf(p, "%2.2x", buf[i]); } #ifdef THREADED_CHECKSUMS static void *checksum_thread(void *arg) { struct algo_context *a = arg; struct _checksum_context *c = a->parent; int num_blocks_summed = 0; while (1) { /* wait to be given some work to do */ pthread_mutex_lock(&a->start_mutex); while (a->buf == NULL) { pthread_cond_wait(&a->start_cv, &a->start_mutex); } pthread_mutex_unlock(&a->start_mutex); /* if we're given a zero-length buffer, then that means we're * done */ if (a->len == 0) break; /* actually do the checksum on the supplied buffer */ algorithms[a->which].update(a->context, a->buf, a->len); num_blocks_summed++; a->buf = NULL; /* and tell the main thread that we're done with that * buffer */ pthread_mutex_lock(&c->done_mutex); c->threads_running--; if (c->threads_running == 0) pthread_cond_signal(&c->done_cv); pthread_mutex_unlock(&c->done_mutex); } pthread_exit(0); } #endif checksum_context_t *checksum_init_context(int checksums, const char *owner) { int i = 0; int ret = 0; struct _checksum_context *context = calloc(1, sizeof(struct _checksum_context)); if (!context) return NULL; context->owner = strdup(owner); if (!context->owner) { free(context); return NULL; } #ifdef THREADED_CHECKSUMS pthread_mutex_init(&context->done_mutex, NULL); pthread_cond_init(&context->done_cv, NULL); context->index = 0; context->threads_running = 0; context->threads_desired = 0; for (i = 0; i < NUM_CHECKSUMS; i++) if ( (1 << i) & checksums) context->threads_desired++; #endif for (i = 0; i < NUM_CHECKSUMS; i++) { struct algo_context *a = &context->algo[i]; if ( (1 << i) & checksums) { a->context = malloc(algorithms[i].context_size); if (!a->context) { checksum_free_context(context); return NULL; } a->digest = malloc(algorithms[i].digest_size); if (!a->digest) { checksum_free_context(context); return NULL; } a->hexdump = malloc(1 + (2*algorithms[i].digest_size)); if (!a->hexdump) { checksum_free_context(context); return NULL; } algorithms[i].init(a->context); a->enabled = 1; a->finalised = 0; #ifdef THREADED_CHECKSUMS a->which = i; a->parent = context; a->buf = NULL; a->len = 0; pthread_mutex_init(&a->start_mutex, NULL); pthread_cond_init(&a->start_cv, NULL); ret = pthread_create(&a->thread, NULL, checksum_thread, a); if (ret != 0) { fprintf(stderr, "failed to create new thread: %d\n", ret); checksum_free_context(context); return NULL; } #endif } else a->enabled = 0; } return context; } void checksum_free_context(checksum_context_t *context) { int i = 0; struct _checksum_context *c = context; for (i = 0; i < NUM_CHECKSUMS; i++) { struct algo_context *a = &c->algo[i]; #ifdef THREADED_CHECKSUMS if (a->thread) { void *ret; pthread_cancel(a->thread); pthread_join(a->thread, &ret); a->thread = 0; } #endif free(a->context); free(a->digest); free(a->hexdump); } free(c->owner); free(c); } #ifdef THREADED_CHECKSUMS void checksum_update(checksum_context_t *context, unsigned char const *buf, unsigned int len) { int i = 0; struct _checksum_context *c = context; static int index = 0; index++; c->threads_running = c->threads_desired; for (i = 0; i < NUM_CHECKSUMS; i++) { if (c->algo[i].enabled) { struct algo_context *a = &c->algo[i]; pthread_mutex_lock(&a->start_mutex); a->len = len; a->buf = buf; pthread_cond_signal(&a->start_cv); pthread_mutex_unlock(&a->start_mutex); } } /* Should now all be running, wait on them all to return */ pthread_mutex_lock(&c->done_mutex); while (c->threads_running > 0) { pthread_cond_wait(&c->done_cv, &c->done_mutex); } pthread_mutex_unlock(&c->done_mutex); } #else // THREADED_CHECKSUMS void checksum_update(checksum_context_t *context, unsigned char const *buf, unsigned int len) { int i = 0; struct _checksum_context *c = context; for (i = 0; i < NUM_CHECKSUMS; i++) { if (c->algo[i].enabled) { struct algo_context *a = &c->algo[i]; algorithms[i].update(a->context, buf, len); } } } #endif // THREADED_CHECKSUMS void checksum_final(checksum_context_t *context) { int i = 0; struct _checksum_context *c = context; #ifdef THREADED_CHECKSUMS void *thread_ret; /* Clean up the threads */ c->threads_running = c->threads_desired; for (i = 0; i < NUM_CHECKSUMS; i++) { if (c->algo[i].enabled) { void *ret = 0; struct algo_context *a = &c->algo[i]; pthread_mutex_lock(&a->start_mutex); a->len = 0; a->buf = (unsigned char *)-1; pthread_cond_signal(&a->start_cv); pthread_mutex_unlock(&a->start_mutex); pthread_join(a->thread, &ret); a->thread = 0; } } #endif for (i = 0; i < NUM_CHECKSUMS; i++) { struct algo_context *a = &c->algo[i]; if (a->enabled) { algorithms[i].final(a->digest, a->context); hex_dump_to_buffer(a->hexdump, a->digest, algorithms[i].digest_size); a->finalised = 1; } } } void checksum_copy(checksum_context_t *context, enum checksum_types which, unsigned char *digest) { struct _checksum_context *c = context; if (c->algo[which].enabled) { if (c->algo[which].finalised) memcpy(digest, c->algo[which].digest, algorithms[which].digest_size); else memset(digest, 0, algorithms[which].digest_size); } else fprintf(stderr, "Asked for %s checksum, not enabled!\n", algorithms[which].name); } const char *checksum_hex(checksum_context_t *context, enum checksum_types which) { struct _checksum_context *c = context; if (c->algo[which].enabled && c->algo[which].finalised) return c->algo[which].hexdump; /* else */ return NULL; } /* Parse the command line options for which checksums to use */ int parse_checksum_algo(char *arg, int *algo) { int error = 0; int i = 0; char *start_ptr = arg; int len = 0; *algo = 0; if (!strcasecmp(arg, "all")) { *algo = 0xFF; return 0; } while (*start_ptr != 0) { int match = 0; len = 0; while (start_ptr[len] != ',' && start_ptr[len] != 0) len++; if (len) { for (i = 0; i < NUM_CHECKSUMS; i++) { if (len == strlen(algorithms[i].name) && !strncasecmp(start_ptr, algorithms[i].name, len)) { match = 1; *algo |= (1 << i); } } if (!match) { fprintf(stderr, "invalid algorithm name found in %s\n", arg); return EINVAL; } } if (start_ptr[len] == 0) break; start_ptr += len + 1; } if (! (*algo & CHECK_MD5_USED)) { fprintf(stderr, "invalid choices: algorithms *must* include MD5\n"); return EINVAL; } return 0; } #ifdef CHECKSUM_SELF_TEST #include #include #include #include #include #include int main(int argc, char **argv) { char buf[1024]; int fd = -1; char *filename; int err = 0; static checksum_context_t *test_context = NULL; int i = 0; if (argc != 2) { fprintf(stderr, "Need a filename to act on!\n"); return 1; } filename = argv[1]; fd = open(filename, O_RDONLY); if (fd < 0) { fprintf(stderr, "Unable to open file %s, errno %d\n", filename, errno); return 1; } test_context = checksum_init_context(CHECK_ALL_USED, "test"); if (!test_context) { fprintf(stderr, "Unable to initialise checksum context\n"); return 1; } while(1) { err = read(fd, buf, sizeof(buf)); if (err < 0) { fprintf(stderr, "Failed to read from file, errno %d\n", errno); return 1; } if (err == 0) break; // EOF /* else */ checksum_update(test_context, buf, err); } close(fd); checksum_final(test_context); for (i = 0; i < NUM_CHECKSUMS; i++) { struct checksum_info *info; unsigned char r[64]; int j = 0; info = checksum_information(i); memset(r, 0, sizeof(r)); checksum_copy(test_context, i, r); printf("OUR %s:\n", info->name); for (j = 0; j < info->digest_size; j++) printf("%2.2x", r[j]); printf(" %s\n", filename); printf("system checksum program (%s):\n", info->prog); sprintf(buf, "%s %s", info->prog, filename); system(buf); printf("\n"); } return 0; } #endif /* CHECKSUM_SELF_TEST */ cdrkit-1.1.11/genisoimage/write.c0000644000372500001440000021203310761222460015712 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)write.c 1.88 06/02/01 joerg */ /* Parts from @(#)write.c 1.106 07/02/17 joerg */ /* * Program write.c - dump memory structures to file for iso9660 filesystem. * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * Copyright (c) 1999-2003 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 23/2/2000 */ #include #include "genisoimage.h" #include #include #ifdef SORTING #include "match.h" #endif /* SORTING */ #include #include #ifdef DVD_VIDEO #include "dvd_reader.h" #include "dvd_file.h" #include "ifo_read.h" #endif #ifdef APPLE_HYB #include #endif #ifdef VMS #include "vms.h" #endif /* Max number of sectors we will write at one time */ #define NSECT 16 /* Counters for statistics */ static int table_size = 0; static int total_dir_size = 0; static int rockridge_size = 0; static struct directory **pathlist; static int next_path_index = 1; static int sort_goof; static int is_rr_dir = 0; struct output_fragment *out_tail; struct output_fragment *out_list; struct iso_primary_descriptor vol_desc; void set_721(char *pnt, unsigned int i); void set_722(char *pnt, unsigned int i); void set_723(char *pnt, unsigned int i); void set_731(char *pnt, unsigned int i); void set_732(char *pnt, unsigned int i); void set_733(char *pnt, unsigned int i); int get_731(char *p); int get_732(char *p); int get_733(char *p); static int xawrite(void *buffer, int size, int count, FILE *file, int submode, BOOL islast); void xfwrite(void *buffer, int size, int count, FILE *file, int submode, BOOL islast); static int assign_directory_addresses(struct directory *node); #ifdef APPLE_HYB static void write_one_file(char *filename, off_t size, FILE *outfile, off_t off); #else static void write_one_file(char *filename, off_t size, FILE *outfile); #endif static void write_files(FILE *outfile); #if 0 static void dump_filelist __PR((void)); #endif static int compare_dirs(const void *rr, const void *ll); int sort_directory(struct directory_entry **sort_dir, int rr); static int root_gen(void); static BOOL assign_file_addresses(struct directory *dpnt, BOOL isnest); static void free_one_directory(struct directory *dpnt); static void free_directories(struct directory *dpnt); void generate_one_directory(struct directory *dpnt, FILE *outfile); static void build_pathlist(struct directory *node); static int compare_paths(void const *r, void const *l); static int generate_path_tables(void); void memcpy_max(char *to, char *from, int max); void outputlist_insert(struct output_fragment *frag); static int file_write(FILE *outfile); static int pvd_write(FILE *outfile); static int xpvd_write(FILE *outfile); static int evd_write(FILE *outfile); static int vers_write(FILE *outfile); static int graftcp(char *to, char *from, char *ep); static int pathcp(char *to, char *from, char *ep); static int pathtab_write(FILE *outfile); static int exten_write(FILE *outfile); int oneblock_size(int starting_extent); static int pathtab_size(int starting_extent); static int startpad_size(int starting_extent); static int interpad_size(int starting_extent); static int endpad_size(int starting_extent); static int file_gen(void); static int dirtree_dump(void); static int dirtree_fixup(int starting_extent); static int dirtree_size(int starting_extent); static int ext_size(int starting_extent); static int dirtree_write(FILE *outfile); static int dirtree_cleanup(FILE *outfile); static int startpad_write(FILE *outfile); static int interpad_write(FILE *outfile); static int endpad_write(FILE *outfile); #ifdef APPLE_HYB static int hfs_pad; static int hfs_get_parms(char *key); static void hfs_file_gen(int start_extent); static void gen_prepboot(void); Ulong get_adj_size(int Csize); int adj_size(int Csize, int start_extent, int extra); void adj_size_other(struct directory *dpnt); static int hfs_hce_write(FILE * outfile); int insert_padding_file(int size); #endif /* APPLE_HYB */ #ifdef SORTING static int compare_sort(const void * rr, const void * ll); static void reassign_link_addresses(struct directory * dpnt); static int sort_file_addresses(void); #endif /* SORTING */ /* * Routines to actually write the disc. We write sequentially so that * we could write a tape, or write the disc directly */ #define FILL_SPACE(X) memset(vol_desc.X, ' ', sizeof (vol_desc.X)) void set_721(char *pnt, unsigned int i) { pnt[0] = i & 0xff; pnt[1] = (i >> 8) & 0xff; } void set_722(char *pnt, unsigned int i) { pnt[0] = (i >> 8) & 0xff; pnt[1] = i & 0xff; } void set_723(char *pnt, unsigned int i) { pnt[3] = pnt[0] = i & 0xff; pnt[2] = pnt[1] = (i >> 8) & 0xff; } void set_731(char *pnt, unsigned int i) { pnt[0] = i & 0xff; pnt[1] = (i >> 8) & 0xff; pnt[2] = (i >> 16) & 0xff; pnt[3] = (i >> 24) & 0xff; } void set_732(char *pnt, unsigned int i) { pnt[3] = i & 0xff; pnt[2] = (i >> 8) & 0xff; pnt[1] = (i >> 16) & 0xff; pnt[0] = (i >> 24) & 0xff; } void set_733(char *pnt, unsigned int i) { pnt[7] = pnt[0] = i & 0xff; pnt[6] = pnt[1] = (i >> 8) & 0xff; pnt[5] = pnt[2] = (i >> 16) & 0xff; pnt[4] = pnt[3] = (i >> 24) & 0xff; } int get_731(char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8) | ((p[2] & 0xff) << 16) | ((p[3] & 0xff) << 24)); } int get_732(char *p) { return ((p[3] & 0xff) | ((p[2] & 0xff) << 8) | ((p[1] & 0xff) << 16) | ((p[0] & 0xff) << 24)); } int get_733(char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8) | ((p[2] & 0xff) << 16) | ((p[3] & 0xff) << 24)); } void xfwrite(void *buffer, int size, int count, FILE *file, int submode, BOOL islast) { /* * This is a hack that could be made better. * XXXIs this the only place? * It is definitely needed on Operating Systems that do not allow to * write files that are > 2GB. If the system is fast enough to be able * to feed 1400 KB/s writing speed of a DVD-R drive, use stdout. * If the system cannot do this reliable, you need to use this hacky * option. */ static int idx = 0; #ifdef XFWRITE_DEBUG if (count != 1 || (size % 2048) != 0) fprintf(stderr, "Count: %d, size: %d\n", count, size); #endif if (split_output != 0 && (idx == 0 || ftell(file) >= ((off_t)1024 * 1024 * 1024))) { char nbuf[512]; extern char *outfile; if (idx == 0) unlink(outfile); sprintf(nbuf, "%s_%02d", outfile, idx++); file = freopen(nbuf, "wb", file); if (file == NULL) { #ifdef USE_LIBSCHILY comerr("Cannot open '%s'.\n", nbuf); #else fprintf(stderr, "Cannot open '%s'.\n", nbuf); exit(1); #endif } } while (count) { int got; seterrno(0); if (osecsize != 0) got = xawrite(buffer, size, count, file, submode, islast); else got = fwrite(buffer, size, count, file); if (got <= 0) { #ifdef USE_LIBSCHILY comerr("cannot fwrite %d*%d\n", size, count); #else fprintf(stderr, "cannot fwrite %d*%d\n", size, count); exit(1); #endif } /* * This comment is in hope to prevent silly people from * e.g. SuSE (who did not yet learn C but believe that * they need to patch other peoples code) from changing the * next cast into an illegal lhs cast expression. * The cast below is the correct way to handle the problem. * The (void *) cast is to avoid a GCC warning like: * "warning: dereferencing type-punned pointer will break \ * strict-aliasing rules" * which is wrong this code. (void *) introduces a compatible * intermediate type in the cast list. */ count -= got; buffer = (void *)(((char *)buffer) + size * got); } } static int xawrite(void *buffer, int size, int count, FILE *file, int submode, BOOL islast) { register char *p = buffer; register int amt = size * count; register int n; struct xa_subhdr subhdr[2]; if (osecsize == 2048) return (fwrite(buffer, size, count, file)); if (amt % 2048) comerrno(EX_BAD, "Trying to write %d bytes (not a multiple of 2048).\n", amt); subhdr[0].file_number = subhdr[1].file_number = 0; subhdr[0].channel_number = subhdr[1].channel_number = 0; subhdr[0].coding = subhdr[1].coding = 0; while (amt > 0) { #ifdef LATER if (submode < 0) subhdr[0].sub_mode = subhdr[1].sub_mode = XA_SUBH_DATA; else subhdr[0].sub_mode = subhdr[1].sub_mode = submode; #else subhdr[0].sub_mode = subhdr[1].sub_mode = XA_SUBH_DATA; #endif if ((amt <= 2048) && islast) { subhdr[0].sub_mode = subhdr[1].sub_mode |= (XA_SUBH_EOR|XA_SUBH_EOF); } n = fwrite(&subhdr, sizeof (subhdr), 1, file); if (n <= 0) return (n); n = fwrite(p, 2048, 1, file); if (n <= 0) return (n); p += 2048; amt -= 2048; } return (1); } #ifdef APPLE_HYB /* * use the deferred_write struct to store info about the hfs_boot_file */ static struct deferred_write mac_boot; #endif /* APPLE_HYB */ static struct deferred_write *dw_head = NULL, *dw_tail = NULL; unsigned int last_extent_written = 0; static Uint path_table_index; time_t begun; /* * We recursively walk through all of the directories and assign extent * numbers to them. We have already assigned extent numbers to everything that * goes in front of them */ static int assign_directory_addresses(struct directory *node) { int dir_size; struct directory *dpnt; dpnt = node; while (dpnt) { /* skip if it's hidden */ if (dpnt->dir_flags & INHIBIT_ISO9660_ENTRY) { dpnt = dpnt->next; continue; } /* * If we already have an extent for this (i.e. it came from a * multisession disc), then don't reassign a new extent. */ dpnt->path_index = next_path_index++; if (dpnt->extent == 0) { dpnt->extent = last_extent; dir_size = ISO_BLOCKS(dpnt->size); last_extent += dir_size; /* * Leave room for the CE entries for this directory. * Keep them close to the reference directory so that * access will be quick. */ if (dpnt->ce_bytes) { last_extent += ISO_BLOCKS(dpnt->ce_bytes); } } if (dpnt->subdir) { assign_directory_addresses(dpnt->subdir); } dpnt = dpnt->next; } return (0); } #ifdef APPLE_HYB static void write_one_file(char *filename, off_t size, FILE *outfile, off_t off) #else static void write_one_file(char *filename, off_t size, FILE *outfile) #endif /* APPLE_HYB */ { /* * It seems that there are still stone age C-compilers * around. * The Metrowerks C found on BeOS/PPC does not allow * more than 32kB of local vars. * As we do not need to call write_one_file() recursively * we make buffer static. */ static char buffer[SECTOR_SIZE * NSECT]; FILE *infile; off_t remain; int use; char *mirror_name; unsigned char md5[16]; int include_in_jigdo = list_file_in_jigdo(filename, size, &mirror_name, md5); if ((infile = fopen(filename, "rb")) == NULL) { #ifdef USE_LIBSCHILY comerr("cannot open '%s'\n", filename); #else #ifndef HAVE_STRERROR fprintf(stderr, "cannot open '%s': (%d)\n", filename, errno); #else fprintf(stderr, "cannot open '%s': %s\n", filename, strerror(errno)); #endif exit(1); #endif } #ifdef APPLE_HYB fseek(infile, off, SEEK_SET); #endif /* APPLE_HYB */ remain = size; if (include_in_jigdo) write_jt_match_record(filename, mirror_name, SECTOR_SIZE, size, md5); while (remain > 0) { int amt; use = (remain > SECTOR_SIZE * NSECT - 1 ? NSECT * SECTOR_SIZE : remain); use = ISO_ROUND_UP(use); /* Round up to nearest sector */ /* boundary */ memset(buffer, 0, use); seterrno(0); amt = fread(buffer, 1, use, infile); if (amt < use && amt < remain) { /* * Note that genisoimage is not star and no 100% archiver. * We only detect file growth if the new size does not * match 'use' at the last read. */ if (geterrno() == 0) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "File '%s' did shrink.\n" "Files must not be changed while genisoimage runs!\n", filename); #else fprintf(stderr, "File '%s' did shrink.\n" "Files must not be changed while genisoimage runs!\n", filename); exit(EX_BAD); #endif } #ifdef USE_LIBSCHILY comerr("Cannot read from '%s'\n", filename); #else fprintf(stderr, "Cannot read from '%s'\n", filename); exit(1); #endif } if (!include_in_jigdo) jtwrite(buffer, use, 1, XA_SUBH_DATA, remain <= (SECTOR_SIZE * NSECT)); xfwrite(buffer, use, 1, outfile, XA_SUBH_DATA, remain <= (SECTOR_SIZE * NSECT)); last_extent_written += use / SECTOR_SIZE; #if 0 if ((last_extent_written % 1000) < use / SECTOR_SIZE) { fprintf(stderr, "%d..", last_extent_written); } #else if (verbose > 0 && (int)(last_extent_written % (gui ? 500 : 5000)) < use / SECTOR_SIZE) { time_t now; time_t the_end; double frac; time(&now); frac = last_extent_written / (1.0 * last_extent); the_end = begun + (now - begun) / frac; #ifndef NO_FLOATINGPOINT fprintf(stderr, "%6.2f%% done, estimate finish %s", frac * 100., ctime(&the_end)); #else fprintf(stderr, "%3d.%-02d%% done, estimate finish %s", (int)(frac * 100.), (int)((frac+.00005) * 10000.)%100, ctime(&the_end)); #endif fflush(stderr); } #endif remain -= use; } fclose(infile); }/* write_one_file(... */ static void write_files(FILE *outfile) { struct deferred_write *dwpnt, *dwnext; dwpnt = dw_head; while (dwpnt) { /*#define DEBUG*/ #ifdef DEBUG fprintf(stderr, "The file name is %s and pad is %d, size is %lld and extent is %d\n", dwpnt->name, dwpnt->pad, (Llong)dwpnt->size, dwpnt->extent); #endif if (dwpnt->table) { jtwrite(dwpnt->table, ISO_ROUND_UP(dwpnt->size), 1, XA_SUBH_DATA, TRUE); xfwrite(dwpnt->table, ISO_ROUND_UP(dwpnt->size), 1, outfile, XA_SUBH_DATA, TRUE); last_extent_written += ISO_BLOCKS(dwpnt->size); table_size += dwpnt->size; /* fprintf(stderr, "Size %lld ", (Llong)dwpnt->size); */ free(dwpnt->table); dwpnt->table = NULL; } else { #ifdef VMS vms_write_one_file(dwpnt->name, dwpnt->size, outfile); #else #ifdef APPLE_HYB write_one_file(dwpnt->name, dwpnt->size, outfile, dwpnt->off); #else write_one_file(dwpnt->name, dwpnt->size, outfile); #endif /* APPLE_HYB */ #endif free(dwpnt->name); dwpnt->name = NULL; } #ifndef DVD_VIDEO #define dvd_video 0 #endif #ifndef APPLE_HYB #define apple_hyb 0 #endif #if defined(APPLE_HYB) || defined(DVD_VIDEO) if (apple_hyb || dvd_video) { /* * we may have to pad out ISO files to work with HFS * clump sizes */ char blk[SECTOR_SIZE]; Uint i; for (i = 0; i < dwpnt->pad; i++) { jtwrite(blk, SECTOR_SIZE, 1, 0, FALSE); xfwrite(blk, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; } } #endif /* APPLE_HYB || DVD_VIDEO */ dwnext = dwpnt; dwpnt = dwpnt->next; free(dwnext); dwnext = NULL; } }/* write_files(... */ #if 0 static void dump_filelist() { struct deferred_write *dwpnt; dwpnt = dw_head; while (dwpnt) { fprintf(stderr, "File %s\n", dwpnt->name); dwpnt = dwpnt->next; } fprintf(stderr, "\n"); } #endif static int compare_dirs(const void *rr, const void *ll) { char *rpnt, *lpnt; struct directory_entry **r, **l; r = (struct directory_entry **) rr; l = (struct directory_entry **) ll; rpnt = (*r)->isorec.name; lpnt = (*l)->isorec.name; #ifdef APPLE_HYB /* * resource fork MUST (not sure if this is true for HFS volumes) be * before the data fork - so force it here */ if ((*r)->assoc && (*r)->assoc == (*l)) return (1); if ((*l)->assoc && (*l)->assoc == (*r)) return (-1); #endif /* APPLE_HYB */ /* If the entries are the same, this is an error. */ if (strcmp(rpnt, lpnt) == 0) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Error: '%s' and '%s' have the same ISO9660 name '%s'.\n", (*r)->whole_name, (*l)->whole_name, rpnt); #else fprintf(stderr, "Error: '%s' and '%s' have the same ISO9660 name '%s'.\n", (*r)->whole_name, (*l)->whole_name, rpnt); #endif sort_goof++; } /* Check we don't have the same RR name */ if (use_RockRidge && !is_rr_dir) { /* * entries *can* have the same RR name in the "rr_moved" * directory so skip checks if we're in reloc_dir */ if (!(strcmp((*r)->name, (*l)->name))) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Error: '%s' and '%s' have the same Rock Ridge name '%s'.\n", (*r)->whole_name, (*l)->whole_name, (*r)->name); #else fprintf(stderr, "Error: '%s' and '%s' have the same Rock Ridge name '%s'.\n", (*r)->whole_name, (*l)->whole_name, (*r)->name); #endif sort_goof++; } } /* * Put the '.' and '..' entries on the head of the sorted list. For * normal ASCII, this always happens to be the case, but out of band * characters cause this not to be the case sometimes. * FIXME(eric) - these tests seem redundant, in that the name is never * assigned these values. It will instead be \000 or \001, and thus * should always be sorted correctly. I need to figure out why I * thought I needed this in the first place. */ #if 0 if (strcmp(rpnt, ".") == 0) return (-1); if (strcmp(lpnt, ".") == 0) return (1); if (strcmp(rpnt, "..") == 0) return (-1); if (strcmp(lpnt, "..") == 0) return (1); #else /* * The code above is wrong (as explained in Eric's comment), leading to * incorrect sort order iff the -L option ("allow leading dots") is in * effect and a directory contains entries that start with a dot. * (TF, Tue Dec 29 13:49:24 CET 1998) */ if ((*r)->isorec.name_len[0] == 1 && *rpnt == 0) return (-1); /* '.' */ if ((*l)->isorec.name_len[0] == 1 && *lpnt == 0) return (1); if ((*r)->isorec.name_len[0] == 1 && *rpnt == 1) return (-1); /* '..' */ if ((*l)->isorec.name_len[0] == 1 && *lpnt == 1) return (1); #endif while (*rpnt && *lpnt) { if (*rpnt == ';' && *lpnt != ';') return (-1); if (*rpnt != ';' && *lpnt == ';') return (1); if (*rpnt == ';' && *lpnt == ';') return (0); if (*rpnt == '.' && *lpnt != '.') return (-1); if (*rpnt != '.' && *lpnt == '.') return (1); if ((unsigned char) *rpnt < (unsigned char) *lpnt) return (-1); if ((unsigned char) *rpnt > (unsigned char) *lpnt) return (1); rpnt++; lpnt++; } if (*rpnt) return (1); if (*lpnt) return (-1); return (0); } /* * Function: sort_directory * * Purpose: Sort the directory in the appropriate ISO9660 * order. * * Notes: Returns 0 if OK, returns > 0 if an error occurred. */ int sort_directory(struct directory_entry **sort_dir, int rr) { int dcount = 0; int xcount = 0; int j; int i, len; struct directory_entry *s_entry; struct directory_entry **sortlist; /* need to keep a count of how many entries are hidden */ s_entry = *sort_dir; while (s_entry) { if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) xcount++; dcount++; s_entry = s_entry->next; } if (dcount == 0) { return (0); } /* OK, now we know how many there are. Build a vector for sorting. */ sortlist = (struct directory_entry **) e_malloc(sizeof (struct directory_entry *) * dcount); j = dcount - 1; dcount = 0; s_entry = *sort_dir; while (s_entry) { if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) { /* put any hidden entries at the end of the vector */ sortlist[j--] = s_entry; } else { sortlist[dcount] = s_entry; dcount++; } len = s_entry->isorec.name_len[0]; s_entry->isorec.name[len] = 0; s_entry = s_entry->next; } /* Each directory is required to contain at least . and .. */ if (dcount < 2) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Directory size too small (. or .. missing ??%s)\n", "?"); /* Try to avoid a GCC trigraph warning */ #else fprintf(stderr, "Directory size too small (. or .. missing ??%s)\n", "?"); /* Try to avoid a GCC trigraph warning */ #endif sort_goof = 1; } else { /* only sort the non-hidden entries */ sort_goof = 0; is_rr_dir = rr; #ifdef PROTOTYPES qsort(sortlist, dcount, sizeof (struct directory_entry *), (int (*) (const void *, const void *)) compare_dirs); #else qsort(sortlist, dcount, sizeof (struct directory_entry *), compare_dirs); #endif /* * Now reassemble the linked list in the proper sorted order * We still need the hidden entries, as they may be used in * the Joliet tree. */ for (i = 0; i < dcount + xcount - 1; i++) { sortlist[i]->next = sortlist[i + 1]; } sortlist[dcount + xcount - 1]->next = NULL; *sort_dir = sortlist[0]; } free(sortlist); sortlist = NULL; return (sort_goof); } static int root_gen() { init_fstatbuf(); root_record.length[0] = 1 + offsetof(struct iso_directory_record, name[0]); root_record.ext_attr_length[0] = 0; set_733((char *) root_record.extent, root->extent); set_733((char *) root_record.size, ISO_ROUND_UP(root->size)); iso9660_date(root_record.date, root_statbuf.st_mtime); root_record.flags[0] = ISO_DIRECTORY; root_record.file_unit_size[0] = 0; root_record.interleave[0] = 0; set_723(root_record.volume_sequence_number, volume_sequence_number); root_record.name_len[0] = 1; return (0); } #ifdef SORTING /* * sorts deferred_write entries based on the sort weight */ static int compare_sort(const void *rr, const void *ll) { struct deferred_write **r; struct deferred_write **l; int r_sort; int l_sort; r = (struct deferred_write **) rr; l = (struct deferred_write **) ll; r_sort = (*r)->s_entry->sort; l_sort = (*l)->s_entry->sort; if (r_sort != l_sort) return (r_sort < l_sort ? 1 : -1); else return ((*r)->extent - (*l)->extent); } /* * reassign start extents to files that are "hard links" to * files that may have been sorted */ static void reassign_link_addresses(struct directory *dpnt) { struct directory_entry *s_entry; struct file_hash *s_hash; while (dpnt) { s_entry = dpnt->contents; for (s_entry = dpnt->contents; s_entry; s_entry = s_entry->next) { /* link files have already been given the weight NOT_SORTED */ if (s_entry->sort == NOT_SORTED) { /* update the start extent */ s_hash = find_hash(s_entry->dev, s_entry->inode); if (s_hash) { set_733((char *) s_entry->isorec.extent, s_hash->starting_block); s_entry->starting_block = s_hash->starting_block; } } if (verbose > 2 && s_entry->size != 0) { fprintf(stderr, "%8u %8u ", s_entry->starting_block, (unsigned int)(s_entry->starting_block + ISO_BLOCKS(s_entry->size) - 1)); if (s_entry->inode != TABLE_INODE) { fprintf(stderr, "%s\n", s_entry->whole_name); } else { fprintf(stderr, "%s%s%s\n", s_entry->filedir->whole_name, SPATH_SEPARATOR, trans_tbl); } } } if (dpnt->subdir) { reassign_link_addresses(dpnt->subdir); } dpnt = dpnt->next; } } /* * sort files in order of the given sort weight */ static int sort_file_addresses() { struct deferred_write *dwpnt; struct deferred_write **sortlist; struct directory_entry *s_entry; int start_extent; int num = 0; int i; /* need to store start extents for linked files */ flush_hash(); /* find out how many files we have */ dwpnt = dw_head; while (dwpnt) { num++; dwpnt = dwpnt->next; } /* return if we have none */ if (num == 0) { return (1); } /* save the start extent of the first file */ start_extent = dw_head->extent; /* set up vector to store entries */ sortlist = (struct deferred_write **) e_malloc(sizeof (struct deferred_write *) * num); for (i = 0, dwpnt = dw_head; i < num; i++, dwpnt = dwpnt->next) sortlist[i] = dwpnt; /* sort the list */ #ifdef PROTOTYPES qsort(sortlist, num, sizeof (struct deferred_write *), (int (*)(const void *, const void *))compare_sort); #else qsort(sortlist, num, sizeof (struct deferred_write *), compare_sort); #endif /* reconstruct the linked list */ for (i = 0; i < num-1; i++) { sortlist[i]->next = sortlist[i+1]; } sortlist[num-1]->next = NULL; dw_head = sortlist[0]; free(sortlist); /* set the new start extents for the sorted list */ for (i = 0, dwpnt = dw_head; i < num; i++, dwpnt = dwpnt->next) { s_entry = dwpnt->s_entry; dwpnt->extent = s_entry->starting_block = start_extent; set_733((char *) s_entry->isorec.extent, start_extent); start_extent += ISO_BLOCKS(s_entry->size); #ifdef DVD_VIDEO /* * Shouldn't this be done for every type of sort? Otherwise * we will loose every pad info we add if we sort the files */ if (dvd_video) { start_extent += dwpnt->pad; } #endif /* DVD_VIDEO */ /* cache start extents for any linked files */ add_hash(s_entry); } return (0); } #endif /* SORTING */ static BOOL assign_file_addresses(struct directory *dpnt, BOOL isnest) { struct directory *finddir; struct directory_entry *s_entry; struct file_hash *s_hash; struct deferred_write *dwpnt; char whole_path[PATH_MAX]; #ifdef DVD_VIDEO char dvd_path[PATH_MAX]; title_set_info_t * title_set_info = NULL; char *p; #endif BOOL ret = FALSE; while (dpnt) { #ifdef DVD_VIDEO if (dvd_video && root == dpnt->parent && ((p = strstr(dpnt->whole_name, "VIDEO_TS")) != 0)&& strcmp(p, "VIDEO_TS") == 0) { int maxlen = strlen(dpnt->whole_name)-8; if (maxlen > (sizeof (dvd_path)-1)) maxlen = sizeof (dvd_path)-1; strncpy(dvd_path, dpnt->whole_name, maxlen); dvd_path[maxlen] = '\0'; #ifdef DEBUG fprintf(stderr, "Found 'VIDEO_TS', the path is %s \n", dvd_path); #endif title_set_info = DVDGetFileSet(dvd_path); if (title_set_info == 0) { /* * Do not switch off -dvd-video but let is fail later. */ /* dvd_video = 0;*/ errmsgno(EX_BAD, "Unable to parse DVD-Video structures.\n"); } else { ret = TRUE; } } #endif /* DVD_VIDEO */ s_entry = dpnt->contents; for (s_entry = dpnt->contents; s_entry; s_entry = s_entry->next) { /* * If we already have an extent for this entry, then * don't assign a new one. It must have come from a * previous session on the disc. Note that we don't * end up scheduling the thing for writing either. */ if (get_733(s_entry->isorec.extent) != 0) { continue; } /* * This saves some space if there are symlinks present */ s_hash = find_hash(s_entry->dev, s_entry->inode); if (s_hash) { if (verbose > 2) { fprintf(stderr, "Cache hit for '%s%s%s'\n", s_entry->filedir->de_name, SPATH_SEPARATOR, s_entry->name); } set_733((char *) s_entry->isorec.extent, s_hash->starting_block); set_733((char *) s_entry->isorec.size, s_hash->size); #ifdef SORTING /* check for non-directory files */ if (do_sort && ((s_entry->isorec.flags[0] & ISO_DIRECTORY) == 0)) { /* make sure the real file has the highest weighting */ s_hash->de->sort = MAX(s_entry->sort, s_hash->de->sort); /* flag this as a potential non-sorted file */ s_entry->sort = NOT_SORTED; } #endif /* SORTING */ continue; } /* * If this is for a directory that is not a . or * a .. entry, then look up the information for the * entry. We have already assigned extents for * directories, so we just need to fill in the blanks * here. */ if (strcmp(s_entry->name, ".") != 0 && strcmp(s_entry->name, "..") != 0 && s_entry->isorec.flags[0] & ISO_DIRECTORY) { finddir = dpnt->subdir; while (1 == 1) { if (finddir->self == s_entry) break; finddir = finddir->next; if (!finddir) { #ifdef DVD_VIDEO if (title_set_info != 0) { DVDFreeFileSet(title_set_info); } #endif comerrno(EX_BAD, "Fatal goof - could not find dir entry for '%s'\n", s_entry->name); } } set_733((char *) s_entry->isorec.extent, finddir->extent); s_entry->starting_block = finddir->extent; s_entry->size = ISO_ROUND_UP(finddir->size); total_dir_size += s_entry->size; add_hash(s_entry); set_733((char *) s_entry->isorec.size, ISO_ROUND_UP(finddir->size)); continue; } /* * If this is . or .., then look up the relevant info * from the tables. */ if (strcmp(s_entry->name, ".") == 0) { set_733((char *) s_entry->isorec.extent, dpnt->extent); /* * Set these so that the hash table has the * correct information */ s_entry->starting_block = dpnt->extent; s_entry->size = ISO_ROUND_UP(dpnt->size); add_hash(s_entry); s_entry->starting_block = dpnt->extent; set_733((char *) s_entry->isorec.size, ISO_ROUND_UP(dpnt->size)); continue; } if (strcmp(s_entry->name, "..") == 0) { if (dpnt == root) { total_dir_size += root->size; } set_733((char *) s_entry->isorec.extent, dpnt->parent->extent); /* * Set these so that the hash table has the * correct information */ s_entry->starting_block = dpnt->parent->extent; s_entry->size = ISO_ROUND_UP(dpnt->parent->size); add_hash(s_entry); s_entry->starting_block = dpnt->parent->extent; set_733((char *) s_entry->isorec.size, ISO_ROUND_UP(dpnt->parent->size)); continue; } /* * Some ordinary non-directory file. Just schedule * the file to be written. This is all quite * straightforward, just make a list and assign * extents as we go. Once we get through writing all * of the directories, we should be ready write out * these files */ if (s_entry->size) { dwpnt = (struct deferred_write *) e_malloc(sizeof (struct deferred_write)); /* save this directory entry for later use */ dwpnt->s_entry = s_entry; /* set the initial padding to zero */ dwpnt->pad = 0; #ifdef DVD_VIDEO if (dvd_video && (title_set_info != 0)) { int pad; pad = DVDGetFilePad(title_set_info, s_entry->name); if (pad < 0) { errmsgno(EX_BAD, "Implementation botch. Video pad for file %s is %d\n", s_entry->name, pad), comerrno(EX_BAD, "Either the *.IFO file is bad or you found a genisoimage bug.\n"); } dwpnt->pad = pad; if (verbose > 0 && pad != 0) { fprintf(stderr, "The pad was %d for file %s\n", dwpnt->pad, s_entry->name); } } #endif /* DVD_VIDEO */ #ifdef APPLE_HYB /* * maybe an offset to start of the real * file/fork */ dwpnt->off = s_entry->hfs_off; #else dwpnt->off = (off_t)0; #endif /* APPLE_HYB */ if (dw_tail) { dw_tail->next = dwpnt; dw_tail = dwpnt; } else { dw_head = dwpnt; dw_tail = dwpnt; } if (s_entry->inode == TABLE_INODE) { dwpnt->table = s_entry->table; dwpnt->name = NULL; sprintf(whole_path, "%s%s%s", s_entry->filedir->whole_name, SPATH_SEPARATOR, trans_tbl); } else { dwpnt->table = NULL; strcpy(whole_path, s_entry->whole_name); dwpnt->name = strdup(whole_path); } dwpnt->next = NULL; dwpnt->size = s_entry->size; dwpnt->extent = last_extent; set_733((char *) s_entry->isorec.extent, last_extent); s_entry->starting_block = last_extent; add_hash(s_entry); last_extent += ISO_BLOCKS(s_entry->size); #ifdef DVD_VIDEO /* Shouldn't we always add the pad info? */ if (dvd_video) { last_extent += dwpnt->pad; } #endif /* DVD_VIDEO */ if (verbose > 2 && !do_sort) { fprintf(stderr, "%8d %8u %s\n", s_entry->starting_block, last_extent - 1, whole_path); } #ifdef DBG_ISO if (ISO_BLOCKS(s_entry->size) > 500) { fprintf(stderr, "Warning: large file '%s'\n", whole_path); fprintf(stderr, "Starting block is %d\n", s_entry->starting_block); fprintf(stderr, "Reported file size is %lld\n", (Llong)s_entry->size); } #endif #ifdef NOT_NEEDED /* Never use this code if you like to create a DVD */ if (last_extent > (800000000 >> 11)) { /* More than 800Mb? Punt */ fprintf(stderr, "Extent overflow processing file '%s'\n", whole_path); fprintf(stderr, "Starting block is %d\n", s_entry->starting_block); fprintf(stderr, "Reported file size is %lld\n", (Llong)s_entry->size); exit(1); } #endif continue; } /* * This is for zero-length files. If we leave the * extent 0, then we get screwed, because many readers * simply drop files that have an extent of zero. * Thus we leave the size 0, and just assign the * extent number. */ set_733((char *) s_entry->isorec.extent, last_extent); } if (dpnt->subdir) { if (assign_file_addresses(dpnt->subdir, TRUE)) ret = TRUE; } dpnt = dpnt->next; } #ifdef DVD_VIDEO if (title_set_info != NULL) { DVDFreeFileSet(title_set_info); } if (dvd_video && !ret && !isnest) { errmsgno(EX_BAD, "Could not find correct 'VIDEO_TS' directory.\n"); } #endif /* DVD_VIDEO */ return (ret); } /* assign_file_addresses(... */ static void free_one_directory(struct directory *dpnt) { struct directory_entry *s_entry; struct directory_entry *s_entry_d; s_entry = dpnt->contents; while (s_entry) { s_entry_d = s_entry; s_entry = s_entry->next; if (s_entry_d->rr_attributes) { free(s_entry_d->rr_attributes); s_entry_d->rr_attributes = NULL; } if (s_entry_d->name != NULL) { free(s_entry_d->name); s_entry_d->name = NULL; } if (s_entry_d->whole_name != NULL) { free(s_entry_d->whole_name); s_entry_d->whole_name = NULL; } #ifdef APPLE_HYB if (apple_both && s_entry_d->hfs_ent && !s_entry_d->assoc) free(s_entry_d->hfs_ent); #endif /* APPLE_HYB */ free(s_entry_d); s_entry_d = NULL; } dpnt->contents = NULL; }/* free_one_directory(... */ static void free_directories(struct directory *dpnt) { while (dpnt) { free_one_directory(dpnt); if (dpnt->subdir) free_directories(dpnt->subdir); dpnt = dpnt->next; } } void generate_one_directory(struct directory *dpnt, FILE *outfile) { unsigned int ce_address = 0; char *ce_buffer; unsigned int ce_index = 0; unsigned int ce_size; unsigned int dir_index; char *directory_buffer; int new_reclen; struct directory_entry *s_entry; struct directory_entry *s_entry_d; unsigned int total_size; total_size = ISO_ROUND_UP(dpnt->size); directory_buffer = (char *) e_malloc(total_size); memset(directory_buffer, 0, total_size); dir_index = 0; ce_size = ISO_ROUND_UP(dpnt->ce_bytes); ce_buffer = NULL; if (ce_size > 0) { ce_buffer = (char *) e_malloc(ce_size); memset(ce_buffer, 0, ce_size); ce_index = 0; /* Absolute byte address of CE entries for this directory */ ce_address = last_extent_written + (total_size >> 11); ce_address = ce_address << 11; } s_entry = dpnt->contents; while (s_entry) { /* skip if it's hidden */ if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) { s_entry = s_entry->next; continue; } /* * We do not allow directory entries to cross sector * boundaries. Simply pad, and then start the next entry at * the next sector */ new_reclen = s_entry->isorec.length[0]; if ((dir_index & (SECTOR_SIZE - 1)) + new_reclen >= SECTOR_SIZE) { dir_index = ISO_ROUND_UP(dir_index); } memcpy(directory_buffer + dir_index, &s_entry->isorec, offsetof(struct iso_directory_record, name[0]) + s_entry->isorec.name_len[0]); dir_index += offsetof(struct iso_directory_record, name[0]) + s_entry->isorec.name_len[0]; /* Add the Rock Ridge attributes, if present */ if (s_entry->rr_attr_size) { if (dir_index & 1) { directory_buffer[dir_index++] = 0; } /* * If the RR attributes were too long, then write the * CE records, as required. */ if (s_entry->rr_attr_size != s_entry->total_rr_attr_size) { struct iso_xa_dir_record *xadp; unsigned char *pnt; int len, nbytes; /* * Go through the entire record, first skip * the XA record and then fix up the * CE entries so that the extent and offset * are correct */ pnt = s_entry->rr_attributes; len = s_entry->total_rr_attr_size; if (len >= 14) { xadp = (struct iso_xa_dir_record *)pnt; if (xadp->signature[0] == 'X' && xadp->signature[1] == 'A' && xadp->reserved[0] == '\0') { len -= 14; pnt += 14; } } while (len > 3) { #ifdef DEBUG if (ce_size <= 0) { fprintf(stderr, "Warning: ce_index(%d) && ce_address(%d) not initialized\n", ce_index, ce_address); } #endif if (pnt[0] == 'C' && pnt[1] == 'E') { nbytes = get_733((char *) pnt + 20); if ((ce_index & (SECTOR_SIZE - 1)) + nbytes >= SECTOR_SIZE) { ce_index = ISO_ROUND_UP(ce_index); } set_733((char *) pnt + 4, (ce_address + ce_index) >> 11); set_733((char *) pnt + 12, (ce_address + ce_index) & (SECTOR_SIZE - 1)); /* * Now store the block in the * ce buffer */ memcpy(ce_buffer + ce_index, pnt + pnt[2], nbytes); ce_index += nbytes; if (ce_index & 1) { ce_index++; } } len -= pnt[2]; pnt += pnt[2]; } } rockridge_size += s_entry->total_rr_attr_size; memcpy(directory_buffer + dir_index, s_entry->rr_attributes, s_entry->rr_attr_size); dir_index += s_entry->rr_attr_size; } if (dir_index & 1) { directory_buffer[dir_index++] = 0; } s_entry_d = s_entry; s_entry = s_entry->next; /* * Joliet doesn't use the Rock Ridge attributes, so we free * it here. */ if (s_entry_d->rr_attributes) { free(s_entry_d->rr_attributes); s_entry_d->rr_attributes = NULL; } } if (dpnt->size != dir_index) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Unexpected directory length %lld expected: %d '%s'\n", (Llong)dpnt->size, dir_index, dpnt->de_name); #else fprintf(stderr, "Unexpected directory length %lld expected: %d '%s'\n", (Llong)dpnt->size, dir_index, dpnt->de_name); #endif } jtwrite(directory_buffer, total_size, 1, 0, FALSE); xfwrite(directory_buffer, total_size, 1, outfile, 0, FALSE); last_extent_written += total_size >> 11; free(directory_buffer); directory_buffer = NULL; if (ce_size > 0) { if (ce_index != dpnt->ce_bytes) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Continuation entry record length mismatch %d expected: %d.\n", ce_index, dpnt->ce_bytes); #else fprintf(stderr, "Continuation entry record length mismatch %d expected: %d.\n", ce_index, dpnt->ce_bytes); #endif } jtwrite(ce_buffer, ce_size, 1, 0, FALSE); xfwrite(ce_buffer, ce_size, 1, outfile, 0, FALSE); last_extent_written += ce_size >> 11; free(ce_buffer); ce_buffer = NULL; } }/* generate_one_directory(... */ static void build_pathlist(struct directory *node) { struct directory *dpnt; dpnt = node; while (dpnt) { /* skip if it's hidden */ if ((dpnt->dir_flags & INHIBIT_ISO9660_ENTRY) == 0) pathlist[dpnt->path_index] = dpnt; if (dpnt->subdir) build_pathlist(dpnt->subdir); dpnt = dpnt->next; } }/* build_pathlist(... */ static int compare_paths(void const *r, void const *l) { struct directory const *ll = *(struct directory * const *) l; struct directory const *rr = *(struct directory * const *) r; if (rr->parent->path_index < ll->parent->path_index) { return (-1); } if (rr->parent->path_index > ll->parent->path_index) { return (1); } return (strcmp(rr->self->isorec.name, ll->self->isorec.name)); }/* compare_paths(... */ static int generate_path_tables() { struct directory_entry *de = NULL; struct directory *dpnt; int fix; int i; int j; int namelen; char *npnt; char *npnt1; int tablesize; /* First allocate memory for the tables and initialize the memory */ tablesize = path_blocks << 11; path_table_m = (char *) e_malloc(tablesize); path_table_l = (char *) e_malloc(tablesize); memset(path_table_l, 0, tablesize); memset(path_table_m, 0, tablesize); /* * Now start filling in the path tables. Start with root directory */ path_table_index = 0; pathlist = (struct directory **) e_malloc(sizeof (struct directory *) * next_path_index); memset(pathlist, 0, sizeof (struct directory *) * next_path_index); build_pathlist(root); do { fix = 0; #ifdef PROTOTYPES qsort(&pathlist[1], next_path_index - 1, sizeof (struct directory *), (int (*) (const void *, const void *)) compare_paths); #else qsort(&pathlist[1], next_path_index - 1, sizeof (struct directory *), compare_paths); #endif for (j = 1; j < next_path_index; j++) { if (pathlist[j]->path_index != j) { pathlist[j]->path_index = j; fix++; } } } while (fix); for (j = 1; j < next_path_index; j++) { dpnt = pathlist[j]; if (!dpnt) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Entry %d not in path tables\n", j); #else fprintf(stderr, "Entry %d not in path tables\n", j); exit(1); #endif } npnt = dpnt->de_name; /* So the root comes out OK */ if ((*npnt == 0) || (dpnt == root)) { npnt = "."; } npnt1 = strrchr(npnt, PATH_SEPARATOR); if (npnt1) { npnt = npnt1 + 1; } de = dpnt->self; if (!de) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Fatal ISO9660 goof - directory has amnesia\n"); #else fprintf(stderr, "Fatal ISO9660 goof - directory has amnesia\n"); exit(1); #endif } namelen = de->isorec.name_len[0]; path_table_l[path_table_index] = namelen; path_table_m[path_table_index] = namelen; path_table_index += 2; set_731(path_table_l + path_table_index, dpnt->extent); set_732(path_table_m + path_table_index, dpnt->extent); path_table_index += 4; if (dpnt->parent->path_index > 0xffff) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Unable to generate sane path tables - too many directories (%d)\n", dpnt->parent->path_index); #else fprintf(stderr, "Unable to generate sane path tables - too many directories (%d)\n", dpnt->parent->path_index); exit(1); #endif } set_721(path_table_l + path_table_index, dpnt->parent->path_index); set_722(path_table_m + path_table_index, dpnt->parent->path_index); path_table_index += 2; for (i = 0; i < namelen; i++) { path_table_l[path_table_index] = de->isorec.name[i]; path_table_m[path_table_index] = de->isorec.name[i]; path_table_index++; } if (path_table_index & 1) { path_table_index++; /* For odd lengths we pad */ } } free(pathlist); pathlist = NULL; if (path_table_index != path_table_size) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Path table lengths do not match %d expected: %d\n", path_table_index, path_table_size); #else fprintf(stderr, "Path table lengths do not match %d expected: %d\n", path_table_index, path_table_size); #endif } return (0); }/* generate_path_tables(... */ void memcpy_max(char *to, char *from, int max) { int n = strlen(from); if (n > max) { n = max; } memcpy(to, from, n); }/* memcpy_max(... */ void outputlist_insert(struct output_fragment *frag) { struct output_fragment *nfrag; nfrag = e_malloc(sizeof (*frag)); movebytes(frag, nfrag, sizeof (*frag)); nfrag->of_start_extent = 0; if (out_tail == NULL) { out_list = out_tail = nfrag; } else { out_tail->of_next = nfrag; out_tail = nfrag; } } static int file_write(FILE *outfile) { Uint should_write; #ifdef APPLE_HYB char buffer[SECTOR_SIZE]; memset(buffer, 0, sizeof (buffer)); if (apple_hyb) { int i; /* * write out padding to round up to HFS allocation block */ for (i = 0; i < hfs_pad; i++) { jtwrite(buffer, sizeof (buffer), 1, 0, FALSE); xfwrite(buffer, sizeof (buffer), 1, outfile, 0, FALSE); last_extent_written++; } } #endif /* APPLE_HYB */ /* * OK, all done with that crap. Now write out the directories. This is * where the fur starts to fly, because we need to keep track of each * file as we find it and keep track of where we put it. */ should_write = last_extent - session_start; if (verbose > 2) { #ifdef DBG_ISO fprintf(stderr, "Total directory extents being written = %d\n", last_extent); #endif #ifdef APPLE_HYB if (apple_hyb) fprintf(stderr, "Total extents scheduled to be written (inc HFS) = %d\n", last_extent - session_start); else #endif /* APPLE_HYB */ fprintf(stderr, "Total extents scheduled to be written = %u\n", last_extent - session_start); } /* Now write all of the files that we need. */ write_files(outfile); #ifdef APPLE_HYB /* write out extents/catalog/dt file */ if (apple_hyb) { jtwrite(hce->hfs_ce, HFS_BLOCKSZ, hce->hfs_tot_size, 0, FALSE); xfwrite(hce->hfs_ce, HFS_BLOCKSZ, hce->hfs_tot_size, outfile, 0, FALSE); /* round up to a whole CD block */ if (HFS_ROUND_UP(hce->hfs_tot_size) - hce->hfs_tot_size * HFS_BLOCKSZ) { jtwrite(buffer, HFS_ROUND_UP(hce->hfs_tot_size) - hce->hfs_tot_size * HFS_BLOCKSZ, 1, 0, FALSE); xfwrite(buffer, HFS_ROUND_UP(hce->hfs_tot_size) - hce->hfs_tot_size * HFS_BLOCKSZ, 1, outfile, 0, FALSE); } last_extent_written += ISO_ROUND_UP(hce->hfs_tot_size * HFS_BLOCKSZ) / SECTOR_SIZE; /* write out HFS boot block */ if (mac_boot.name) write_one_file(mac_boot.name, mac_boot.size, outfile, mac_boot.off); } #endif /* APPLE_HYB */ /* The rest is just fluff. */ if (verbose == 0) { return (0); } #ifdef APPLE_HYB if (apple_hyb) { fprintf(stderr, "Total extents actually written (inc HFS) = %d\n", last_extent_written - session_start); fprintf(stderr, "(Size of ISO volume = %d, HFS extra = %d)\n", last_extent_written - session_start - hfs_extra, hfs_extra); } else #else fprintf(stderr, "Total extents actually written = %d\n", last_extent_written - session_start); #endif /* APPLE_HYB */ /* Hard links throw us off here */ if (should_write != (last_extent - session_start)) { fprintf(stderr, "Number of extents written not what was predicted. Please fix.\n"); fprintf(stderr, "Predicted = %d, written = %d\n", should_write, last_extent); } fprintf(stderr, "Total translation table size: %d\n", table_size); fprintf(stderr, "Total rockridge attributes bytes: %d\n", rockridge_size); fprintf(stderr, "Total directory bytes: %d\n", total_dir_size); fprintf(stderr, "Path table size(bytes): %d\n", path_table_size); #ifdef DEBUG fprintf(stderr, "next extent, last_extent, last_extent_written %d %d %d\n", next_extent, last_extent, last_extent_written); #endif return (0); }/* iso_write(... */ /* * Function to write the PVD for the disc. */ static int pvd_write(FILE *outfile) { char iso_time[17]; int should_write; struct tm local; struct tm gmt; time(&begun); local = *localtime(&begun); gmt = *gmtime(&begun); /* * There was a comment here about breaking in the year 2000. * That's not true, in 2000 tm_year == 100, so 1900+tm_year == 2000. */ sprintf(iso_time, "%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d00", 1900 + local.tm_year, local.tm_mon + 1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec); local.tm_min -= gmt.tm_min; local.tm_hour -= gmt.tm_hour; local.tm_yday -= gmt.tm_yday; if (local.tm_yday < -2) /* Hit new-year limit */ local.tm_yday = 1; /* Local is GMT + 1 day */ iso_time[16] = (local.tm_min + 60 * (local.tm_hour + 24 * local.tm_yday)) / 15; /* Next we write out the primary descriptor for the disc */ memset(&vol_desc, 0, sizeof (vol_desc)); vol_desc.type[0] = ISO_VD_PRIMARY; memcpy(vol_desc.id, ISO_STANDARD_ID, sizeof (ISO_STANDARD_ID)); vol_desc.version[0] = 1; memset(vol_desc.system_id, ' ', sizeof (vol_desc.system_id)); memcpy_max(vol_desc.system_id, system_id, strlen(system_id)); memset(vol_desc.volume_id, ' ', sizeof (vol_desc.volume_id)); memcpy_max(vol_desc.volume_id, volume_id, strlen(volume_id)); should_write = last_extent - session_start; set_733((char *) vol_desc.volume_space_size, should_write); set_723(vol_desc.volume_set_size, volume_set_size); set_723(vol_desc.volume_sequence_number, volume_sequence_number); set_723(vol_desc.logical_block_size, SECTOR_SIZE); /* * The path tables are used by DOS based machines to cache directory * locations */ set_733((char *) vol_desc.path_table_size, path_table_size); set_731(vol_desc.type_l_path_table, path_table[0]); set_731(vol_desc.opt_type_l_path_table, path_table[1]); set_732(vol_desc.type_m_path_table, path_table[2]); set_732(vol_desc.opt_type_m_path_table, path_table[3]); /* Now we copy the actual root directory record */ memcpy(vol_desc.root_directory_record, &root_record, offsetof(struct iso_directory_record, name[0]) + 1); /* * The rest is just fluff. It looks nice to fill in many of these * fields, though. */ FILL_SPACE(volume_set_id); if (volset_id) memcpy_max(vol_desc.volume_set_id, volset_id, strlen(volset_id)); FILL_SPACE(publisher_id); if (publisher) memcpy_max(vol_desc.publisher_id, publisher, strlen(publisher)); FILL_SPACE(preparer_id); if (preparer) memcpy_max(vol_desc.preparer_id, preparer, strlen(preparer)); FILL_SPACE(application_id); if (appid) memcpy_max(vol_desc.application_id, appid, strlen(appid)); FILL_SPACE(copyright_file_id); if (copyright) memcpy_max(vol_desc.copyright_file_id, copyright, strlen(copyright)); FILL_SPACE(abstract_file_id); if (abstract) memcpy_max(vol_desc.abstract_file_id, abstract, strlen(abstract)); FILL_SPACE(bibliographic_file_id); if (biblio) memcpy_max(vol_desc.bibliographic_file_id, biblio, strlen(biblio)); FILL_SPACE(creation_date); FILL_SPACE(modification_date); FILL_SPACE(expiration_date); FILL_SPACE(effective_date); vol_desc.file_structure_version[0] = 1; FILL_SPACE(application_data); memcpy(vol_desc.creation_date, iso_time, 17); memcpy(vol_desc.modification_date, iso_time, 17); memcpy(vol_desc.expiration_date, "0000000000000000", 17); memcpy(vol_desc.effective_date, iso_time, 17); if (use_XA) { char *xap = &((char *)&vol_desc)[1024]; memcpy(&xap[0], "CD-XA001", 8); /* XA Sign. */ memcpy(&xap[8], "\0\0", 2); /* XA flags */ memcpy(&xap[10], "\0\0\0\0\0\0\0\0", 8); /* Start dir */ memcpy(&xap[18], "\0\0\0\0\0\0\0\0", 8); /* Reserved */ } /* if not a bootable cd do it the old way */ jtwrite(&vol_desc, SECTOR_SIZE, 1, 0, FALSE); xfwrite(&vol_desc, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; return (0); } /* * Function to write the Extended PVD for the disc. */ static int xpvd_write(FILE *outfile) { vol_desc.type[0] = ISO_VD_SUPPLEMENTARY; vol_desc.version[0] = 2; vol_desc.file_structure_version[0] = 2; /* if not a bootable cd do it the old way */ jtwrite(&vol_desc, SECTOR_SIZE, 1, 0, FALSE); xfwrite(&vol_desc, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; return (0); } /* * Function to write the EVD for the disc. */ static int evd_write(FILE *outfile) { struct iso_primary_descriptor evol_desc; /* * Now write the end volume descriptor. Much simpler than the other * one */ memset(&evol_desc, 0, sizeof (evol_desc)); evol_desc.type[0] = (unsigned char) ISO_VD_END; memcpy(evol_desc.id, ISO_STANDARD_ID, sizeof (ISO_STANDARD_ID)); evol_desc.version[0] = 1; jtwrite(&evol_desc, SECTOR_SIZE, 1, 0, TRUE); xfwrite(&evol_desc, SECTOR_SIZE, 1, outfile, 0, TRUE); last_extent_written += 1; return (0); } /* * Function to write the version information for the disc. */ static int vers_write(FILE *outfile) { char vers[SECTOR_SIZE+1]; int X_ac; char **X_av; char *cp; int i; int idx = 4; int len; extern char version_string[]; extern int path_ind; /* Now write the version descriptor. */ memset(vers, 0, sizeof (vers)); strcpy(vers, "MKI "); cp = vers; X_ac = saved_ac(); X_av = saved_av(); strcpy(&cp[idx], ctime(&begun)); idx += 25; strcpy(&cp[idx], version_string); idx += strlen(version_string); for (i = 1; i < X_ac; i++) { len = strlen(X_av[i]); if ((idx + len + 2) >= SECTOR_SIZE) break; cp[idx++] = ' '; /* * Do not give away secret information when not in debug mode. */ if (debug) strcpy(&cp[idx], X_av[i]); else if (i >= path_ind) len = graftcp(&cp[idx], X_av[i], &vers[SECTOR_SIZE-1]); else if (X_av[i][0] == '/') len = pathcp(&cp[idx], X_av[i], &vers[SECTOR_SIZE-1]); else strcpy(&cp[idx], X_av[i]); idx += len; } cp[SECTOR_SIZE - 1] = '\0'; /* Per default: keep privacy. Blackout the version and arguments. */ if(getenv("ISODEBUG")) { jtwrite(vers, SECTOR_SIZE, 1, 0, TRUE); xfwrite(vers, SECTOR_SIZE, 1, outfile, 0, TRUE); } else { jtwrite(calloc(SECTOR_SIZE, 1), SECTOR_SIZE, 1, 0, TRUE); xfwrite(calloc(SECTOR_SIZE, 1), SECTOR_SIZE, 1, outfile, 0, TRUE); } last_extent_written += 1; return (0); } /* * Avoid to write unwanted information into the version info string. */ static int graftcp(char *to, char *from, char *ep) { int len = strlen(from); char *node = NULL; if (use_graft_ptrs) node = findgequal(from); if (node == NULL) { len = 0; node = from; } else { len = node - from; *node = '\0'; strncpy(to, from, ep - to); *node++ = '='; to += len++; *to++ = '='; } return (len + pathcp(to, node, ep)); } static int pathcp(char *to, char *from, char *ep) { int len = strlen(from); char *p; p = strrchr(from, '/'); if (p == NULL) { strncpy(to, from, ep - to); } else { if (p[1] == '\0') { --p; while (p > from && *p != '/') --p; } len = 0; if (*p == '/') { strncpy(to, "...", ep - to); to += 3; len = 3; } if (to < ep) { strncpy(to, p, ep - to); len += strlen(to); } } return (len); } /* * Function to write the path table for the disc. */ static int pathtab_write(FILE *outfile) { /* Next we write the path tables */ jtwrite(path_table_l, path_blocks << 11, 1, 0, FALSE); xfwrite(path_table_l, path_blocks << 11, 1, outfile, 0, FALSE); last_extent_written += path_blocks; jtwrite(path_table_m, path_blocks << 11, 1, 0, FALSE); xfwrite(path_table_m, path_blocks << 11, 1, outfile, 0, FALSE); last_extent_written += path_blocks; free(path_table_l); free(path_table_m); path_table_l = NULL; path_table_m = NULL; return (0); } static int exten_write(FILE *outfile) { jtwrite(extension_record, SECTOR_SIZE, 1, 0, FALSE); xfwrite(extension_record, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; return (0); } /* * Functions to describe padding block at the start of the disc. */ int oneblock_size(int starting_extent) { last_extent++; return (0); } /* * Functions to describe path table size. */ static int pathtab_size(int starting_extent) { path_table[0] = starting_extent; path_table[1] = 0; path_table[2] = path_table[0] + path_blocks; path_table[3] = 0; last_extent += 2 * path_blocks; return (0); } /* * Functions to describe padding blocks before PVD. */ static int startpad_size(int starting_extent) { last_extent = session_start + 16; return (0); } /* * Functions to describe padding blocks between sections. */ static int interpad_size(int starting_extent) { int emod = 0; #ifdef needed starting_extent += 16; /* First add 16 pad blocks */ #endif if ((emod = starting_extent % 16) != 0) { starting_extent += 16 - emod; /* Now pad to mod 16 # */ } last_extent = starting_extent; return (0); } /* * Functions to describe padding blocks at end of disk. */ static int endpad_size(int starting_extent) { starting_extent += 150; /* 150 pad blocks (post gap) */ last_extent = starting_extent; return (0); } static int file_gen() { #ifdef APPLE_HYB int start_extent = last_extent; /* orig ISO files start */ #endif /* APPLE_HYB */ if (!assign_file_addresses(root, FALSE)) { #ifdef DVD_VIDEO if (dvd_video) { comerrno(EX_BAD, "Unable to make a DVD-Video image.\n" "Possible reasons:\n" " - VIDEO_TS subdirectory was not found on specified location\n" " - VIDEO_TS has invalid contents\n" ); } #else ; /* EMPTY */ #endif } #ifdef SORTING if (do_sort) { if (sort_file_addresses() == 0) reassign_link_addresses(root); } #endif /* SORTING */ #ifdef APPLE_HYB /* * put this here for the time being - may when I've worked out how to * use Eric's new system for creating/writing parts of the image it * may move to it's own routine */ if (apple_hyb) hfs_file_gen(start_extent); #ifdef PREP_BOOT else if (use_prep_boot || use_chrp_boot) gen_prepboot(); #endif /* PREP_BOOT */ #endif /* APPLE_HYB */ return (0); } static int dirtree_dump() { if (verbose > 2) { dump_tree(root); } return (0); } static int dirtree_fixup(int starting_extent) { if (use_RockRidge && reloc_dir) finish_cl_pl_entries(); if (use_RockRidge) update_nlink_field(root); return (0); } static int dirtree_size(int starting_extent) { assign_directory_addresses(root); return (0); } static int ext_size(int starting_extent) { extern int extension_record_size; struct directory_entry *s_entry; extension_record_extent = starting_extent; s_entry = root->contents; set_733((char *) s_entry->rr_attributes + s_entry->rr_attr_size - 24, extension_record_extent); set_733((char *) s_entry->rr_attributes + s_entry->rr_attr_size - 8, extension_record_size); last_extent++; return (0); } static int dirtree_write(FILE *outfile) { generate_iso9660_directories(root, outfile); return (0); } static int dirtree_cleanup(FILE *outfile) { free_directories(root); return (0); } static int startpad_write(FILE *outfile) { char buffer[SECTOR_SIZE]; int i; int npad; memset(buffer, 0, sizeof (buffer)); npad = session_start + 16 - last_extent_written; for (i = 0; i < npad; i++) { jtwrite(buffer, sizeof (buffer), 1, 0, FALSE); xfwrite(buffer, sizeof (buffer), 1, outfile, 0, FALSE); last_extent_written++; } return (0); } static int interpad_write(FILE *outfile) { char buffer[SECTOR_SIZE]; int i; int npad = 0; memset(buffer, 0, sizeof (buffer)); #ifdef needed npad = 16; #endif if ((i = last_extent_written % 16) != 0) npad += 16 - i; for (i = 0; i < npad; i++) { jtwrite(buffer, sizeof (buffer), 1, 0, FALSE); xfwrite(buffer, sizeof (buffer), 1, outfile, 0, FALSE); last_extent_written++; } return (0); } static int endpad_write(FILE *outfile) { char buffer[SECTOR_SIZE]; int i; memset(buffer, 0, sizeof (buffer)); for (i = 0; i < 150; i++) { jtwrite(buffer, sizeof (buffer), 1, 0, FALSE); xfwrite(buffer, sizeof (buffer), 1, outfile, 0, FALSE); last_extent_written++; } return (0); } #ifdef APPLE_HYB /* * hfs_get_parms: get HFS parameters from the command line */ static int hfs_get_parms(char *key) { int ret = 0; char *p; if (hfs_parms == NULL) return (ret); if ((p = strstr(hfs_parms, key)) != NULL) { p += strlen(key) + 1; sscanf(p, "%d", &ret); } return (ret); } /* * hfs_file_gen: set up "fake" HFS volume using the ISO9660 tree */ static void hfs_file_gen(int start_extent) { int Csize; /* clump size for HFS vol */ int loop; int last_extent_save = last_extent; char *p; /* allocate memory for the libhfs/genisoimage extra info */ hce = (hce_mem *) e_malloc(sizeof (hce_mem)); hce->error = (char *) e_malloc(1024); /* mark as unallocated for use later */ hce->hfs_ce = hce->hfs_hdr = hce->hfs_map = 0; /* reserve space for the label partition - if it is needed */ #ifdef PREP_BOOT /* a PReP bootable partition needs the map.. */ if (gen_pt || use_prep_boot || use_chrp_boot) #else if (gen_pt) #endif /* PREP_BOOT */ hce->hfs_map_size = HFS_MAP_SIZE; else hce->hfs_map_size = 0; /* set the HFS parameter string to upper case */ if (hfs_parms) { for (p = hfs_parms; *p; p++) *p = toupper(*p); } /* set the initial factor to increase Catalog file size */ if ((hce->ctc_size = hfs_get_parms("CTC")) == 0) hce->ctc_size = CTC; /* set the max size of the Catalog file */ if ((hce->max_XTCsize = hfs_get_parms("MAX_XTCSIZE")) == 0) hce->max_XTCsize = MAX_XTCSIZE; /* set the number of time to try to make an HFS volume */ if ((loop = hfs_get_parms("CTC_LOOP")) == 0) loop = CTC_LOOP; /* * "create" the HFS volume (just the header, catalog/extents files) if * there's a problem with the Catalog file being too small, we keep on * increasing the size (up to CTC_LOOP) times and try again. * Unfortunately I don't know enough about the inner workings of HFS, * so I can't workout the size of the Catalog file in advance (and I * don't want to "grow" as is is normally allowed to), therefore, this * approach is a bit over the top as it involves throwing away the * "volume" we have created and trying again ... */ do { hce->error[0] = '\0'; /* attempt to create the Mac volume */ Csize = make_mac_volume(root, start_extent); /* if we have a problem ... */ if (Csize < 0) { /* * we've made too many attempts, or got some other * error */ if (loop == 0 || errno != HCE_ERROR) { /* HCE_ERROR is not a valid errno value */ if (errno == HCE_ERROR) errno = 0; /* exit with the error */ if (*hce->error) fprintf(stderr, "%s\n", hce->error); perr(hfs_error); } else { /* increase Catalog file size factor */ hce->ctc_size *= CTC; /* * reset the initial "last_extent" and try * again */ last_extent = last_extent_save; } } else { /* everything OK - just carry on ... */ loop = 0; } } while (loop--); hfs_extra = HFS_ROUND_UP(hce->hfs_tot_size) / SECTOR_SIZE; last_extent += hfs_extra; /* generate the Mac label and HFS partition maps */ mac_boot.name = hfs_boot_file; /* * only generate the partition tables etc. if we are making a bootable * CD - or if the -part option is given */ if (gen_pt) { if (gen_mac_label(&mac_boot)) { if (*hce->error) fprintf(stderr, "%s\n", hce->error); perr(hfs_error); } } /* set Autostart filename if required */ if (autoname) { if (autostart()) perr("Autostart filename must less than 12 characters"); } /* finished with any HFS type errors */ free(hce->error); hce->error = 0; /* * the ISO files need to start on a multiple of the HFS allocation * blocks, so find out how much padding we need */ /* * take in accout alignment of files wrt HFS volume start - remove any * previous session as well */ start_extent -= session_start; hfs_pad = ROUND_UP(start_extent*SECTOR_SIZE + (hce->hfs_hdr_size + hce->hfs_map_size) * HFS_BLOCKSZ, Csize) / SECTOR_SIZE; hfs_pad -= (start_extent + (hce->hfs_hdr_size + hce->hfs_map_size) / HFS_BLK_CONV); #ifdef PREP_BOOT gen_prepboot_label(hce->hfs_map); #endif /* PREP_BOOT */ } #ifdef PREP_BOOT static void gen_prepboot() { /* * we need to allocate the hce struct since hce->hfs_map is used to * generate the fdisk partition map required for PReP booting */ hce = (hce_mem *) e_malloc(sizeof (hce_mem)); /* mark as unallocated for use later */ hce->hfs_ce = hce->hfs_hdr = hce->hfs_map = 0; /* reserve space for the label partition - if it is needed */ hce->hfs_map_size = HFS_MAP_SIZE; hce->hfs_map = (unsigned char *) e_malloc(hce->hfs_map_size * HFS_BLOCKSZ); gen_prepboot_label(hce->hfs_map); } #endif /* PREP_BOOT */ /* * get_adj_size: get the ajusted size of the volume with the HFS * allocation block size for each file */ Ulong get_adj_size(int Csize) { struct deferred_write *dw; Ulong size = 0; int count = 0; /* loop through all the files finding the new total size */ for (dw = dw_head; dw; dw = dw->next) { size += (ROUND_UP(dw->size, Csize)/HFS_BLOCKSZ); count++; } /* * crude attempt to prevent overflows - HFS can only cope with a * maximum of about 65536 forks (actually less) - this will trap cases * when we have far too many files */ if (count >= 65536) return (-1); else return (size); } /* * adj_size: adjust the ISO record entries for all files * based on the HFS allocation block size */ int adj_size(int Csize, int start_extent, int extra) { struct deferred_write *dw; struct directory_entry *s_entry; int size; /* get the adjusted start_extent (with padding) */ /* take in accout alignment of files wrt HFS volume start */ start_extent -= session_start; start_extent = ROUND_UP(start_extent*SECTOR_SIZE + extra*HFS_BLOCKSZ, Csize) / SECTOR_SIZE; start_extent -= (extra / HFS_BLK_CONV); start_extent += session_start; /* initialise file hash */ flush_hash(); /* * loop through all files changing their starting blocks and finding * any padding needed to written out latter */ for (dw = dw_head; dw; dw = dw->next) { s_entry = dw->s_entry; s_entry->starting_block = dw->extent = start_extent; set_733((char *) s_entry->isorec.extent, start_extent); size = ROUND_UP(dw->size, Csize) / SECTOR_SIZE; dw->pad = size - ISO_ROUND_UP(dw->size) / SECTOR_SIZE; /* * cache non-HFS files - as there may be multiple links to * these files (HFS files can't have multiple links). We will * need to change the starting extent of the other links later */ if (!s_entry->hfs_ent) add_hash(s_entry); start_extent += size; } return (start_extent); } /* * adj_size_other: adjust any non-HFS files that may be linked * to an existing file (i.e. not have a deferred_write * entry of it's own */ void adj_size_other(struct directory *dpnt) { struct directory_entry *s_entry; struct file_hash *s_hash; while (dpnt) { s_entry = dpnt->contents; for (s_entry = dpnt->contents; s_entry; s_entry = s_entry->next) { /* * if it's an HFS file or a directory - then ignore * (we're after non-HFS files) */ if (s_entry->hfs_ent || (s_entry->isorec.flags[0] & ISO_DIRECTORY)) continue; /* * find any cached entry and assign new starting * extent */ s_hash = find_hash(s_entry->dev, s_entry->inode); if (s_hash) { set_733((char *) s_entry->isorec.extent, s_hash->starting_block); /* not vital - but tidy */ s_entry->starting_block = s_hash->starting_block; } } if (dpnt->subdir) { adj_size_other(dpnt->subdir); } dpnt = dpnt->next; } /* clear file hash */ flush_hash(); } /* * hfs_hce_write: write out the HFS header stuff */ static int hfs_hce_write(FILE *outfile) { char buffer[SECTOR_SIZE]; int n = 0; int r; /* HFS hdr output */ int tot_size = hce->hfs_map_size + hce->hfs_hdr_size; memset(buffer, 0, sizeof (buffer)); /* * hack time ... if the tot_size is greater than 32Kb then * it won't fit in the first 16 blank SECTORS (64 512 byte * blocks, as most of this is padding, we just truncate this * data to 64x4xHFS_BLOCKSZ ... hope this is OK ... */ if (tot_size > 64) tot_size = 64; /* get size in CD blocks == 4xHFS_BLOCKSZ == 2048 */ n = tot_size / HFS_BLK_CONV; r = tot_size % HFS_BLK_CONV; /* write out HFS volume header info */ jtwrite(hce->hfs_map, HFS_BLOCKSZ, tot_size, 0, FALSE); xfwrite(hce->hfs_map, HFS_BLOCKSZ, tot_size, outfile, 0, FALSE); /* fill up to a complete CD block */ if (r) { jtwrite(buffer, HFS_BLOCKSZ, HFS_BLK_CONV - r, 0, FALSE); xfwrite(buffer, HFS_BLOCKSZ, HFS_BLK_CONV - r, outfile, 0, FALSE); n++; } last_extent_written += n; return (0); } /* * insert_padding_file : insert a dumy file to make volume at least * 800k * * XXX If we ever need to write more then 2 GB, make size off_t */ int insert_padding_file(int size) { struct deferred_write *dwpnt; /* get the size in bytes */ size *= HFS_BLOCKSZ; dwpnt = (struct deferred_write *) e_malloc(sizeof (struct deferred_write)); dwpnt->s_entry = 0; /* set the padding to zero */ dwpnt->pad = 0; /* set offset to zero */ dwpnt->off = (off_t)0; /* * don't need to wory about the s_entry stuff as it won't be touched# * at this point onwards */ /* insert the entry in the list */ if (dw_tail) { dw_tail->next = dwpnt; dw_tail = dwpnt; } else { dw_head = dwpnt; dw_tail = dwpnt; } /* aloocate memory as a "Table" file */ dwpnt->table = e_malloc(size); dwpnt->name = NULL; dwpnt->next = NULL; dwpnt->size = size; dwpnt->extent = last_extent; last_extent += ISO_BLOCKS(size); /* retune the size in HFS blocks */ return (ISO_ROUND_UP(size) / HFS_BLOCKSZ); } struct output_fragment hfs_desc = {NULL, NULL, NULL, hfs_hce_write, "HFS volume header"}; #endif /* APPLE_HYB */ struct output_fragment startpad_desc = {NULL, startpad_size, NULL, startpad_write, "Initial Padblock"}; struct output_fragment voldesc_desc = {NULL, oneblock_size, root_gen, pvd_write, "Primary Volume Descriptor"}; struct output_fragment xvoldesc_desc = {NULL, oneblock_size, NULL, xpvd_write, "Enhanced Volume Descriptor"}; struct output_fragment end_vol = {NULL, oneblock_size, NULL, evd_write, "End Volume Descriptor" }; struct output_fragment version_desc = {NULL, oneblock_size, NULL, vers_write, "Version block" }; struct output_fragment pathtable_desc = {NULL, pathtab_size, generate_path_tables, pathtab_write, "Path table"}; struct output_fragment dirtree_desc = {NULL, dirtree_size, NULL, dirtree_write, "Directory tree" }; struct output_fragment dirtree_clean = {NULL, dirtree_fixup, dirtree_dump, dirtree_cleanup, "Directory tree cleanup" }; struct output_fragment extension_desc = {NULL, ext_size, NULL, exten_write, "Extension record" }; struct output_fragment files_desc = {NULL, NULL, file_gen, file_write, "The File(s)"}; struct output_fragment interpad_desc = {NULL, interpad_size, NULL, interpad_write, "Intermediate Padblock"}; struct output_fragment endpad_desc = {NULL, endpad_size, NULL, endpad_write, "Ending Padblock"}; cdrkit-1.1.11/genisoimage/mac_label.h0000644000372500001440000001431110531416235016463 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)mac_label.h 1.3 04/03/01 joerg, Copyright 1997, 1998, 1999, 2000 James Pearson */ /* * Copyright (c) 1997, 1998, 1999, 2000 James Pearson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * mac_label.h: defines Macintosh partition maps and label * * Taken from "genisoimage 1.05 PLUS" by Andy Polyakov * (see http://fy.chalmers.se/~appro/genisoimage_plus.html for details) * * Much of this is already defined in the libhfs code, but to keep * things simple we stick with these. */ #ifndef _MAC_LABEL_H #define _MAC_LABEL_H #ifdef __cplusplus extern "C" { #endif #ifdef PREP_BOOT struct fdiskPartition { #define prepPartType 0x41 #define chrpPartType 0x96 unsigned char boot; /* bootable flag; not used */ unsigned char CHSstart[3]; /* start CHS; not used */ unsigned char type; /* Partition type, = 0x41 (PReP bootable) */ unsigned char CHSend[3]; /* end CHS; not used */ unsigned char startSect[4]; /* start sector (really start of boot image on CD */ unsigned char size[4]; /* size of partition (or boot image ;) ) */ }; typedef struct fdiskPartition fdiskPartition; #endif /* Driver Descriptor Map */ #define sbSigMagic "ER" struct MacLabel { unsigned char sbSig[2]; /* unique value for SCSI block 0 */ unsigned char sbBlkSize[2]; /* block size of device */ unsigned char sbBlkCount[4]; /* number of blocks on device */ unsigned char sbDevType[2]; /* device type */ unsigned char sbDevId[2]; /* device id */ unsigned char sbData[4]; /* not used */ unsigned char sbDrvrCount[2]; /* driver descriptor count */ unsigned char ddBlock[4]; /* 1st driver's starting block */ unsigned char ddSize[2]; /* size of 1st driver (512-byte blks) */ unsigned char ddType[2]; /* system type (1 for Mac+) */ #ifndef PREP_BOOT unsigned char ddPad[486]; /* ARRAY[0..242] OF INTEGER; not used */ #else #define fdiskMagic0 0x55 #define fdiskMagic1 0xAA unsigned char pad1[420]; /* not used */ fdiskPartition image[4]; /* heh heh heh, we can have up to 4 */ /* different boot images */ unsigned char fdiskMagic[2]; /* PReP uses fdisk partition map */ #endif /* PREP_BOOT */ }; typedef struct MacLabel MacLabel; #define IS_MAC_LABEL(d) (((MacLabel*)(d))->sbSig[0] == 'E' && \ ((MacLabel*)(d))->sbSig[1] == 'R') /* Partition Map Entry */ #define pmSigMagic "PM" #define pmPartType_1 "Apple_partition_map" #define pmPartName_11 "Apple" #define pmPartType_2 "Apple_Driver" #define pmPartType_21 "Apple_Driver43" #define pmPartType_3 "Apple_UNIX_SVR2" #define pmPartName_31 "A/UX Root" #define pmPartName_32 "A/UX Usr" #define pmPartName_33 "Random A/UX fs" #define pmPartName_34 "Swap" #define pmPartType_4 "Apple_HFS" #define pmPartName_41 "MacOS" #define pmPartType_5 "Apple_Free" #define pmPartName_51 "Extra" #define PM2 2 #define PM4 4 struct MacPart { unsigned char pmSig[2]; /* unique value for map entry blk */ unsigned char pmSigPad[2]; /* currently unused */ unsigned char pmMapBlkCnt[4]; /* # of blks in partition map */ unsigned char pmPyPartStart[4]; /* physical start blk of partition */ unsigned char pmPartBlkCnt[4]; /* # of blks in this partition */ unsigned char pmPartName[32]; /* ASCII partition name */ unsigned char pmPartType[32]; /* ASCII partition type */ unsigned char pmLgDataStart[4]; /* log. # of partition's 1st data blk */ unsigned char pmDataCnt[4]; /* # of blks in partition's data area */ unsigned char pmPartStatus[4]; /* bit field for partition status */ unsigned char pmLgBootStart[4]; /* log. blk of partition's boot code */ unsigned char pmBootSize[4]; /* number of bytes in boot code */ unsigned char pmBootAddr[4]; /* memory load address of boot code */ unsigned char pmBootAddr2[4]; /* currently unused */ unsigned char pmBootEntry[4]; /* entry point of boot code */ unsigned char pmBootEntry2[4]; /* currently unused */ unsigned char pmBootCksum[4]; /* checksum of boot code */ unsigned char pmProcessor[16]; /* ASCII for the processor type */ unsigned char pmPad[376]; /* ARRAY[0..187] OF INTEGER; not used */ }; typedef struct MacPart MacPart; #define IS_MAC_PART(d) (((MacPart*)(d))->pmSig[0] == 'P' && \ ((MacPart*)(d))->pmSig[1] == 'M') #define PM_STAT_VALID 0x01 /* Set if a valid partition map entry */ #define PM_STAT_ALLOC 0x02 /* Set if partition is already allocated; clear if available */ #define PM_STAT_INUSE 0x04 /* Set if partition is in use; may be cleared after a system reset */ #define PM_STAT_BOOTABLE 0x08 /* Set if partition contains valid boot information */ #define PM_STAT_READABLE 0x10 /* Set if partition allows reading */ #define PM_STAT_WRITABLE 0x20 /* Set if partition allows writing */ #define PM_STAT_BOOT_PIC 0x40 /* Set if boot code is position-independent */ #define PM_STAT_UNUSED 0x80 /* Unused */ #define PM_STAT_DEFAULT PM_STAT_VALID|PM_STAT_ALLOC|PM_STAT_READABLE|PM_STAT_WRITABLE typedef struct { char *name; /* Partition name */ char *type; /* Partition type */ int ntype; /* Partition type (numeric) */ int start; /* start extent (SECTOR_SIZE blocks) */ int size; /* extents (SECTOR_SIZE blocks) */ } mac_partition_table; /* from libhfs */ #define HFS_BB_SIGWORD 0x4c4b typedef struct deferred_write defer; #ifdef __cplusplus } #endif #endif /* _MAC_LABEL_H */ cdrkit-1.1.11/genisoimage/exclude.c0000644000372500001440000000312610536265343016221 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)exclude.c 1.9 04/03/04 joerg */ /* * 9-Dec-93 R.-D. Marzusch, marzusch@odiehh.hanse.de: * added 'exclude' option (-x) to specify pathnames NOT to be included in * CD image. */ #include #include #include #include #include #include /* this allows for 1000 entries to be excluded ... */ #define MAXEXCL 1000 static char *excl[MAXEXCL]; void exclude(char *fn); int is_excluded(char *fn); void exclude(char *fn) { register int i; for (i = 0; excl[i] && i < MAXEXCL; i++) ; if (i == MAXEXCL) { fprintf(stderr, "Can't exclude '%s' - too many entries in table\n", fn); return; } excl[i] = (char *) malloc(strlen(fn) + 1); if (excl[i] == NULL) { #ifdef USE_LIBSCHILY errmsg("Can't allocate memory for excluded filename\n"); #else fprintf(stderr, "Can't allocate memory for excluded filename\n"); #endif return; } strcpy(excl[i], fn); } int is_excluded(char *fn) { register int i; /* * very dumb search method ... */ for (i = 0; excl[i] && i < MAXEXCL; i++) { if (strcmp(excl[i], fn) == 0) { return (1); /* found -> excluded filenmae */ } } return (0); /* not found -> not excluded */ } cdrkit-1.1.11/genisoimage/sha1.c0000644000372500001440000003052110740042205015406 0ustar steveusers/* sha1.c - Functions to compute SHA1 message digest of files or memory blocks according to the NIST specification FIPS-180-1. Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Scott G. Miller Credits: Robert Klep -- Expansion function fix */ #include "sha1.h" #include #include /* SWAP does an endian swap on architectures that are little-endian, as SHA1 needs some data in a big-endian form. */ #ifdef WORDS_BIGENDIAN # define SWAP(n) (n) #else # define SWAP(n) \ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #endif #define BLOCKSIZE 4096 #if BLOCKSIZE % 64 != 0 # error "invalid BLOCKSIZE" #endif /* This array contains the bytes used to pad the buffer to the next 64-byte boundary. (RFC 1321, 3.1: Step 1) */ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; /* Takes a pointer to a 160 bit block of data (five 32 bit ints) and intializes it to the start constants of the SHA1 algorithm. This must be called before using hash in the call to sha1_hash. */ void sha1_init_ctx (struct sha1_ctx *ctx) { ctx->A = 0x67452301; ctx->B = 0xefcdab89; ctx->C = 0x98badcfe; ctx->D = 0x10325476; ctx->E = 0xc3d2e1f0; ctx->total[0] = ctx->total[1] = 0; ctx->buflen = 0; } /* Put result from CTX in first 20 bytes following RESBUF. The result must be in little endian byte order. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf) { ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); ((md5_uint32 *) resbuf)[4] = SWAP (ctx->E); return resbuf; } /* Process the remaining bytes in the internal buffer and the usual prolog according to the standard and write the result to RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf) { /* Take yet unprocessed bytes into account. */ md5_uint32 bytes = ctx->buflen; size_t pad; /* Now count remaining bytes. */ ctx->total[0] += bytes; if (ctx->total[0] < bytes) ++ctx->total[1]; pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3); *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); /* Process last bytes. */ sha1_process_block (ctx->buffer, bytes + pad + 8, ctx); return sha1_read_ctx (ctx, resbuf); } /* Compute SHA1 message digest for bytes read from STREAM. The resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ int sha1_stream (FILE *stream, void *resblock) { struct sha1_ctx ctx; char buffer[BLOCKSIZE + 72]; size_t sum; /* Initialize the computation context. */ sha1_init_ctx (&ctx); /* Iterate over full file contents. */ while (1) { /* We read the file in blocks of BLOCKSIZE bytes. One call of the computation function processes the whole buffer so that with the next round of the loop another block can be read. */ size_t n; sum = 0; /* Read block. Take care for partial reads. */ while (1) { n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); sum += n; if (sum == BLOCKSIZE) break; if (n == 0) { /* Check for the error flag IFF N == 0, so that we don't exit the loop after a partial read due to e.g., EAGAIN or EWOULDBLOCK. */ if (ferror (stream)) return 1; goto process_partial_block; } /* We've read at least one byte, so ignore errors. But always check for EOF, since feof may be true even though N > 0. Otherwise, we could end up calling fread after EOF. */ if (feof (stream)) goto process_partial_block; } /* Process buffer with BLOCKSIZE bytes. Note that BLOCKSIZE % 64 == 0 */ sha1_process_block (buffer, BLOCKSIZE, &ctx); } process_partial_block:; /* Process any remaining bytes. */ if (sum > 0) sha1_process_bytes (buffer, sum, &ctx); /* Construct result in desired memory. */ sha1_finish_ctx (&ctx, resblock); return 0; } /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ void * sha1_buffer (const char *buffer, size_t len, void *resblock) { struct sha1_ctx ctx; /* Initialize the computation context. */ sha1_init_ctx (&ctx); /* Process whole buffer but last len % 64 bytes. */ sha1_process_bytes (buffer, len, &ctx); /* Put result in desired memory area. */ return sha1_finish_ctx (&ctx, resblock); } void sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx) { /* When we already have some bits in our internal buffer concatenate both inputs first. */ if (ctx->buflen != 0) { size_t left_over = ctx->buflen; size_t add = 128 - left_over > len ? len : 128 - left_over; memcpy (&ctx->buffer[left_over], buffer, add); ctx->buflen += add; if (ctx->buflen > 64) { sha1_process_block (ctx->buffer, ctx->buflen & ~63, ctx); ctx->buflen &= 63; /* The regions in the following copy operation cannot overlap. */ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], ctx->buflen); } buffer = (const char *) buffer + add; len -= add; } /* Process available complete blocks. */ if (len >= 64) { #if !_STRING_ARCH_unaligned # define alignof(type) offsetof (struct { char c; type x; }, x) # define UNALIGNED_P(p) (((size_t) p) % alignof (md5_uint32) != 0) if (UNALIGNED_P (buffer)) while (len > 64) { sha1_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); buffer = (const char *) buffer + 64; len -= 64; } else #endif { sha1_process_block (buffer, len & ~63, ctx); buffer = (const char *) buffer + (len & ~63); len &= 63; } } /* Move remaining bytes in internal buffer. */ if (len > 0) { size_t left_over = ctx->buflen; memcpy (&ctx->buffer[left_over], buffer, len); left_over += len; if (left_over >= 64) { sha1_process_block (ctx->buffer, 64, ctx); left_over -= 64; memcpy (ctx->buffer, &ctx->buffer[64], left_over); } ctx->buflen = left_over; } } /* --- Code below is the primary difference between md5.c and sha1.c --- */ /* SHA1 round constants */ #define K1 0x5a827999L #define K2 0x6ed9eba1L #define K3 0x8f1bbcdcL #define K4 0xca62c1d6L /* Round functions. Note that F2 is the same as F4. */ #define F1(B,C,D) ( D ^ ( B & ( C ^ D ) ) ) #define F2(B,C,D) (B ^ C ^ D) #define F3(B,C,D) ( ( B & C ) | ( D & ( B | C ) ) ) #define F4(B,C,D) (B ^ C ^ D) /* Process LEN bytes of BUFFER, accumulating context into CTX. It is assumed that LEN % 64 == 0. Most of this code comes from GnuPG's cipher/sha1.c. */ void sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx) { const md5_uint32 *words = buffer; size_t nwords = len / sizeof (md5_uint32); const md5_uint32 *endp = words + nwords; md5_uint32 x[16]; md5_uint32 a = ctx->A; md5_uint32 b = ctx->B; md5_uint32 c = ctx->C; md5_uint32 d = ctx->D; md5_uint32 e = ctx->E; /* First increment the byte count. RFC 1321 specifies the possible length of the file up to 2^64 bits. Here we only compute the number of bytes. Do a double word increment. */ ctx->total[0] += len; if (ctx->total[0] < len) ++ctx->total[1]; #define rol(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) #define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \ ^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \ , (x[I&0x0f] = rol(tm, 1)) ) #define R(A,B,C,D,E,F,K,M) do { E += rol( A, 5 ) \ + F( B, C, D ) \ + K \ + M; \ B = rol( B, 30 ); \ } while(0) while (words < endp) { md5_uint32 tm; int t; for (t = 0; t < 16; t++) { x[t] = SWAP (*words); words++; } R( a, b, c, d, e, F1, K1, x[ 0] ); R( e, a, b, c, d, F1, K1, x[ 1] ); R( d, e, a, b, c, F1, K1, x[ 2] ); R( c, d, e, a, b, F1, K1, x[ 3] ); R( b, c, d, e, a, F1, K1, x[ 4] ); R( a, b, c, d, e, F1, K1, x[ 5] ); R( e, a, b, c, d, F1, K1, x[ 6] ); R( d, e, a, b, c, F1, K1, x[ 7] ); R( c, d, e, a, b, F1, K1, x[ 8] ); R( b, c, d, e, a, F1, K1, x[ 9] ); R( a, b, c, d, e, F1, K1, x[10] ); R( e, a, b, c, d, F1, K1, x[11] ); R( d, e, a, b, c, F1, K1, x[12] ); R( c, d, e, a, b, F1, K1, x[13] ); R( b, c, d, e, a, F1, K1, x[14] ); R( a, b, c, d, e, F1, K1, x[15] ); R( e, a, b, c, d, F1, K1, M(16) ); R( d, e, a, b, c, F1, K1, M(17) ); R( c, d, e, a, b, F1, K1, M(18) ); R( b, c, d, e, a, F1, K1, M(19) ); R( a, b, c, d, e, F2, K2, M(20) ); R( e, a, b, c, d, F2, K2, M(21) ); R( d, e, a, b, c, F2, K2, M(22) ); R( c, d, e, a, b, F2, K2, M(23) ); R( b, c, d, e, a, F2, K2, M(24) ); R( a, b, c, d, e, F2, K2, M(25) ); R( e, a, b, c, d, F2, K2, M(26) ); R( d, e, a, b, c, F2, K2, M(27) ); R( c, d, e, a, b, F2, K2, M(28) ); R( b, c, d, e, a, F2, K2, M(29) ); R( a, b, c, d, e, F2, K2, M(30) ); R( e, a, b, c, d, F2, K2, M(31) ); R( d, e, a, b, c, F2, K2, M(32) ); R( c, d, e, a, b, F2, K2, M(33) ); R( b, c, d, e, a, F2, K2, M(34) ); R( a, b, c, d, e, F2, K2, M(35) ); R( e, a, b, c, d, F2, K2, M(36) ); R( d, e, a, b, c, F2, K2, M(37) ); R( c, d, e, a, b, F2, K2, M(38) ); R( b, c, d, e, a, F2, K2, M(39) ); R( a, b, c, d, e, F3, K3, M(40) ); R( e, a, b, c, d, F3, K3, M(41) ); R( d, e, a, b, c, F3, K3, M(42) ); R( c, d, e, a, b, F3, K3, M(43) ); R( b, c, d, e, a, F3, K3, M(44) ); R( a, b, c, d, e, F3, K3, M(45) ); R( e, a, b, c, d, F3, K3, M(46) ); R( d, e, a, b, c, F3, K3, M(47) ); R( c, d, e, a, b, F3, K3, M(48) ); R( b, c, d, e, a, F3, K3, M(49) ); R( a, b, c, d, e, F3, K3, M(50) ); R( e, a, b, c, d, F3, K3, M(51) ); R( d, e, a, b, c, F3, K3, M(52) ); R( c, d, e, a, b, F3, K3, M(53) ); R( b, c, d, e, a, F3, K3, M(54) ); R( a, b, c, d, e, F3, K3, M(55) ); R( e, a, b, c, d, F3, K3, M(56) ); R( d, e, a, b, c, F3, K3, M(57) ); R( c, d, e, a, b, F3, K3, M(58) ); R( b, c, d, e, a, F3, K3, M(59) ); R( a, b, c, d, e, F4, K4, M(60) ); R( e, a, b, c, d, F4, K4, M(61) ); R( d, e, a, b, c, F4, K4, M(62) ); R( c, d, e, a, b, F4, K4, M(63) ); R( b, c, d, e, a, F4, K4, M(64) ); R( a, b, c, d, e, F4, K4, M(65) ); R( e, a, b, c, d, F4, K4, M(66) ); R( d, e, a, b, c, F4, K4, M(67) ); R( c, d, e, a, b, F4, K4, M(68) ); R( b, c, d, e, a, F4, K4, M(69) ); R( a, b, c, d, e, F4, K4, M(70) ); R( e, a, b, c, d, F4, K4, M(71) ); R( d, e, a, b, c, F4, K4, M(72) ); R( c, d, e, a, b, F4, K4, M(73) ); R( b, c, d, e, a, F4, K4, M(74) ); R( a, b, c, d, e, F4, K4, M(75) ); R( e, a, b, c, d, F4, K4, M(76) ); R( d, e, a, b, c, F4, K4, M(77) ); R( c, d, e, a, b, F4, K4, M(78) ); R( b, c, d, e, a, F4, K4, M(79) ); a = ctx->A += a; b = ctx->B += b; c = ctx->C += c; d = ctx->D += d; e = ctx->E += e; } } cdrkit-1.1.11/genisoimage/multi.c0000644000372500001440000013726711016351607015731 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)multi.c 1.68 05/05/15 joerg */ /* * File multi.c - scan existing iso9660 image and merge into * iso9660 filesystem. Used for multisession support. * * Written by Eric Youngdale (1996). * Copyright (c) 1999-2003 J. Schilling * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "genisoimage.h" #include #include #include #include #include /* Needed for printasc() */ #ifdef VMS #include #include #include "vms.h" #endif #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif #ifndef roundup #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) #endif /* * Cannot debug memset() with gdb on Linux, so use fillbytes() */ /*#define memset(s, c, n) fillbytes(s, n, c)*/ #define TF_CREATE 1 #define TF_MODIFY 2 #define TF_ACCESS 4 #define TF_ATTRIBUTES 8 static int isonum_711(unsigned char *p); static int isonum_721(unsigned char *p); static int isonum_723(unsigned char *p); static int isonum_731(unsigned char *p); static void printasc(char *txt, unsigned char *p, int len); static void prbytes(char *txt, unsigned char *p, int len); unsigned char *parse_xa(unsigned char *pnt, int *lenp, struct directory_entry *dpnt); int rr_flags(struct iso_directory_record *idr); static int parse_rrflags(Uchar *pnt, int len, int cont_flag); static BOOL find_rr(struct iso_directory_record *idr, Uchar **pntp, int *lenp); static int parse_rr(unsigned char *pnt, int len, struct directory_entry *dpnt); static int check_rr_dates(struct directory_entry *dpnt, struct directory_entry *current, struct stat *statbuf, struct stat *lstatbuf); static struct directory_entry ** read_merging_directory(struct iso_directory_record *, int *); static int free_mdinfo(struct directory_entry **, int len); static void free_directory_entry(struct directory_entry * dirp); static void merge_remaining_entries(struct directory *, struct directory_entry **, int); static int merge_old_directory_into_tree(struct directory_entry *, struct directory *); static void check_rr_relocation(struct directory_entry *de); static int isonum_711(unsigned char *p) { return (*p & 0xff); } static int isonum_721(unsigned char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); } static int isonum_723(unsigned char *p) { #if 0 if (p[0] != p[3] || p[1] != p[2]) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "invalid format 7.2.3 number\n"); #else fprintf(stderr, "invalid format 7.2.3 number\n"); exit(1); #endif } #endif return (isonum_721(p)); } static int isonum_731(unsigned char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8) | ((p[2] & 0xff) << 16) | ((p[3] & 0xff) << 24)); } int isonum_733(unsigned char *p) { return (isonum_731(p)); } FILE *in_image = NULL; #ifndef USE_SCG /* * Don't define readsecs if genisoimage is linked with * the SCSI library. * readsecs() will be implemented as SCSI command in this case. * * Use global var in_image directly in readsecs() * the SCSI equivalent will not use a FILE* for I/O. * * The main point of this pointless abstraction is that Solaris won't let * you read 2K sectors from the cdrom driver. The fact that 99.9% of the * discs out there have a 2K sectorsize doesn't seem to matter that much. * Anyways, this allows the use of a scsi-generics type of interface on * Solaris. */ static int readsecs(int startsecno, void *buffer, int sectorcount) { int f = fileno(in_image); if (lseek(f, (off_t) startsecno * SECTOR_SIZE, SEEK_SET) == (off_t) - 1) { #ifdef USE_LIBSCHILY comerr(" Seek error on old image\n"); #else fprintf(stderr, " Seek error on old image\n"); exit(10); #endif } if (read(f, buffer, (sectorcount * SECTOR_SIZE)) != (sectorcount * SECTOR_SIZE)) { #ifdef USE_LIBSCHILY comerr(" Read error on old image\n"); #else fprintf(stderr, " Read error on old image\n"); exit(10); #endif } return (sectorcount * SECTOR_SIZE); } #endif static void printasc(char *txt, unsigned char *p, int len) { int i; fprintf(stderr, "%s ", txt); for (i = 0; i < len; i++) { if (isprint(p[i])) fprintf(stderr, "%c", p[i]); else fprintf(stderr, "."); } fprintf(stderr, "\n"); } static void prbytes(char *txt, register Uchar *p, register int len) { fprintf(stderr, "%s", txt); while (--len >= 0) fprintf(stderr, " %02X", *p++); fprintf(stderr, "\n"); } unsigned char * parse_xa(unsigned char *pnt, int *lenp, struct directory_entry *dpnt) { struct iso_xa_dir_record *xadp; int len = *lenp; static int did_xa = 0; /*fprintf(stderr, "len: %d\n", len);*/ if (len >= 14) { xadp = (struct iso_xa_dir_record *)pnt; /* if (dpnt) prbytes("XA ", pnt, len);*/ if (xadp->signature[0] == 'X' && xadp->signature[1] == 'A' && xadp->reserved[0] == '\0') { len -= 14; pnt += 14; *lenp = len; if (!did_xa) { did_xa = 1; errmsgno(EX_BAD, "Found XA directory extension record.\n"); } } else if (pnt[2] == 0) { char *cp = NULL; if (dpnt) cp = (char *)&dpnt->isorec; if (cp) { prbytes("ISOREC:", (Uchar *)cp, 33+cp[32]); printasc("ISOREC:", (Uchar *)cp, 33+cp[32]); prbytes("XA REC:", pnt, len); printasc("XA REC:", pnt, len); } if (no_rr == 0) { errmsgno(EX_BAD, "Disabling RR / XA / AA.\n"); no_rr = 1; } *lenp = 0; if (cp) { errmsgno(EX_BAD, "Problems with old ISO directory entry for file: '%s'.\n", &cp[33]); } errmsgno(EX_BAD, "Illegal extended directory attributes found (bad XA disk?).\n"); /* errmsgno(EX_BAD, "Disabling Rock Ridge for old session.\n");*/ comerrno(EX_BAD, "Try again using the -no-rr option.\n"); } } if (len >= 4 && pnt[3] != 1 && pnt[3] != 2) { prbytes("BAD RR ATTRIBUTES:", pnt, len); printasc("BAD RR ATTRIBUTES:", pnt, len); } return (pnt); } static BOOL find_rr(struct iso_directory_record *idr, Uchar **pntp, int *lenp) { struct iso_xa_dir_record *xadp; int len; unsigned char *pnt; BOOL ret = FALSE; len = idr->length[0] & 0xff; len -= sizeof (struct iso_directory_record); len += sizeof (idr->name); len -= idr->name_len[0]; pnt = (unsigned char *) idr; pnt += sizeof (struct iso_directory_record); pnt -= sizeof (idr->name); pnt += idr->name_len[0]; if ((idr->name_len[0] & 1) == 0) { pnt++; len--; } if (len >= 14) { xadp = (struct iso_xa_dir_record *)pnt; if (xadp->signature[0] == 'X' && xadp->signature[1] == 'A' && xadp->reserved[0] == '\0') { len -= 14; pnt += 14; ret = TRUE; } } *pntp = pnt; *lenp = len; return (ret); } static int parse_rrflags(Uchar *pnt, int len, int cont_flag) { int ncount; int cont_extent; int cont_offset; int cont_size; int flag1; int flag2; cont_extent = cont_offset = cont_size = 0; ncount = 0; flag1 = flag2 = 0; while (len >= 4) { if (pnt[3] != 1 && pnt[3] != 2) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #else fprintf(stderr, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #endif return (0); /* JS ??? Is this right ??? */ } ncount++; if (pnt[0] == 'R' && pnt[1] == 'R') flag1 = pnt[4] & 0xff; if (strncmp((char *) pnt, "PX", 2) == 0) /* POSIX attributes */ flag2 |= 1; if (strncmp((char *) pnt, "PN", 2) == 0) /* POSIX device number */ flag2 |= 2; if (strncmp((char *) pnt, "SL", 2) == 0) /* Symlink */ flag2 |= 4; if (strncmp((char *) pnt, "NM", 2) == 0) /* Alternate Name */ flag2 |= 8; if (strncmp((char *) pnt, "CL", 2) == 0) /* Child link */ flag2 |= 16; if (strncmp((char *) pnt, "PL", 2) == 0) /* Parent link */ flag2 |= 32; if (strncmp((char *) pnt, "RE", 2) == 0) /* Relocated Direcotry */ flag2 |= 64; if (strncmp((char *) pnt, "TF", 2) == 0) /* Time stamp */ flag2 |= 128; if (strncmp((char *) pnt, "SP", 2) == 0) { /* SUSP record */ flag2 |= 1024; /* su_version = pnt[3] & 0xff;*/ } if (strncmp((char *) pnt, "AA", 2) == 0) { /* Apple Signature record */ flag2 |= 2048; /* aa_version = pnt[3] & 0xff;*/ } if (strncmp((char *)pnt, "CE", 2) == 0) { /* Continuation Area */ cont_extent = isonum_733(pnt+4); cont_offset = isonum_733(pnt+12); cont_size = isonum_733(pnt+20); } len -= pnt[2]; pnt += pnt[2]; if (len <= 3 && cont_extent) { unsigned char sector[SECTOR_SIZE]; readsecs(cont_extent, sector, 1); flag2 |= parse_rrflags(§or[cont_offset], cont_size, 1); } } return (flag2); } int rr_flags(struct iso_directory_record *idr) { int len; unsigned char *pnt; int ret = 0; if (find_rr(idr, &pnt, &len)) ret |= 4096; ret |= parse_rrflags(pnt, len, 0); return (ret); } /* * Parse the RR attributes so we can find the file name. */ static int parse_rr(unsigned char *pnt, int len, struct directory_entry *dpnt) { int cont_extent; int cont_offset; int cont_size; char name_buf[256]; cont_extent = cont_offset = cont_size = 0; pnt = parse_xa(pnt, &len, dpnt /* 0 */); while (len >= 4) { if (pnt[3] != 1 && pnt[3] != 2) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #else fprintf(stderr, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #endif return (-1); } if (strncmp((char *) pnt, "NM", 2) == 0) { strncpy(name_buf, (char *) pnt + 5, pnt[2] - 5); name_buf[pnt[2] - 5] = 0; if (dpnt->name) { size_t nlen = strlen(dpnt->name); /* * append to name from previous NM records */ dpnt->name = realloc(dpnt->name, nlen + strlen(name_buf) + 1); strcpy(dpnt->name + nlen, name_buf); } else { dpnt->name = strdup(name_buf); dpnt->got_rr_name = 1; } /* continue searching for more NM records */ } else if (strncmp((char *) pnt, "CE", 2) == 0) { cont_extent = isonum_733(pnt + 4); cont_offset = isonum_733(pnt + 12); cont_size = isonum_733(pnt + 20); } len -= pnt[2]; pnt += pnt[2]; if (len <= 3 && cont_extent) { unsigned char sector[SECTOR_SIZE]; readsecs(cont_extent, sector, 1); if (parse_rr(§or[cont_offset], cont_size, dpnt) == -1) return (-1); } } /* Fall back to the iso name if no RR name found */ if (dpnt->name == NULL) { char *cp; strcpy(name_buf, dpnt->isorec.name); cp = strchr(name_buf, ';'); if (cp != NULL) { *cp = '\0'; } dpnt->name = strdup(name_buf); } return (0); }/* parse_rr */ /* * Returns 1 if the two files are identical * Returns 0 if the two files differ */ static int check_rr_dates(struct directory_entry *dpnt, struct directory_entry *current, struct stat *statbuf, struct stat *lstatbuf) { int cont_extent; int cont_offset; int cont_size; int offset; unsigned char *pnt; int len; int same_file; int same_file_type; mode_t mode; char time_buf[7]; cont_extent = cont_offset = cont_size = 0; same_file = 1; same_file_type = 1; pnt = dpnt->rr_attributes; len = dpnt->rr_attr_size; /* * We basically need to parse the rr attributes again, and dig out the * dates and file types. */ pnt = parse_xa(pnt, &len, /* dpnt */ 0); while (len >= 4) { if (pnt[3] != 1 && pnt[3] != 2) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #else fprintf(stderr, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #endif return (-1); } /* * If we have POSIX file modes, make sure that the file type is * the same. If it isn't, then we must always write the new * file. */ if (strncmp((char *) pnt, "PX", 2) == 0) { mode = isonum_733(pnt + 4); if ((lstatbuf->st_mode & S_IFMT) != (mode & S_IFMT)) { same_file_type = 0; same_file = 0; } } if (strncmp((char *) pnt, "TF", 2) == 0) { offset = 5; if (pnt[4] & TF_CREATE) { iso9660_date((char *) time_buf, lstatbuf->st_ctime); if (memcmp(time_buf, pnt + offset, 7) != 0) same_file = 0; offset += 7; } if (pnt[4] & TF_MODIFY) { iso9660_date((char *) time_buf, lstatbuf->st_mtime); if (memcmp(time_buf, pnt + offset, 7) != 0) same_file = 0; offset += 7; } } if (strncmp((char *) pnt, "CE", 2) == 0) { cont_extent = isonum_733(pnt + 4); cont_offset = isonum_733(pnt + 12); cont_size = isonum_733(pnt + 20); } len -= pnt[2]; pnt += pnt[2]; if (len <= 3 && cont_extent) { unsigned char sector[SECTOR_SIZE]; readsecs(cont_extent, sector, 1); /* * Continue to scan the extension record. * Note that this has not been tested yet, but it is * definitely more correct that calling parse_rr() * as done in Eric's old code. */ pnt = §or[cont_offset]; len = cont_size; /* * Clear the "pending extension record" state as * we did already read it now. */ cont_extent = cont_offset = cont_size = 0; } } /* * If we have the same fundamental file type, then it is clearly safe * to reuse the TRANS.TBL entry. */ if (same_file_type) { current->de_flags |= SAFE_TO_REUSE_TABLE_ENTRY; } return (same_file); } static struct directory_entry ** read_merging_directory(struct iso_directory_record *mrootp, int *nentp) { unsigned char *cpnt; unsigned char *cpnt1; char *p; char *dirbuff; int i; struct iso_directory_record *idr; int len; int nbytes; int nent; struct directory_entry **pnt; int rlen; struct directory_entry **rtn; int seen_rockridge; unsigned char *tt_buf; int tt_extent; int tt_size; static int warning_given = 0; /* * This is the number of sectors we will need to read. We need to * round up to get the last fractional sector - we are asking for the * data in terms of a number of sectors. */ nbytes = roundup(isonum_733((unsigned char *) mrootp->size), SECTOR_SIZE); /* * First, allocate a buffer large enough to read in the entire * directory. */ dirbuff = (char *) e_malloc(nbytes); readsecs(isonum_733((unsigned char *) mrootp->extent), dirbuff, nbytes / SECTOR_SIZE); /* * Next look over the directory, and count up how many entries we have. */ len = isonum_733((unsigned char *) mrootp->size); i = 0; *nentp = 0; nent = 0; while (i < len) { idr = (struct iso_directory_record *) & dirbuff[i]; if (idr->length[0] == 0) { i = ISO_ROUND_UP(i); continue; } nent++; i += idr->length[0]; } /* * Now allocate the buffer which will hold the array we are about to * return. */ rtn = (struct directory_entry **) e_malloc(nent * sizeof (*rtn)); /* * Finally, scan the directory one last time, and pick out the relevant * bits of information, and store it in the relevant bits of the * structure. */ i = 0; pnt = rtn; tt_extent = 0; seen_rockridge = 0; tt_size = 0; while (i < len) { idr = (struct iso_directory_record *) & dirbuff[i]; if (idr->length[0] == 0) { i = ISO_ROUND_UP(i); continue; } *pnt = (struct directory_entry *) e_malloc(sizeof (**rtn)); (*pnt)->next = NULL; #ifdef DEBUG fprintf(stderr, "IDR name: '%s' ist: %d soll: %d\n", idr->name, strlen(idr->name), idr->name_len[0]); #endif (*pnt)->isorec = *idr; (*pnt)->starting_block = isonum_733((unsigned char *) idr->extent); (*pnt)->size = isonum_733((unsigned char *) idr->size); (*pnt)->priority = 0; (*pnt)->name = NULL; (*pnt)->got_rr_name = 0; (*pnt)->table = NULL; (*pnt)->whole_name = NULL; (*pnt)->filedir = NULL; (*pnt)->parent_rec = NULL; /* * Set this information so that we correctly cache previous * session bits of information. */ (*pnt)->inode = (*pnt)->starting_block; (*pnt)->dev = PREV_SESS_DEV; (*pnt)->rr_attributes = NULL; (*pnt)->rr_attr_size = 0; (*pnt)->total_rr_attr_size = 0; (*pnt)->de_flags = SAFE_TO_REUSE_TABLE_ENTRY; #ifdef APPLE_HYB (*pnt)->assoc = NULL; (*pnt)->hfs_ent = NULL; #endif /* APPLE_HYB */ /* * Check for and parse any RR attributes for the file. All we * are really looking for here is the original name of the * file. */ rlen = idr->length[0] & 0xff; cpnt = (unsigned char *) idr; rlen -= offsetof(struct iso_directory_record, name[0]); cpnt += offsetof(struct iso_directory_record, name[0]); rlen -= idr->name_len[0]; cpnt += idr->name_len[0]; if ((idr->name_len[0] & 1) == 0) { cpnt++; rlen--; } if (no_rr) rlen = 0; if (rlen > 0) { (*pnt)->total_rr_attr_size = (*pnt)->rr_attr_size = rlen; (*pnt)->rr_attributes = e_malloc(rlen); memcpy((*pnt)->rr_attributes, cpnt, rlen); seen_rockridge = 1; } #ifdef DEBUG fprintf(stderr, "INT name: '%s' ist: %d soll: %d\n", (*pnt)->isorec.name, strlen((*pnt)->isorec.name), idr->name_len[0]); #endif if (idr->name_len[0] < sizeof ((*pnt)->isorec.name)) { /* * Now zero out the remainder of the name field. */ cpnt = (unsigned char *) (*pnt)->isorec.name; cpnt += idr->name_len[0]; memset(cpnt, 0, sizeof ((*pnt)->isorec.name) - idr->name_len[0]); } else { /* * Simple sanity work to make sure that we have no * illegal data structures in our tree. */ (*pnt)->isorec.name[MAX_ISONAME] = '\0'; (*pnt)->isorec.name_len[0] = MAX_ISONAME; } /* * If the filename len from the old session is more * then 31 chars, there is a high risk of hard violations * if the ISO9660 standard. * Run it through our name canonication machine.... */ if (idr->name_len[0] > LEN_ISONAME || check_oldnames) { iso9660_check(idr, *pnt); } if (parse_rr((*pnt)->rr_attributes, rlen, *pnt) == -1) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Cannot parse Rock Ridge attributes for '%s'.\n", idr->name); #else fprintf(stderr, "Cannot parse Rock Ridge attributes for '%s'.\n", idr->name); exit(1); #endif } if (((*pnt)->isorec.name_len[0] == 1) && (((*pnt)->isorec.name[0] == 0) || /* "." entry */ ((*pnt)->isorec.name[0] == 1))) { /* ".." entry */ if ((*pnt)->name != NULL) { free((*pnt)->name); } if ((*pnt)->whole_name != NULL) { free((*pnt)->whole_name); } if ((*pnt)->isorec.name[0] == 0) { (*pnt)->name = strdup("."); } else { (*pnt)->name = strdup(".."); } } #ifdef DEBUG fprintf(stderr, "got DE name: %s\n", (*pnt)->name); #endif if (strncmp(idr->name, trans_tbl, strlen(trans_tbl)) == 0) { if ((*pnt)->name != NULL) { free((*pnt)->name); } if ((*pnt)->whole_name != NULL) { free((*pnt)->whole_name); } /* (*pnt)->name = strdup("");*/ (*pnt)->name = strdup(trans_tbl); tt_extent = isonum_733((unsigned char *) idr->extent); tt_size = isonum_733((unsigned char *) idr->size); if (tt_extent == 0) tt_size = 0; } pnt++; i += idr->length[0]; } #ifdef APPLE_HYB /* * If we find an associated file, check if there is a file * with same ISO name and link it to this entry */ for (pnt = rtn, i = 0; i < nent; i++, pnt++) { int j; rlen = isonum_711((*pnt)->isorec.name_len); if ((*pnt)->isorec.flags[0] & ISO_ASSOCIATED) { for (j = 0; j < nent; j++) { if (strncmp(rtn[j]->isorec.name, (*pnt)->isorec.name, rlen) == 0 && (rtn[j]->isorec.flags[0] & ISO_ASSOCIATED) == 0) { rtn[j]->assoc = *pnt; /* * don't want this entry to be * in the Joliet tree */ (*pnt)->de_flags |= INHIBIT_JOLIET_ENTRY; /* * as we have associated files, then * assume we are are dealing with * Apple's extensions - if not already * set */ if (apple_both == 0) { apple_both = apple_ext = 1; } break; } } } } #endif /* APPLE_HYB */ /* * If there was a TRANS.TBL;1 entry, then grab it, read it, and use it * to get the filenames of the files. Also, save the table info, just * in case we need to use it. * * The entries look something like: F ISODUMP.;1 isodump */ if (tt_extent != 0 && tt_size != 0) { nbytes = roundup(tt_size, SECTOR_SIZE); tt_buf = (unsigned char *) e_malloc(nbytes); readsecs(tt_extent, tt_buf, nbytes / SECTOR_SIZE); /* * Loop through the file, examine each entry, and attempt to * attach it to the correct entry. */ cpnt = tt_buf; cpnt1 = tt_buf; while (cpnt - tt_buf < tt_size) { /* Skip to a line terminator, or end of the file. */ while ((cpnt1 - tt_buf < tt_size) && (*cpnt1 != '\n') && (*cpnt1 != '\0')) { cpnt1++; } /* Zero terminate this particular line. */ if (cpnt1 - tt_buf < tt_size) { *cpnt1 = '\0'; } /* * Now dig through the actual directories, and try and * find the attachment for this particular filename. */ for (pnt = rtn, i = 0; i < nent; i++, pnt++) { rlen = isonum_711((*pnt)->isorec.name_len); /* * If this filename is so long that it would * extend past the end of the file, it cannot * be the one we want. */ if (cpnt + 2 + rlen - tt_buf >= tt_size) { continue; } /* * Now actually compare the name, and make sure * that the character at the end is a ' '. */ if (strncmp((char *) cpnt + 2, (*pnt)->isorec.name, rlen) == 0 && cpnt[2 + rlen] == ' ' && (p = strchr((char *)&cpnt[2 + rlen], '\t'))) { p++; /* * This is a keeper. Now determine the * correct table entry that we will * use on the new image. */ if (strlen(p) > 0) { (*pnt)->table = e_malloc(strlen(p) + 4); sprintf((*pnt)->table, "%c\t%s\n", *cpnt, p); } if (!(*pnt)->got_rr_name) { if ((*pnt)->name != NULL) { free((*pnt)->name); } (*pnt)->name = strdup(p); } break; } } cpnt = cpnt1 + 1; cpnt1 = cpnt; } free(tt_buf); } else if (!seen_rockridge && !warning_given) { /* * Warn the user that iso-9660 names were used because neither * Rock Ridge (-R) nor TRANS.TBL (-T) name translations were * found. */ fprintf(stderr, "Warning: Neither Rock Ridge (-R) nor TRANS.TBL (-T) \n"); fprintf(stderr, "name translations were found on previous session.\n"); fprintf(stderr, "ISO-9660 file names have been used instead.\n"); warning_given = 1; } if (dirbuff != NULL) { free(dirbuff); } *nentp = nent; return (rtn); }/* read_merging_directory */ /* * Free any associated data related to the structures. */ static int free_mdinfo(struct directory_entry **ptr, int len) { int i; struct directory_entry **p; p = ptr; for (i = 0; i < len; i++, p++) { /* * If the tree-handling code decided that it needed an entry, it * will have removed it from the list. Thus we must allow for * null pointers here. */ if (*p == NULL) { continue; } free_directory_entry(*p); } free(ptr); return (0); } static void free_directory_entry(struct directory_entry *dirp) { if (dirp->name != NULL) free(dirp->name); if (dirp->whole_name != NULL) free(dirp->whole_name); if (dirp->rr_attributes != NULL) free(dirp->rr_attributes); if (dirp->table != NULL) free(dirp->table); free(dirp); } /* * Search the list to see if we have any entries from the previous * session that match this entry. If so, copy the extent number * over so we don't bother to write it out to the new session. */ int check_prev_session(struct directory_entry **ptr, int len, struct directory_entry *curr_entry, struct stat *statbuf, struct stat *lstatbuf, struct directory_entry **odpnt) { int i; int rr; int retcode = 0; /* Default not found */ for (i = 0; i < len; i++) { if (ptr[i] == NULL) { /* Used or empty entry skip */ continue; } #if 0 if (ptr[i]->name != NULL && ptr[i]->isorec.name_len[0] == 1 && ptr[i]->name[0] == '\0') { continue; } if (ptr[i]->name != NULL && ptr[i]->isorec.name_len[0] == 1 && ptr[i]->name[0] == 1) { continue; } #else if (ptr[i]->name != NULL && strcmp(ptr[i]->name, ".") == 0) { continue; } if (ptr[i]->name != NULL && strcmp(ptr[i]->name, "..") == 0) { continue; } #endif if (ptr[i]->name != NULL && strcmp(ptr[i]->name, curr_entry->name) != 0) { /* Not the same name continue */ continue; } /* * It's a directory so we must always merge it with the new * session. Never ever reuse directory extents. See comments * in tree.c for an explaination of why this must be the case. */ if ((curr_entry->isorec.flags[0] & ISO_DIRECTORY) != 0) { retcode = 2; /* Flag directory case */ goto found_it; } /* * We know that the files have the same name. If they also * have the same file type (i.e. file, dir, block, etc), then * we can safely reuse the TRANS.TBL entry for this file. The * check_rr_dates() function will do this for us. * * Verify that the file type and dates are consistent. If not, * we probably have a different file, and we need to write it * out again. */ retcode = 1; /* We found a non directory */ if (ptr[i]->rr_attributes != NULL) { if ((rr = check_rr_dates(ptr[i], curr_entry, statbuf, lstatbuf)) == -1) return (-1); if (rr == 0) { /* Different files */ goto found_it; } } /* * Verify size and timestamp. If rock ridge is in use, we * need to compare dates from RR too. Directories are special, * we calculate their size later. */ if (ptr[i]->size != curr_entry->size) { /* Different files */ goto found_it; } if (memcmp(ptr[i]->isorec.date, curr_entry->isorec.date, 7) != 0) { /* Different files */ goto found_it; } /* We found it and we can reuse the extent */ memcpy(curr_entry->isorec.extent, ptr[i]->isorec.extent, 8); curr_entry->starting_block = isonum_733((unsigned char *)ptr[i]->isorec.extent); curr_entry->de_flags |= SAFE_TO_REUSE_TABLE_ENTRY; goto found_it; } return (retcode); found_it: if (odpnt != NULL) { *odpnt = ptr[i]; } else { free(ptr[i]); } ptr[i] = NULL; return (retcode); } /* * open_merge_image: Open an existing image. */ int open_merge_image(char *path) { #ifndef USE_SCG in_image = fopen(path, "rb"); if (in_image == NULL) { return (-1); } #else in_image = fopen(path, "rb"); if (in_image == NULL) { if (scsidev_open(path) < 0) return (-1); } #endif return (0); } /* * close_merge_image: Close an existing image. */ int close_merge_image() { #ifdef USE_SCG return (scsidev_close()); #else return (fclose(in_image)); #endif } /* * merge_isofs: Scan an existing image, and return a pointer * to the root directory for this image. */ struct iso_directory_record * merge_isofs(char *path) { char buffer[SECTOR_SIZE]; int file_addr; int i; struct iso_primary_descriptor *pri = NULL; struct iso_directory_record *rootp; struct iso_volume_descriptor *vdp; /* * Start by searching for the volume header. Ultimately, we need to * search for volume headers in multiple places because we might be * starting with a multisession image. FIXME(eric). */ get_session_start(&file_addr); for (i = 0; i < 100; i++) { if (readsecs(file_addr, buffer, sizeof (buffer) / SECTOR_SIZE) != sizeof (buffer)) { #ifdef USE_LIBSCHILY comerr(" Read error on old image %s\n", path); #else fprintf(stderr, " Read error on old image %s\n", path); exit(10); #endif } vdp = (struct iso_volume_descriptor *) buffer; if ((strncmp(vdp->id, ISO_STANDARD_ID, sizeof (vdp->id)) == 0) && (isonum_711((unsigned char *) vdp->type) == ISO_VD_PRIMARY)) { break; } file_addr += 1; } if (i == 100) { return (NULL); } pri = (struct iso_primary_descriptor *) vdp; /* Check the blocksize of the image to make sure it is compatible. */ if (isonum_723((unsigned char *) pri->logical_block_size) != SECTOR_SIZE) { errmsgno(EX_BAD, "Previous session has incompatible sector size %d.\n", isonum_723((unsigned char *) pri->logical_block_size)); return (NULL); } if (isonum_723((unsigned char *) pri->volume_set_size) != 1) { errmsgno(EX_BAD, "Previous session has volume set size %d (must be 1).\n", isonum_723((unsigned char *) pri->volume_set_size)); return (NULL); } /* Get the location and size of the root directory. */ rootp = (struct iso_directory_record *) e_malloc(sizeof (struct iso_directory_record)); memcpy(rootp, pri->root_directory_record, sizeof (*rootp)); return (rootp); } static void merge_remaining_entries(struct directory *this_dir, struct directory_entry **pnt, int n_orig) { int i; struct directory_entry *s_entry; unsigned int ttbl_extent = 0; unsigned int ttbl_index = 0; char whole_path[PATH_MAX]; /* * Whatever is leftover in the list needs to get merged back into the * directory. */ for (i = 0; i < n_orig; i++) { if (pnt[i] == NULL) { continue; } if (pnt[i]->name != NULL && pnt[i]->whole_name == NULL) { /* Set the name for this directory. */ strcpy(whole_path, this_dir->de_name); strcat(whole_path, SPATH_SEPARATOR); strcat(whole_path, pnt[i]->name); pnt[i]->whole_name = strdup(whole_path); } if (pnt[i]->name != NULL && /* strcmp(pnt[i]->name, "") == 0 )*/ strcmp(pnt[i]->name, trans_tbl) == 0) { ttbl_extent = isonum_733((unsigned char *)pnt[i]->isorec.extent); ttbl_index = i; continue; } /* * Skip directories for now - these need to be treated * differently. */ if ((pnt[i]->isorec.flags[0] & ISO_DIRECTORY) != 0) { /* * FIXME - we need to insert this directory into the * tree, so that the path tables we generate will be * correct. */ if ((strcmp(pnt[i]->name, ".") == 0) || (strcmp(pnt[i]->name, "..") == 0)) { free_directory_entry(pnt[i]); pnt[i] = NULL; continue; } else { merge_old_directory_into_tree(pnt[i], this_dir); } } pnt[i]->next = this_dir->contents; pnt[i]->filedir = this_dir; this_dir->contents = pnt[i]; pnt[i] = NULL; } /* * If we don't have an entry for the translation table, then don't * bother trying to copy the starting extent over. Note that it is * possible that if we are copying the entire directory, the entry for * the translation table will have already been inserted into the * linked list and removed from the old entries list, in which case we * want to leave the extent number as it was before. */ if (ttbl_extent == 0) { return; } /* * Finally, check the directory we are creating to see whether there * are any new entries in it. If there are not, we can reuse the same * translation table. */ for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { /* * Don't care about '.' or '..'. They are never in the table * anyways. */ if (s_entry->name != NULL && strcmp(s_entry->name, ".") == 0) { continue; } if (s_entry->name != NULL && strcmp(s_entry->name, "..") == 0) { continue; } /* if (strcmp(s_entry->name, "") == 0)*/ if (strcmp(s_entry->name, trans_tbl) == 0) { continue; } if ((s_entry->de_flags & SAFE_TO_REUSE_TABLE_ENTRY) == 0) { return; } } /* * Locate the translation table, and re-use the same extent. It isn't * clear that there should ever be one in there already so for now we * try and muddle through the best we can. */ for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { /* if (strcmp(s_entry->name, "") == 0)*/ if (strcmp(s_entry->name, trans_tbl) == 0) { fprintf(stderr, "Should never get here\n"); set_733(s_entry->isorec.extent, ttbl_extent); return; } } pnt[ttbl_index]->next = this_dir->contents; pnt[ttbl_index]->filedir = this_dir; this_dir->contents = pnt[ttbl_index]; pnt[ttbl_index] = NULL; } /* * Here we have a case of a directory that has completely disappeared from * the face of the earth on the tree we are mastering from. Go through and * merge it into the tree, as well as everything beneath it. * * Note that if a directory has been moved for some reason, this will * incorrectly pick it up and attempt to merge it back into the old * location. FIXME(eric). */ static int merge_old_directory_into_tree(struct directory_entry *dpnt, struct directory *parent) { struct directory_entry **contents = NULL; int i; int n_orig; struct directory *this_dir, *next_brother; char whole_path[PATH_MAX]; this_dir = (struct directory *) e_malloc(sizeof (struct directory)); memset(this_dir, 0, sizeof (struct directory)); this_dir->next = NULL; this_dir->subdir = NULL; this_dir->self = dpnt; this_dir->contents = NULL; this_dir->size = 0; this_dir->extent = 0; this_dir->depth = parent->depth + 1; this_dir->parent = parent; if (!parent->subdir) parent->subdir = this_dir; else { next_brother = parent->subdir; while (next_brother->next) next_brother = next_brother->next; next_brother->next = this_dir; } /* Set the name for this directory. */ strcpy(whole_path, parent->de_name); strcat(whole_path, SPATH_SEPARATOR); strcat(whole_path, dpnt->name); this_dir->de_name = strdup(whole_path); this_dir->whole_name = strdup(whole_path); /* * Now fill this directory using information from the previous session. */ contents = read_merging_directory(&dpnt->isorec, &n_orig); /* * Start by simply copying the '.', '..' and non-directory entries to * this directory. Technically we could let merge_remaining_entries * handle this, but it gets rather confused by the '.' and '..' entries */ for (i = 0; i < n_orig; i++) { /* * We can always reuse the TRANS.TBL in this particular case. */ contents[i]->de_flags |= SAFE_TO_REUSE_TABLE_ENTRY; if (((contents[i]->isorec.flags[0] & ISO_DIRECTORY) != 0) && (i >= 2)) { continue; } /* If we have a directory, don't reuse the extent number. */ if ((contents[i]->isorec.flags[0] & ISO_DIRECTORY) != 0) { memset(contents[i]->isorec.extent, 0, 8); if (strcmp(contents[i]->name, ".") == 0) this_dir->dir_flags |= DIR_HAS_DOT; if (strcmp(contents[i]->name, "..") == 0) this_dir->dir_flags |= DIR_HAS_DOTDOT; } /* * for regilar files, we do it here. * If it has CL or RE attributes, remember its extent */ check_rr_relocation(contents[i]); /* * Set the whole name for this file. */ strcpy(whole_path, this_dir->whole_name); strcat(whole_path, SPATH_SEPARATOR); strcat(whole_path, contents[i]->name); contents[i]->whole_name = strdup(whole_path); contents[i]->next = this_dir->contents; contents[i]->filedir = this_dir; this_dir->contents = contents[i]; contents[i] = NULL; } /* * and for directories, we do it here. * If it has CL or RE attributes, remember its extent */ check_rr_relocation(dpnt); /* * Zero the extent number for ourselves. */ memset(dpnt->isorec.extent, 0, 8); /* * Anything that is left are other subdirectories that need to be * merged. */ merge_remaining_entries(this_dir, contents, n_orig); free_mdinfo(contents, n_orig); #if 0 /* * This is no longer required. The post-scan sort will handle all of * this for us. */ sort_n_finish(this_dir); #endif return (0); } char *cdrecord_data = NULL; int get_session_start(int *file_addr) { char *pnt; #ifdef CDRECORD_DETERMINES_FIRST_WRITABLE_ADDRESS /* * FIXME(eric). We need to coordinate with cdrecord to obtain the * parameters. For now, we assume we are writing the 2nd session, so * we start from the session that starts at 0. */ if (file_addr != NULL) *file_addr = 16; /* * We need to coordinate with cdrecord to get the next writable address * from the device. Here is where we use it. */ session_start = last_extent = last_extent_written = cdrecord_result(); #else if (file_addr != NULL) *file_addr = 0L; session_start = last_extent = last_extent_written = 0L; if (check_session && cdrecord_data == NULL) return (0); if (cdrecord_data == NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Special parameters for cdrecord not specified with -C\n"); #else fprintf(stderr, "Special parameters for cdrecord not specified with -C\n"); exit(1); #endif } /* * Next try and find the ',' in there which delimits the two numbers. */ pnt = strchr(cdrecord_data, ','); if (pnt == NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Malformed cdrecord parameters\n"); #else fprintf(stderr, "Malformed cdrecord parameters\n"); exit(1); #endif } *pnt = '\0'; if (file_addr != NULL) { *file_addr = atol(cdrecord_data); } pnt++; session_start = last_extent = last_extent_written = atol(pnt); pnt--; *pnt = ','; #endif return (0); } /* * This function scans the directory tree, looking for files, and it makes * note of everything that is found. We also begin to construct the ISO9660 * directory entries, so that we can determine how large each directory is. */ int merge_previous_session(struct directory *this_dir, struct iso_directory_record *mrootp, char *reloc_root, char *reloc_old_root) { struct directory_entry **orig_contents = NULL; struct directory_entry *odpnt = NULL; int n_orig; struct directory_entry *s_entry; int status; int lstatus; struct stat statbuf, lstatbuf; int retcode; /* skip leading slash */ while (reloc_old_root && reloc_old_root[0] == PATH_SEPARATOR) { reloc_old_root++; } while (reloc_root && reloc_root[0] == PATH_SEPARATOR) { reloc_root++; } /* * Parse the same directory in the image that we are merging for * multisession stuff. */ orig_contents = read_merging_directory(mrootp, &n_orig); if (orig_contents == NULL) { if (reloc_old_root) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Reading old session failed, cannot execute -old-root.\n"); #else fprintf(stderr, "Reading old session failed, cannot execute -old-root.\n"); exit(1); #endif } return (0); } if (reloc_old_root && reloc_old_root[0]) { struct directory_entry **new_orig_contents = orig_contents; int new_n_orig = n_orig; /* decend until we reach the original root */ while (reloc_old_root[0]) { int i; char *next; int last; for (next = reloc_old_root; *next && *next != PATH_SEPARATOR; next++); if (*next) { last = 0; *next = 0; next++; } else { last = 1; } while (*next == PATH_SEPARATOR) { next++; } for (i = 0; i < new_n_orig; i++) { struct iso_directory_record subroot; if (new_orig_contents[i]->name != NULL && strcmp(new_orig_contents[i]->name, reloc_old_root) != 0) { /* Not the same name continue */ continue; } /* * enter directory, free old one only if not the top level, * which is still needed */ subroot = new_orig_contents[i]->isorec; if (new_orig_contents != orig_contents) { free_mdinfo(new_orig_contents, new_n_orig); } new_orig_contents = read_merging_directory(&subroot, &new_n_orig); if (!new_orig_contents) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Reading directory %s in old session failed, cannot execute -old-root.\n", reloc_old_root); #else fprintf(stderr, "Reading directory %s in old session failed, cannot execute -old-root.\n", reloc_old_root); exit(1); #endif } i = -1; break; } if (i == new_n_orig) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "-old-root (sub)directory %s not found in old session.\n", reloc_old_root); #else fprintf(stderr, "-old-root (sub)directory %s not found in old session.\n", reloc_old_root); exit(1); #endif } /* restore string, proceed to next sub directory */ if (!last) { reloc_old_root[strlen(reloc_old_root)] = PATH_SEPARATOR; } reloc_old_root = next; } /* * preserve the old session, skipping those dirs/files that are found again * in the new root */ for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { status = stat_filter(s_entry->whole_name, &statbuf); lstatus = lstat_filter(s_entry->whole_name, &lstatbuf); /* * check_prev_session() will search for s_entry and remove it from * orig_contents if found */ retcode = check_prev_session(orig_contents, n_orig, s_entry, &statbuf, &lstatbuf, NULL); if (retcode == -1) return (-1); } merge_remaining_entries(this_dir, orig_contents, n_orig); /* use new directory */ free_mdinfo(orig_contents, n_orig); orig_contents = new_orig_contents; n_orig = new_n_orig; if (reloc_root && reloc_root[0]) { /* also decend into new root before searching for files */ this_dir = find_or_create_directory(this_dir, reloc_root, NULL, TRUE, NULL); if (!this_dir) { return (-1); } } } /* * Now we scan the directory itself, and look at what is inside of it. */ for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { status = stat_filter(s_entry->whole_name, &statbuf); lstatus = lstat_filter(s_entry->whole_name, &lstatbuf); /* * We always should create an entirely new directory tree * whenever we generate a new session, unless there were * *no* changes whatsoever to any of the directories, in which * case it would be kind of pointless to generate a new * session. * I believe it is possible to rigorously prove that any change * anywhere in the filesystem will force the entire tree to be * regenerated because the modified directory will get a new * extent number. Since each subdirectory of the changed * directory has a '..' entry, all of them will need to be * rewritten too, and since the parent directory of the * modified directory will have an extent pointer to the * directory it too will need to be rewritten. Thus we will * never be able to reuse any directory information when * writing new sessions. * * We still check the previous session so we can mark off the * equivalent entry in the list we got from the original disc, * however. */ /* * The check_prev_session function looks for an identical * entry in the previous session. If we see it, then we copy * the extent number to s_entry, and cross it off the list. * It returns 2 if it's a directory */ retcode = check_prev_session(orig_contents, n_orig, s_entry, &statbuf, &lstatbuf, &odpnt); if (retcode == -1) return (-1); if (retcode == 2 && odpnt != NULL) { int dflag; if (strcmp(s_entry->name, ".") != 0 && strcmp(s_entry->name, "..") != 0) { struct directory *child; /* * XXX It seems that the tree that has been * XXX read from the previous session does not * XXX carry whole_name entries. We provide a * XXX hack in * XXX multi.c:find_or_create_directory() * XXX that should be removed when a * XXX reasonable method could be found. */ child = find_or_create_directory(this_dir, s_entry->whole_name, s_entry, 1, NULL); dflag = merge_previous_session(child, &odpnt->isorec, NULL, reloc_old_root); if (dflag == -1) { return (-1); } free(odpnt); odpnt = NULL; } } } if (!reloc_old_root) { /* * Whatever is left over, are things which are no longer in the tree on * disk. We need to also merge these into the tree. */ merge_remaining_entries(this_dir, orig_contents, n_orig); } free_mdinfo(orig_contents, n_orig); return (1); } /* * This code deals with relocated directories which may exist * in the previous session. */ struct dir_extent_link { unsigned int extent; struct directory_entry *de; struct dir_extent_link *next; }; static struct dir_extent_link *cl_dirs = NULL; static struct dir_extent_link *re_dirs = NULL; static void check_rr_relocation(struct directory_entry *de) { unsigned char sector[SECTOR_SIZE]; unsigned char *pnt = de->rr_attributes; int len = de->rr_attr_size; int cont_extent = 0, cont_offset = 0, cont_size = 0; pnt = parse_xa(pnt, &len, /* dpnt */ 0); while (len >= 4) { if (pnt[3] != 1 && pnt[3] != 2) { #ifdef USE_LIBSCHILY errmsgno(EX_BAD, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #else fprintf(stderr, "**BAD RRVERSION (%d) for %c%c\n", pnt[3], pnt[0], pnt[1]); #endif } if (strncmp((char *) pnt, "CL", 2) == 0) { struct dir_extent_link *dlink = e_malloc(sizeof (*dlink)); dlink->extent = isonum_733(pnt + 4); dlink->de = de; dlink->next = cl_dirs; cl_dirs = dlink; } else if (strncmp((char *) pnt, "RE", 2) == 0) { struct dir_extent_link *dlink = e_malloc(sizeof (*dlink)); dlink->extent = de->starting_block; dlink->de = de; dlink->next = re_dirs; re_dirs = dlink; } else if (strncmp((char *) pnt, "CE", 2) == 0) { cont_extent = isonum_733(pnt + 4); cont_offset = isonum_733(pnt + 12); cont_size = isonum_733(pnt + 20); } else if (strncmp((char *) pnt, "ST", 2) == 0) { len = pnt[2]; } len -= pnt[2]; pnt += pnt[2]; if (len <= 3 && cont_extent) { /* ??? What if cont_offset+cont_size > SECTOR_SIZE */ readsecs(cont_extent, sector, 1); pnt = sector + cont_offset; len = cont_size; cont_extent = cont_offset = cont_size = 0; } } } void match_cl_re_entries() { struct dir_extent_link *re = re_dirs; /* for each relocated directory */ for (; re; re = re->next) { struct dir_extent_link *cl = cl_dirs; for (; cl; cl = cl->next) { /* find a place where it was relocated from */ if (cl->extent == re->extent) { /* set link to that place */ re->de->parent_rec = cl->de; re->de->filedir = cl->de->filedir; /* * see if it is in rr_moved */ if (reloc_dir != NULL) { struct directory_entry *rr_moved_e = reloc_dir->contents; for (; rr_moved_e; rr_moved_e = rr_moved_e->next) { /* yes it is */ if (re->de == rr_moved_e) { /* forget it */ re->de = NULL; } } } break; } } } } void finish_cl_pl_for_prev_session() { struct dir_extent_link *re = re_dirs; /* for those that were relocated, but NOT to rr_moved */ re = re_dirs; for (; re; re = re->next) { if (re->de != NULL) { /* * here we have hypothetical case when previous session * was not created by genisoimage and contains relocations */ struct directory_entry *s_entry = re->de; struct directory_entry *s_entry1; struct directory *d_entry = reloc_dir->subdir; /* do the same as finish_cl_pl_entries */ if (s_entry->de_flags & INHIBIT_ISO9660_ENTRY) { continue; } while (d_entry) { if (d_entry->self == s_entry) break; d_entry = d_entry->next; } if (!d_entry) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Unable to locate directory parent\n"); #else fprintf(stderr, "Unable to locate directory parent\n"); exit(1); #endif } if (s_entry->filedir != NULL && s_entry->parent_rec != NULL) { char *rr_attr; /* * First fix the PL pointer in the directory in the * rr_reloc dir */ s_entry1 = d_entry->contents->next; rr_attr = find_rr_attribute(s_entry1->rr_attributes, s_entry1->total_rr_attr_size, "PL"); if (rr_attr != NULL) set_733(rr_attr + 4, s_entry->filedir->extent); /* Now fix the CL pointer */ s_entry1 = s_entry->parent_rec; rr_attr = find_rr_attribute(s_entry1->rr_attributes, s_entry1->total_rr_attr_size, "CL"); if (rr_attr != NULL) set_733(rr_attr + 4, d_entry->extent); } } } /* free memory */ re = re_dirs; while (re) { struct dir_extent_link *next = re->next; free(re); re = next; } re = cl_dirs; while (re) { struct dir_extent_link *next = re->next; free(re); re = next; } } cdrkit-1.1.11/genisoimage/hdisk.pl0000755000372500001440000000414110471375025016061 0ustar steveusers#!/usr/bin/perl ############################################################################### # # hfsutils - tools for reading and writing Macintosh HFS volumes # Copyright (C) 1996, 1997 Robert Leslie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ############################################################################### die "Usage: $0 device-path\n" unless (@ARGV == 1); ($disk) = @ARGV; format STDOUT_TOP = # Partition Type HFS Volume Name Start Length ------------------------------------------------------------------------------- . format STDOUT = @# @<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<< @####### @######## $bnum, $pmParType, $drVN, $pmPyPartStart, $pmPartBlkCnt . open(DISK, $disk) || die "$disk: $!\n"; $bnum = 1; do { seek(DISK, 512 * $bnum, 0) || die "seek: $!\n"; read(DISK, $block, 512) || die "read: $!\n"; ($pmSig, $pmMapBlkCnt, $pmPyPartStart, $pmPartBlkCnt, $pmParType) = (unpack('n2 N3 A32 A32 N10 A16', $block))[0, 2..4, 6]; die "$disk: unsupported partition map\n" if ($pmSig == 0x5453); die "$disk: no partition map\n" unless ($pmSig == 0x504d); if ($pmParType eq 'Apple_HFS') { seek(DISK, 512 * ($pmPyPartStart + 2), 0) || die "seek: $!\n"; read(DISK, $block, 512) || die "read: $!\n"; ($len, $drVN) = (unpack('n N2 n5 N2 n N n c A27', $block))[13, 14]; $drVN = substr($drVN, 0, $len); } else { $drVN = ''; } write; } while ($bnum++ < $pmMapBlkCnt); close(DISK); cdrkit-1.1.11/genisoimage/ifo_types.h0000644000372500001440000000521510531416235016570 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)ifo_types.h 1.2 04/03/02 joerg */ #ifndef _IFO_TYPES_H #define _IFO_TYPES_H /* * Copyright (C) 2001, 2002 Billy Biggs , * Håkan Hjort , * Olaf Beck * (I only did the cut down no other contribs) * Jörg Schilling * (making the code portable) * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * NOTE: This is a cut down version of libdvdread for genisoimage, due * to portability issues with the current libdvdread according to * the maintainer of genisoimage. * This cut down version only reads from a harddisk file structure * and it only implements the functions necessary inorder to make * genisoimage produce valid DVD-Video images. * DON'T USE THIS LIBRARY IN ANY OTHER PROGRAM GET THE REAL * LIBDVDREAD INSTEAD */ #include "dvd_reader.h" typedef struct { UInt32_t title_set_sector; /* sector */ } title_info_t; typedef struct { UInt16_t nr_of_srpts; title_info_t * title; /* array of title info */ } tt_srpt_t; typedef struct { UInt32_t vmg_last_sector; /*sector */ UInt32_t vmgi_last_sector; /* sector */ UInt16_t vmg_nr_of_title_sets; UInt32_t vmgm_vobs; /* sector */ UInt32_t tt_srpt; /* sector */ } vmgi_mat_t; typedef struct { UInt32_t vts_last_sector; /* sector */ UInt32_t vtsi_last_sector; /* sector */ UInt32_t vtsm_vobs; /* sector */ UInt32_t vtstt_vobs; /* sector */ } vtsi_mat_t; typedef struct { /* VMGI */ vmgi_mat_t * vmgi_mat; tt_srpt_t * tt_srpt; /* VTSI */ vtsi_mat_t * vtsi_mat; } ifo_handle_t; #endif /* _IFO_TYPES_H */ cdrkit-1.1.11/genisoimage/RELEASE0000644000372500001440000000006010471375025015416 0ustar steveusers# @(#)RELEASE 1.35 04/09/09 joerg Release 2.01 cdrkit-1.1.11/genisoimage/desktop.c0000644000372500001440000001133410536265343016241 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)desktop.c 1.6 04/03/04 joerg, Copyright 1997, 1998, 1999, 2000 James Pearson */ /* * Copyright (c) 1997, 1998, 1999, 2000 James Pearson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * make_desktop: create "Desktop DB" and "Desktop DF" files. * * These are set up to prevent the Mac "rebuilding the desktop" * when the CD is inserted ??? * * I don't know if these files should be populated, but I've just * created these files in their initial states: * * Desktop DB: Initial size == volume's clump size * first block contents found by using od ... * rest of file seems to be padding * No resource fork * * Desktop DF: Empty * * If the files already exist, then set correct type/creator/flags * * James Pearson 11/8/97 * Adapted from mkhfs routines for mkhybrid */ #ifdef APPLE_HYB #include #include "genisoimage.h" #define DB "Desktop DB" #define DBFC "DMGR" #define DBT "BTFL" #define DF "Desktop DF" #define DFT "DTFL" /* * from "data.h" - libhfs routines */ extern void d_putw(unsigned char *, short); extern void d_putl(unsigned char *, long); int make_desktop(hfsvol *vol, int end); extern hce_mem *hce; /* libhfs/genisoimage extras */ int make_desktop(hfsvol *vol, int end) { hfsfile *hfp; /* Mac file */ hfsdirent ent; /* Mac finderinfo */ unsigned long clps; /* clump size */ unsigned short blks; /* blocks in a clump */ unsigned char *blk; /* user data */ /* * set up default directory entries - not all these fields are needed, * but we'll set them up anyway ... * First do a memset because there was a report about randomly * changing Desktop DB/DF entries... */ memset(&ent, 0, sizeof (hfsdirent)); /* First clear all ... */ ent.u.file.rsize = 0; /* resource size == 0 */ strcpy(ent.u.file.creator, DBFC); /* creator */ strcpy(ent.u.file.type, DBT); /* type */ ent.crdate = ent.mddate = time(0); /* date is now */ ent.fdflags = HFS_FNDR_ISINVISIBLE; /* invisible files */ /* * clear the DB file */ blk = hce->hfs_ce + hce->hfs_ce_size * HFS_BLOCKSZ; blks = hce->hfs_dt_size; clps = blks * HFS_BLOCKSZ; memset(blk, 0, clps); /* * create "Desktop DB" (if it doesn't exist) */ if (hfs_create(vol, DB, ent.u.file.type, ent.u.file.creator) == 0) { /* * DB file size from hce_mem info * set up "Desktop DB" data - following found by od'ing the * "Desktop DB" file */ d_putw(blk + 8, 0x100); d_putw(blk + 10, 0x3); d_putw(blk + 32, 0x200); d_putw(blk + 34, 0x25); d_putl(blk + 36, blks); d_putl(blk + 40, blks - 1); d_putl(blk + 46, clps); d_putw(blk + 50, 0xff); d_putw(blk + 120, 0x20a); d_putw(blk + 122, 0x100); d_putw(blk + 248, 0x8000); d_putl(blk + 504, 0x1f800f8); d_putl(blk + 508, 0x78000e); /* entries for "Desktop DB" */ ent.u.file.dsize = clps; /* size = clump size */ /* open file */ if ((hfp = hfs_open(vol, DB)) == 0) perr(hfs_error); /* "write" file */ write_fork(hfp, clps); /* set DB file attributes */ if (hfs_fsetattr(hfp, &ent) < 0) perr(hfs_error); /* find the real start of the file */ end += hce->hfs_ce_size; /* close DB file */ if (hfs_close(hfp, end, 0) < 0) perr(hfs_error); } else { /* * if it already exists, then make sure it has the correct * type/creator and flags */ if (hfs_setattr(vol, DB, &ent) < 0) perr(hfs_error); } /* setup "Desktop DF" file as an empty file */ strcpy(ent.u.file.type, DFT); /* type */ ent.u.file.dsize = 0; /* empty */ /* create DF file (if it doesn't exist) - no need to open it */ hfs_create(vol, DF, ent.u.file.type, ent.u.file.creator); /* set DB file attributes */ if (hfs_setattr(vol, DF, &ent) < 0) perr(hfs_error); return (0); } #endif /* APPLE_HYB */ cdrkit-1.1.11/genisoimage/boot-alpha.c0000644000372500001440000001127310545504751016617 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* * Program boot-alpha.c - Handle Linux alpha boot extensions to iso9660. * * Written by Steve McIntyre June 2004 * * Heavily inspired by isomarkboot by David Mosberger in 1996. * * Copyright 2004 Steve McIntyre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "genisoimage.h" #include #include #include #include "match.h" #include "diskmbr.h" #include "bootinfo.h" #include #include "endianconv.h" int add_boot_alpha_filename(char *filename); static int boot_alpha_write(FILE *outfile); static int boot_alpha_hppa_write(FILE *outfile); static char *boot_file_name = NULL; unsigned long long alpha_hppa_boot_sector[256]; /* One (ISO) sector */ int boot_sector_initialized = 0; #define BOOT_STRING "Linux/Alpha aboot for ISO filesystem." /* Simple function: store the filename to be used later when we need to find the boot file */ extern int add_boot_alpha_filename(char *filename) { boot_file_name = filename; return 0; } static int boot_alpha_write(FILE *outfile) { struct directory_entry *boot_file; /* Boot file we need to search for */ unsigned long length = 0; unsigned long extent = 0; if (!boot_sector_initialized) { memset(alpha_hppa_boot_sector, 0, sizeof(alpha_hppa_boot_sector)); boot_sector_initialized = 1; } /* Write the text header into the boot sector */ strcpy((char *)alpha_hppa_boot_sector, BOOT_STRING); /* Find the dir entry for the boot file by walking our file list */ boot_file = search_tree_file(root, boot_file_name); if (!boot_file) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Uh oh, I cant find the Alpha boot file '%s'!\n", boot_file_name); #else fprintf(stderr, "Uh oh, I cant find the Alpha boot file '%s'!\n", boot_file_name); exit(1); #endif } /* Grab the ISO start sector and length from the dir entry. ISO uses 2048-byte sectors, but we convert to 512-byte sectors here for the sake of the firmware */ extent = get_733(boot_file->isorec.extent); extent *= 4; length = get_733(boot_file->isorec.size); length /= 512; /* I'm sure we should take account of any overlap here, but I'm copying what isomarkboot does. Maybe the boot files are specified to be exact multiples of 512 bytes? */ fprintf(stderr, "Found alpha boot image %s: using extent %lu, #blocks %lu\n", boot_file_name, extent, length); /* Now write those values into the appropriate area of the boot sector in LITTLE ENDIAN format. */ write_le64(length, (unsigned char *)&alpha_hppa_boot_sector[60]); write_le64(extent, (unsigned char *)&alpha_hppa_boot_sector[61]); return 0; } static int boot_alpha_hppa_write(FILE *outfile) { unsigned long long sum = 0; int i = 0; /* Now generate a checksum of the first 504 bytes of the boot sector and place it in alpha_hppa_boot_sector[63]. Isomarkboot currently gets this wrong and will not work on big-endian systems! */ for (i = 0; i < 63; i++) sum += read_le64((unsigned char *)&alpha_hppa_boot_sector[i]); write_le64(sum, (unsigned char *)&alpha_hppa_boot_sector[63]); jtwrite(alpha_hppa_boot_sector, sizeof(alpha_hppa_boot_sector), 1, 0, FALSE); xfwrite(alpha_hppa_boot_sector, sizeof(alpha_hppa_boot_sector), 1, outfile, 0, FALSE); last_extent_written++; return 0; } struct output_fragment alphaboot_desc = {NULL, NULL, NULL, boot_alpha_write, "alpha boot block"}; struct output_fragment alpha_hppa_boot_desc = {NULL, oneblock_size, NULL, boot_alpha_hppa_write, "alpha/hppa boot block"}; cdrkit-1.1.11/genisoimage/boot.c0000644000372500001440000003417210576062671015543 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)boot.c 1.13 04/02/22 Copyright 1999-2003 J. Schilling */ /* * Support for generic boot (sector 0..16) * and to boot Sun sparc and Sun x86 systems. * * Copyright (c) 1999-2003 J. Schilling */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; see the file COPYING. If not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "genisoimage.h" #include #include #include #include #include "sunlabel.h" extern int use_sunx86boot; static struct sun_label cd_label; static struct x86_label sx86_label; static struct pc_part fdisk_part; static char *boot_files[NDKMAP]; /* Change this for > 8 x86 parts */ static void init_sparc_label(void); static void init_sunx86_label(void); void sparc_boot_label(char *label); void sunx86_boot_label(char *label); void scan_sparc_boot(char *files); void scan_sunx86_boot(char *files); int make_sun_label(void); int make_sunx86_label(void); static void dup_sun_label(int part); static int sunboot_write(FILE *outfile); static int sunlabel_size(int starting_extent); static int sunlabel_write(FILE * outfile); static int genboot_size(int starting_extent); static int genboot_write(FILE * outfile); /* * Set the virtual geometry in the disk label. * If we like to make the geometry variable, we may change * dkl_ncyl and dkl_pcyl later. */ static void init_sparc_label() { i_to_4_byte(cd_label.dkl_vtoc.v_version, V_VERSION); i_to_2_byte(cd_label.dkl_vtoc.v_nparts, NDKMAP); i_to_4_byte(cd_label.dkl_vtoc.v_sanity, VTOC_SANE); i_to_2_byte(cd_label.dkl_rpm, CD_RPM); i_to_2_byte(cd_label.dkl_pcyl, CD_PCYL); i_to_2_byte(cd_label.dkl_apc, CD_APC); i_to_2_byte(cd_label.dkl_intrlv, CD_INTRLV); i_to_2_byte(cd_label.dkl_ncyl, CD_NCYL); i_to_2_byte(cd_label.dkl_acyl, CD_ACYL); i_to_2_byte(cd_label.dkl_nhead, CD_NHEAD); i_to_2_byte(cd_label.dkl_nsect, CD_NSECT); cd_label.dkl_magic[0] = DKL_MAGIC_0; cd_label.dkl_magic[1] = DKL_MAGIC_1; } static void init_sunx86_label() { li_to_4_byte(sx86_label.dkl_vtoc.v_sanity, VTOC_SANE); li_to_4_byte(sx86_label.dkl_vtoc.v_version, V_VERSION); li_to_2_byte(sx86_label.dkl_vtoc.v_sectorsz, 512); li_to_2_byte(sx86_label.dkl_vtoc.v_nparts, NX86MAP); li_to_4_byte(sx86_label.dkl_pcyl, CD_PCYL); li_to_4_byte(sx86_label.dkl_ncyl, CD_NCYL); li_to_2_byte(sx86_label.dkl_acyl, CD_ACYL); li_to_2_byte(sx86_label.dkl_bcyl, 0); li_to_4_byte(sx86_label.dkl_nhead, CD_NHEAD); li_to_4_byte(sx86_label.dkl_nsect, CD_NSECT); li_to_2_byte(sx86_label.dkl_intrlv, CD_INTRLV); li_to_2_byte(sx86_label.dkl_skew, 0); li_to_2_byte(sx86_label.dkl_apc, CD_APC); li_to_2_byte(sx86_label.dkl_rpm, CD_RPM); li_to_2_byte(sx86_label.dkl_write_reinstruct, 0); li_to_2_byte(sx86_label.dkl_read_reinstruct, 0); li_to_2_byte(sx86_label.dkl_magic, DKL_MAGIC); } /* * For command line parser: set ASCII label. */ void sparc_boot_label(char *label) { strncpy(cd_label.dkl_ascilabel, label, 127); cd_label.dkl_ascilabel[127] = '\0'; } void sunx86_boot_label(char *label) { strncpy(sx86_label.dkl_vtoc.v_asciilabel, label, 127); sx86_label.dkl_vtoc.v_asciilabel[127] = '\0'; } /* * Parse the command line argument for boot images. */ void scan_sparc_boot(char *files) { char *p; int i = 1; struct stat statbuf; int status; init_sparc_label(); do { if (i >= NDKMAP) comerrno(EX_BAD, "Too many boot partitions.\n"); boot_files[i++] = files; if ((p = strchr(files, ',')) != NULL) *p++ = '\0'; files = p; } while (p); i_to_2_byte(cd_label.dkl_vtoc.v_part[0].p_tag, V_USR); i_to_2_byte(cd_label.dkl_vtoc.v_part[0].p_flag, V_RONLY); for (i = 0; i < NDKMAP; i++) { p = boot_files[i]; if (p == NULL || *p == '\0') continue; if (strcmp(p, "...") == '\0') break; status = stat_filter(p, &statbuf); if (status < 0 || access(p, R_OK) < 0) comerr("Cannot access '%s'.\n", p); i_to_4_byte(cd_label.dkl_map[i].dkl_nblk, roundup(statbuf.st_size, CD_CYLSIZE)/512); i_to_2_byte(cd_label.dkl_vtoc.v_part[i].p_tag, V_ROOT); i_to_2_byte(cd_label.dkl_vtoc.v_part[i].p_flag, V_RONLY); } } void scan_sunx86_boot(char *files) { char *p; int i = 0; struct stat statbuf; int status; init_sunx86_label(); do { if (i >= NDKMAP) comerrno(EX_BAD, "Too many boot partitions.\n"); boot_files[i++] = files; if ((p = strchr(files, ',')) != NULL) *p++ = '\0'; files = p; } while (p); li_to_2_byte(sx86_label.dkl_vtoc.v_part[0].p_tag, V_ROOT); /* UFS */ li_to_2_byte(sx86_label.dkl_vtoc.v_part[0].p_flag, V_RONLY); li_to_2_byte(sx86_label.dkl_vtoc.v_part[1].p_tag, V_USR); /* ISO */ li_to_2_byte(sx86_label.dkl_vtoc.v_part[1].p_flag, V_RONLY); li_to_2_byte(sx86_label.dkl_vtoc.v_part[2].p_tag, 0); /* ALL */ li_to_2_byte(sx86_label.dkl_vtoc.v_part[2].p_flag, 0); for (i = 0; i < NDKMAP; i++) { p = boot_files[i]; if (p == NULL || *p == '\0') continue; if (i == 1 || i == 2) { comerrno(EX_BAD, "Partition %d may not have a filename.\n", i); } status = stat_filter(p, &statbuf); if (status < 0 || access(p, R_OK) < 0) comerr("Cannot access '%s'.\n", p); li_to_4_byte(sx86_label.dkl_vtoc.v_part[i].p_size, roundup(statbuf.st_size, CD_CYLSIZE)/512); if (i > 2) { li_to_2_byte(sx86_label.dkl_vtoc.v_part[i].p_tag, V_USR); li_to_2_byte(sx86_label.dkl_vtoc.v_part[i].p_flag, V_RONLY); } } } /* * Finish the Sun disk label and compute the size of the additional data. */ int make_sun_label() { int last; int cyl = 0; int nblk; int bsize; int i; char *p; /* * Compute the size of the padding for the iso9660 image * to allow the next partition to start on a cylinder boundary. */ last = roundup(last_extent, (CD_CYLSIZE/SECTOR_SIZE)); i_to_4_byte(cd_label.dkl_map[0].dkl_nblk, last*4); bsize = 0; for (i = 0; i < NDKMAP; i++) { p = boot_files[i]; if (p != NULL && strcmp(p, "...") == '\0') { dup_sun_label(i); break; } if ((nblk = a_to_4_byte(cd_label.dkl_map[i].dkl_nblk)) == 0) continue; i_to_4_byte(cd_label.dkl_map[i].dkl_cylno, cyl); cyl += nblk / (CD_CYLSIZE/512); if (i > 0) bsize += nblk; } bsize /= 4; return (last-last_extent+bsize); } /* * A typical Solaris boot/install CD from a Sun CD set looks * this way: * * UFS Part 0 tag 2 flag 10 start 3839 size 1314560 * ISO Part 1 tag 4 flag 10 start 0 size 3839 * ALL Part 2 tag 0 flag 0 start 0 size 1318400 */ int make_sunx86_label() { int last; int cyl = 0; int nblk; int bsize; int i; int partoff = 1; /* The offset of the Solaris 0x82 partition */ char *p; /* * Compute the size of the padding for the iso9660 image * to allow the next partition to start on a cylinder boundary. */ last = roundup(last_extent, (CD_CYLSIZE/SECTOR_SIZE)); li_to_4_byte(sx86_label.dkl_vtoc.v_part[1].p_size, last*4); /* * Note that the Solaris fdisk partition with fdisk signature 0x82 * is created at fixed offset 1 sector == 512 Bytes by this * implementation. * We need subtract this partition offset from all absolute * partition offsets in order to get offsets relative to the * Solaris primary partition. */ bsize = 0; for (i = 0; i < NDKMAP; i++) { if (i == 2) /* Never include the whole disk in */ continue; /* size/offset computations */ p = boot_files[i]; if ((nblk = la_to_4_byte(sx86_label.dkl_vtoc.v_part[i].p_size)) == 0) continue; li_to_4_byte(sx86_label.dkl_vtoc.v_part[i].p_start, cyl*(CD_CYLSIZE/512)-partoff); cyl += nblk / (CD_CYLSIZE/512); if (i == 0 || i > 2) bsize += nblk; } li_to_4_byte(sx86_label.dkl_vtoc.v_part[0].p_start, last*4-partoff); li_to_4_byte(sx86_label.dkl_vtoc.v_part[1].p_start, 0); li_to_4_byte(sx86_label.dkl_vtoc.v_part[1].p_size, last*4-partoff); li_to_4_byte(sx86_label.dkl_vtoc.v_part[2].p_start, 0); li_to_4_byte(sx86_label.dkl_vtoc.v_part[2].p_size, last*4+bsize); fdisk_part.part[0].pr_status = STATUS_ACTIVE; fdisk_part.part[0].pr_type = TYPE_SOLARIS; li_to_4_byte(fdisk_part.part[0].pr_partoff, partoff); li_to_4_byte(fdisk_part.part[0].pr_nsect, last*4+bsize-partoff); fdisk_part.magic[0] = 0x55; fdisk_part.magic[1] = 0xAA; bsize /= 4; return (last-last_extent+bsize); } /* * Duplicate a partition of the Sun disk label until all partitions are filled up. */ static void dup_sun_label(int part) { int cyl; int nblk; int i; if (part < 1 || part >= NDKMAP) part = 1; cyl = a_to_4_byte(cd_label.dkl_map[part-1].dkl_cylno); nblk = a_to_4_byte(cd_label.dkl_map[part-1].dkl_nblk); for (i = part; i < NDKMAP; i++) { i_to_4_byte(cd_label.dkl_map[i].dkl_cylno, cyl); i_to_4_byte(cd_label.dkl_map[i].dkl_nblk, nblk); i_to_2_byte(cd_label.dkl_vtoc.v_part[i].p_tag, V_ROOT); i_to_2_byte(cd_label.dkl_vtoc.v_part[i].p_flag, V_RONLY); } } /* * Write out Sun boot partitions. */ static int sunboot_write(FILE *outfile) { char buffer[SECTOR_SIZE]; int i; int n; int nblk; int amt; int f; char *p; memset(buffer, 0, sizeof (buffer)); /* * Write padding to the iso9660 image to allow the * boot partitions to start on a cylinder boundary. */ amt = roundup(last_extent_written, (CD_CYLSIZE/SECTOR_SIZE)) - last_extent_written; for (n = 0; n < amt; n++) { jtwrite(buffer, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buffer, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; } if (use_sunx86boot) i = 0; else i = 1; for (; i < NDKMAP; i++) { if (use_sunx86boot && (i == 1 || i == 2)) continue; p = boot_files[i]; if (p == NULL || *p == '\0') continue; if (p != NULL && strcmp(p, "...") == '\0') break; if (use_sunx86boot) { if ((nblk = la_to_4_byte(sx86_label.dkl_vtoc.v_part[i].p_size)) == 0) continue; } else { if ((nblk = a_to_4_byte(cd_label.dkl_map[i].dkl_nblk)) == 0) continue; } if ((f = open(boot_files[i], O_RDONLY| O_BINARY)) < 0) comerr("Cannot open '%s'.\n", boot_files[i]); amt = nblk / 4; for (n = 0; n < amt; n++) { memset(buffer, 0, sizeof (buffer)); if (read(f, buffer, SECTOR_SIZE) < 0) comerr("Read error on '%s'.\n", boot_files[i]); jtwrite(buffer, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buffer, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; } close(f); } fprintf(stderr, "Total extents including %s boot = %u\n", use_sunx86boot ? "Solaris x86":"sparc", last_extent_written - session_start); return (0); } /* * Do size management for the Sun disk label that is located in the first * sector of a disk. */ static int sunlabel_size(int starting_extent) { if (last_extent != session_start) comerrno(EX_BAD, "Cannot create sparc boot on offset != 0.\n"); last_extent++; return (0); } /* * Cumpute the checksum and write a Sun disk label to the first sector * of the disk. * If the -generic-boot option has been specified too, overlay the * Sun disk label on the firs 512 bytes of the generic boot code. */ static int sunlabel_write(FILE *outfile) { char buffer[SECTOR_SIZE]; register char *p; register short count = (512/2) - 1; int f; memset(buffer, 0, sizeof (buffer)); if (genboot_image) { if ((f = open(genboot_image, O_RDONLY| O_BINARY)) < 0) comerr("Cannot open '%s'.\n", genboot_image); if (read(f, buffer, SECTOR_SIZE) < 0) comerr("Read error on '%s'.\n", genboot_image); close(f); } if (use_sunx86boot) { if (sx86_label.dkl_vtoc.v_asciilabel[0] == '\0') strcpy(sx86_label.dkl_vtoc.v_asciilabel, CD_X86LABEL); p = (char *)&sx86_label; sx86_label.dkl_cksum[0] = 0; sx86_label.dkl_cksum[1] = 0; while (count-- > 0) { sx86_label.dkl_cksum[0] ^= *p++; sx86_label.dkl_cksum[1] ^= *p++; } memcpy(&buffer[0x1BE], &fdisk_part.part, 512-0x1BE); memcpy(&buffer[1024], &sx86_label, 512); } else { /* * If we don't already have a Sun disk label text * set up the default. */ if (cd_label.dkl_ascilabel[0] == '\0') strcpy(cd_label.dkl_ascilabel, CD_DEFLABEL); p = (char *)&cd_label; cd_label.dkl_cksum[0] = 0; cd_label.dkl_cksum[1] = 0; while (count--) { cd_label.dkl_cksum[0] ^= *p++; cd_label.dkl_cksum[1] ^= *p++; } memcpy(buffer, &cd_label, 512); } jtwrite(buffer, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buffer, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; return (0); } /* * Do size management for the generic boot code on sectors 0..16. */ static int genboot_size(int starting_extent) { if (last_extent > (session_start + 1)) comerrno(EX_BAD, "Cannot create generic boot on offset != 0.\n"); last_extent = session_start + 16; return (0); } /* * Write the generic boot code to sectors 0..16. * If there is a Sun disk label, start writing at sector 1. */ static int genboot_write(FILE *outfile) { char buffer[SECTOR_SIZE]; int i; int f; if ((f = open(genboot_image, O_RDONLY| O_BINARY)) < 0) comerr("Cannot open '%s'.\n", genboot_image); for (i = 0; i < 16; i++) { memset(buffer, 0, sizeof (buffer)); if (read(f, buffer, SECTOR_SIZE) < 0) comerr("Read error on '%s'.\n", genboot_image); if (i != 0 || last_extent_written == session_start) { jtwrite(buffer, SECTOR_SIZE, 1, 0, FALSE); xfwrite(buffer, SECTOR_SIZE, 1, outfile, 0, FALSE); last_extent_written++; } } close(f); return (0); } struct output_fragment sunboot_desc = {NULL, NULL, NULL, sunboot_write, "Sun Boot" }; struct output_fragment sunlabel_desc = {NULL, sunlabel_size, NULL, sunlabel_write, "Sun Disk Label" }; struct output_fragment genboot_desc = {NULL, genboot_size, NULL, genboot_write, "Generic Boot" }; cdrkit-1.1.11/genisoimage/files.c0000644000372500001440000002130410536265343015670 0ustar steveusers/* * This file has been modified for the cdrkit suite. * * The behaviour and appearence of the program code below can differ to a major * extent from the version distributed by the original author(s). * * For details, see Changelog file distributed with the cdrkit package. If you * received this file from another source then ask the distributing person for * a log of modifications. * */ /* @(#)files.c 1.12 04/03/04 joerg */ /* * File files.c - Handle ADD_FILES related stuff. * * Written by Eric Youngdale (1993). * * Copyright 1993 Yggdrasil Computing, Incorporated * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */ #include #include "genisoimage.h" #include #include #include #ifdef ADD_FILES void add_one_file(char *addpath, char *path); void add_file_list(int argc, char **argv, int ind); void add_file(char *filename); char *look_up_addition(char **newpath, char *path, struct dirent **de); void nuke_duplicates(char *path, struct dirent **de); struct dirent *readdir_add_files(char **pathp, char *path, DIR *dir); struct file_adds { char *name; struct file_adds *child; struct file_adds *next; int add_count; int used; union diru { /* * XXX Struct dirent is not guaranteed to be any size on a POSIX * XXX compliant system. * XXX We need to allocate enough space here, to allow the hacky * XXX code in tree.c made by Ross Biro biro@yggdrasil.com * XXX to work on operating systems other than Linux :-( * XXX Changes made by Joerg Schilling * XXX joerg@schily.isdn.cs.tu-berlin.de * XXX to prevent core dumps on Solaris. * XXX Space allocated: * XXX 1024 bytes == NAME_MAX * XXX + 2 bytes for directory record length * XXX + 2*8 bytes for inode number & offset (64 for future exp) */ struct dirent de; char dspace[NAME_MAX + 2 + 2 * 8]; } du; struct { char *path; char *name; } *adds; }; extern struct file_adds *root_file_adds; /* * FIXME(eric) - the file adding code really doesn't work very well * at all. We should differentiate between adding directories, and adding * single files, as adding a full directory affects how we should be * searching for things. Ideally what we should do is make two passes * through the local filesystem - one to figure out what trees we need * to scan (and merge in any additions at that point), and the second to * actually fill out each structure with the appropriate contents. */ struct file_adds *root_file_adds = NULL; void add_one_file(char *addpath, char *path) { char *cp; char *name; struct file_adds *f; struct file_adds *tmp; f = root_file_adds; tmp = NULL; name = strrchr(addpath, PATH_SEPARATOR); if (name == NULL) { name = addpath; } else { name++; } cp = strtok(addpath, SPATH_SEPARATOR); while (cp != NULL && strcmp(name, cp)) { if (f == NULL) { root_file_adds = e_malloc(sizeof (*root_file_adds)); f = root_file_adds; f->name = NULL; f->child = NULL; f->next = NULL; f->add_count = 0; f->adds = NULL; f->used = 0; } if (f->child) { for (tmp = f->child; tmp->next != NULL; tmp = tmp->next) { if (strcmp(tmp->name, cp) == 0) { f = tmp; goto next; } } if (strcmp(tmp->name, cp) == 0) { f = tmp; goto next; } /* add a new node. */ tmp->next = e_malloc(sizeof (*tmp->next)); f = tmp->next; f->name = strdup(cp); f->child = NULL; f->next = NULL; f->add_count = 0; f->adds = NULL; f->used = 0; } else { /* no children. */ f->child = e_malloc(sizeof (*f->child)); f = f->child; f->name = strdup(cp); f->child = NULL; f->next = NULL; f->add_count = 0; f->adds = NULL; f->used = 0; } next: cp = strtok(NULL, SPATH_SEPARATOR); } /* Now f if non-null points to where we should add things */ if (f == NULL) { root_file_adds = e_malloc(sizeof (*root_file_adds)); f = root_file_adds; f->name = NULL; f->child = NULL; f->next = NULL; f->add_count = 0; f->adds = NULL; } /* Now f really points to where we should add this name. */ f->add_count++; f->adds = realloc(f->adds, sizeof (*f->adds) * f->add_count); f->adds[f->add_count - 1].path = strdup(path); f->adds[f->add_count - 1].name = strdup(name); } /* * Function: add_file_list * * Purpose: Register an add-in file. * * Arguments: */ void add_file_list(int argc, char **argv, int ind) { char *ptr; char *dup_arg; while (ind < argc) { dup_arg = strdup(argv[ind]); ptr = strchr(dup_arg, '='); if (ptr == NULL) { free(dup_arg); return; } *ptr = 0; ptr++; add_one_file(dup_arg, ptr); free(dup_arg); ind++; } } void add_file(char *filename) { char buff[PATH_MAX]; FILE *f; char *ptr; char *p2; int count = 0; if (strcmp(filename, "-") == 0) { f = stdin; } else { f = fopen(filename, "r"); if (f == NULL) { #ifdef USE_LIBSCHILY comerr("Cannot open '%s'.\n", filename); #else perror("fopen"); exit(1); #endif } } while (fgets(buff, sizeof (buff), f)) { count++; ptr = buff; while (isspace(*ptr)) ptr++; if (*ptr == 0) continue; if (*ptr == '#') continue; if (ptr[strlen(ptr) - 1] == '\n') ptr[strlen(ptr) - 1] = 0; p2 = strchr(ptr, '='); if (p2 == NULL) { #ifdef USE_LIBSCHILY comerrno(EX_BAD, "Error in file '%s' line %d: %s\n", filename, count, buff); #else fprintf(stderr, "Error in file '%s' line %d: %s\n", filename, count, buff); exit(1); #endif } *p2 = 0; p2++; add_one_file(ptr, p2); } if (f != stdin) fclose(f); } /* This function looks up additions. */ char * look_up_addition(char **newpath, char *path, struct dirent **de) { char *dup_path; char *cp; struct file_adds *f; struct file_adds *tmp = NULL; f = root_file_adds; if (!f) return (NULL); /* I don't trust strtok */ dup_path = strdup(path); cp = strtok(dup_path, SPATH_SEPARATOR); while (cp != NULL) { for (tmp = f->child; tmp != NULL; tmp = tmp->next) { if (strcmp(tmp->name, cp) == 0) break; } if (tmp == NULL) { /* no match */ free(dup_path); return (NULL); } f = tmp; cp = strtok(NULL, SPATH_SEPARATOR); } free(dup_path); /* If nothing, then return. */ if (tmp == NULL) { /* no match */ return (NULL); } /* looks like we found something. */ if (tmp->used >= tmp->add_count) return (NULL); *newpath = tmp->adds[tmp->used].path; tmp->used++; *de = &(tmp->du.de); return (tmp->adds[tmp->used - 1].name); } /* This function looks up additions. */ void nuke_duplicates(char *path, struct dirent **de) { char *dup_path; char *cp; struct file_adds *f; struct file_adds *tmp; f = root_file_adds; if (!f) return; /* I don't trust strtok */ dup_path = strdup(path); cp = strtok(dup_path, SPATH_SEPARATOR); while (cp != NULL) { for (tmp = f->child; tmp != NULL; tmp = tmp->next) { if (strcmp(tmp->name, cp) == 0) break; } if (tmp == NULL) { /* no match */ free(dup_path); return; } f = tmp; cp = strtok(NULL, SPATH_SEPARATOR); } free(dup_path); #if 0 /* looks like we found something. */ if (tmp->used >= tmp->add_count) return; *newpath = tmp->adds[tmp->used].path; tmp->used++; *de = &(tmp->du.de); return (tmp->adds[tmp->used - 1].name); #endif } /* * This function lets us add files from outside the standard file tree. * It is useful if we want to duplicate a cd, but add/replace things. * We should note that the real path will be used for exclusions. */ struct dirent * readdir_add_files(char **pathp, char **path, DIR *dir) { struct dirent *de; char *addpath; char *name; de = readdir(dir); if (de) { nuke_duplicates(path, &de); return (de); } name = look_up_addition(&addpath, path, &de); if (!name) { return (NULL); } *pathp = addpath; /* * Now we must create the directory entry. * fortuneately only the name seems to matter. */ /* de->d_ino = -1; de->d_off = 0; de->d_reclen = strlen (name); */ strncpy(de->d_name, name, NAME_MAX); de->d_name[NAME_MAX] = 0; nuke_duplicates(path, &de); return (de); } #else struct dirent * readdir_add_files(char **pathp, char *path, DIR *dir) { return (readdir(dir)); } #endif cdrkit-1.1.11/doc/0000755000372500001440000000000011456674326012707 5ustar steveuserscdrkit-1.1.11/doc/plattforms/0000755000372500001440000000000011456674326015102 5ustar steveuserscdrkit-1.1.11/doc/plattforms/README.freebsd0000644000372500001440000000173610532664446017376 0ustar steveusersThese instructions have been tested with FreeBSD 6.2-PRERELEASE, but should work on any 6.x release. If you're having trouble (with any release, not just 6.x), please let us know. Building ======== You need to have cmake installed. It is available in the ports collection or from cmake.org. You also need GNU make. It is also in the ports collection, and can be alternatively obtained from gnu.org. Most users have libiconv installed under /usr/local. If you wish to add support for it (used by genisoimage, and recommended), build with gmake CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib instead of just plain gmake Short note on using wodim ========================= If you want to use wodim with ATAPI drives, make sure you load the atapicam module before using wodim. Not even "wodim -scanbus" works usually if this is not done. The command for loading the atapicam module is (for root) /sbin/kldload atapicam -- Lorenz Minder -- Mon Nov 27 23:23:01 CET 2006 cdrkit-1.1.11/doc/plattforms/README.parallel0000644000372500001440000000312610501353554017542 0ustar steveusersThis file is intended to help with ATAPI <-> Parallel Port devices on Linux Before you start, read http://www.torque.net/parport/paride.html Make sure that your parallel port device is set up to EPP mode from within the BIOS. In many cases it is best to set the PP delay to 0. Here is a short explanation how to make the FreeCom Traveller work in 4x speed on a notebook: 1.) Set BIOS for parallel port to 'EPP'. 2.) Load drivers in default mode: # modprobe paride # modprobe # modprobe pg in case of a FreeCom Traveller this is: # modprobe paride # modprobe friq # modprobe pg 3.) Check kernel log for paride messages: # dmesg ... paride: version 1.04 installed paride: friq registered as protocol 0 ... parport0: PC-style at 0x378 [SPP,PS2,EPP] parport0: no IEEE-1284 device present. ... pg: pg version 1.02, major 97 pg0: Sharing parport0 at 0x378 pg0: friq 1.01, Freecom IQ ASIC-2 adapter at 0x378, mode 4 (EPP-32), delay 1 pg0: CD-R/RW RW8040A, master ... 4.) load module again but use different parameters: 'drive0=IO-Port,Protocol,Unit,Mode,Master/Slave,Delay drive1=...' if you have only one drive at the parallel port 'drive0=IO-Port,0,0,-1,-1,Delay' e.g. for Delay = 0: # modprobe -r pg # modprobe pg drive0=0x378,0,0,-1,-1,0 5.) Check for optimum delay using for maximum speed using wodim -dummy 6.) Use the file rc.pp and modify for your needs 7.) Your CD drive now appears as /dev/pcd? Source: README.cdtext from cdrtools package Edited for cdrkit by Christian Fromme cdrkit-1.1.11/doc/plattforms/README.aix5l0000644000372500001440000000143710532410057016767 0ustar steveusersCdrkit can be built on AIX 5 using the following instructions. Note that the SCSI transport has not been tested yet because of missing hardware. - install cmake either from source or from binaries downloadable on cmake.org. Make sure the cmake is in your PATH and it can find its modules. - GCC compiler (available on gcc.org) is recommended, however the native xlc compiler should work as well. Follow instructions from the INSTALL file. If you installed a local version of GNU libiconv and ld is confused and spews linking errors related to .libiconv, check the linker paths with "cmake -LA build | grep lib". Probably your local path is not listed there and you may need to set LDFLAGS make variable. See INSTALL file for details. -- Eduard Bloch -- Sun, 26 Nov 2006 23:06:25 +0100 cdrkit-1.1.11/doc/plattforms/README.sunos0000644000372500001440000000062410532667171017124 0ustar steveusers Cdrkit have been built and partially tested on SunOS 5.8. To compile, run "gmake". CMake must be installed (with its modules), the cmake binary must available in your path. Installing GNU libiconv is also recommended. On linking problems with 3rd-party libraries involved, make sure that you have matching configuration of CFLAGS and LDFLAGS vars. -- Eduard Bloch -- Tue, 28 Nov 2006 00:01:47 +0100 cdrkit-1.1.11/doc/plattforms/README.win320000644000372500001440000000256710545224035016717 0ustar steveusers Cdrkit suite can be compiled on Windows XP (Service Pack 2) using cygwin environment and tools set, available on: http://sources.redhat.com/cygwin/ and many mirrors. To compile on Cygwin, execute setup.exe to install it. You will need to select cmake, make, libiconv and gcc compiler in the package selection. Also choose subversion if you wish to fetch the latest development version. When done, you can start the Cygwin Shell by the new icon in the Start menu or on the desktop. Visit cdrkit.org and download a tarball of a recent version and store it under \home\your_user_name. Untar the package with tar -z -x -f , go into this directory and run "make", followed by "make install". Ignore messages about clock skew etc. NOTE: with some versions of Cygwin or cmake shipped with it, the installation fails for unknown reason. In this case, you can browse trough the build/ directory, pick up the .exe files there and read the manpage files in application directories with the man command ("man wodim/wodim.1"). Windows drives are available in paths like /cygdrive/c/, /cygdrive/d/. The drive IDs can be detected using "wodim -scanbus". See wodim's manpage for details. STANDARD WARNING: test in dummy mode before you really write data to the disks. Report trouble to Cdrkit maintainers. -- Eduard Bloch -- Tue, 12 Sep 2006 10:06:34 +0200 cdrkit-1.1.11/doc/plattforms/README.linux0000644000372500001440000000413110545230346017103 0ustar steveusers Requirements of cdrkit on Linux: - Linux kernel 2.4 or newer - Glibc 2.2 or newer - libcap library package is required, with development files (headers) - kernel headers useable with the combination of glibc and kernel, as approved by the distribution. Do not blindly use random kernel headers, do not symlink them to /usr/include/linux or /usr/include/asm*. Notes about support on Linux: - Linux kernel versions between 2.6.8 and 2.6.11 are known to have invasive SCSI command filtering which makes the use of wodim almost inpossible or complicated for non-root users. Avoid those kernel versions, unless they have been patched to disable that filtering. - support of generic scsi was limited on 2.4, ie. not available directly with IDE/ATAPI devices. The ide-scsi driver could be used map ATAPI devices to SCSI ids, however this driver had other problems. See README.ATAPI for details. Note that there also the ATAPI:... device access method which uses deprecated funtionality of kernel 2.4. Don't use it unless it is really neccessary. The support for it may be removed in future versions of cdrkit. - the DMA transfer size is limited with some device controllers and the Linux kernel 2.6.x (2.6.19 currently) provides no method to retrieve it for exactly one device. Wodim scans sysfs to retrieve this information, but it needs to be mounted. Use the ts= option of wodim to limit the transfer size on problems. Additional comments moved from the wodim.1 manpage (originaly cdrecord.1): The sg driver on Linux has several severe bugs: - It cannot see if a SCSI command could not be sent at all. - It cannot get the SCSI status byte. wodim for that reason cannot report failing SCSI commands in some situations. - It cannot get real DMA count of transfer. wodim cannot tell you if there is an DMA residual count. - It cannot get number of bytes valid in auto sense data. wodim cannot tell you if device transfers no sense data at all. - It fetches too few data in auto request sense (CCS/SCSI-2/SCSI-3 needs >= 18). -- Reviewed by Eduard Bloch -- 12/2006 cdrkit-1.1.11/doc/ANNOUNCEMENTs/0000755000372500001440000000000011456674326014764 5ustar steveuserscdrkit-1.1.11/doc/ANNOUNCEMENTs/AN-2.01.01a050000644000372500001440000001135710471375025016305 0ustar steveusersPlease have a look at the German open Source Center BerliOS at www.berlios.de BerliOS will continue to support free hosting of cryptography projects even when US laws change and don't allow to host cryptography projects in the USA. Also look at sourcewell.berlios.de, the first Open Source announcement service that itself is implemented as Open Source project. ***************** Important news **************************** For the 'Slottable Source Plugin Module' SSPM Features read README.SSPM ***************** Please Test ********************************* NEW features of cdrtools-2.01.01a05: ******* NOTE: this is _not_ a release that starts a new aplha/beta series of dirtibutions. The only reason is to add certain new CD/DVD features that are important. So _please_ do not send any patches except when you like to fix extreme bugs. I am currently mainly working on stable incremental restore featurs for star-1.5-final. Once star-1.5-final is out, cdrtools will start a new developent cycle. ******* All: - Support for DragonFly BSD added, thanks to joerg@britannica.bec.de - Default Cygwin install uid/group adapted to use available ids. - Updated the (forgotten) autoconf to include the tests needed for Solaris fine grained privileges. - New program btcflash added. Thanks to David Huang - If you like all users to be able to call cdrecord root-less, you need Solaris 10 or newer. Edit the file /etc/security/exec_attr and add: All:solaris:cmd:::/opt/schily/bin/cdrecord: privs=file_dac_read,sys_devices,proc_lock_memory,proc_priocntl,net_privaddr All:solaris:cmd:::/opt/schily/bin/readcd: privs=file_dac_read,sys_devices,net_privaddr All:solaris:cmd:::/opt/schily/bin/cdda2wav: privs=file_dac_read,sys_devices,proc_priocntl,net_privaddr If you like to allow only specific user to use cdrecord, use something like: CD RW:solaris:cmd:::/opt/schily/bin/cdrecord: privs=file_dac_read,sys_devices,proc_lock_memory,proc_priocntl,net_privaddr instead and make the users members of the profile "CD RW" by adding a line like: joerg::::profiles=CD RW into /etc/user_attr Note that you either need to call cdrecord via "pfexec cdrecord ....." or by using a profile aware shell (e.g. /usr/bin/pfksh) Libparanoia (Ported by Jörg Schilling, originated by Monty xiphmont@mit.edu): Libedc (Optimized by Jörg Schilling, originated by Heiko Eißfeldt heiko@hexco.de): Libscg: - Support for root-less cdrecord using fine-grained privileges. Remote SCSI not tests for PRIV_NET_PRIVADDR instead of (geteuid() == 0) This is now active since the needed autoconf code is out. Rscsi: Cdrecord: - Trying to work around a noncompliance (modified interface) present on newer Linux kernels that causes cdrecord to be unable to allocate a SCSI transfer buffer. Newer Linux kernels do not honor a contract from mlockall(MCL_FUTURE) after cdrecord turned off euid == 0 from a suid root installation. Instead of honoring mlockall(MCL_FUTURE), Linux checks each mmap() and compares against getrlimit(RLIMIT_MEMLOCK - Explicit fine grained privileges support for Solaris. Cdrecord now switches off all privs that are no longer needed. Cdda2wav (By Heiko Eißfeldt heiko@hexco.de): - Explicit fine grained privileges support for Solaris. Cdda2wav now switches off all privs that are no longer needed. Readcd: - Allow readcd to work correctly in -scanbus mode Thanks to Fabian Keil for reporting. - Explicit fine grained privileges support for Solaris. readcd now switches off all privs that are no longer needed. Scgcheck: Scgskeleton: - Allow readcd to work correctly in -scanbus mode Thanks to Fabian Keil for reporting. - Explicit fine grained privileges support for Solaris. Scgskeleton now switches off all privs that are no longer needed. Mkisofs (By Jörg Schilling and James Pearson j.pearson@ge.ucl.ac.uk): TODO: - read Joliet filenames with multi-session if no TRANS.TBL or RR is present. I am looking for a volouteer for this task! Note that this can never be 100% correct as there is no relation between the names on the master (UNIX) filesystem, the ISO-9660 names and the Joliet names. Only the Rock Ridge names are untranslated with respect to the original files on the master (UNIX) filesystem. - add libecc/edc for CDI and similar. CYGWIN NT-4.0 NOTES: To compile on Cygwin32, get Cygwin and install it. For more information read README.win32 The files are located on: ftp://ftp.berlios.de/pub/cdrecord/alpha ... NOTE: These tar archives are 100% POSIX compatible. GNU tar may get some minor trouble. If you like a 100% POSIX compliant tar, get star from ftp://ftp.berlios.de/pub/star/ WARNING: Do not use 'winzip' to extract the tar file! Winzip cannot extract symbolic links correctly. Joerg cdrkit-1.1.11/doc/ANNOUNCEMENTs/AN-2.01.01a080000644000372500001440000000574710471375025016316 0ustar steveusersPlease have a look at the German open Source Center BerliOS at www.berlios.de BerliOS will continue to support free hosting of cryptography projects even when US laws change and don't allow to host cryptography projects in the USA. Also look at sourcewell.berlios.de, the first Open Source announcement service that itself is implemented as Open Source project. ***************** Important news **************************** For the 'Slottable Source Plugin Module' SSPM Features read README.SSPM ***************** Please Test ********************************* NEW features of cdrtools-2.01.01a08: ******* NOTE: this is _not_ a release that starts a new aplha/beta series of dirtibutions. The only reason is to add certain new CD/DVD features that are important. So _please_ do not send any patches except when you like to fix extreme bugs. I am currently mainly working on stable incremental restore featurs for star-1.5-final. Once star-1.5-final is out, cdrtools will start a new developent cycle. ******* All: Libparanoia (Ported by Jörg Schilling, originated by Monty xiphmont@mit.edu): Libedc (Optimized by Jörg Schilling, originated by Heiko Eißfeldt heiko@hexco.de): Libscg: Rscsi: Cdrecord: Cdda2wav (By Heiko Eißfeldt heiko@hexco.de): - Started to make cdda2wav Cstyle compliant. - Avoid to shutdown the whole system when kill(getppid(), SKGINT) would result in kill -INT 1 because the parent cdda2wav is dead and the child is orphaned and cdda2wav has been called by root. - __FreeBSD_version >= 600021 have devmajor == 0 for all devices. Thanks to Marius Strobl for reporting. - General #ifdef structure related to FreeBSD in mycdrom.h now corrected, thanks to Marius Strobl. - Try to fix some FreeBSD/DragonFly related problems that have been introduced with a06 when Heiko's changes from 2004 have been integrated IMPORTANT: I need testers for FreeBSD and DragonFly BSD as a result of the merge with the complex changes from Heiko. Readcd: Scgcheck: Scgskeleton: Btcflash: Mkisofs (By Jörg Schilling and James Pearson j.pearson@ge.ucl.ac.uk): TODO: - read Joliet filenames with multi-session if no TRANS.TBL or RR is present. I am looking for a volouteer for this task! Note that this can never be 100% correct as there is no relation between the names on the master (UNIX) filesystem, the ISO-9660 names and the Joliet names. Only the Rock Ridge names are untranslated with respect to the original files on the master (UNIX) filesystem. - add libecc/edc for CDI and similar. CYGWIN NT-4.0 NOTES: To compile on Cygwin32, get Cygwin and install it. For more information read README.win32 The files are located on: ftp://ftp.berlios.de/pub/cdrecord/alpha ... NOTE: These tar archives are 100% POSIX compatible. GNU tar may get some minor trouble. If you like a 100% POSIX compliant tar, get star from ftp://ftp.berlios.de/pub/star/ WARNING: Do not use 'winzip' to extract the tar file! Winzip cannot extract symbolic links correctly. Joerg cdrkit-1.1.11/doc/ANNOUNCEMENTs/AN-2.01.01a040000644000372500001440000001230710471375025016300 0ustar steveusersPlease have a look at the German open Source Center BerliOS at www.berlios.de BerliOS will continue to support free hosting of cryptography projects even when US laws change and don't allow to host cryptography projects in the USA. Also look at sourcewell.berlios.de, the first Open Source announcement service that itself is implemented as Open Source project. ***************** Important news **************************** For the 'Slottable Source Plugin Module' SSPM Features read README.SSPM ***************** Please Test ********************************* NEW features of cdrtools-2.01.01a04: ******* NOTE: this is _not_ a release that starts a new aplha/beta series of dirtibutions. The only reason is to add certain new CD/DVD features that are important. So _please_ do not send any patches except when you like to fix extreme bugs. I am currently mainly working on stable incremental restore featurs for star-1.5-final. Once star-1.5-final is out, cdrtools will start a new developent cycle. ******* All: - astoull*() new in schily.h - utypes.h now has MAX_ and MIN_ value definitions for all basic system types. - Using Makefiles-1.5a02 - Support added to compile in 64 bit mode on Solaris Sparc. Use: smake CCOM=cc64 - Support added to compile shared libraries with version numbers for interface levels and make inofficial "interfaces" static - Prevent gmake to go into an enless loop on Solaris in case that /usr/ucb/tr is before /usr/bin/tr in PATH - Better autoconf error message ion case that the expected C-compiler could not be found. - Mac OS X now installs files as root:wheel - Supply linker mapfiles for all libraries. This allows cdrtools to be compiles using shared libraries only and to properly hide inofficial interfaces on Solaris (using ls) Note that this feature is not available with GNU ld Libparanoia (Ported by Jörg Schilling, originated by Monty xiphmont@mit.edu): Libedc (Optimized by Jörg Schilling, originated by Heiko Eißfeldt heiko@hexco.de): Libscg: - Autoconf test for broken Linux sg.h headers added - if libscg is compiles on newer Solaris systems, the warning: "Warning: Volume management is running, medialess managed drives are invisible.\n" is no longer printed. Since Solaris 11 Build 21, vold no longer hides empty drives that are under volume management. This now allows cdrecord to be even used to close the tray while vold is running. The criteria used to decide whether Solaris is "recent enough" is #ifndef SEEK_HOLE The definition SEEK_HOLE has been added with Solaris 11 Build 14 while the fixed vold appears in Solaris 11 Build 21. - Support for root-less cdrecord using fine-grained privileges. Remote SCSI not tests for PRIV_NET_PRIVADDR instead of (geteuid() == 0) If you like all users to be able to call cdrecord root-less, you need Solaris 10 or newer. Edit the file /etc/security/exec_attr and add: All:solaris:cmd:::/opt/schily/bin/cdrecord: privs=file_dac_read,sys_devices,proc_lock_memory,proc_priocntl,net_privaddr All:solaris:cmd:::/opt/schily/bin/readcd: privs=file_dac_read,sys_devices,net_privaddr All:solaris:cmd:::/opt/schily/bin/cdda2wav: privs=file_dac_read,sys_devices,net_privaddr If you like to allow only specific user to use cdrecord, use something like: CD RW:solaris:cmd:::/opt/schily/bin/cdrecord: privs=file_dac_read,sys_devices,proc_lock_memory,proc_priocntl,net_privaddr instead and make the users members of the profile "CD RW" by adding a line like: joerg::::profiles=CD RW into /etc/user_attr Note that you either need to call cdrecord via "pfexec cdrecord ....." or by using a profile aware shell (e.g. /usr/bin/pfksh) Rscsi: Cdrecord: - Correctly evaluate the write speeds for Ultra speed+ CD-RW media. This prevents wrong warnings that the "drive does not support Ultra speed+" - Fixed a typo in the driveropts=help messages Cdda2wav (By Heiko Eißfeldt heiko@hexco.de): - Added a workaround for the _POSIX_PRIORITY_SCHEDULING behavior on MacosX: defined but not supported# Thanks to: Emanuele Giaquinta - Bugfix: cdda2wav did previously chose to ignore the result of realloc(3) This prevents core-dumps. Readcd: Scgcheck: Scgskeleton: Mkisofs (By Jörg Schilling and James Pearson j.pearson@ge.ucl.ac.uk): - mkisofs now detects if a file grows or shrinks while being read by mkisofs. TODO: - read Joliet filenames with multi-session if no TRANS.TBL or RR is present. I am looking for a volouteer for this task! Note that this can never be 100% correct as there is no relation between the names on the master (UNIX) filesystem, the ISO-9660 names and the Joliet names. Only the Rock Ridge names are untranslated with respect to the original files on the master (UNIX) filesystem. - add libecc/edc for CDI and similar. CYGWIN NT-4.0 NOTES: To compile on Cygwin32, get Cygwin and install it. For more information read README.win32 The files are located on: ftp://ftp.berlios.de/pub/cdrecord/alpha ... NOTE: These tar archives are 100% POSIX compatible. GNU tar may get some minor trouble. If you like a 100% POSIX compliant tar, get star from ftp://ftp.berlios.de/pub/star/ WARNING: Do not use 'winzip' to extract the tar file! Winzip cannot extract symbolic links correctly. Joerg cdrkit-1.1.11/doc/ANNOUNCEMENTs/AN-2.01.01a060000644000372500001440000001022710471375025016301 0ustar steveusersPlease have a look at the German open Source Center BerliOS at www.berlios.de BerliOS will continue to support free hosting of cryptography projects even when US laws change and don't allow to host cryptography projects in the USA. Also look at sourcewell.berlios.de, the first Open Source announcement service that itself is implemented as Open Source project. ***************** Important news **************************** For the 'Slottable Source Plugin Module' SSPM Features read README.SSPM ***************** Please Test ********************************* NEW features of cdrtools-2.01.01a06: ******* NOTE: this is _not_ a release that starts a new aplha/beta series of dirtibutions. The only reason is to add certain new CD/DVD features that are important. So _please_ do not send any patches except when you like to fix extreme bugs. I am currently mainly working on stable incremental restore featurs for star-1.5-final. Once star-1.5-final is out, cdrtools will start a new developent cycle. ******* All: - Better support for BeOS/Zeta in the makefile system - Support for armv5teb-linux-cc was added to the makefile system - If you like all users to be able to call cdrecord root-less, you need Solaris 10 or newer. Edit the file /etc/security/exec_attr and add: All:solaris:cmd:::/opt/schily/bin/cdrecord: privs=file_dac_read,sys_devices,proc_lock_memory,proc_priocntl,net_privaddr All:solaris:cmd:::/opt/schily/bin/readcd: privs=file_dac_read,sys_devices,net_privaddr All:solaris:cmd:::/opt/schily/bin/cdda2wav: privs=file_dac_read,sys_devices,proc_priocntl,net_privaddr If you like to allow only specific user to use cdrecord, use something like: CD RW:solaris:cmd:::/opt/schily/bin/cdrecord: privs=file_dac_read,sys_devices,proc_lock_memory,proc_priocntl,net_privaddr Also edit /etc/security/prof_attr CD RW:::CD-R/RW Recording Authorizations:auths=solaris.device.cdrw instead and make the users members of the profile "CD RW" by adding a line like: joerg::::profiles=CD RW into /etc/user_attr Note that you either need to call cdrecord via "pfexec cdrecord ....." or by using a profile aware shell (e.g. /usr/bin/pfksh) Libparanoia (Ported by Jörg Schilling, originated by Monty xiphmont@mit.edu): Libedc (Optimized by Jörg Schilling, originated by Heiko Eißfeldt heiko@hexco.de): Libscg: - BeOS/Zeta libscg low level adoption code fixed. The code now is passing a "scgcheck" test. Rscsi: Cdrecord: - Adjust some timeouts to prevent that the drive buffer of newer Pioneer DVD writers empties when writing high speed DVD media. - Support for BeOS/Zeta shared memory was added - New tag CDR_MAXFIFOSIZE= in /etc/default/cdrecord allows to limit the size of the FIFO cdrecord is using. This helps the sysadmin to prevent other people from locking up the system. Cdda2wav (By Heiko Eißfeldt heiko@hexco.de): Readcd: - Support for BeOS/Zeta shared memory was added - -scanbus behavior corrected Scgcheck: - Fixed DMA overrun test. BeOS/Zeta did pass the test but scgcheck did complain before. Scgskeleton: - -scanbus behavior corrected Btcflash: - -scanbus behavior corrected - man page added Mkisofs (By Jörg Schilling and James Pearson j.pearson@ge.ucl.ac.uk): - try to work around a GCC trigraph problem - man pages for diag commands added TODO: - read Joliet filenames with multi-session if no TRANS.TBL or RR is present. I am looking for a volouteer for this task! Note that this can never be 100% correct as there is no relation between the names on the master (UNIX) filesystem, the ISO-9660 names and the Joliet names. Only the Rock Ridge names are untranslated with respect to the original files on the master (UNIX) filesystem. - add libecc/edc for CDI and similar. CYGWIN NT-4.0 NOTES: To compile on Cygwin32, get Cygwin and install it. For more information read README.win32 The files are located on: ftp://ftp.berlios.de/pub/cdrecord/alpha ... NOTE: These tar archives are 100% POSIX compatible. GNU tar may get some minor trouble. If you like a 100% POSIX compliant tar, get star from ftp://ftp.berlios.de/pub/star/ WARNING: Do not use 'winzip' to extract the tar file! Winzip cannot extract symbolic links correctly. Joerg cdrkit-1.1.11/doc/ANNOUNCEMENTs/AN-2.01.01a030000644000372500001440000001112010471375025016267 0ustar steveusersPlease have a look at the German open Source Center BerliOS at www.berlios.de BerliOS will continue to support free hosting of cryptography projects even when US laws change and don't allow to host cryptography projects in the USA. Also look at sourcewell.berlios.de, the first Open Source announcement service that itself is implemented as Open Source project. ***************** Important news **************************** For the 'Slottable Source Plugin Module' SSPM Features read README.SSPM ***************** Please Test ********************************* NEW features of cdrtools-2.01.01a02: ******* NOTE: this is _not_ a release that starts a new aplha/beta series of dirtibutions. The only reason is to add certain new CD/DVD features that are important. So _please_ do not send any patches except when you like to fix extreme bugs. I am currently mainly working on stable incremental restore featurs for star-1.5-final. Once star-1.5-final is out, cdrtools will start a new developent cycle. ******* All: - Now using "makefiles-1.5" - Compilation on OS/ should work again (-Zexe -> -o xxx.$(EXEEXT) - Sleeptime to allow reading Gmake warning reduced to 2 seconds. I am still waiting for GNU make to fix the bugs I did report in 1999. - Support for 'make DESTDIR=xxx install' added - Workaround for a Shell Bug on BSDi - Install workaround for the fact that BSDI has chown(1) in /usr/sbin/ - cc-config shell script reworked - Better configure tests for procfs include files - Configure tests for fchown, chmod, fchmod, lchmod, futimes, lutimes - Configure tests for fdopendir - Configure tests for broken ext2fs includes files in Linux kernel - Better SRCROOT search function in makefiles shell scripts - libunls reworked - New autoconf tests for broken , & on various Linux systems Libparanoia (Ported by Jörg Schilling, originated by Monty xiphmont@mit.edu): Libedc (Optimized by Jörg Schilling, originated by Heiko Eißfeldt heiko@hexco.de): Libscg: - Trying to introduce a workaround for broken & on various Linux systems. - Trying to introduce a workaround for the changed SCSI generic Linux Kernel interface from Linux-2.6.8.1 and newer. Be very careful with testing. The Linux adption layer for libscg is already full of workarounds for bugs, unstable interfaces and unwillingness of the Linux Kernel maintainers to give access to the needed information for libscg. I am not sure whether this workaround will not have problems. It has been tested on a Pegasus PPC running Linux-2.6.8.1 Rscsi: Cdrecord: - Allow the -shorttrack option for RAW mode, thanks to a report from Sebastian Trueg - Enhance the minimal grace time from 2 to 3 seconds to make sure that cdrecord will not get out of sync with locks from the Volume management system. - Better checks and better error messages for /etc/default/cdrecord - Correct verbose print mode for old pre-MMC TEAC drives. - Added support for Ultra speed+ CD-RW media recognition and a check whether the drive supports Ultra speed+ CD-RW media. (Thanks to Alexander Noé). Cdda2wav (By Heiko Eißfeldt heiko@hexco.de): Readcd: Scgcheck: Scgskeleton: Mkisofs (By Jörg Schilling and James Pearson j.pearson@ge.ucl.ac.uk): - Better error messages with wrong Eltorito boot options - Man page is now more explicit about requirements for DVD-video directory trees. - Better warning text for missing Rock Ridge in multi.c - Bugs in README.sunx86boot corrected - Multi Volume code for reading old image now gives different error messages on read errors and short reads. - Diagnostic programs isodump, isoinfo, ... no longer dump core when called with dev= parameters. TODO: - read Joliet filenames with multi-session if no TRANS.TBL or RR is present. I am looking for a volouteer for this task! Note that this can never be 100% correct as there is no relation between the names on the master (UNIX) filesystem, the ISO-9660 names and the Joliet names. Only the Rock Ridge names are untranslated with respect to the original files on the master (UNIX) filesystem. - add libecc/edc for CDI and similar. CYGWIN NT-4.0 NOTES: To compile on Cygwin32, get Cygwin and install it. For more information read README.win32 The files are located on: ftp://ftp.berlios.de/pub/cdrecord/alpha ... NOTE: These tar archives are 100% POSIX compatible. GNU tar may get some minor trouble. If you like a 100% POSIX compliant tar, get star from ftp://ftp.berlios.de/pub/star/ WARNING: Do not use 'winzip' to extract the tar file! Winzip cannot extract symbolic links correctly. Joerg cdrkit-1.1.11/doc/ANNOUNCEMENTs/AN-2.00000644000372500001440000015277710471375025015513 0ustar steveusersNEW features of cdrtools-2.0: Please have a look at the German open Source Center BerliOS at www.berlios.de BerliOS will continue to support free hosting of cryptography projects even when US laws change and don't allow to host cryptography projects in the USA. Also look at sourcewell.berlios.de, the first Open Source announcement service that itself is implemented as Open Source project. ***************** Important news **************************** For the 'Slottable Source Plugin Module' SSPM Features read README.SSPM ***************** Please Test ********************************* All: - Now using the "Slottable Source" feature of the makefile system. This is the fist modular reusable portable makefile standard in the open source world. To see a new feature call: "make tinfo" - config.sub now recognises "parisc-unknown-linux-gnu" - Circumvent some problems with GCC-3.0 on Linux - Removed printf() definitions from schily.h to avoid type clashes - Support for SCO (Caldera) OpenUNIX (aka. UnixWare 8) - Better support for Darwin-1.3 and 1.4 This is: - enhanced makefile system - type casts needed for unusual types used on Darwin (e.g. sizeof() returns long!) - Schily support includefiles rearranged to make portability even easier. - mconfig.h now defines IS_SCHILY to signal users of the Schily makefilesystem, that the Schily portability environment is being used. - now includes the forgotten mkdep-sco.sh that helps to better work around the SCO C-compiler. - timedefs.h modified. Now the last schily portability support include file hast been reworked to make portability even much easier. - schily.h & standard.h have been modified to hopefully finally solve all type clash problems with size_t & spawn*() - Compile support for QNX Neutrino - Now we hopefully have floating point support for _all_ platforms even those without *cvt() and without __dtoa(). Thanks to a hint from Thomas Langer we now use strtod.c to gert a fallback __dtoa() - Added an autoconf test for rcmd() so cdrtools now should compile again on BeOS and AmigaOS where no rcmd() is present. - fixed fexec.c to make it compile ion QNX - Now the complete libschily is included although it it not needed for cdrtools. There are two reasons for doing this: - Cdrtools is _the_ program that is heavily tested on many different platforms, so I will get reports for compile problems this way. - cdrtools becomes a base docking platform for the SSPM system this way. Now any of the Schily tools may be included and compiled inside the base portability platform 'cdrtools'. - New supported architctures: s390-linux-cc.rul parisc-linux-cc.rul parisc64-linux-cc.rul - Large File support for IRIX-6.2 (added autoconf test for -n32 cc option) - Large File support for IRIX-6.5 now everything works correctly if the OS supports Large Files by default in 32 bit mode (uses fseeko()/ftello() if present. This could only be done by massively changing the autoconf code stolen from GNUtar. - Support for SGI IRIX platform ip17-irix - Support for SGI IRIX-6.5 - Try to support recent BeOS (again) - Workaround in libschily/comerr.c for the nonstandard big negative errno values on BeOS - libschily now includes floating point printf() for BeOS - fileluopen.c from libschily now compiles on BeOS (without O_NDELAY) - workaround for the nonstandard negative errno values on BeOS - Schily makefile RULES for AmigaOS added - getpagesize() emulation for BeOS to make cdda2wav compile on BeOS - New rule allows automatic fallback to GCC if the configured default compiler could not be found. - statdefs.h enhanced - Many corrections to give less warnings on SCO Openserver - Support for NT-5.1 (WIN XP) added os-cygwin_nt-5.1.id - VMS script build_all.com now includes astoll.c so compilation on VMS should work again. - New macros for max/min values of int*_t in utypes.h - Limit the different handling of packed bitfields for AIX to AIX CC. - Unfortunately fragementation of cdrecord has begun. I noticed this fact recently when people started to ask me senseless things which turned out to be a result of a modified cdrtools source that I have not ben aware of. One main goal of cdrtools is to provide a platform indepenant user interface which cannot be achieved if people change important parts os the user interface. For this reason, I changed the license in hope that this will help at least to keep the user interface the same on all platforms and on all distributions. Please keep in mind that fragmentation in many cases increases my workload. There is no real reason for a modification, and (even worse) the people who create modifications do not help to keep my workload low in order to help me (and Heiko and James) with the cdrtools project. People should rather contribute to the project. Cdrtools should be free and actively mantained in future. With increasing workload, I don't know how to do this. - Add hints that compiling on unknown platforms wil only work if "smake" is used. - Autoconf code for Large file support now handles Linux system include file bugs that prevented correct behavior on 64 Bit Linux systems. - Better autoconf code for the problems with mlock() & HP-UX-10.20 - Better autocheck code for available C-compilers on HP-UX Now even a fallback from GCC to CC works. - Some changes to make compilation on 64 bit systems more correct - Added support for GNU Hurd to the Schily Makefilesystem - Cast pointerdiffs to int for printf() %.*s format and/or include workarounds for 64 bit problems in this area. - Several modifications to make OS/2 work again (e.g. -lsocket added) - fexec.c now uses a configurable PATH environment separator to allow PATH lookup on OS/2 - A 20 year old extension has been removed from format.c This caused printf() to interpret %X as %lX. This caused noticable problems on IA-64. It should have created problems on True64 and on 64 bit Sparc programs too but was not directly visible due to a different stack content. - remove #elif to avoid a GCC-3.x warning - config.sub now knows about IA64 architecture - Makefilesystem now spports compiler specific optimization flags - Align_test.c now creates a better include file (using more () to make sure the compiler created correct code). - Makefilesystem changed $(MAKE) to "$(MAKE)" to allow spaces in pathnames - Correct autoconf test for broken OS like MAC OS X that do not allow local malloc() implementations due to linker bugs. - Add autoconf test for strange clock_t definition method on Linux - README.ATAPI enhanced for all platforms - README.ATAPI now contains a hint on how to use ATAPI drives on HP-UX-11.x - Support for FreeBSD on Ultrasparc added to the makefile system - *roff'd man pages in .../doc dir re-created - Try to work around a bug in OpenBSD. OpenBSD defines EOF in ctype.h but POSIX only mentions an EOF definition for stdio.h. If we include ctype.h bfore schily.h on OpenBSD while stdio.h has not been included, this will fail. /*--------------------------------------------------------------------------*/ Libparanoia (Ported by Jörg Schilling, originated by Monty xiphmont@mit.edu): - The paranoia code from cdparanoia (written by Monty xiphmont@mit.edu) has been converted into a portable library. /*--------------------------------------------------------------------------*/ Libedc (Optimized by Jörg Schilling, originated by Heiko Eißfeldt heiko@hexco.de): - Changed to allow compilation on K&R compilers too - Speedup by 300% The speedup is nearly processor independant. Pentium-233 2443 sectors/s 32x 333Mhz-UltraSparc-IIi 6402 sectors/s 85x 900Mhz-UltraSparc-III+ 22813 sectors/s 304x Athlon-1000 24378 sectors/s 325x Athlon-1700 40168 sectors/s 535x Depending on the speed of gettimeofday(), these numbers may be up to 5% too low. - Code is now put under GPL. /*--------------------------------------------------------------------------*/ Libscg: - Trying to add a workaround for just another bug in the sg driver in the Linux kernel. If a TIMEOUT occurs, the error code does not indicate a TIMEOUT. - Better scg_open() error messages when trying to do scanbus on Linux and no /dev/sg* or /dev/pg* could be opened. - Output Request Sense buffer with -debug when the USCSI interface is used on Solaris. - First attempt for support for the new IOKit SCSI interface on MaxOS X Darwin-1.4 and newer with much much help from Constantine Sapuntzakis Unfortunately there is not yet support for SCSI devices nor is there support for standard Bus,Target,Lun device namings. I hope that bot may be added in the future. Volunteers who like to help with the libscg interface stuff for Darwin-1.4 are welcome. - Try to make scsi-beos.c compile on new BeOS version 5 - First attempt to integrate the AmigaOS SCSI transport interface code from Thomas Langer - Massive modicifation of the support code for SCO OpenServer 5.x As the kernel implementation contains several bugs, the new code will by default not check for hard disks in scan mode. The code checks the following environment variables: "LIBSCG_SCAN_ALL" To force scanning for all SCSI targets. "LIBSCG_SCSIUSERCMD" use old SCSIUSERCMD ioctl() "LIBSCG_MAX_DMA" override MAX_DMA value, value must be number in kB "LIBSCG_ENABLE_USB" enable access of USB devices - Version -> 0.6 - Adding support for the CDROM_SEND_PACKET ioctl() from cdrom.c Thanks to Alexander Kern for the idea and first code fragments for supporting the CDROM_SEND_PACKET ioctl() from the cdrom.c kernel driver. Please note that this interface in principle is completely unneeded but the Linux kernel is just a cluster of code and does not support planned orthogonal interface systems. For this reason we need CDROM_SEND_PACKET in order to work around a bug in the linux kernel that prevents to use PCATA drives because the kernel panics if you try to put ide-scsi on top of the PCATA driver. The code is currently in "status nascendi" but usable with some trade offs. To use: call e.g. cdrecord -scanbus dev=ATAPI: cdrecord -dao -v speed=24 dev=ATAPI:0,0 .... Be careful! This code is only needed in order to be able to use PCATA CD-writers on notebooks because there is a severe kernel bug. Unfortunately, this bug causes the kernel to hang (and force you to reboot) if you try to call: cdrecord -scanbus without the dev=ATAPI: option. In this case cdrecord will hang infintely and unkillable in open("/dev/sg1", 2) => you need to reboot :-( Repeat by: Insert a PCATA CD-Writer in a Sony VAIO notebook and run cdrecord -scanbus. - Enhanced list of SCSI Error texts from SCSI standard from 29.5.2001 - New callback function to allow execption handling to be done after the current SCSI command did finish. - scsi-aix.c now uses UIntptr_t in alignement macro. - Some 64 bit casts in the USCSI code from scsi-sun.c For hints on the Linux Packet code in ide-cdrom.c read README.ATAPI - Introduce a workaround for a conceptional Bug in the Linux kernel SCSI implementation. Linux is unable to distinct between a target selection timeut (e.g. switched off target) and a command timeout (e.g. command needs more time than expected). If the detected command time is < 1 second, libscg will now assume a dead target. - Fix a bug with ATAPI in scsi-vms.c - now the SCSI status byte is OK Thanks To Eberhard Heuser - Allow up to 26 IDE controlers in scsi-vms.c - Thanks to Chip Dancy - Do not open all /dev/scg* devices on Solaris if not in Scanbus mode - Handle ENXIO in Solaris USCSI interface code as indicator for a switched off device. - Max DMA size for Linux ATAPI Packet interface code corrected. Max DMA is 128k-1 and not 128k. - Support for recently defined new SCSI target types found in SCSI standard. - New help system that lists all SCSI low level transports for a specific platform together with their properties. - Allow consistent usage of alternate SCSI transport layers. Now the Solaris USCSI implementation and the (SuSE) Linux ATA implementation behave similar and both allow dev= as well as dev=: for -scanbus, e.g. cdrecord dev=USCSI -scanbus cdrecord dev=USCSI: -scanbus cdrecord dev=ATAPI -scanbus cdrecord dev=ATAPI: -scanbus all work the same way. - Small change for Linux device initialization by request of Linus Torvalds The purpose of this change is to support a new SCSI transport interface for ATAPI in Linux that came up with the latest developer Linux kernels (e.g. Linux-2.5.43). This interface allows to send SCSI commands directly to ATAPI drives without using ide-scsi and sg, but it has several pitfalls. While Linux allows to use DMA when using ide-scsi and sg if the sector size is 2048 and the transfer buffer starts page aligned, the new direct interface never uses DMA (acording to Linus Torvalds). So if you write audio CDs or data CDs in RAW mode, there is no difference. If you write data CDs in TAO or DAO mode, using ide-scsi and sg allows much higher write speed. Note that this may change in future.... Notes for use: - You need to specify something like dev=/dev/hdc Note that this is unsupported by libscg. - As long as there is no safe way for libscg to find out early that this new interface is used, libscg may hang a bit on open. This is caused by the fact that libscg is forced to read from the open filedscriptor to clean up old Linux sg driver interfaces. This was never a problem with /dev/sg*, but when doing the same thing, this causes libscg to read content from /dev/hd* - There is (currently) no way for cdrecord to scan for ATAPI devices when using this interface. As long as this is true, you may want to prefer to use cdrecord dev=ATAPI: -scanbus and cdrecord dev=ATAPI:0,0 ... instead. - Fix scsi-unixware.c to allow multiple opens. - Fixed several typo's. - Avoid to read from the media (when using the new experimental Linux ATAPI transport) while trying to clear old sg driver status. - Woraround for Linux kernel design bug: CDROM_SEND_PACKET sets errno to EINVAL in case SCSI sense key is "Invalid command". /*--------------------------------------------------------------------------*/ Rscsi: - RSCSI now works if the target is a Win32 system. This is not done by changing rscsi.c but by fixing a bug in Cygwin! The fix to Cygwin's rshd is posted in http://sources.redhat.com/ml/cygwin-apps/2001-05/msg00000.html Thanks to egor duda NOTE that in a few weeks this patch will be integrated into Cygwin and cdrecord/RSCSI will work out of the box on a recent Cygwin release. - Now prints user ID & user Name into DEBUG file - Now using signal safe read/write functions. - Code now checks for HAVE_NETDB_H (added by request of "Thomas" to help with AmigaOS port) This should indicate whether there is support for rcmd() in the OS. - Make it compile on BeOS - changed because GNU Hurd has no MAXHOSTNAMELEN - Return "PIPE" for hostname comparison if called from e.g. 'sshd'. /*--------------------------------------------------------------------------*/ Cdrecord: - New option -overburn This option has been added as many people seem to be unabe to understand that they are going to write more than the official disk capacity from reading cdrecord's output. Oveburnung now is no more done by default! NOTE that there even are some drives that prevent you from writing exactly the official size and stop several hundreds of sectors before. - Do not print a warning for writing more than 90 minutes if the media is a DVD - Fix for a problem with setting high priority on Win32 systems. Thanks to egor duda - Sony MMC drives now work in -multi session mode. There was a bug in cdrecord that was accepted by all other drives. The bug did cause a temporary bad setup to the drive. - I hope that the 90 minute CD capacity warning now will finally disappear for DVD writers. - Old test code removed that prevented cdrecord from being able to write manually configured indices. Note that the index lists from the *.inf files with using the -useinfo option alway worked. - -force will force cdrecord to ingnore any failed forced OPC. currently this is only done if the drive does not support forced OPC. - Do forced OPC before blanking a CD-RW - Driveropts "burnproof" renamed to "burnfree". This has been done as this technology now appears in the MMC standard. - Cdrecord now shows whether BURN-Free is active. This makes sense as Ricoh's "Just-Link" is enabled by default. Unfortunately, the way "Just-link" is implemented is not compliant with the MMC standard. We will have to wait until I get the needed information from Ricoh. - Support for MMC RAW mode writing. This allows to do disk at once recording on Philips drives that do not support SAO. You may write audio tracks in RAW mode. There are some new and most likely transient options: -raw16 Write 2352 Bytes sectors + P+Q Subchannel -raw96r Write 2352 Bytes sectors + P+W Subchannel (R-W in raw mode) -raw96p Write 2352 Bytes sectors + P+W Subchannel (R-W in packed mode) Indices are fully supported in RAW mode. MCN & ISRC are not yet suported in RAW mode, they are silently discarded. I know that cdrecord currently does not work in RAW/R96P mode. It is not clear whether this is a bug in cdrecord or in the Plextor firmware as I did not yet found another drive that claimes to support RAW7R96P. If you find other problems in RAW mode or if you find new bugs introduced in old write modes, please send a bug report. - Cdrecord now checks the properties of the writer. If a specific write mode is not supported by the writer, cdrecord warns you and makes a suggestion for a similar alternate write mode. With the curent structure of cdrecord, it is not possible to silently e.g. change the write mode from -dao to -raw96r - MMC compliant drives are automatically scanned for supported write modes. This should help to make cdrecord work without manual static configuration. My hope is still to have no need to know all drive properties in advance, so new drives will continue to work as long as they are standard comliant enough for cdrecord. NOTE for GUI implementors: the line starting with the text: "Checking possible write modes:" will go away in the near future. The line starting with: "Supported modes:" will remain and should be checked for possible write modes. - Fixed a bug in the option checking that prevented to write data CD's at all. Now only "RAW data" CD's are flagged as expected. - Fixed a bug in the Firmware bug recognition system. This bug did prevent cdrecord to work with Philips drives when writing in RAW mode. - New options -copy & -nocopy to allow to modify the 'copy' bit in audio subchannel data. - -scms option added to the man page and online help. - New model to compute SCSI transfersizes - -xa1 -xa2 sector typedefinitions changed. - Debug messages while checking possible write modes of MMC compliant made optional. - RAW writing scatter sector function made more general - New functions to convert between 2448 and 2368 byte sectors NOTE: Read README.raw - add a forgotten if (xdebug) in drv_mmc.c. This caused a superfluous write mode debug message to be printed - do installation of exit handlers (to reset SCSI state) earlier - Cdrecord now does not exit with 0 anymore when interrupted with ^C during the waittime before starting to write. - First CD-Text support (can only copy CD-Text information from master disk) Writing of CD-Text is supported for all drives that support CD-Text in SAO write mode and for all drives that support to write in RAW/RAW96R mode (use -raw96r in this case). NOTE: Read README.cdtext - Circumvent a bug in the system include files from Linux that makes printf() a macro and prevented compilation with GCC-3.0 - Added some #include to substitute missing printf() definitions - SAO/R16 mode removed from tests, it may never occur. - Changed some .min defines in structs to .pmin to avoid K&R complier problems - better FIFO debug messages - New driver config table for Taiyo Yuden EW-50. This dive is like a Philips CDD-521 but has been reported to swab audio data. - rscsi client code now uses buffered read to speed up on Cygwin - rscsi client code now uses signal safe read/write functions - Cdrecod now does not open/close the tray anymore if the disk is going to be erased. - modify -version output if Clone writing support is present - A new driver has been added that first checks the media if the drive supports to write CD & DVD. - Behaviour of the function that reads fs= tsize= and similar corrected. - Modified driver interface for better DVD support - FIFO Code now checks for HAVE_FORK (added by request of "Thomas" to help with AmigaOS port) - Better messages when trying to write more than the amount of data that fits on a DVD. - The DVD driver now reports a DVD media back to the high level code. - correctly use the buffer capacity code from the driver instead of the MMC-2 read buffer cap code directly - Support for the unusual not ready error code of the CyberDrive CW038D - CD-Text Code now also accepts Text File without 4 byte Size header - CD-Text file read code now is able to do CRC error correction Note that only songle bit errors per 18 byte pack. - CD-text Autoring support: CD-text may now be based on fields found in the *.inf files created by cdda2wav. To create a CD with CD-Text based on information from freedb.org call: 1) cdda2wav -B -v255 -L 2) cdrecord {-dao!-raw96r} -v -useinfo -text *.wav CD-text TODO: - Check whether the *.inf files are all from the same CD and clear some CD-text fields that are only valid if they relate to one CD only. - Add some more fields (mainly a dficiency of cdda2wav) - Support multi language text - Support character coding other than ISO-9959-1 CD-text may be based on fields found in the *.inf files created by cdda2wav. NOTE: Read README.cdtext - better messages for CD manufacturer codes that are not in the latest free Orange forum table. - Default usage code is now only 6 lines so the error message does no longer scroll out the screen. If yu like to get the old long usage information, call cdrecord -help - move 'dd' like number conversion stuff into getnum.c - Allow the /etc/default/cdrecord parsing code to be used by readcd too (as documented in the man page) - First support for Plextor's VariRec feature in the PX-W4012 I am not sure about the final user interface. For now, call e.g. cdrecord speed=4 driveropts=varirec=-1 for all audio CDs. Allowed varirec parameters are -2, -1, 0, 1, 2 VariRec only works at write speed 4. - Print the actual current write speed in verbose mode. - DVD-R code (undisclosed) now supports: Vendor_info : 'MATSHITA' Identifikation : 'DVD-RAM LF-D310 ' Revision : 'A116' - Support for SCMS from *.inf files Note that you need to use cdda2wav/cdrecord that have fitting versions because of this change. Otherwise cdrecord may add SCMS copy protection. - RAW mode now honors COPY bit and SCMS coding. - Avoid coredump with "cdrecord textfile= non/existant ..." - Corrected printf() formats for verbose printing to hold enough space for media > 1 GB (DVD) - Corrected printf() formats to make the write speed non-jumping. - If called from a GUI, cdrecord now reads from "stderr" if the CD-input-data is from "stdin". If it turns out that stderr is not open for reading, cdrecord waits to receive a SIGUSR1 - Better printouts for the DISC-ids covered by the orange forum embargo. - DVD structure structure definition enhanced to reflect current standard. - new option gracetime= - Try to abort DAO recording with a flush_buffer() if ^C is hit. - Try to make cdrecord behave more polite for platforms (like Cygwin) that don't support large files when the DVD data to be written is read from stdin. mkisofs ... | cdrecord ... - will now work for DVDs on non large file OS - Call flush buffer in silent mode to avoid error messages with cdrecord -toc called on a CD-ROM drive. - Avoid core dump is a single .inf file is missing and -text option is used. - Data structures modified to allow new features in the future. - Fixed a bug that caused cdrecord to ignore escaped file type args if they looked like a valid option (e.g.): cdrecord dev=0,0 -dao -v -- speed=8 "speed=8" should be handled as if it was a filename but was skipped. - Print write mode when starting to write. I hope that this helps me to understand incorrect "bug reports" from lazy people who do not include their cdrecord command line. - Printing ATIP information is now caused by a separate (internal) flag and not ny a hack. - Do not allow to write to ultra low speed RW media if the drive is not able to write at 2x or 1x. This may be circumvented with -force. - Do not allow to write to high speed RW media if the drive is not a high speed RW drive. This may be circumvented with -force. - Data structures modified to allow new features in the future. Trying to make driver interface simpler and cleaner. This resulted in a major rewrite of the driver interface. - please test if multi session with TEAC CDR-50/CDR-55 still works. As a lot has been changed in the driver interface, please test if bugs have been introduced! - New test that prevents to write CD-RW media too slow - Display of current DVD write speed now correct and no more based on single speed CD but on single speed DVD. - Moving SAO/RAW start code from cdrecord.c into drv_mmc.c allows clean DVD-R/RW driver interface code. Now cdrecord -dao will work correctly (as expected) even for DVDs - speed= option no longer defaults to speed=1 Each driver now includes a default speed and a maximum speed. If the maximum speed in the driver is wrong, use -force to overwrite. Please send feedback if my assumptions on write speed are wrong: - No drive using the Philips CDD-521 command set is faster or slower than 2x - No drive using the Yamaha CDR-100 driver is faster than 4x No drive using the Yamaha CDR-100 driver is slower than 2x - The Tayo Yuden CW-50 is 2x - The Kodak PCD-600 is 6x - Abort when the last track # of a multi session disk would be > 99 - Data structures modified to allow new features in the future. - Better bessages for CD-RW where the speed ofthe media does not match the properties of the writer. - Avoid to reload media in -dummy RAW mode. - Correctly abort if there was a problem when writing CD-Text in the LEAD-IN. - Again: Data structures modified to allow new features in the future. This release uses the new data structurec to allow to write ISRC/MCN in RAW mode. - Fixed a bug that caused cdrecord to write a wrong relative time into the subchannel data when writing audio CDs in RAW mode. This affected the pregap sectors if pregap size was != 0. - Allow cdrecord to write ISRC & MCN even in RAW mode. - Allow Simulation driver cdr_simul and dvd_simul to simulate any write mode. - Simulation driver cdr_simul and dvd_simul changed so no reload on the real background drive occurs. - Since last release , the new data structures allow to write ISRC/MCN in RAW mode. This now makes RAW mode fully usable for audio CDs. NOTE: if you find any problems with CDs written in SAO mode, first try to write the same CD in RAW mode if your drive supports to write in RAW mode. Tere are a lot of drives that have rotten firmware and create broken CDs in DAO mode. - Support for Yahama Audio Master Quality Recording. This support is switched on via driveropts=audiomaster I am sorry, but I had to do major changes in the MMC driver in order to be able to support Audio Master. This may have affected all other driveropts= too. Please test and keep in mind that I like to have the mext major release in a few weeks. When audiomaster has been specified, BURN-Free recording is disabled and - as the visible size of the medium decreases - a second disk size check is done after Audio Master has been turned on. - man page enhanced according to new features - Short Usage funtion now includes a hint on how to obtain the list of possible driveropts= parameters - Include the tags "VARIREC ", "AUDIOMASTER ", "FORCESPEED " In the "Driver flags" line that is visible with cdrecord -checkdrive. - cdrecord driveropts=help now includes "varirec=" and "audiomaster" - Support for writing data sectors in RAW mode has been added to the GPL#ed version of cdrecord. Note that writing data sectors in RAW mode is a highly CPU intense task. For this reason, cdrecord first checks whether it would be possible to do the requested job reliably. If it is questionable whether the job could be done in the desired speed, cdrecord aborts with a related message. The max theoretical speed (not including the writing load) is printed in a new line starting with: "Encoding speed :". Cdrecord allows half of this speed. - Allow RAW writing of data sectors to work correctly without the need of specifying -data - Allow spaces as delimiters between different tags in a single line in the file /etc/default/cdrecord - Support for Ricoh (and others) Just Link This support is switched on via driveropts=burnfree Note that Just Link is by default swichted on in the drive but as Just Link may create CDs that are no 100% OK, cdrecord now by default switches it off. Now you definitely need to specify driveropts=burnfree to switch Just Link on again. If you call cdrecord dev=... -checkdrive you will see the TAG "BURNFREE" as a hint that either Burn-Proof or Just Link is supported. - "Turning .... " messages for drive special functiions are now printed to stdout - Limited display (once every 1 MB) of the drives internal buffer RAM fill ratio. - Display the minimal drive buffer fill ratio a the end of the write process. - Display number of predicted drive buffer underruns based on the fill ratio of the drive buffer (incremented if fill ratio is < 5%). - Display average write speed at the end of the write process. In dao mode, this includes the time needed to write the lead in and thus is not 100& correct (value is too low). - Display of the number of times the Buffer underrun protection has been active for drives where the manufacturer send me the needed information (Ricoh, Yamaha, Aopen). It may work for other drives too but there is no guarantee. - Fixed a bug in the driveropts= parsing routine. - New driveropts= option "forcespeed". Use with extreme care as this will force several drives ((Ricoh, Yamaha, Aopen, ...) to write with the selected high speed although the mediaum is too bad for this operation. - New driveropts= option "tattooinfo". Use together with -checkrive to retrieve the information about the picture size that will fit. The result will be someting like: DiskT@2 inner r: 265 DiskT@2 outer r: 583 DiskT@2 image size: 3744 x 318 pixel. - New driveropts= option "tattoofile=". Use together with -checkrive to write an image of the right size to disk. Read README.DiskT@2 - Rearrange the order of the new statistics printing - Allow several of the new statistics to be printed even if cdrecord aborts due to an error. - Let the old Philips drive use the common CD media 'reload' function. - Try to find out if a drive is MMC, MMC-2 or MMC-3 compliant. - see cdrecord -checkdrive - Suppress printing oof the average write speed if the size of the tracks is not known prior to start CD writing - ATIP printing (cdrecord -atip) enhanced to support Ultra high speed CD-RW media. - Check whether somebody likes to write a Ultra high speed CD-RW on an improper writer - Print MMC conformance level of the drive based on content of SCSI mode page 2A. - Print more information for MMC-2 & MMC-3 drives with cdrecord -prcap - The new true CAV Plexwriter 482448 is now supported. Please note that it is not easy to write at 48x. You definitely need a correct DMA setup to optimal values. Also note switching on Burn-Proof will reduce the max speed to 40x so it may be that you don't need Burn-Proof if you simply reduce speed to 40x manually - make sure that using both -copy and -useinfo will not result in unclear state Instead the content of the *.inf files will be used - Simulation driver (cdr_simul / dvd_simul) now uses correct speed ratio for DVDs - Simulation driver now supports fake "Next writable address" function. - On Linux usleep() is very unacurate, meter the real sleep time and cumulate a correction value. This allows the simulation driver to simulate the correct write speed. - Added a note to Heiko Eißfeldt's libedc when printing RAW encoding speed - Limit gracetime to 999 seconds and make output correct even for times > 9 seconds. - Corrected a bug in the MMC driver that caused cdrecord to use the wrong place for current speed when doing MMC/MMC-3 dependant stuff - cdrecord -prcap will now use the same format for MMC & MMC-3 drives rsulting in a better readability. - Don't print write time statistics if writing did not yet start - Try to handle drives that don't support to write at speed 1 but will fail if you try to call cdrecord speed=1 ... - New option -immed tells cdrecord to set the SCSI "IMMED" flag in certain commands. This option is not needed if your PC has been configured correctly. However, ATAPI drives usually cannnot do disconnect/reconnect. As a result, the PC may hang with long lasting commands if the CD-writer has been connected to the same IDE cable as the harddisk. A correct solution would be to set up a correct cabling but there seem to be notebooks around that have been set up the wrong way by the manufacturer. As it is impossible to fix this problem in notebooks, -immed has been added. Use this option with care and do not expect cdrecord to work correctly if it has been called with -immed. - -force will not completely removeany speed restrictions for writing in RAW mode. Instead, only the speed that a single CPU allows will be permitted by cdrecord. This still has a high potential for a buffer underrun. By default cdrecord still is limited to half the encoding speed that a single CPU allows. Even this may result in a buffer underrun on Linux as Linux does not use DMA for IDE when the sector size is != 2048 bytes which is true in RAW write mode. - If the environment variable "CDR_FORCERAWSPEED" is set, this will have the same results for RAW speed as using -force. However, -force has more general effects and should be avoided. - Fixed a bug in fifo.c introduced with the driver interface change. Now cdrecord compiles again on VMS (without FIFO). Thanks to Eberhard Heuser. - Allow cdrecord to compile without libedc Thanks to Eberhard Heuser. - Run read buffer capacity in silent mode. This is needed because drives with buggy firmware like the CW-7585 did cause hundreds of "command sequence erorrs" to be emmited when trying to read the current drive buffer fill ratio. - Fixed man page to correctly call SAO mode SAO and not DAO. - Encoding speed is contend dependant. Initalize test buffer before doing a libedc speed test to make the result independant from grabage on the stack. - Support for libscg help system - Warn to use cdrecord blank=all if a drive rejects cdrecord blank=fast - Fixed a bug that became obvious with Yamaha AudioMaster mode and CD-Text The problem was caused by the fact that cdrecord did not allow to overwrite the lead in start time in cdrecord's internal data structures. - Fixed a bug with recognition of complete disks that came up after cdrecord did allow to deal with >= 90 minute CD's. - Changed Text "BURN-Free was not used" to "BURN-Free was never needed" because people did believe that the old text means that Burn-Proof has been disabled. - Man page now includes a hint that padsize is always using 2048 as sector size. - Fixed a bug with padsize=xxx if sector size was not 2048 bytes. Cdrecord in this case did just divide the number of pad bytes by the number of bytes in an output sized sector (e.g. 2448 or 2352 bytes). This did result in a too low number of padding sectors. The fix caused a complete rewrite of the pad size handling. - Treat packet mode similar to normal writing: Print Drive buffer fill ratio and current write speed. - Treat padding similar to normal writing: Print Drive buffer fill ratio and current write speed. - Make verbose printing consistent and non-jumping - A new experimental feature of the -immed flag is to tell cdrecord to try to wait short times wile writing to the media. This is expected to free the IDE bus if the CD/DVD writer and the data source are connected to the same IDE cable. In this case, the CD/DVD writer would otherwise usually block the IDE bus for nearly all the time making it impossible to fetch data from the source drive. As this is an experimental feature, I would like to get feedback. - #ifdef _POSIX_MEMLOCK/_POSIX_PRIORITY_SCHEDULING Tests now POSIX 2001 compliant - Do not try to close fd if running on an OS that does not use an fd to mmap() chared memory from anonymous pages. - Print Orange Forum embargo warning only if ATIP minutes == 97 because some DVD writer return junk with read ATIP - New option minbuf= to choose the mininum drive buffer fill ratio for the ATAPI wait option that is intended to forcibly free the IDE bus to avoid buffer underruns with bad HW configurations. The permitted range is 25..95 for 25%..95% buffer fill ratio. - minbuf= may switch on the ATAPI wait option without enabling the SCSI Immed option. - Forcibly switch on -v for now if the ATAPI wait option has been selected. This is needed because due to a bug, this option will not work without -v - Make FIFO code work on AmigaOS For Yamaha Disk Tatoo features read README.DiskT@2 /*--------------------------------------------------------------------------*/ Cdda2wav (By Heiko Eißfeldt heiko@hexco.de): - Changes to make cdda2wav compile better on Alpha/True64 - Restructured to better use the schily makefile portability structures. - Changed handling of Table of contents. Now the more informative methods of Read full toc are being used in favor to the old SCSI readtoc command. For Sony methods, the fallback is the old method. The new methods are available on MMC drives and modern drives with Sony command sets. It should enhance access to very weird multi session cds. ************** NOTE: If your drive still has problems to copy such non-CD's, there is a simple hack to allow the disk to be copied on all drives: Use a (black) whiteboard pen (non-permanent) and paint on the space directly outside the visible ring that is in the middle of the non-CD. This is the space where the broken TOC from the second session is located. After doing the copy please return the disk to the dealer and tell the dealer that this is broken goods. This is the only way to stop the big groups to defraud the customers. ************* - Temporary hack to fix a bug in the ISRC code that caused the ISRC string to be shortened by one character. - fixed ioctl handling of toc entries - checked ISRC retrieval (MMC + Plextor) - more checking for weird CDs with wrong track types - bugfix in setuid.c - read full toc method extended to a data track in the second session for cd-extra/enhanced cd recognition - if the tracks in the TOC are labelled as data, this is checked and corrected if untrue - show cd text disc identification, if one exist - a new perl script to generate a binary cdtext file for use with cdrecord. This is currently very simple, but it enables you to create cd-text enriched copies from non cd-text originals. For a hint how to use the new perl script see the CD-text usage notes above. - New option -L to ask freedb.freedb.org for CDDB information. This alllows to automatically create CD-Text CDs. - correct TOC endianess for FreeBSD ioctl interface. - Fixed a bug that caused cdda2wav to dump core with certain CD-Text data. - new option -L changed. Now a numerical parameter (0 or 1) defines the handling of multiple cddbp entries. 0 enters user interactive mode. 1 take the first entry unconditionally. I still need a reasonable way for gui interaction in this case! Proposals are welcome. - made cddbp handling for mixed mode cds more robust. It is unclear yet, if data tracks have to be included in the query. Anybody knows the definitive answer? - Better TOC ADDR/CRTL (red book) handling - Better method to scan for indices. - Support for SCMS in *.inf files - Better SUID/SGID handling - new script cddda2ogg - bugfix deemphasizing (thanks to Klaus Wolterec) - bugfix rounding error (creation of info files) - added AlbumPerformer entry in info files - integration of Monty's libparanoia - switch to Jörgs getargs option handling - Fix some bugs with option parsing introduced with the new option parsing using getargs() - New option -version to make cdrtools behave similar - New option paraopts=opts for paranoia options. - Print Paranoia statistics result at end of every track. - prepare for better recording of discs with illegal TOCs - prepare for non-english cd_text languages - rewrite of the TOC handling code (now multisession capable and much more robust) - add a fallback method (shmat()) for failed mmap() - linux bug workaround: open() sound device does block when device is busy. - several code cleanups, some 64-bit portability bugfixes - Fixed shell script 'cdda2mp3.new' to correctly use "#!/bin/sh" - Fixed a bug (introduced while converting to getargs()) that caused cdda2wav to dump core on OS that implement read only text correctly like Solaris does) if compled with gcc or Sun CC COPTX=-xstrconst - Remove old unused getopt() code. - Check DMA residual count - FreeBSD cooked ioctl() Byte swapping now finally OK? - Fixed a bug that caused cdda2wav to return wrong byteorder on Big endian machines if -paranoia has been specified - fix several CDDB query bugs - support CDDBP protocol 5 - customizable CDDBP server and port settings. - Fixed a bug in the paranoia calling code that caused cdda2wav to try to access one sector too far on the media if in paranoia mode. - Allow again compilation on FreeBSD - bugfix for CD Extra, when copyright messages were present - patch from Kyle to make CD extra handling more robust - bugfix for wrong warning message 'no generation of info files' due to incomplete length - new verbose suboptions. Strings will finally replace the tedious binary masks. For script compatibility the special form of -v255 will be recognized for some releases. -vhelp will show the new strings. - reworked the toc display code to make it more orthogonal. - changed option 'speed-select' to 'speed' for better interoperability - Temporary added -v for compatibility with old GUI programs. Note: -v is outdated and will be removed soon. - Implement a temporary compatibility bug for the -v option. - Support for libscg help system - Man page fixed - Fix for an uninitialized variable - New exit codes for xcdroast - Fix for a CDDB bug: need to use lead out start for play time - Fix for a CDDB bug: Allow whitepsace in Genre - Fix for a CDDB bug: need to count data tracks too /*--------------------------------------------------------------------------*/ Readcd: - better error recovery with -noerror - error handling increased - Handle signals and other aborts by restoring old drive state - Set PF bit with mode select. - New option -quiet to suppress primary SCSI error messages in read CD error handling This are the messages that are printed before entering the retry mode. - Secondary SCSI error messages are now suppressed by default, they may be turned on again with -verbose This are the messages that are printed in -noerror retry mode. - Better handling of C2 scans on unreadable data disks. - use comerrno() instead of comerr() if the drive is not ready as errno is not valid after that test. - Enhanced output for C2 error scan. - Now use /etc/default/cdrecord as documented in the man page. - Better behavior with extreme badly readable media. - List number of completely unreadable sectors in addition to the C2 error count. - Man page updated to contain all options - New option speed= to allow reading at slower speed and avoid read error caused by vibrations of the media. - added new option -overhead to meter SCSI command execution overhead. /*--------------------------------------------------------------------------*/ Scgcheck: - Fixed Makefile so scgcheck now compiles on FreeBSD /*--------------------------------------------------------------------------*/ Mkisofs (By Jörg Schilling and James Pearson j.pearson@ge.ucl.ac.uk): - Man page updated and corrected. - Try to avoid the C-compiler warnings for getopt.c that are caused by the non-confirming way of hacking used by FSF people - isoinfo now corectly displays file with filesize > 1 GB - isoinfo now implements a new option -s that displays the size of the files in multiples of the sector size (2048 Bytes) - libhfs_iso reworked to use timedefs.h from schily portability support. - Better error messages for ISO and Rock Ridge directory sort problems - Preserves HFS file dates for AppleDouble, AppleSingle and NetaTalk files - Fixed a problem from an uninitialized variable in desktop.c that caused random effects in Apple CD's - better documentation for README.sort/README.hide from James Pearson - Fixed a bug in sort code that caused the compare function to behave symmetric when called c(a,b) vs. c(b,a) - First UDF support via -udf option - thanks to Ben Rudiak-Gould. Note that the UDF support is not what you might indend. It is currently wired to the Joliet tree which is a bad idea. It also does not yet support Symbolic Links, user ID's and similar. - Write messages with more correct size names for the floppy eltorito boot images - Added a missing prototype in getopt.c - isodump.c isoinfo.c isovfy.c: Correctly handle symlinks use offsetof(struct iso_directory_record, name[0]) instead of sizeof(struct iso_directory_record) - sizeof(idr->name) - Fixed a check in the Apple HFS code that used strcmp for data that could contain null bytes. - Introduced many casts to enhance portability. This was needed for GNU fnmatch.c and the HFS support lib libhfs_iso - Use Protoyped function definitions for hash.c to allow old UNIX variants where sizeof(dev_t) is < sizeof(int) - Fixed a check in the Apple HFS code that used strcmp for data that could contain null bytes. - Introduced many casts to enhance portability. This was needed for GNU fnmatch.c and the HFS support lib libhfs_iso - Use Protoyped function definitions for hash.c to allow old UNIX variants where sizeof(dev_t) is < sizeof(int) - Support generic boot code if session does not start at sector 0. - Fixed a minor bug with HFS labels & multi-session Thanks to James Pearson - Only print a short Usage if mkisofs detected a usage error. - -z option now working to create CDs in a format with Linux proprietary Rock Ridge extensions for transparent compression. This is a patch from H.P. Anvin. It makes only sense with Linux-2.4.14 or later. - New option -debug - Correctly use stat()/lstat() with graft points - Fixed a bug with escape character handling in graft point handling. - Make the graft point a directory if the file it should point to is a directory. - Correctly handle non-canonical filenames with graft points. .////././///test=OBJ/sparc-sunos5-cc/ will now work correctly and not result in a corrupted ISO-Filesystem. - Canonicalize graft points so commands like: mkisofs -graft-points /a/b/././//=some_dir and mkisofs -graft-points /a/b/../c/=some_dir will not cause broken ISO images anymore. - Avoid unwanted information in debug information on disk. - Allow the -sort option to work with the Eltorito Boot Catalogue - Allow '-' to be part of the ISO-9660 filename if -no-iso-translate has been specified. Thanks for this hint from Georgy Salnikov (sge@nmr.nioch.nsc.ru) from Novosibirsk, Russia. - Try to avoid an integer overflow with the -C option and DVDs - Try to fix (very old) rotten code in various files that did cause integer overflows for files > 2 GB - 2kB. Inconsistent use of (always diferent) hand crufted code using 2048, 2047, ... instead of SECTOR_SIZE, ISO_ROUND_UP(), ... Note that this is not only of interest for DVDs as mkisofs could believe that > 2 GB of data would fit on a CD. - New code to print file type names. - Some more changes to reduce the probability of integer overflows in size computations. - Fixed a bug in the code that removes sensitive information from the command line. - Add text strings with descritpive text to the output_fragment structures - verbose > 1 (use -v) writes debug info for output fragments. This uses the new strings introduced with the last version. - isoinfo now uses getargs() and includes -version and -help options. - isoinfo now is able to find out that Joliet information is present if the disk contains illegal Joliet UNICODE escape code. This seem to happen with disks written with Adaptecs programs. - isoinfo has new option -debug that prints more information from the Primary volume descriptor. - Support for Apple HFS on Mac OS X Thanks to James Pearson. - Support for more then 65535 directories as only the parent entries need to fit into the path tables. - Full DVD-Video support thanks to Olaf Beck - olaf_sc@yahoo.com - Avoid a C-compler warning caused by mkisofs.h - Fixed a bug in the DEBUG code from the DVD-Video enhancements - Allow symlink targets to be up to 1024 bytes - devdump/isodump/isovfy now use getallargs() and implement -help/-version - If UDF but no Joliet is used, UDF filenames may be 255 chars long. Note that this is still hack. - From James: New option -joliet-long to allow 103 UNICODE characters with Joliet. This is not Joliet compliant but several other programs also create long Joliet names. - Fixed a minor C non-compliance in ifo_read.c - Allow symlink targets to be up to 1024 bytes - devdump/isodump/isovfy now use getallargs() and implement -help/-version - If UDF but no Joliet is used, UDF filenames may be 255 chars long. Note that this is still hack. - From James: New option -joliet-long to allow 103 UNICODE characters with Joliet. This is not Joliet compliant but several other programs also create long Joliet names. - Correct a minor problem with K&R compilers for the programs in mkisofs/diag/ - Make fire PATH_MAX is defined in isoinfo.c too. - Make sure UDF directory permissions include 'execute permission'. - A patch from James that make mkisofs able to create a HFS volume < 4 GB. - Support for MS code page 1250 (Slavic/Central Europe) added. Thanks to Petr Balas petr@balas.cz - A patch from James that make mkisofs able to create a HFS volume > 4 GB. - A new option -hfs-parms for better HFS support for HFS volumes > 4 GB from James Pearson - Fixed several typos in the man page and the source - Belly based speudo fix for a problem with mkisofs -f (follow) and symlinks to directories where directory content was missing with the old version. The new version is most likely better and we (James and I) could not find problems with the new version. - Make "HFS_TYPE" and "HFS_CREATOR" work as documented in ~/.mkisofsrc - Fixed a small typo in isofinfo.c - As mkisofs -f has bugs that cannot be fixed for this release, I decided to mark the '-f' Option as non-functional. People who use it will be warned that it does not work correctly. - Sort VIDEO_TS.IFO to be the first entry in VIDEO_TS/ woth -dvd-video - Disable Joliet if -dvd-video has been specified. This needs to be done to allow the change above. - Correctly handle files > 1GB on the UDF filesystem. Thanks to Wei DING for the patch. - Add support for Code Page 1251 - Koi8-u added to libunls - Fix a nasty bug in the UDF handling part that caused mkisofs to create completely broken filesystem images if directories have been nested deeper than 8 and -D has not been specified. - Include a new piece of code that causes mkisofs to abort with an error message if it turns out that the block numbers estimated during the sizing phase do not match the block numbers in the write phase. - Enabled a piece of code that has been introduced 2 years ago and that causes mkisofs to prevent deep directory relocation if Rock Ridge has not been spacified. If you like mkisofs not to omit the part of the directory tree that is nested too deep, specify either -R, -r or -D. TODO: - read Joliet filenames with multi-session if no TRANS.TBL or RR is present. I am looking for a volouteer for this task: Peter Berendi announced that he likes to be the volounteer for this task. Unfortunately, I did no hear again from him, but I got a proposal from "Krisztian Gede" who also likes to do the job. Note that this can never be 100% correct as there is no relation between the names on the master (UNIX) filesystem, the ISO-9660 names and the Joliet names. Only the Rock Ridge names are untranslated with respect to the original files on the master (UNIX) filesystem. - implement Yellow book compliant XA extended dir attributes - add libecc/edc for CDI and similar. This may not be needed if we ise VCDimager and recent cdrecord versions. CYGWIN NT-4.0 NOTES: To compile on Cygwin32, get Cygwin and install it. For more information read README.win32 The files are located on: ftp://ftp.berlios.de/pub/cdrecord/alpha ... NOTE: These tar archives are 100% ansi compatible. Solaris 2.x tar and GNU tar may get some minor trouble. WARNING: Do not use 'mc' to extract the tar file! All mc versions before 4.0.14 cannot extract symbolic links correctly. WARNING: Do not use 'winzip' to extract the tar file! Winzip cannot extract symbolic links correctly. Joerg cdrkit-1.1.11/doc/ANNOUNCEMENTs/AN-2.01.01a070000644000372500001440000000551110471375025016302 0ustar steveusersPlease have a look at the German open Source Center BerliOS at www.berlios.de BerliOS will continue to support free hosting of cryptography projects even when US laws change and don't allow to host cryptography projects in the USA. Also look at sourcewell.berlios.de, the first Open Source announcement service that itself is implemented as Open Source project. ***************** Important news **************************** For the 'Slottable Source Plugin Module' SSPM Features read README.SSPM ***************** Please Test ********************************* NEW features of cdrtools-2.01.01a07: ******* NOTE: this is _not_ a release that starts a new aplha/beta series of dirtibutions. The only reason is to add certain new CD/DVD features that are important. So _please_ do not send any patches except when you like to fix extreme bugs. I am currently mainly working on stable incremental restore featurs for star-1.5-final. Once star-1.5-final is out, cdrtools will start a new developent cycle. ******* All: - Autoconf script added to 'conf' directory Libparanoia (Ported by Jörg Schilling, originated by Monty xiphmont@mit.edu): Libedc (Optimized by Jörg Schilling, originated by Heiko Eißfeldt heiko@hexco.de): Libscg: Rscsi: Cdrecord: - Fixed a bug caused by an uninitalized variable when handling CDR_MAXFIFOSIZE= and no file /etc/default/cdrecord exists Cdda2wav (By Heiko Eißfeldt heiko@hexco.de): - Write correct error info in case that BeOS/Zeta *_area() calls fail. - As Heiko did not work on cdda2wav during the past 2.5 years, Heiko did hand over the SCCS history for cdda2wav. - Autoconf test for added (FreeBSD) - Some FreeBSD related changes from Heiko done in 2004 IMPORTANT: I need testers for FreeBSD and DragonFly BSD as a result of the merge with the complex changes from Heiko. Readcd: Scgcheck: Scgskeleton: Btcflash: Mkisofs (By Jörg Schilling and James Pearson j.pearson@ge.ucl.ac.uk): TODO: - read Joliet filenames with multi-session if no TRANS.TBL or RR is present. I am looking for a volouteer for this task! Note that this can never be 100% correct as there is no relation between the names on the master (UNIX) filesystem, the ISO-9660 names and the Joliet names. Only the Rock Ridge names are untranslated with respect to the original files on the master (UNIX) filesystem. - add libecc/edc for CDI and similar. CYGWIN NT-4.0 NOTES: To compile on Cygwin32, get Cygwin and install it. For more information read README.win32 The files are located on: ftp://ftp.berlios.de/pub/cdrecord/alpha ... NOTE: These tar archives are 100% POSIX compatible. GNU tar may get some minor trouble. If you like a 100% POSIX compliant tar, get star from ftp://ftp.berlios.de/pub/star/ WARNING: Do not use 'winzip' to extract the tar file! Winzip cannot extract symbolic links correctly. Joerg cdrkit-1.1.11/doc/ANNOUNCEMENTs/AN-2.010000644000372500001440000015030610530112213015536 0ustar steveusersPlease have a look at the German open Source Center BerliOS at www.berlios.de BerliOS will continue to support free hosting of cryptography projects even when US laws change and don't allow to host cryptography projects in the USA. Also look at sourcewell.berlios.de, the first Open Source announcement service that itself is implemented as Open Source project. ***************** Important news **************************** For the 'Slottable Source Plugin Module' SSPM Features read README.SSPM ***************** Please Test ********************************* NEW features of cdrtools-2.01: All: - Support for the ELF format in BSDi 4.x - Allow floating point printing on OS/2. This has been possible since 11/2001 but OS/2 has been forgotten. - Correct OS/2 ranlib handling - New architecture 9000-831-hp - Include +DAportable in HP-UX cc options - README.hpux enhanced to include hints on how to compile 64 bit binaries. - Support for NetBSD on PPC (macppc-netbsd-cc) - portable getdomainname() replacement now supports to get the domainname from /etc/resolv.conf. This allows usage even on OS/2 - Typo in DEFAULTS files fixed - New generic target for symlinks - New file rename.c for portability part of libschily - Better Next STep support: - Some workarounds for broken unistd.h - -lkvm removed from Next Step config. - waitdefs.h fixed for very old BSD based systems (~ 1980) like Next STep - strdup() moved into portability part of libschily - fixed typo in fctldefs.h R_RDONLY -> O_RDONLY - New file ttydefs.h includes portability phrases from ved and bsh. - Added an autoconf test for buggy termios.h in Next Step. Next STep provides fully functional termios.h but tcgetattt(), ... is missing in libc. - Test for clock_t changed to deal with a bug in Next STep. Next Step illegally needs sys/time.h for clock_t - Make recently introduced symlink install use relative symlinks instead of absolute symlinks. - Change autoconf/statdefs.h to support nanosecond support for SCO UnixWare and FreeBSD - Call conf/mkdep-sco.sh via sh to be independent from 'x' bit. - libschily/rename.c fixed for SCO Openserver fo avoid warning for redefinition of MAXPATHNAME - libschily/usleep.c fixed to avoid SCO Openserver warning about non matchin prototype in system include files - Better Portability for SCO UnixWare - New platforms i486, i586, Pentium III, Pentium Pro - Let strdefs.h also include strings.h for strcasecmp() - Support for missing struct sockaddr_storage - Support for broken wait3() (returns wrong timings) - Changed broken portability Prototype support in libfile to use 'makefiles / prototype.h' based system - Changed fileopen() and filereopen() to avoid fdopen() provlems (does not accept mode string that does not match fd flags) - Catch the case where somebody tries to compile on Solaris with /usr/ucb in PATH before /opt/SUNWspro/bin and when calling 'cc' results in: /usr/ucb/cc: language optional software package not installed - Trying to make the source get accepted by 'cstyle'. - Changes in the general topic 'Stack Scanning' and the software signal system handlecond()/raisecond() that make the software signal system now usable on all platforms. - Trying to support DOS with the DJGPP compilation environment Thanks to Alex Kopylov for the first version of the port and further helping. Note that in order to compile cdrtools on DOS/DJGPP you need smake-1.2a20 or newer. GNU make does not seem to work for a DOS compilation. - New File README.msdos - New RULES for DOS/DJGPP - Make some vars in align_test.c static because Mac OS X creates unneeded name space pollution. - DJGPP has no SIGBUS, use #ifdef in avoffset.c and align_test.c - Several changes with casting Null pointer constants to Null Pointers if they are used as parameters in var arg lists (see below). - New gethostname() fallback emulation using uname(2). - Better rename(2) emulation for Platforms that don't have rename(). - niread()/niwrite()/nixread()/nixwrite() in libschily now resets errno to the old value in case EINTR did occur. - README.msdos has been corrected according to a hint from Alex Kopylov - New macros to platform independently set up integers in little endian format. This is needed to e.g. write PC disk labels from big endian platforms. - Rules extended to support volume management libs - The install-sh script not takes care about UNIX variants like SCO UnixWare and SCO OpenServer that allow to give away files via chown. If this works and /tmp has the sticky bit set, the root test was unable to remove the test files later. For this reason, now a subdirectory in /tmp is used. - Support for the special .PHONY: target ---> needs smake-1.2a21 or newer This helps to deal with files like INSTALL operating systems like Win32 and Mac OS that don't honor file name case and prevents the file named INSTALL to get into trouble with 'make install' - 'make install' now works on operating systems that require a '.exe' suffix for executable binaries - Updated the file README.ATAPI Updated information for Linux, SCO-OpenServer, SCO-UnixWare, Win32 and DOS - mconfig.h now supports make COPTX=-DNO_FORK & COPTX=-DNO_VFORK - snprintf() from libschily now correctly follows POSIX.1-2001 for maxlength == 0 - Workaround for a bug in the C-compiler from SCO-OpenServer. It is not very probable that this causes problems with cdrecord. The function getfp() did not return the correct Frame Pointer when called as first function in another function as the compiler sdoes set up the new stack frame after getfp() has been called. - New function filemopen(char *name, char *omode, mode_t mode) with additional mode_t parameter. - update recent getargs() version from repository. This has been forgotten. - Add a workaround for a SCO OpenServer C-compiler bug. The bug causes the first function in a function to be called before the new stack frame has been established and did cause scanning the stack frame to fail. - Make snprintf() POSIX compliant. - Many typos in the READMEs fixed, thanks to a hint from Stefano Allrath - New global method to handle PATH environment delimiters (":" on POSIX systems and ";" on DOS). - New README.msdos reflecting new features of smake-1.2a23 on DOS/DJGPP - Some minor enhancements to the makefilesystem - Some minor changes for better compilation in SGI IRIX - Trying to start adding support for Win32/Mingw32 - New global #define NEED_O_BINARY to make using setmode() easier - New autoconf test for struct stat.st_fstype - New autoconf test for fnmatch() - New autoconf test for blksize_t/blkcnt_t - libscgily/stdio/io.h renamed to schilyio.h to avoid conflicts with DOS. - Added a Note to README.linux: NOTE for all Linux 2.5.x versions and all Linux versions before 2.6.8: Linux did ship with defective kernel include files starting with 2.5.x. These defective kernel include files did prevent compilation. If you have problems compiling software and see error messages related to include/scsi/scsi.h & include/scsi/sg.h either upgrade to Linux-2.6.8 or newer or remove /usr/src/linux - Support added to the makefile system that allows compilation on AMD x86_64 using non automake aware make programs like GNU make. Note that smake ftp://ftp.berlios.de/pub/smake/alpha/ is able to compile things even on unknown platforms as it includes auto make features. Libparanoia (Ported by Jörg Schilling, originated by Monty xiphmont@mit.edu): - Included a bug fix from the libparanoia Author. Correctly allocate some arrays. Note: on 32 Bit machines, this patch does not result in a different binary but the code is now really correct. - New indentation is better conforming to 'cstyle' - Fixed a bug in libparanoia that prevented the statistics to show up the number of 'skips' (the number of exhausted read retries) when SKIP verification has been turned off. - modified to avoid GCCs shadowed variable warnings. - Try to use page aligned transfer buffers if possible. - Avoid buffer size problems wit non page aligned transfers on FreeBSD. - Avoid freeing pointers that are not from malloc() by copying the data to a second allocated chunk of free()able space. This has been a bug introduced while trying to handle buffer size problems with non page aligned transfers on FreeBSD. Libedc (Optimized by Jörg Schilling, originated by Heiko Eißfeldt heiko@hexco.de): Libscg: - Reordered and restructured scsi-remote.c code to allow compilation on OS/2 and hopefully other OS like BeOS - First attempt to support QNX. Note that the sourcecode comes from QNX and it looks as if it is buggy for commands that cause SCSI commands that result in a Check Condition status. From looking at the source, the stack gets overwritten in this case. - SCSI adaptation layer for SCO UnixWare rewritten to support multiple opens and to better follow the libscg interface standard. - Second attempt to support QNX. Make it compile - Check kernel level error return codes on SCO-UnixWare - Starting to support SCSI reset on SCO-UnixWare - Extensions to libscg related include files to support DVD+RW formatting - Make libscg work on SCO UnixWare if an application like cdrecord has been installed suid root. Before, the called administration programs did not work if euid!=uid - Fixed a problem with possible garbage in the SCSI error string. Thanks to Stefano Di Paola for reporting. - Fixed another printf buffer vulnerability in scsi-remote.c - New version of scsi-amigaos.c from Thomas Langer - Added a work around for a Solaris 9 x86 bug: DKIOCINFO returns a max DMA size of 256 kB but only 68 kB will work. Check max DMA size for a IDE disk to get a correct value.... For more information read the updated file README.solaris and the new files README.solaris-x86-ata-DMA and README.solaris-x86-ATAPI-DMA - Changed scsi-os2.c to allow 'cdrecord -scanbus' to find targets with target ids > 7. - Librscg now uses correct casting to a Null Pointer for execlp() as NULL is a Null Pointer Constant but no Null Pointer. This could make problems with some 64 bit architectures. - New driver scsi-dos.c acting as 16 bit DOS ASPI interface Thanks to Alex Kopylov for the first version of the driver. Check his Web Page: http://bootcd.narod.ru/index_e.htm it contains precompiled DOS binaries. - The driver scsi-dos.c has already been verified with 'scgcheck'. - scsi-os2.c and scsi-wnt.c now correctly return 0 from scg_send() if the target is not valid. - scsi-wnt.c does now support multiple SCSI opens. - scsi-wnt.c does now correctly return SCG_NO_ERROR in case a SCSI command returned CHECK CONDITION. - scg__open() now prints a warning if it has not compiled with the results from a certified autoconf environment. - Introduced a fix to avoid the need for a #define ident prod_ident for SCSI Inquiry data. This #define did cause problems with the latest Sun Studio 8, C compilers - First attempt to support running cdrecord while the volume management is active. - Increased version number to 0.8 - First attempt to work around the problems for suid programs introduced by Sun with Solaris 9. Programs that like to issue a USCSI ioctl() need to be root or get EPERM. Cdrecord did does up root privilleges eraly to avoid security problems. libscg now selectively runs the USCSI ioctl() as root if the program is installed suid root. - Fixed a bug in scsi-mac-iokit.c in scgo_havebus() that caused pxupgrade not to work on MacOS X. - First attempt to support the SPTI Ioctl interface on Windows NT. see also http://www.ste-home.de/cdrtools-spti/ Thanks to Richard Stemmer, Jay A. Key and thomas podkanski This allows to use cdrtools on NT without the need to install ASPI in case you are administrator when yu run a program. Please note that the use of SPTI is default. If you like to force using ASPI, use dev=ASPI:b,t,l or dev=ASPI (in the -scanbus case). If you like to force STPI, use dev=SPTI:b,t,l or dev=SPTI. Currently, the interface does not yet fully matches the scg interface standard. - Try to support the half hearted and badly designed /dev/hd* interface from Linux-2.6 in a more usable way. The only reason for adding this kind of support is that the Linux kernel hackers reject to fix the known DMA bugs in the already existing SCSI transport interfaces in the Linux kernel. Using /dev/hd* is unfortunately the only way to get DMA with sector size being 2352, 2448 or similar. Use cdrecord -scanbus dev=ATA and cdrecord dev=ATA:1,0,0 Note: The Bus mapping function inside the kernel for this interface is a dummy. For this reason, we need to do the mapping ourselves. Busnumber is ("/dev/hd*"[7] - 'a') / 2 Target is ("/dev/hd*"[7] - 'a') % 2 Also note that creating this interface in the Linux kernel was a waste of time. It did need a lot of effort to be created. Instead of first adding a new interface with a new broken DMA implementation and later fixing the DMA bugs, it would have been better to just fix the DMA bugs in ide-scsi.c Adding SCSI transport to something like /dev/hd* on an OS that includes a generic SCSI transport driver is disregarding SCSI protocol layering. A clean way to implement ATAPI on Linux would be to rather introduce a SCSI hostadaptor driver that sends the SCSI commands via the ATA hardware. Linux users should think about buying a CD writer for Linus Torvalds. Maybe this could help to get better SCSI support in the Linux. Currently Linus doesn't know anything about the CD-writing problems on Linux and his contributions to CD-writing related issues in discussions are just guesses that are not related to own experiences and understanding for the matter :-( It seems that the Linux way of dealing with bugs is to implement a new incompatible interface instead of fixing the known bugs from old interfaces :-( - Allow cdrecord -scanbus dev=ASPI and cdrecord -scanbus dev=SPTI to work on win32. - Correct a bug in the Win32 version analyze function that is needed to use the correct SPTI interface. Unfortunately, the interface did change with a NT-4.0 service pack. It is unclear whether the currently used interface type is correct for all possible NT-4.0 variants. - For Win32, default to STPI only if on NT-5.x as there is a bug in some UDMA implementations that causes blue screens. - The Mac OS X SCSI low level transport now roughly meets the interface standard. For this reason, the file scsi-mac-iokit.c now is marked with Author "schily" - Indented according to the cstyle standard. - For win32, dev=ASPI:1,0 and dev=SPTI:1,0 work again - Trying to add a workaround for the Linux problem with USB where the kernel issues a request sense even when there was only a DMA underrun and the drive replies as expected with no-sense. Our problem in this case is that we needed to ad another workaround because sometimes Linux clears the status byte and we did assume a CHECK CONDITION in case sense[0] was != 0. - Enhanced max # of SCSI busses to 256 for the Linux sg driver. This was needed because of the (compared to Solaris) suboptimal way of dealing with instance numbers on Linuux. While Solaris keeps a data base with instance numbers, disconnecting and reconnecting a USB drive results in the USB device getting the same SCSI address as before. As Linux does not have such a data base, disconnecting/reconnecting a USB device has the unfortunate side effect of assigning a new and different SCSI address with every USB connect. This also creates problems when software likes to manage access rights to devices for non-root users. - Win32 SPTI interface now also supports controllers with more than one SCSI Bus. Thanks to Richard Stemmer - Fixed a bug in the Win32 SPTI/ASPI interface introduced with 2.01a28 that caused core dumps because it did try to access data behind the end of the sense data array in the ASPI cmd structure. - Scan /dev/hda../dev/hdz instead of /dev/hda../dev/hdt for dev=ATAPI on Linux. - Trying to write a better warning message for the dev=ATAPI: interface on Linux (the related kernel interface is unmaintained and does not support DMA at all). - Fixed a bug in Win-NT Version string handling in scsi-wnt.c Thanks to Alex Kopylov This caused that libscg did not properly recognize NT-4.x with service pack 4 to be equivalent to NT-5.0 (Win2k). - Trying to avoid using the WinNT-SPTI interface for NT-4.0 - Fixed a security bug in scsi-remote.c (the RSCSI client). Rscsi: - Support for IPv6 - Workaround for missing struct sockaddr_storage on SCO UnixWare - Security update. Forbid to write arbitrary debug files, only allow a debug file name that has been configured in /etc/rscsi.conf. Writing arbitrary files with a siud root program could be used to become root on a local machine if you are already logged into that local machine. - README.rscsi typo's corrected. Cdrecord: - Use correct set_mode_params() return value in deflt_writemodes_mmc() - Correct a debug printing to go to stderr instead of stdout. - Workaround for broken Firmware for LG (Lucky Goldstar) drives. These drives have been unable to write Audio in TAO mode because they have an illegal audio pause length default. Thanks to a hint from: Mark Vytlacil - Man page now correctly describes the data formats used with -xa1 & -xa2 - Use Prototypes for functions with enum parameter in fifo.c to avoid warnings on SCO UnixWare - Trying to catch SIGHUP to avoid hung recorders after people close X windows by accident (This in most cases happens because some newer GUIs try try copy bad ideas from Microsoft like the 'x' button on the top bar in the window. - Trying to print hints if the SCSI error core looks like a buffer underrun occurred. - First (still mostly empty) driver for the Matsushita CW-7501 - First TAO writing support for the Matsushita CW-7501 - New option -setdropts to allow cdrecord to set driver specific parameters and exit. - Added support to disable/enable the Plextor PowerRec feature. Use driveropts=forcespeed Be very careful as this will cause in badly readable disks. The only senseful reason to use this feature is to run tests in -dummy mode to check whether the system would be able to record fast enough and to later buy High-Speed Media. Note that documentation for the related SCSI command is not oficially available and thus the information has been "guessed". - Added support to enable/disable the Plextor SpeedRead feature. Use driveropts=speedread to allow the drive to read CDs faster than 40x. Be very careful as this may cause the media to break in the drive while reading, resulting in a destroyed media and drive! Note that documentation for the related SCSI command is not oficially available and thus the information has been "guessed". - Added support to enable/disable the Plextor SingleSession feature. Use driveropts=singlesession This allows to read defective (illegal) media with extremely non-standard additional TOC entries. You need to enable Single Session mode before you insert the defective disk! Note that documentation for the related SCSI command is not oficially available and thus the information has been "guessed". - Added support to enable/disable the Plextor Hide CD-R feature. Use driveropts=hidecdr This allows to make CD-Rs look like CD-ROMs and applications believe that the media in the drive is not a CD-R. Note that documentation for the related SCSI command is not oficially available and thus the information has been "guessed". - Added reading out "real" Burn-Proof counter for Plextor drives. Note that documentation for the related SCSI command is not oficially available and thus the information has been "guessed". - Try to do a more correct job when doing Buffer Underrun estimation counts. - Make the explicit Buffer underrun error checking work for Plextor drives too. - Fixed the command line parser for driveropts= parameters. Before the fix, driveropts=noburnfree,hidecdr would result in assuming: driveropts=noburnfree,nohidecdr - Now also supporting SAO/DAO write mode for the CW-7501 - New option -lock (similar to -load) that loads the media but leaves the drive in locked status. - New driver interface to allow SAO recording for the CW-7501 Simplified: "dummy" and "multi" Parameter information has been moved into the track structure. - Removed the internal implication that -packet is a TAO write mode. Please test! It may be that this did introduce bugs. - Try to avoid ANSI C arithmetic conformance change warnings from SCO C-compiler by introducing proper casting. - Driver interface restructured to support aborting SAO recording with the Sony CDU-948 - "Driver flags" printing corrected - Better behavior with CADDY drives and -load option - Fixed a bug that caused cdrecord not to abort if Tracks with unknown length are present in RAW write mode. - Print extended Power Rec Speed information for Plextor drives. - CUE Sheet handling generalized to allow to implement SAO writing for more drives. - Start supporting the Sony CDU-948 in SAO mode. Currently not yet working: - Multi-session - MCN/ISRC - Grace time handling restructured. The grate time waiting is now done even before the forced blanking and it is made sure that the waiting is done only once. - Several changes in the open source part are visible as a result of the new DVD+RW / DVD+R support. - cdrecord-ProDVD now includes first DVD+RW and DVD+R support. Check ftp://ftp.berlios.de/pub/cdrecord/ProDVD/ on Thursday 24.4.2002 for the first binaries - Do not try to lower the possible number of open files in raise_fdlim() anymore. - Check return code of driver's init function. - Better error messages from main write loop. - Write a hint that a user may have used a "preformatted" CD-RW if read_next_writable_address fails for the "invisible" track and tell him to run cdrecord blank=.... - Fixed a bug that caused cdrecord to prevent a 3rd session on a multi session disk. This bug was introduced with the driver restructuring a few releases before. - Better driver text strings for the driver IDs in the CD MMC drivers. - Move Plextor PowerRec speed info completely to the statistics _past_ the recording activities. - Allow more nonstandard Cue sheets to be accepted by the Sony CDU-924 and CDU-948. - Implement MMC-3 DVD+ Drive/Media recognition to avoid that cdrecord starts to treat a DVD+ as a CD-R because the DVD+ drive identifies as CD-R/RW + DVD-ROM with "no DVD media installed" from a MMC-2 viewpoint. - Added a note to the cdrecord man page how to use mkisofs to allow cdrecord to knoe about track sizes in SAO or RAW mode. - Fixed a multi session bug that has been introduced with the DVD+R/RW restructuring with cdrecord-2.01a11. This bug caused cdrecord to be unable to start a track from a sector number != 0 in TAO mode. - Fixed a problem with cdrecord -msinfo introduced with the the DVD+R/RW restructuring with cdrecord-2.01a11. The unwanted verbose printing has been removed with this version. - New option -xa to create CD-ROM XA mode 2 form 1 sectors with 2048 bytes of user data - New option -xamix to create mixed CD-ROM XA mode 2 form 1/2 sectors with 2332 bytes of user supplied data. - Restructured sector types to make them usable: -mode2 CD-ROM data mode 2 - 2336 bytes -xa CD-ROM XA mode 2 form 1 - 2048 bytes -xa1 CD-ROM XA mode 2 form 1 - 2056 bytes -xa2 CD-ROM XA mode 2 form 2 - 2324 bytes -xamix CD-ROM XA mode 2 form 1/2 - 2332 bytes To write conforming CD-ROM XA multisession disks use cdrecord -multi -xa1 together with mkisofs -XA -sectype xa1 - -cdi is now implemented how it should be: as a flat to change the TOC type of a CD and not as a sector mode. - Track parsing completely restructured to allow new features. One of the features is to write audio CDs from a pipe, other features will follow. - Cdrecord now resets euid to the uid of the caller (if called suid root) before it opens data files. - Fixed a bug that caused cdrecord to insert two grace wait periods if a disk was blanked and rewritten in one call. - Allow cdrecord to copy audio CDs from a pipe from cdda2wav without using an intermediate file on disk. To copy an audio CD from a pipe (without intermediate files), first run cdda2wav dev=1,0 -vall cddb=0 -info-only and then run cdda2wav dev=1,0 -no-infofile -B -Oraw - | \ cdrecord dev=2,0 -v -dao -audio -useinfo -text *.inf This will get all information (including track size info) from the *.inf files and then read the audio data from stdin. If you like to write from stdin, make sure that cdrecord is called with a large enough fifo size (e.g. fs=128m), reduce the write speed to a value below the read speed of the source drive (e.g. speed=12), and switch the burn- free option for the recording drive on by adding driveropts=burnfree. - New option -abort allows you to send a write abort sequence to a drive. This may help if other software did leave the drive in an unusable condition. - New 'xio' module allows to open a file virtually more than once to support CDRWIN CUE sheets in cdrecord. - Run Plextor Speedinfo SCSI command in silent mode as old Plextor drives do not support this command. - Workaround for a Plextor (Premium only???) firmware bug that may result in a B0 pointer A5:A5:A5 instead of FF:FF:FF. This made it impossible to blank a freshly written CD-RW witout reloading the media. Now cdrecord does not check the disk size anymore if the number of tracks to be written is 0. - First CDRWIN CUE sheet support. Cdrecord currently supports what is in the CUE sheet description in the CDRWIN documentation (with a few exceptions). Note that the examples in the rest of the CDRWIN man page are mostly illegal if you compare them against the CDRWIN CUE sheet syntax documentation. These exceptions are currently in effect: - Only one FILE Line per CUE sheet file (This is compliant to the CUE shet format documentation although the examples show CUE files with more than one FILE line). NOTE that the CUE syntax has been ill defined so that it would not make sense to e.g. use more than one FILE line for audio CDs. - The AIFF File type is not implemented (because I have no documentation for this audio file format). - The MP3 File type is not yet implemented. - The CDG data type keyword will not yet work - The CDI data type keyword will not yet work - Only a sector size of 2048 will work with MODE1 - Sectors with sector size 2336 will not yet work - POSTGAP will not yet work. Note that the CDRWIN CUE documentation is bad and it is unclear how formless (non XA) MODE 2 sectors should be made. CDI is not a sector/track property but a disk property. The File type BINARY vs. MOTOROLA is unclear. To use the cue sheet feature call: cdrecord dev=.... -v -dao cuefile=xx.cue The main reason for implementing CUE sheet support was to allow to write VCD/SVCD with cdrecord. It has currently tested with the test SVCD from ftp://ftp.vcdimager.org/pub/vcdimager/examples/test_svcd/ Cdrecord should allow to write audio type CUE sheet based CDs also. - Modified the notes close to the Copyright printing code in cdrecord.c to make clear that this note is not a deviation from the GPL but just a memorandum on how to understand the GPL. - Fixed a bug in file descriptor handling that caused cdrecord not to continue at offset xxx in the file after a new track did start. - Added a forgotten feature in the CUE Sheet parser so it will now know that WAVE files use swapped (intel) byte order. - Restructured the main program of cdrecord so that cdrecord overall behaves similar to before when cue sheets are used. e.g. cdrecord -eject cuefile=xxx did only eject the disk instead of first writing and then ejecting. - Added some hints to the man page to make speed= handling clearer - Fixed some typos in the man page - Added the -format option to the man page - CD-Text handling reworked: CD-Text from textfile= or from CUE CDTEXTFILE wins over CD-Text from *.inf files and over CUE SONGRITER. - CD-Text from CUE file (either CDTEXTFILE or SONGRITER) now needs -text in addition in order to be not ignored. - Fixed a bug in the recognition for cdda2wav | cdrecord *.inf that caused a message WARNING: Stdin is connected to a terminal. if not writing from a pipe. - Small fix in auinfo.c to again allow compilation on K&R systems - Typo fixes for the cdrecord man page - The clone write code is now part of the GPL'd source Note that this part of the code is now more than 2 years old but previously has been excluded from the publically visible part of the source. To understand how to use the clone mode read README.clone - New option ts= to set the SCSI transfer buffer size - Man page corrected to correctly mention current format for /etc/default/cdrecord - call setmode(fileno, O_BINARY) for DOS/DJGPP also - Better check if we use the FIFO to avoid core dumps with too small FIFO sizes. - Switch off FIFO of fifo size is < 2 * SCSI transferbuffer - Fixed a small bug in the man page (..sp instead of .sp). Thanks to Eric Raymond for reporting! - Work around for a problem in the Plextor 708 firmware (at least 1.01..1.02) that caused cdrecord to be unable to recognize that a DVD medium is present instead of a CD medium. - Changed the GPL clarifications text in a way so Debian people still agree with me that cdrecord is free software. The clarifications are needed in order to tell people/companies (like Mr. Rosenkranzer, RedHat & SuSE) who create broken branches from cdrecord that they are not legally publishing their branches because they violate the GPL § 2 Paragraph c) and GPL Preamble Section 6). If would be better if the named persons/companies would rather stay in contact to the Authors, discuss things and contribute to the community instead of creating useless/broken changes and in case of SuSE Linux even creating hacks that introduce security risks. Note that now, RedHat Linux (enterprise server) or the SuSE Linux are even more expensive than e.g. Solaris x86, see: http://www.osnews.com/story.php?news_id=5416&page=5 Small Correction to this web page: Solaris x86 is free again for personal use. - Extended the man page to make it more clear that all CD/DVD-writers ever made use only SCSI commands. - Another change to the man page according to a hint from Eric Raimond in order to get better compliance for troff -> "*ml" converters. - Allow people who cannot provide an e-mail address or who don't like to support their modifications to modify cdrecord - Some CUE sheet modifications in drv_mmc.c now made it into the official SCCS history file. - Several fixes to avoid the need for a #define ident prod_ident for SCSI Inquiry data. This #define did cause problems with the latest Sun Studio 8, C compilers - Hack to work around a POSIX real time priotity design bug that causes us to become root again on e.g. Linux in order to be able to lower the priority of the FIFO background process. - Better documentation and EXAMPLE for -setdropts driveropts= in the man page. - print a help message to direct the user to use -raw96r in case the drive does not accept the cue sheet with -dao. - Mark all drives that cannot be accessed because the volume management is running and no media is in the drive with '?' instead of '*', so they may be distinct from non existing drives. Read README.volmgt for more information - Now works again suid root on Solaris 9 - Fixed a bug introduced in 2.01alpha by a source consolidation. cdrecord -toc did not work anymore for CD-ROM readers - Updated README.audio - Make the CUE Sheet handling search for a file name from a FILE statement also in the directory where the CUE sheet is found (in case there is no slash (/) in the file name from 'FILE'). - Avoid coredumps when cdrecord is called with -xd and there is no known driver for the current drive. - New option -tao is now needed if you like to write in TAO mode. Cdrecord now does no longer writes if no write mode has been specified. - New option -sao as alias for -dao. As the official name for the write mode is SAO, -sao is more correct than -dao. - Fixes for minor typos in cdrecord.1 - Fixed a bug with pad=xxx and pad sizes > 2 GB. - Trying to fix a bug introduced lately with the check for specified write mode options. As a result, only TAO mode writing did work. - Better man page & online help for the ts= option. - Fixed a typo in the man page. - Better error messages when audio size is < 300 Sectors or needs padding. Thanks to a hint from Stefano Allrath - cdrecord -scanbus now checks for 256 SCSI busses - cdrecord -scanbus now checks for 256 SCSI busses This has already been announced for 2.01a28 but forgotten to include - Some Man Page Fixes trying to avoid coding problems for non 7-bit ACSII - Several typos in the man page fixed - Man page enhanced to include a better documentation for the driver= option. - Several other enhancements to the man page - modified to avoid GCCs shadowed variable warnings. - Cdrecord now tolerates the OPC "error code" "Power calibration area almost full" to not a real error. - Fix for a bug that caused cdrecord to be unable to reload the media for some drives. The fix helps with the following problem: Trying to clear drive status. cdrecord: Drive needs to reload the media to return to proper status. cdrecord: Cannot load media with this drive! cdrecord: Try to load media by hand. cdrecord: Cannot load media. - man page enhanced - Print the "Make sure you are root" only if root privilleges are missing. - Avoid warning for not working nice() on DOS Thanks to Alex Kopylov - -clone option documented in the man page. This has been forgotten before. - Several typos in the man page fixed - Do not try to call nice() on DOS/DJGPP - cdrecord now tries to check the DMA speed if the drive supports to read the drive buffer. If the DMA speed is not sufficient, then cdrecord requires that burnfree is activated. If the environment variable "CDR_FORCESPEED" is set or -force has been specified, then cdrecord does not try to enforce that the available DMA speed is 2x the expected write speed. - Make some symbols static to avoid problem with a badly designed libc on OpenBSD that violates POSIX by pulluting the namespace with symbols like 'pl'. Cdda2wav (By Heiko Eißfeldt heiko@hexco.de): - fixed typo in cdda2ogg.1 - Do not use uname() but gethostname() for portability. - include unistd.h for abs() - old Toshiba's usable again - Multisession Non-CD-Extra disks now work again Now also a lot more broken disks are readable again. - not using ioctl in signalhandler any more - trying to support sound on Win32 - Several changes (mostly OS/2 related) for more ask Heiko - bugfix add cdda2ogg manpage,and script and makefile install target - support BeOS shared memory and FIFO - support soundcard output under QNX - windows-users! Cygwin has fixed the bug introduced with 1.3.18. Please upgrade to the new 1.5.3-1 release. - call setmode(fileno, O_BINARY) for DOS/DJGPP also - Now using the major() macro for some Linux duties. WARNING to creators of Linux distributions: It has _always_ been wrong to compile software only once for different kernel versions (e.g. for compile Linux-2.4 and later install a 2.2 kernel on the so created system). Now that Linux-2.6 introduces incompatible changes to kernel/user interfaces, the resulting binaries will not work correctly anymore. - Made CD-Text handling reentrant to overcome a problem triggered by XCDRoast - Now works again suid root on Solaris 9 - Fix for a Bug that prevents paranoia statistics from being printed because the paranoia statistics for the forked version has not been inside the shared memory. - New paranoia sub option paraopts=overlap=xx This is mainly a bug fix for cdda2wav. Cdda2wav previously _always_ did completely deactivate the dynamic overlapping from libparanoia. Instead, it did set the overlapping to the statical value 0. If you omit paraopts=overlap=xx, cdda2wav will now use dynamic overlapping with -paranoia. If you like the old behavior, use: paraopts=overlap=0 - New paranoia sub option paraopts=minoverlap=xx This sets the minimum dynamic overlap - New paranoia sub option paraopts=maxoverlap=xx This sets the maximum dynamic overlap - Better paranoia statistics output - Fixed a Problem with some Linux sound card drivers that caused cdda2wav to be unable to output to the soundcard. - cdda2wav now checks /etc/default/cdrecord and accepts dev=plextor as cdrecord does. - Trying to add verbose output that estimates the read quality with -paranoia - Trying to convert non-ascii characters in user & host names into '_' for better cddb compatibility. - Some Man Page Fixes trying to avoid coding problems for non 7-bit ACSII - New option -scanbus - Removed some "historical junk" that caused cdda2wav to define a compile time default input device. This conflicts with cdda2wav -scanbus and is superfluous and contra productive since cdda2wav reads /etc/default/cdrecord - cdda2wav has signed bitfields of size 1 :-( - Fixed a typo in cdda2ogg.1 - Bug fix from Heiko for index lists that contain offset values of -1 in the middle - Trying to handle interface setup more carefully if SCSI Generic is not used. - Better Debug Code in setuid.c - Trying to fix a bug in UID handling on FreeBSD Thanks to the bugs reports and help from Fabian Keil - Try to workaround a bug in GCC that caused incorrect warnings for "strict-aliasing rules" Readcd: - First (hacky) implementation of a way to meter the read speed as a function of the disk location modeled after a idea from Markus Plail Call: readcd dev=b,t,l meshpoints=1000 > outfile then gnuplot gnuplot> plot "outfile" w l or gnuplot> replot "outfile" w l if you like to overlay graphs. - New option fs=# (same syntax as with cdrecord fs=#) to allow the user to set the maximum transfer size even in non-interactive mode. This may help is the OS (as it has been the case for Solaris 9 x86) reports a wrong maximum DMA size or there is a bug in libscg. - Speed printing with meshpoints=# now is based on 1000 bytes == 1 kb as documented in the SCSI standard. - Stop reading if the OS replies with a DMA residual count != 0 - New option -factor will cause the read speed values to be printed be based on the single speed of the current medium. This is only possible if readcd is able to find out the current medium type. - The clone read code is now part of the GPL'd source Note that this part of the code is now more than 2 years old but previously has been excluded from the publically visible part of the source. Clone writing has been designed to allow to copy complex structured media like e.g. SVCDs without the need to first do a sector by sector analysis on the source media. To understand how to use the clone mode read README.clone - New option ts= to set the SCSI transfer buffer size - call setmode(fileno, O_BINARY) for DOS/DJGPP also - Now works again suid root on Solaris 9 - Better man page & online help for the ts= option. - New option -scanbus - Fixed a bug with -scanbus (did not work correctly if /etc/default/cdrecord exists). - Added an allocated list of defective sectors, that is printed to the end of a read operation. Scgcheck: - Trying to check if multiple scg_open() requests result in usable interfaces. - Send more outout to stdout instead of stderr. - More correct test for max sense count. - Eject CD _after_ asking for it. - Abor further DMA residual tests if a basic DMA residual test fails. - Second open test enhanced. - A small fix to prevent a core dump caused by a problem on Mac OS X. Scgskeleton: - New Skeleton program as sample and template for programs that like to use libscg. This template has been included to help people like the Author of the BTC firmware flash program to write simple portable applications that send arbitrary SCSI commands to arbitrary drives. Mkisofs (By Jörg Schilling and James Pearson j.pearson@ge.ucl.ac.uk): - First attempt to support ISO-9660:1999 (Version 2) via -iso-level 4 This allows 207 chars in filenames if Rock Ridge is not used ans 197 207 chars in filenames if Rock Ridge is used. Note that this as an absolutely nontrivial change. Problems may even occur when not using -iso-level 4. Please test and report problems. It is not clear whether mkisofs should characters in the range outside 7-Bit ASCII. Currently, mkisofs allows any 7-Bit ASCII character except '\0' and '/'. - Second attempt to support ISO-9660:1999 (Version 2) via -iso-level 4 This allows 207 chars in filenames if Rock Ridge is not used and 197 207 chars in filenames if Rock Ridge is used. In version 2.01a01 the extended VD used the wrong signature 1. This has been corrected. - isoinfo is now able to recognize ISO-9660:1999 - Enhanced the filename length for graft points to 2x PATH_MAX - Abort with a warning message if the total size of the image data created by mkisofs would differ from the size printed by -print-size - udf.c indented according to hints from the program 'cstyle' - UDF now uses the same 'now' timestamp as the ISO-9660 part of the FS. - New Stream File feature and new options: -stream-file-name -stream-media-size This feature has been implemented after an idea from M.H. Voase. Mkisofs had to be heavily modified to allow this feature. A typical usage would look like this: star -c . | mkisofs -stream-media-size 333000 | cdrecord dev=b,t,l -dao tsize=333000s - The maximum size of the tar archive is 332800 sectors. Note that only plain vanilla ISO-9660 is possible in this mode. - The final padding that is added by default is now 150 sectors which is the required size of the track post gap on a CD. - Inter partition padding is now only chosen to make the next partition start on a sector number that is a multiple of 16. - isoinfo now also prints root directory extent # in debug mode - First step to allow mkisofs to support Kodak Photo CD and Kodak Picture CD format: Try to correctly support associated files in multi-session mode. - Diagnostic programs modified to use ttydefs.h and to have better portability for the built in "stty" features. - isoinfo now prints the ISO-9660 directory flags. - Make mkhybrid a symlink to mkisofs instead of a hardlink - getopt.h/fnmatch.h changed to use 'makefiles / prototype.h' based system instead FSD junk system - Removed FSF junk from getopt.c that either created problems with SCO Unixware or did not compile on AIX - Prototype for DVDOpenFile() to avoid warning on SCO UnixWare related to enum function parameter - Fixed a bug with split symbolic links found by Klaus Kopper with the new debug messages introduced with mkisofs-2.01a04 - Changed #if __STDC__ to #ifdef PROTOTYPES for better portability - Now using character code translation for 8 Bit characters that are used with -iso-level 4 (ISO-9660-1999). - Fixed a typo in the on-line Usage information for isoinfo - New options -XA & -xa -XA Generate XA iso-directory attributes with original owner and mode information. -xa Generate XA iso-directory attributes with rationalized owner and mode information (user/group == 0). In the first phase of the implementation you need to specify -R in addition. - Try to support files >= 2 GB. Note that mkisofs is not yet written cleanly so there may be problems if files >= are used. In such a case, please report. - Create XA "CD-XA001" signature in PVD with -XA or -xa In the first phase of the implementation you need to specify -R in addition to -XA or -xa or no XA signatures will be written. - Removed a debug statement that has been introduced to implement support for filees >= 2GB. - This version of mkisofs allows to create sectors with 2056 bytes if the option -XA or -xa has been used together with -sectype xa1. This is 2048 bytes + sub-header. - -apple does no longer include -R or -r. If you like to use -apple, you need to use -R/-r or -XA/-xa in addition. - New option -sectype SECTYPE / -s SECTYPE Possible parameters are: data 2048 bytes per sector - the old and current default xa1 2056 bytes per sector - this is what you need for a conforming CD-ROM XA multi session CD. Use -sectype xa1 together with -XA - Fixed a bug in the Rock Ridge symlink handling with Continuation records triggered by '/../' filename components. Thanks to jmmikkel@bbn.com (Joanne M Mikkelson) for the fix. - man page corrected - Moved Eltorito PVD before ISO-9660:1999 enhanced PCD to allow bootable CD with ISO-9660:1999 - -sort file handling fixed: mkisofs now looks for SPACE/TAB whatever comes last (as documented in the man page). - Better error message in case of a stat(2) buffer overflow (too long filename). This release now prints the file name that caused the problem. - call setmode(fileno, O_BINARY) for DOS/DJGPP also - Added a NOTE regarding the SILO boot program for Linux sparc to the man page. - Added support for Solaris x86 boot CDs. This includes the following new options: - -sunx86-boot to create a fdisk & SVr4 partition table - -sunx86-label to set the "disk label" name for the SVr4 partition table. - New file README.sunx86boot - The file README.sunx86boot has been reworked to make it more correct and contain less typos. - Fixed a Rock-Ridge length handling bug in update_nlink()/increment_nlink() (tree.c) that may have caused an endless loop. - "Total extents including sparc boot" Message is now correctly "Total extents including %s boot" sparc/sunx86 - mkisofs now checks /etc/default/cdrecord and allows e.g. "mkisofs -C 0,1234 dev=plextor ...." as cdrecord does - Unclean message ....extents written (%d Mb) changed to ....extents written (%d MB) to avoid "MegaBit" confusion. - Minor change for old UNIX versions like SCO OpenServer to get smooth compilation on system where mode_t is a short. - Fix for a bug in RockRidge name handling for long file names that need to be split into more than one sector. Thanks to Patrick Ohly - Trying to fix a bug in the multi session time stamp comparing functions. CE records have not been handled correctly here. - Support for PowerPC CHRP Boot added, thanks to "Leigh Brown" - Support for -uid/-gid for UDF Filesystems added - isoinfo now is able to list ElTorito Boot information with -d - isoinfo now correctly shows long RR filenames from CE Extension records. - Fixed a bug in the PowerPC CHRP Boot, thanks to "Leigh Brown" - New options -root & -old-root from Patrick Ohly This allows mkisofs to be used for "incremental backups" where each backup is put into a separate directory tree on the CD. - Default to System ID "UNIX" for unknown platforms instead of uning LINUX. - Support System ID "SCO-OPENSERVER" and "SCO-UNIXWARE" - Better error message when a user tries to create a multi session image out of a multi-volume image. - When doing malloc(), include Null Byte at end of TRANS_TBL data to avoid memory size conflicts. - Fix for a core dump caused by a double free() when doing: echo bar >/tmp/bar echo foo/bar=/tmp/bar > /tmp/pathlist env LD_PRELOAD=libumem.so.1 UMEM_DEBUG=default UMEM_LOGGING=transaction \ mkisofs -hfs -graft-points -o /tmp/foo.raw -path-list=/tmp/pathlist Thanks to Jürgen Keil jk@tools.de - Fixed a typo in write.c "Padbock" -> "Padblock" Thanks to Richard Dawe - Trying to fix a problem with comparing relaxed ISO-9660 file names that contain a ';' which normally is a separator for the ISO-9660 version number. The fix is in hash.c, please test! - Avoid GCCs shadowed variable warnings. - Added a comment is in hope to prevent silly people from e.g. SuSE (who did not yet learn C but believe that they need to patch other peoples code) from changing a valid cast into an illegal lhs cast expression. The cast in the unodified version of write.c is the correct way to handle the problem. It would save a lot of time if people from companies like SuSE would remember the Open Source software development model and contact the Author for help rather than introducing proprietary changes that result in worse and incompatible software variants. The way, companies like SuSE deal with Open Source software just proves that Jonathan Schwartz from Sun is not wrong when he calls SuSE and RedHat proprietary software companies. Users from Open Source software expect that companies like SuSE and RedHat are in close contact with the software developers but they unfortunately are not. They prefer to create proprietary variants that are usually much worse than the original software. The only explanation I have for this behaviour is that SuSE likes to deviate from RedHat and RedHat likes to deviate from SuSE in hope to get customer retention this way. While the last 150 years did prove that this proprietary method to tie up customers works for a limited time, it did always fail after some time. - Removed verbose output for Eltorito boot method when called with -quiet - The Eltorito boot catalog and the Eltorito boot files are now by default sorted to the beginning of the filesystem image as sime BIOS versions don't boot from locations beyond 512 MB. - All programs from mkisofs/diag now support libscg so you may now use e.g. isoinfo to list end extract from CDs directly on platforms that do not support a usual driver interface (like on Win32). - Set default SYSID to "DOS" for DJGPP Thanks to Alex Kopylov - devdump isodebug isodump isoinfo isovfy now include libscg and allow to use SCSI devices as input - devdump isodebug isodump isoinfo isovfy now implement a new option dev= to force to use the SCSI interface from libscg. - isoinfo now correctly sets the filemode of stdout to O_BINARY on DOS alike Platforms like Win32 & DJGPP This affects the '-x pathname' option Thanks to Alex Kopylov - The options -H/-L/-P from mkisofs have been marked "outdated" as they are reserved by POSIX.1-2001 for other purposes. Mkisofs-2.02 will start to implement the POSIX.1-2001 semantics for these options. - The max. length for the strings in the Primary volume descriptor is now also documented in the options section of the man page. - Speed up by 30% in the case that a directory contains many (> 5000) pathological file name entries (that _all_ do not differ in 8.3). - A minor speed up in devdump & isodump was made by no longer calling strlen() in the end condition of a for loop (this still was old code from Eric). - fixed a bug with -dvd-video The bug caused mkisofs not to find the IFO file when VIDEO_TS was not the first entry in the unsorted source directory. Thanks to a hint from Johan Borg borg@morth.org - The option -volset-size does no longer accept numbers > 1 This change was needed because Eric Youngdale did completely missunderstand the ISO-9660 standard with respect to Volume Set Sizes. A Volume Set is not a numbered set of CDs but a set of CDs that contains a coherent directory tree that would not fit on a single volume. - Fixed a typo in the mkisofs man page - man page enhanced to make clear that the options -no-split-symlink-fields & -no-split-symlink-components are most likely not needed as they have been introduced by Eric Youngdale when serious bugs have been in mkisofs. - Changelog updated - Try to workaround a bug in GCC that caused incorrect warnings for "strict-aliasing rules" TODO: - read Joliet filenames with multi-session if no TRANS.TBL or RR is present. I am looking for a volunteer for this task! Note that this can never be 100% correct as there is no relation between the names on the master (UNIX) filesystem, the ISO-9660 names and the Joliet names. Only the Rock Ridge names are untranslated with respect to the original files on the master (UNIX) filesystem. - add libecc/edc for CDI and similar. CYGWIN NT-4.0 NOTES: To compile on Cygwin32, get Cygwin and install it. For more information read README.win32 The files are located on: ftp://ftp.berlios.de/pub/cdrecord/alpha ... NOTE: These tar archives are 100% POSIX compatible. GNU tar may get some minor trouble. If you like a 100% POSIX compliant tar, get star from ftp://ftp.berlios.de/pub/star/ WARNING: Do not use 'winzip' to extract the tar file! Winzip cannot extract symbolic links correctly. Joerg cdrkit-1.1.11/doc/ANNOUNCEMENTs/AN-2.01.01a010000644000372500001440000000522510471375025016276 0ustar steveusersPlease have a look at the German open Source Center BerliOS at www.berlios.de BerliOS will continue to support free hosting of cryptography projects even when US laws change and don't allow to host cryptography projects in the USA. Also look at sourcewell.berlios.de, the first Open Source announcement service that itself is implemented as Open Source project. ***************** Important news **************************** For the 'Slottable Source Plugin Module' SSPM Features read README.SSPM ***************** Please Test ********************************* NEW features of cdrtools-2.01.01a01: ******* NOTE: this is _not_ a release that starts a new aplha/beta series of dirtibutions. The only reason is to add certain new CD/DVD features that are important. So _please_ do not send any patches except when you like to fix extreme bugs. I am currently mainly working on stable incremental restore featurs for star-1.5-final. Once star-1.5-final is out, cdrtools will start a new developent cycle. ******* All: - Better lint make rules - Better autoconf rrules for ACLs - Better support for Linux on IBM-390 - Better support for Linux on AMD x86-64 - Better conforming to lint warnings. Libparanoia (Ported by Jörg Schilling, originated by Monty xiphmont@mit.edu): Libedc (Optimized by Jörg Schilling, originated by Heiko Eißfeldt heiko@hexco.de): Libscg: - Modified the remote SCSI library stuff that has been changed due to a security problem on order to make it compile again on HP-UX. Rscsi: Cdrecord: - Support for the Plextor GigaRec feature. Use driveropts=gigarec=1.2 to increase CD capacity by 20%. Cdda2wav (By Heiko Eißfeldt heiko@hexco.de): Readcd: Scgcheck: Scgskeleton: Mkisofs (By Jörg Schilling and James Pearson j.pearson@ge.ucl.ac.uk): TODO: - read Joliet filenames with multi-session if no TRANS.TBL or RR is present. I am looking for a volouteer for this task! Note that this can never be 100% correct as there is no relation between the names on the master (UNIX) filesystem, the ISO-9660 names and the Joliet names. Only the Rock Ridge names are untranslated with respect to the original files on the master (UNIX) filesystem. - add libecc/edc for CDI and similar. CYGWIN NT-4.0 NOTES: To compile on Cygwin32, get Cygwin and install it. For more information read README.win32 The files are located on: ftp://ftp.berlios.de/pub/cdrecord/alpha ... NOTE: These tar archives are 100% POSIX compatible. GNU tar may get some minor trouble. If you like a 100% POSIX compliant tar, get star from ftp://ftp.berlios.de/pub/star/ WARNING: Do not use 'winzip' to extract the tar file! Winzip cannot extract symbolic links correctly. Joerg cdrkit-1.1.11/doc/icedax/0000755000372500001440000000000011456674326014144 5ustar steveuserscdrkit-1.1.11/doc/icedax/README0000644000372500001440000005364510540226701015020 0ustar steveusersHi dear cdrom drive users, This README describes hardware related matters as well as the installation of icedax, the sampling utility. This icedax utility comes with the Cdrkit project. Cdrkit is a spinoff from cdrtools. However, the cdrtools developers are not involved in the development of this spinoff and therefore shall not be made responsible for any problem caused by it. Please do not try to get support for this program by contacting the original authors. Requirements ============ For SCSI cdroms and CD-writers, as well as SCSI-emulated ATAPIS and parallel port drives 1s. kernel support for SCSI, the host adapter, SCSI cdroms and the generic SCSI interface (if under Linux). You need to have the proper device descriptors (get them under Linux with the MAKEDEV script from /dev). For ATAPI cdroms under Linux 1a. kernel support for the ATAPI cdrom driver or alternatively ide-scsi emulation. You need to have the proper device descriptors (get them with the MAKEDEV script from /dev). For parallel port cdroms under Linux With newer kernels icedax uses the same parallel port access as does wodim. Please refer additionally to the wodim documentation. There are generally two drivers to access the cdrom through the parallel port: the ATAPI cd emulation (called pcd), and the SCSI device emulation (called pg). The pcd driver does NOT support cdda reading (kernel 2.2.12), while the pg driver has no restriction. So you have to use pg for that. For cdrom drives with proprietary busses under Linux 1p. Please check the CDROM-HOWTO for features of the respective drivers. The sbpcd driver is very demanding due to the lack of interrupts. optionally currently for Solaris and all platforms running 4fronts OpenSoundSystems: 2. kernel sound card support. Recommendations for higher throughput on Linux SCSI systems =========================================================== Higher throughput will give better chances for non-interrupted sampling. This should avoid typical interruption errors (cracklings at buffer boundaries). 1. Increase SG_BIG_BUFF to (128*1024) in /usr/src/linux/include/scsi/sg.h (and recompile your kernel and boot it :-). NOTE: Some kernel configurations will lead to 'out of kernel memory' errors. If you encounter this message regularly, better leave SG_BIG_BUFF at 32768. 1a.There is a patch for multiple sg device access under Linux. It uses up to 128 K buffer for each device. See here: ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha/sg* 2. Ensure your harddisk has write cache enabled (For SCSI hard disks I switched it on with the scsiinfo program from tsx-11.mit.edu), but enable this only if it is correctly working ;-) This has boosted the throughput of icedax considerably. Supported interfaces ==================== Non SCSI drives (Linux only): ATAPI: The greatest group nowadays are ATAPI (EIDE) cdrom drives. Support is only limited by the drive. Kernel and icedax are ready for them (unless the drive uses a very uncommon method). Newer kernels can do an scsi emulation for ATAPI devices. This interface is supported. Parallel port interface: There is a driver that maps the parallel port driver to an generic scsi like driver. Should work with newer kernels. Proprietary interfaces: Older drives with proprietary interfaces are supported only if the kernel driver allows reading cdda audio data via ioctl(). Currently only Eberhard Moenkeberg's sbpcd and Corey Minyard's cdu31a driver do allow this. The sbpcd driver of kernels earlier than 2.0.30 and 2.1.57 needs a patch before satisfying output can be obtained (see README.sbpcd). SCSI drives: For these drives the SCSI library from Joerg Schilling is used. Thus we need kernel support (compiled-in or as a module) for it. The generic SCSI interface allows multi sector transfers (max. 128 KB) which lowers cpu load considerably. ** NEW ** I added a script 'scsi_scan.linux' to find the generic devices for all SCSI CDROM- or WORM-type drives. Configuration ============= There are some adjustable parameters in the beginning of the Makefile (which is called local.cnf.in) . They describe default settings of icedax: INTERFACE: How the cdrom is accessed. Choose one method for INTERFACE. DEVICE: The default cdrom device is set in DEF_DEVICE. SOUND FILE FORMAT DEFAULTS: The default format can be 'wav', 'sun pcm au', 'aiff', 'aifc', or 'raw bigendian samples'. It is determined by the Makefile variable DEF_TYPE. AUDIO FILENAME: The default filename is given by DEF_FILE. Unless 'cdr' format is being used, this name is appended with '.wav', '.au', '.aiff' or '.aifc'. RATE: the default rate is given by setting DEF_UNDERSAMPLING to the divisor for the audio cd sampling frequency (44100 Hz). RATE = 44100 Hz / DEF_UNDERSAMPLING DEF_UNDERSAMPLING can be any multiple of a half greater than one half. DYNAMIC: The default dynamic range of one sample in one channel is defined in DEF_BITS which can be one of 8, 12 or 16. CHANNELS: set DEF_CHANNELS to 1 for mono and 2 for stereo. RECORDING TIME: set DEF_TIME to the amount of seconds to record (or 0 for the whole track). SOUND DEVICE: set SOUND_DEVICE to the device name of your sound card. The line containing HAVESOUND should be uncommented also, if you want the option to hear what you record. All of those values can be overridden by command line parameters. Compiling icedax ================== Adjust the Makefile (named local.cnf.in) for your cdrom interface and device setting first. Then type make and as root make install This will compile icedax and copy the binary to /usr/local/bin and the man page to /usr/local/man/man1 (defaults). Privileges ========== You can setgid the binary, if you want to allow access to a CDROM's scsi_generic interface for icedax but not for arbitrary programs. Giving away permissions to send SCSI commands directly to a device is not something you want to do lightly on a multi-user server system. The setgid privileges will only be used to access the scsi generic interface; for cooked_ioctl, the setgid privileges are not necessary and they are simply dropped. Previous versions of icedax had to be setuid to root. Such privileges are no longer necessary and will be dropped if present. Select device ============= By default icedax uses the generic SCSI interface and a device tripel for SCSI bus, id, and lun. This setting can be overridden by specifying '-Iinterface' and '-D cdromdevice'. The following command line example uses the generic_scsi interface and the SCSI device with bus 1, id 2 and lun 3: icedax -Igeneric_scsi -D1,2,3 The shell script 'scan_scsi.linux' will report the generic devices for all SCSI cdrom drives. If you need to use another interface, check the device setting also as they need to fit together. Here is an example for an ATAPI cdrom using the cooked_ioctl interface and the cdrom device /dev/hdb: icedax -Icooked_ioctl -D/dev/hdb Features ======== I added an optional on-the-fly correction for pre-emphasized samples (available for original CDDA format only). If the -T option is given, the samples will be filtered before they are written to disk. The samples then have a linear frequency response again. When recording in mono, both channels are summed with halved amplitude. Undersampling is done by summing several samples with reduced amplitude to prevent overflows. This damps higher freqencies as well. Compared to exact resampling icedax does not use a very sophisticated (expensive) filter algorithm. It currently uses quadratic interpolation for noninteger subsampling factors. Sampling can be aborted by pressing the Interrupt-Key (eg control-C) at anytime. Unless streaming to a pipe, the wav header will be updated to contain the actual length of the sample. The same will happen, if disk space becomes exhausted. Fast options ============ The options can also influence the performance greatly. The fastest case is given when the samples don't need to be changed from their original form or analysed, that is the output format uses the same parameters as the drive: 16-bit samples, stereo at 44100 Hz sample rate AND with the same endianess (-Cbig and -Ebig, or -Clittle and -Elittle). To be sure all parameters can be given explicitly on the command line. This avoids an analysis of icedax. icedax -P0 -q -S run as root will read with maximum speed and copy its output into the wav file, taking advantage of realtime scheduling as well. For throughput testing the additional option -N can be used. Write operations will be suppressed then. Options that slow down initially ================================ -v needs some time for analysis before the actual sampling starts Options that slow down during sampling ====================================== -P1 causes overlap reading, the slowdown depends on the amount of jitter -e synchronous output to a sound card slows down to onefold speed Options that need more cpu power ================================ -p resamples the output send to the sound card -M calculates checksums -T on-the-fly preemphasis filtering -F checking for extremal samples -G checking for differences in both channels -C if a conversion is required (see below) -E if a conversion is required (see below) -Oaudiotype if a conversion is required (see below) -c 1 -c s -m -b 8 -b 12 -a -r When are one or two endianess (byte order) conversions required? ================================================================ There are three stages where the endianess matters: 1.) on the input side the cd drive can deliver in two flavors (called F1). When the flavor is unknown, icedax needs to find out the endianess. A simple voting method is used. Successive samples are compared in both flavors and the flavor with the statistically smaller changes is taken. The flavor can be defined with the -C option, avoiding the analysis. 2.) For any calculation with samples (and echoing to the sound card), the samples are needed in the byte order of the machine (in this case I set 'need_host_order' to yes). The flavor of the machine endianess is called F2. 3.) Finally, there are two flavors of output sound formats (called F3): wav uses little endian samples cdr and au use big endian samples If the samples currently in memory have the wrong endianess a (possibly second) conversion is required. This gives the following table: F1 F2 need_host_order F3 conversions little little no little 0 little little yes little 0 little little no big 1 little little yes big 1 little big no little 0 little big yes little 2 little big no big 1 little big yes big 1 big little no little 1 big little yes little 1 big little no big 0 big little yes big 2 big big no little 1 big big yes little 1 big big no big 0 big big yes big 0 Known problems ============== 1. Sound quality Audible errors caused by hesitations: When recording the same audio track twice, recordings can slightly differ. Furthermore depending on the firmware in the cdrom drive, positioning errors can be so severe that they cannot be easily corrected by icedax. This will unfortunately lead to audible errors. In this case some overlap or even underlap between successive portions is introduced from the cdrom drive. Here is this case demonstrated graphically: Sec 1 ... Sec n |----------------------| first read delivered |------------------------| second read wanted |------------------------| second read delivered |-| extra bogus bytes |-| missing bytes This is due to synchronisation problems between sectors inside the cdrom drive. When the drive has been forced to wait, these problems arise. Audio cds are lacking sector headers, so it's a difficult job to do the positioning right (in the firmware). The frequency of these errors is reduced when the reading process can continue undisturbed for longer periods. So, a high throughput is essential. You may want to fine-tune your update daemon to use shorter intervals (see 'man 8 update'). Shorter intervals are better because the update interruptions are shorter when not so much write requests can pile up. The plextor 4plexplus drive (PX-4XCE) and newer models, newer pioneer models as well as CD-writers with large buffers don't suffer from this errors. Here the default is to switch off overlap reading. If you cannot get good samples from your drives you might consider an alternative program. Monty's cdparanoia program goes to great lengths in order to seperate the good bits from the bad ones. 2. The index scanner has caused timeouts on my toshiba 3401 due to fast random accesses. 3. Retrieval of media catalog numbers and International Standard Recording Codes may fail due to firmware bugs. Audio Format Conversion ======================= Currently wav, sun (au-pcm), Apple/SGI aiff/aifc, and raw formats are supported. I try to write correct wav files (little endian samples), but some cd-writers might swap them, which would result in sort of white noise instead of the original sounds. icedax has an endianness detector for these cases, but as for all automatics, it might fail on bizarre samples. Hint: icedax can be forced to use a given input endianness with the -C option (arguments are 'little', 'big' or 'guess'). The sun format is a pcm variant, and uses big endian samples. The other more common sun format with logarithmically scaled samples (au) is not supported but can be obtained from sox's conversion. The raw format is like the sun format except it has no header. I changed the endianness to big endian samples in order to comply with popular cd burning software like the wodim program. The sound converter 'sox' can be used to obtain other sound formats. (Note however, that the current sox player and a newer sound driver do not harmonize well, use the player from the wavplay package instead (available at sunsite)). Feedback ======== Tested patches, any hardware information regarding drives as well as success/ failure reports are always welcome at heiko@colossus.escape.de. known cdda capable drives ========================= Check out these web pages for uptodate information: and From a news posting from Björn Wiberg > The following table was generated using the CDROM.CFG file from Nero > v3.0.4.2. > > It shows different CD-ROM models and what speeds they can do DAE at. I > guess the values are "safe ones"; i.e. the speeds at which each drive > can perform DAE reliably. > > A value of "0x" means the drive doesn't support DAE. > > For your convenience, the maximum data transfer speed of the drives > (for reading conventional files and data from the CD-ROM) are also > included. > > Hopefully, this will help some of you who are looking for a good > CD-ROM drive to choose a model which seems fast enough both for data > and DAE. > > The models which support DAE: > (Sorted by DAE speed, data speed and model) > > CD-ROM model DAE Data Interface > --------------------------------------------------------- > PLEXTOR CD-ROM PX-32TS 16x 16x SCSI > TEAC CD-524E 14x 24x IDE > CREATIVE CD620E 12x 5x IDE > MITSUMI CD-ROM FX320S !B 12x 32x IDE > TEAC CD-532E 12x 32x IDE > HITACHI CDR-8335 12x 24x IDE > PIONEER CD-ROM DR-A02S 12x 24x IDE > TEAC CD-ROM CD-532S 12x 14x SCSI > PIONEER CD-ROM DR-A12X 12x 12x IDE > PIONEER CD-ROM DR-U06S 12x 12x SCSI > PLEXTOR CD-ROM PX-20TS 12x 12x SCSI > MITSUMI CD-ROM FX120T !B 11x 12x IDE > PIONEER CD-ROM DR-A04S 11x 32x IDE > PIONEER CD-ROM DR-U12X 10x 12x SCSI > HITACHI CDR-8330 9x 24x IDE > SONY CD-ROM CDU711 9x 14x IDE > MATSHITA CD-ROM CR-584 9x 12x IDE > MATSHITA CD-ROM CR-586 8x 32x IDE > CDM-T531 Ver1.041 8x 18x IDE > TEAC CD-516E 8x 16x IDE > TOSHIBA CD-ROM XM-6201TA 8x 16x SCSI > PLEXTOR CD-ROM PX-12CS 8x 12x SCSI > PLEXTOR CD-ROM PX-12TS 8x 12x SCSI > PIONEER CD-ROM DR-U10X 8x 10x SCSI > SONY CD-ROM CDU611 8x 10x IDE > FUNAI E285X 8x 8x IDE > MITSUMI CD-ROM FX810T4!B 8x 8x IDE > SONY CD-ROM CDU511 8x 8x IDE > SONY CD-ROM CDU571-Q 8x 8x IDE > TEAC CD-C68E 8x 8x IDE > MITSUMI CD-ROM FX400E !B 8x 4x IDE > HITACHI CDR-8130 7x 16x IDE > MATSHITA CD-ROM CR-585 6x 24x IDE > CREATIVE CD2422E MC102 6x 12x IDE > MATSHITA CD-ROM CR-508 6x 12x SCSI > IBM PD-1 LF-1195 6x 6x IDE > PLEXTOR CD-ROM PX-6XCS 6x 6x SCSI > LITEON CD-ROM LTN301 5x 32x IDE > LITEON CD-ROM LTN242F 5x 24x IDE > HITACHI CDR-7930 5x 8x IDE > ASUS CD-S340 4x 34x IDE > E-IDE CD-ROM 32X/AKU 4x 32x IDE > ATAPI CDROM 4x 24x IDE > LITEON CD-ROM LTN244 4x 24x IDE > PHILIPS PCA248CD 4x 24x IDE > TEAC CD-524EA 4x 24x IDE > LITEON CD-ROM LTN202 4x 21x IDE > ATAPI CD-ROM DRIVE-24X 4x 20x IDE > CREATIVE CD2423E NC101 4x 20x IDE > SAMSUNG CD-ROM SCR-2431 4x 20x IDE > TAE IL CD-ROM CDD-7240J 4x 20x IDE > TEAC CD-220E 4x 20x IDE > CREATIVE CD1620E SL970404 4x 16x IDE > LITEON CD-ROM LTN262 4x 16x IDE > TEAC CD-ROM CD-516S 4x 16x SCSI > ATAPI CD-ROM DRIVE 4x 15x IDE > BCD 16XA CD-ROM 4x 10x IDE > MATSHITA CD-ROM CR-506 4x 8x SCSI > SONY CD-ROM CDU311 4x 8x IDE > MATSHITA CD-ROM CR-504-J 4x 4x SCSI > MITSBISH CDRW226 4x 4x SCSI > SONY CD-ROM CDU625-S 4x 4x SCSI > SONY CD-ROM CDU-76S 4x 4x SCSI > SONY CD-ROM CDU77E 4x 4x IDE > PLEXTOR CD-ROM PX-4XCE 4x 4x SCSI > SONY CD-ROM CDU55E 4x 2x IDE > PIONEER CD-ROM DR-U24X 3x 24x SCSI > LITEON CD-ROM LTN204 3x 21x IDE > PIONEER CD-ROM DR-A01S 3x 20x IDE > PIONEER CD-ROM DR-A24X 3x 20x IDE > FUNAI E295X 3x 16x IDE > PIONEER CD-ROM DR-U03S 3x 12x SCSI > BTC 24X CD-ROM SLL24 3x 10x IDE > PLEXTOR CD-ROM PX-8XCS 3x 4x SCSI > CyberDrv CD-ROM TW240S 3x 3x SCSI > COMPAQ CRD-8320B 2x 32x IDE > LG CD-ROM CRD-8320B 2x 32x IDE > TOSHIBA CD-ROM XM-6202B 2x 32x IDE > CREATIVE DVD-ROM DVD2240E 2x 24x IDE > TOSHIBA CD-ROM XM-6102D 2x 24x IDE > BTC 16X CD-ROM SLL16 1x 10x IDE > NEC CD-ROM DRIVE:282 2x 8x IDE > HITACHI GD-2000 2x 4x IDE > MATSHITA CD-ROM CR-581 2x 4x IDE > NEC CD-ROM DRIVE:222 2x 4x SCSI > MATSHITA CD-ROM CR-8004 2x 2x SCSI > GoldStar CD-ROM CRD-8240B 1x 24x IDE > TOSHIBA CD-ROM XM-6102B 1x 24x IDE > CyberDrv IDE CD-ROM 120D 1x 12x IDE > I DE CD-ROM TW120D 1x 12x IDE > NEC CD-ROM DRIVE:464 1x 12x SCSI > TORiSAN CD-ROM CDR_U112 1x 12x IDE > TOSHIBA CD-ROM XM-5701TA 1x 12x SCSI > TOSHIBA CD-ROM XM-5702B 1x 12x IDE > CyberDrv SCSI CD-ROM 120S 1x 10x IDE > NEC CD-ROM DRIVE:463 1x 10x SCSI > COMPAQ DVD-ROM SD-M1002 1x 8x IDE > MATSHITA CD-ROM CR-583 1x 8x IDE > NEC CD-ROM DRIVE:462 1x 8x SCSI > TEAC CD-58E 1x 8x IDE > OPTICS_S 8622 SCSI 1x 8x SCSI > TOSHIBA CD-ROM XM-5602B 1x 8x IDE > TOSHIBA CD-ROM XM-3801TA 1x 7x SCSI > NEC CD-ROM DRIVE:461 1x 6x SCSI > IBM CDRM00203 1x 6x SCSI > TEAC CD-46E 1x 6x IDE > TEAC CD-56E 1x 6x IDE > TEAC CD-ROM CD-56S 1x 6x SCSI > TOSHIBA CD-ROM XM-5502TA 1x 6x IDE > TOSHIBA CD-ROM XM-3701TA 1x 6x SCSI > NEC CD-ROM DRIVE:502 1x 4x SCSI > TOSHIBA CD-ROM XM-1502BN 1x 4x IDE > TOSHIBA CD-ROM XM-5302TA 1x 4x IDE > TOSHIBA CD-ROM XM-5401TA 1x 4x SCSI > TOSHIBA CD-ROM XM-5402TA 1x 4x IDE > TOSHIBA CD-ROM XM-1502B 1x 4x IDE > TOSHIBA CD-ROM XM-3501TA 1x 4x SCSI > TOSHIBA CD-ROM XM-5301TA 1x 4x SCSI > TOSHIBA CD-ROM XM-5201TA 1x 2x SCSI known cdda uncapable drives =========================== Pioneer DRM-602X, DRM-604X Teac CD-55A (panasonic bus) Philips CM206/10 serial RS-422 CM207 CM226/10 serial RS-422 CDD462/01 serial RS-422 Orchid CDS3110 Additions to the tables above are welcome. and now catch your sounds, Heiko heiko@colossus.escape.de (Original author) Changes for the Cdrkit project by Christian Fromme , Eduard Bloch cdrkit-1.1.11/doc/icedax/Frontends0000644000372500001440000000175110531376444016026 0ustar steveusersThis file lists additional free frontend software to be combined with icedax: graphical frontends =================== BurnIT (http://sunsite.auc.dk/BurnIT/) by Jesper Petersen a Java based frontend for cdrecord and icedax/cdparanoia Grip (http://www.ling.ed.ac.uk/~oliphant/grip) by Mike Oliphant a GTK+ Frontend for audio extraction and MPEG 1 Layer 3 conversion (incl. CDDB support) requires libcdaudio (also by Mike Oliphant) Krabber (http://members.tripod.com/~fehlfarben/download.html) by Adrian Schroeter a KDE frontend for cdparanoia and MPEG 1 Layer 3 conversion (incl. CDDB support) script frontends ================ Cdr Create/Duplicate/Rip (ftp://ftp.burdell.org/pub/) by David Cantrell a ncurses based Perl script for CDDA to MPEG 1 Layer 3 conversion (incl. CDDB support) requires xmcd Ripenc rip encoder (http://www.asde.com/~mjparme/index.htm) by Michael J. Parmeley a shell script frontend for CDDA extraction and MPEG 1 Layer 3 conversion (incl. CDDB support) cdrkit-1.1.11/doc/icedax/FAQ0000644000372500001440000002355710540226701014471 0ustar steveusersFrequently Asked Questions Status ====== Q: What is the copyright status of icedax? A: icedax is software copyrighted by Heiko Eissfeldt and others, and released under the General Public License from the Free Software Foundation (see file GPL). Compilation =========== Q: What are the requirements to run icedax? A: All operating systems that are supported by wodim should also be able to run icedax. Currently DOS and Windows are not covered. Requirements of previous versions of icedax have been cut down for the sake of portability. Features like fork(), realtime scheduling, or shared memory are all optional now. You need Cmake and its dependencies, an ANSI C compiler and a C library to build icedax on a supported operating system. To run icedax, a SCSI transport implementation for the os, a cdrom or cd burner device to read from, and at least say 65K of memory for buffers are needed. Q: Why does it not compile under Linux, although I am using the newest kernel? A: There have been changes in the generic driver by Douglas Gilbert, that are in its first release not compatible with the scsi library from Joerg Schilling. We are working on this problem... In the meantime better do not use this variant, use the older one instead. Q: Why does it not compile using standard make? A: Like wodim, icedax uses the cmake system, which requires a sophisticated make program like GNU make. Pure posix make functionality is not enough. Setting Up (for now Linux only) =============================== Q: Should I use scsi emulation or the eide driver for my ATAPI cdrom drive? A: Scsi emulation is preferred, since it enables icedax to use more commands and is often the only way to get special information like track titles with cd-text. The emulation module is called ide-scsi, the eide module is called ide-cd. Q: How can I use my parallel-port-connected cdrom with icedax? A: Under Linux there is a driver, that makes this device under SCSI emulation available. For more information see the wodim documentation. Q: How do I check, if the current Linux kernel does support generic SCSI? A: run 'cat /proc/devices | grep "21 sg"' and see, if a line with 'sg' appears. If it does not appear, the current kernel is not able to use the generic_scsi interface. If you have generic SCSI support compiled as a module, see next question, otherwise you need to recompile the kernel and enable generic SCSI. You might try to use the 'cooked_ioctl' interface as a last resort, but then you need to supply a cdrom device with -D (like -D/dev/cdrom). In this case icedax completely relies on the cdda reading methods from the kernel driver, so it might not work (due to unsupported). Q: How do I load the generic SCSI module by hand? A: run 'insmod sg' and check the result (see above). Q: How do I find the device setting for my drive? A: Under Linux use the script scan_scsi.Linux. It prints the available devices and their respective device option to be used. Be aware of the fact that the generic device naming may change whenever the devices on the SCSI bus change (present or not present). General usage (sampling) ======================== Q: How do I record the whole cd, each track in a seperate file? A: Use the '-B' option. This will automagically create a file for each track. Q: How do I record the whole cd into one file? A: Just extend the default recording time from one track to a big enough time in seconds to cover the whole cd (like -d99999). Q: How do I record successive tracks (a track range) into seperate files? A: Use the '-B' option and -t+. Q: How do I record successive tracks (a track range) into one file? A: Use -t+. Q: How do I record different tracks into seperate files with individual file names? A: Use the supplied script 'readmult'. For usage see the comments at the beginning of the script. Q: How can I get the highest speed out of icedax? A: See the file README. There is a section about performance and what is influencing it. Q: How can I burn audio cds with icedax and wodim on-the-fly? A: This has not been tested very well, so caveat emptor. It is possible to use icedax and wodim with pipes, _but_ there are several issues. 1.: The cd drive may become too slow to keep wodim's buffer happy, when a scratch on the audio cd is encountered, and several retries take place. 2.: Currently there is no way to carry individual track information from icedax to wodim. Several information bits are available very late but are needed in advance from wodim. 3.: Some operating systems have limitations in multiple SCSI accesses and other resources (shared memory). icedax and wodim may block each other, or might fight over limited resources. For these reasons it is not recommended to burn on-the-fly with icedax. Frontends ========= Q: Which frontends for icedax are available? A: See the file 'Frontends'. There are command line and graphical frontends. Album and track titles ====================== Q: Does icedax support titles from cd extra (aka cd plus aka enhanced cd)? A: In general, yes. In order to get this information, icedax needs to read a data sector from the second session of the cd. This requires multisession support and the capability to read XA sectors. The titles are printed on the screen and written into the inf files, then. Q: Does icedax support titles from cd-text? A: Newer versions support the most important features of cd-text like titles and creators. Non-supported are currently 16-bit characters, so asian titles etc. are currently not available. Q: Does icedax support CDDB ids? A: Yes, while it does not make CDDB lookups itself, it supplies an cddb file with the table of contents and the cddb id. For cddb lookups see the perl script tracknames.pl and tracknames.txt. If the titles are known to icedax, it fills the titles itself in the cddb file. Q: What is the MCN? A: The media catalog number is an unique id for the audio cd release. It is similar to the ISBN for books, but unfortunately it is included only on some audio cds. Q: What is the ISRC? A: The International Standard Record Code is an unique id for a track. Like the MCN (see above) it is an optional item. MP3 coding ========== Q: Does icedax support on-the-fly mp3-coding? A: Yes. As of version 1.9alpha I integrated the LAME encoding engine as a new output format. To support external encoders, I added two scripts. The trick is to avoid big temporary files. There are three versions (cdda2mp3.file, cdda2mp3.pipe, and cdda2mp3.fifo), the first using files, the second uses pipes, and the last uses a named pipe (also called fifo). The examples use the Fraunhofer encoder 'l3enc', which is a commercial product and has to be purchased seperately. Other encoders should be usable in a similar way. Conversions =========== Q: How do I create a file suitable for cd burning? A: If you are using wodim, you can produce cdr or wav files. To select cdr files, use -Ocdr, to select wav files use -Owav (the default). Audio files that have been recorded with a length not a multiple of the audio sector size 2352 bytes, should be used with wodim's -pad option. Q: How do I convert a wav file into a cdr file (my other cd burning program does not accept wav format)? A: Use 'dd if=wavfile of=cdrfile conv=swab ibs=44 skip=1 obs=2352' Q: How to convert cdr to wav? A: Use sox, the sound utility. It supports other formats as well. Specials ======== Q: Does icedax support the pre-emphasis bit? A: If the table of contents marks a track as pre-emphasized, the corresponding inf file will have this information, too. That enables a cd burning program to retain the state of the track. Q: Can icedax undo the pre-emphasis effect in the samples? A: Yes, if the -T option is given (and cd quality is selected), icedax filters the samples with the reverse emphasis on-the-fly. This has been checked with a sine sweep from a pre-emphasized test cd. Q: My cdrom delivers the stereo channels swapped. How can I undo this? A: Use the -cs option. Q: Does icedax support indices? A: Yes, but since there are positioning problems with a lot of drives, information might be inaccurate. A start index can be specified with the -i option. To get all indices, use the -v7 option. Q: Can icedax avoid including the pre-gap region at the end of the track? A: Currently not. This might be added later, but is not easily done. Q: How can I get all information about the cd without writing files? A: Use the -J option, which switches analysis to the max, and aborts after the report. Q: Can icedax display/save the graphics on my CD+graphics disc? A: No, this is not planned. A seperate X11 program could do that probably better. Q: Can icedax read the audio portion from my CD-I/Video-CD/DVD mpeg streams? A: No, these are special formats, which require much more effort. User support/feedback ===================== Q: icedax is great. How can I support you to encourage further development? A: Look into the file NEEDED. Also constructive criticism and feedback is appreciated. Q: I want to port cdrkit (wodim/genisoimage/icedax) to a new platform (like DJGPP,cygwin,os/2). How should I proceed? A: It would be convenient to have a unix like environment (like cygwin provides) A shell, and a make program would be needed to first create smake (in order to make the makefile system working). Another critical component is autoconf. Once that is running, os dependent interfaces and the SCSI library should be adjusted. For the makefile system and the scsi library please contact Joerg Schilling. Q: icedax sucks. Are there other alternatives available? A: Yes, for Linux you might try 'cdparanoia' from Monty (see README file). cdrkit-1.1.11/doc/icedax/tracknames.txt0000644000372500001440000000216010531376444017025 0ustar steveusersDate: Fri, 2 Oct 1998 16:58:15 -0400 From: Bill O'Donnell To: heiko@colossus.escape.de Subject: CDDB/icedax quick lookup utility Hello, I just started using icedax to capture CD audio on Linux. It's working great on my 2.0.22 kernel with NEC CD-ROM DRIVE:273 (ATAPI). Anyway, I noticed that you're dumping out cddb query info, but not doing the query yet, so I hacked a quick perl program to do it. If you run with a default extraction like this: icedax -B -D /dev/hda then run the program included something like this: cddbhack.pl ma.us.cddb.com 8880 < audio.cddb It looks up the names, and creates a file "rename.sh" which can be used to rename all the audio_XX.wav files to a nice name. Anyway, thought you might find it useful, feel free to include in your next beta distribution or not. Sorry if I made any stupid perl mistakes, I only just learned it last week. I would have done it in C or python but I need to learn perl for another job... Cheers, -billo Bill O'Donnell Independent Software Developer billo@billo.com http://www.billo.com cdrkit-1.1.11/doc/icedax/NEEDED0000644000372500001440000000064710531376444015013 0ustar steveusersHere I list some things, which would be very helpful for the further development of cdrtools/icedax, but I currently have no access to. User support for the acquisition of these items is appreciated :-) Access to all 'coloured books' from Philips/Sony (Red/Yellow/Green/Orange/White/Blue,...). CD-extra discs with a lot of features/entries in the data sectors (SUB_INFO*). CD-text discs with a lot of features/entries. cdrkit-1.1.11/doc/icedax/THANKS0000644000372500001440000000223110540226701015034 0ustar steveusersCdda2wav development has been funded by Project MODE http://www.mode.net/ and Fraunhofer Institut für integrierte Schaltungen (FhG-IIS) http://www.iis.fhg.de/ Code for extraction of ISRC and MCN codes as well as MD5 signatures has been made possible by their contributions, thanks very much. Thanks to Rik Swusten of Plextor Europe for supplying a cd burner for development. Thanks to Ricoh for supplying a cd burner for development. Thanks to Sanyo for supplying a Burn-Proof cd burner with documentaion for development. More thanks goto Joerg Schilling (helped a lot to integrate his SCSI library) Aaron Newsome (which created an account on his machine for me to do testing) Christopher Montgomery (aka Monty, for his work on jitter correction) Zygo Blaxell (a lot of code improvements) Thomas Niederreiter (extensions for cd-writers) Piercarlo Grandi (rewrote of cdda2wav's man page) Stewart Addison (suggestions and a fine web page on cdda) Leland Olds (the cdda2wav debian maintainer) Francesco Chemolli (getopt_long patches) Thanks to all testers and finally Jim McLaughlin for supplying the first cdda-reader source code (that got me started). Heiko Eißfeldt cdrkit-1.1.11/doc/icedax/tracknames.pl0000755000372500001440000001041210531376444016623 0ustar steveusers#!/usr/local/bin/perl # A quick perl hack to get rename files pulled in with icedax. # by billo@billo.com # use Socket; use IO::Handle; use Env qw(USER); use strict; no strict 'subs'; # can't get it to stop complaining about SOCK my $state = "header"; my $global_album = "Artist / Title"; my $global_title = "Title"; my $global_artist = "Artist"; my @global_tracks = ("") x 100; my $global_ntracks = 0; my @track_offsets = (); my $disc_id = 0; my $disc_time = 0; if ($#ARGV != 1) { print "usage: cddbhack.pl CDDBHOST PORT < audio.cddb\n"; exit 0; } while () { if ($state eq "header") { if (/#\s[\s]*(\d[\d]*)$/) { push @track_offsets, $1; } elsif (/#\s[\s]*Disc length:\s(\d[\d]*)/) { $disc_time = $1; $state = "discid"; } } elsif ($state eq "discid") { if (/DISCID=(\w[\w]*)/) { $disc_id = $1; last; } } } my $query_string = "cddb query $disc_id " . ($#track_offsets + 1); foreach my $offset (@track_offsets) { $query_string .= " $offset"; } $query_string .= " $disc_time"; print "$query_string\n"; my $host = $ARGV[0]; my $port = $ARGV[1]; my $iaddr = inet_aton($host); my $paddr = sockaddr_in($port, $iaddr); socket(SOCK, AF_INET, SOCK_STREAM, getprotobyname('tcp')) or die "socket: $!"; connect(SOCK, $paddr) or die "connect: $!"; autoflush SOCK 1; print "Connected.\n"; my ($status, $result) = &resp(\*SOCK); if (int($status) != 201) { print "Unexpected status.\n"; close(\*SOCK); exit 0; } $host = `hostname`; $host =~ s/\n//g; &cmd(\*SOCK, "cddb hello $USER $host billo-scan 0.1"); ($status, $result) = &resp(\*SOCK); if (int($status) != 200) { print "Unexpected status.\n"; close(\*SOCK); exit 0; } &cmd(\*SOCK, "$query_string"); ($status, $result) = &resp(\*SOCK); if (int($status) != 200) { print "Unexpected status.\n"; close(\*SOCK); exit 0; } my ($ignore, $cat, $id, @rest) = split (" ", $result); my $read_string = "cddb read $cat $id"; &cmd(\*SOCK, $read_string); &resp(\*SOCK); while () { if (/^\./) { # print $_; # print "last line\n"; last; } else { &process($_); # print $_; } } &cmd(\*SOCK, "quit"); &resp(\*SOCK); close(\*SOCK); &rename; exit 0; sub cmd { my ($S, $cmd) = @_; print "$cmd\n"; print $S "$cmd\r\n"; } sub resp { my ($S) = @_; my ($code, $message); while (<$S>) { if (/^(\d[\d]*)\s.*/) { # print "\n$1\n"; print "$_\n"; $code = $1; $message = $_; last; } sleep(1); } my @return_array = ($code, $message); return @return_array; } sub process { my ($line) = @_; $_ = $line; if (/^DTITLE=(.*)$/) { $global_album = $1; $_ = $global_album; if (m/([^\/][^\/]*)\s\/\s([^\/][^\/\n\r]*)/) { $global_artist = $1; $global_title = $2; } print "$global_album\n"; print "$global_title\n"; print "$global_artist\n"; return; } if (/^TTITLE(\d[\d]*)=(.*)$/) { my $track = $1 + 1; if ($track > $global_ntracks) { $global_ntracks = $track; } $global_tracks[$track] = sprintf ("%s-%02d-%s", $global_title, $track, $2); $global_tracks[$track] =~ s/\s$//g; $global_tracks[$track] =~ s/'//g; $global_tracks[$track] =~ s/\s/_/g; $global_tracks[$track] =~ s/:/_/g; $global_tracks[$track] =~ s/\?//g; $global_tracks[$track] =~ s/\*//g; $global_tracks[$track] =~ s/\\/_/g; $global_tracks[$track] =~ s/\s/_/g; $global_tracks[$track] =~ s/\//_/g; print "Track match " . $global_tracks[$track] . "\n"; } } sub rename { my $i = 1; for ($i = 1; $i <= $global_ntracks; $i++) { my $track_name = $global_tracks[$i]; if ($track_name ne "") { my $file_name = sprintf("audio_%02d.wav", $i); my $new_file_name = sprintf("$track_name.wav", $i); my $mv_cmd = "mv '" . $file_name . "' '" . $new_file_name . "'"; print "$mv_cmd\n"; `echo $mv_cmd >> rename.sh`; } } } sub unrename { my $i = 1; for ($i = 1; $i <= $global_ntracks; $i++) { my $track_name = $global_tracks[$i]; if ($track_name ne "") { my $file_name = sprintf("$track_name.wav", $i); my $new_file_name = sprintf("audio_%02d.wav", $i); my $mv_cmd = "mv '" . $file_name . "' '" . $new_file_name . "'"; print "$mv_cmd\n"; `echo $mv_cmd >> unrename.sh`; } } } cdrkit-1.1.11/doc/icedax/TODO0000644000372500001440000000236010473136454014626 0ustar steveusersimproved Indexscan without playing sectors use C2 pointers to reduce speed Solaris handling with volumed SunOS/Solaris and 512 byte sectors?? setuid.c group ids on WinXP?? stabilization: check all exit codes (exit with error if sync failed) new ioctl support for Solaris, FreeBSD-3.x, FreeBSD-4.x find cause of ringbuffer assertions (resource temporarily unavailable) new features: enable hidden (audio) track recording thread support more sound support CDIndex, CDDB lookups prepare for MP3 inclusion (lame) cut off silence at start and end of track interpolation for massive read errors internal: get cache setting/set cache to zero/reset cache size at the end... maybe add something for pioneer cd drives (spin up problems) develop a new transport to read cdda sectors with complete subchannels use index0 optionally to cut off the pregap portion detect type of hidden track (data/audio) implement capability to add a global shift enhance cd text: increase buffer size add tab semantics support 16-bit characters try fallback read text info from program area structural: plug-in infrastructure BeOS: cddbp support, sound support QNX: realtime support RR-scheduler message, sound support in lconfig Makefiles OS/2: sound support cygwin: sound support cdrkit-1.1.11/doc/icedax/OtherProgs0000644000372500001440000000014010473136454016147 0ustar steveusersdagrab works with ioctls, includes cddb lookups cdparanoia has sophisticated jitter correction cdrkit-1.1.11/doc/icedax/HOWTOUSE0000644000372500001440000000441410540226701015326 0ustar steveusersIcedax User guide ================= NOTE: expressions in angle braces have to be substituted with the corresponding numerical values. For example: has to be substituted with the numerical value to be used. Common tasks ============ NOTE: The examples used here depend on proper default settings for interface method and devices as specified in the Makefile. They can be overriden with command line parameters, but here I choose to focus on simple examples. Copy complete audio CDs 1. Copy an audio CD into wav files one per track. icedax -B will produce the sample wav files (one per track) audio_01.wav audio_02.wav ... and the corresponding description files audio_01.inf audio_02.inf ... 2. Same as above but include MD-5 type signatures icedax -B -M 3. Same as above but use other file name ('party_cd.wav') icedax -B -M party_cd.wav Copy single tracks 1. Copy one track (eg track 6) into a wav file. icedax -t6 will produce a wav file including track 6 audio.wav and audio.inf Copy parts of tracks 1. Copy from given start time to end of track icedax -t6 -o will record track 6 starting at track time /75 seconds from track beginning upto the end of track. 2. Copy from given start time and record for a given time icedax -t6 -o -d