Add options processing to cd-read. Had not very useful output on

mode1 format1 test.
This commit is contained in:
rocky
2003-09-21 03:35:39 +00:00
parent f501c696fc
commit 11d4eb000c
5 changed files with 633 additions and 265 deletions

3
NEWS
View File

@@ -1,9 +1,10 @@
0.64 0.64
- Add/expose routines to get/set time. time is reported back in entry - Add/expose routines to get/set time. time is reported back in entry
stat. Routines to creat IS0-9660 directories and entries must now stat. Routines to create ISO-9660 directories and entries must now
supply the time to set on the entry. supply the time to set on the entry.
- cd-info: now displays date on iso9660 listing and translates filename - cd-info: now displays date on iso9660 listing and translates filename
to normal conventions to normal conventions
- cd-read: new program to help diagnose reading problems.
- Document more functions. - Document more functions.
0.63 0.63

View File

@@ -1,5 +1,5 @@
/* /*
$Id: cd-info.c,v 1.34 2003/09/14 09:34:18 rocky Exp $ $Id: cd-info.c,v 1.35 2003/09/21 03:35:40 rocky Exp $
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org> Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org>
@@ -187,6 +187,32 @@ enum {
char *temp_str; char *temp_str;
#define DEV_PREFIX "/dev/"
static char *
fillout_device_name(const char *device_name)
{
#if defined(HAVE_WIN32_CDROM)
return strdup(device_name);
#else
unsigned int prefix_len=strlen(DEV_PREFIX);
if (0 == strncmp(device_name, DEV_PREFIX, prefix_len))
return strdup(device_name);
else {
char *full_device_name=malloc(strlen(device_name)+prefix_len);
sprintf(full_device_name, DEV_PREFIX "%s", device_name);
return full_device_name;
}
#endif
}
/* Parse a all options. */
static bool
parse_options (int argc, const char *argv[])
{
int opt;
struct poptOption optionsTable[] = { struct poptOption optionsTable[] = {
{"debug", 'd', POPT_ARG_INT, &opts.debug_level, 0, {"debug", 'd', POPT_ARG_INT, &opts.debug_level, 0,
"Set debugging to LEVEL"}, "Set debugging to LEVEL"},
@@ -224,7 +250,6 @@ struct poptOption optionsTable[] = {
{"cddb-timeout", '\0', POPT_ARG_INT, &opts.cddb_timeout, 0, {"cddb-timeout", '\0', POPT_ARG_INT, &opts.cddb_timeout, 0,
"CDDB timeout value in seconds (default 10 seconds)"}, "CDDB timeout value in seconds (default 10 seconds)"},
#endif #endif
#ifdef HAVE_VCDINFO #ifdef HAVE_VCDINFO
@@ -267,31 +292,7 @@ struct poptOption optionsTable[] = {
"display version and copyright information and exit"}, "display version and copyright information and exit"},
POPT_AUTOHELP {NULL, 0, 0, NULL, 0} POPT_AUTOHELP {NULL, 0, 0, NULL, 0}
}; };
poptContext optCon = poptGetContext (NULL, argc, argv, optionsTable, 0);
#define DEV_PREFIX "/dev/"
static char *
fillout_device_name(const char *device_name)
{
#if defined(HAVE_WIN32_CDROM)
return strdup(device_name);
#else
unsigned int prefix_len=strlen(DEV_PREFIX);
if (0 == strncmp(device_name, DEV_PREFIX, prefix_len))
return strdup(device_name);
else {
char *full_device_name=malloc(strlen(device_name)+prefix_len);
sprintf(full_device_name, DEV_PREFIX "%s", device_name);
return full_device_name;
}
#endif
}
/* Parse a single option. */
static bool
parse_options (poptContext optCon)
{
int opt;
while ((opt = poptGetNextOpt (optCon)) != -1) { while ((opt = poptGetNextOpt (optCon)) != -1) {
switch (opt) { switch (opt) {
@@ -830,7 +831,6 @@ main(int argc, const char *argv[])
int first_data = -1; /* # of first data track */ int first_data = -1; /* # of first data track */
int first_audio = -1; /* # of first audio track */ int first_audio = -1; /* # of first audio track */
cdio_analysis_t cdio_analysis; cdio_analysis_t cdio_analysis;
poptContext optCon = poptGetContext (NULL, argc, argv, optionsTable, 0);
memset(&cdio_analysis, 0, sizeof(cdio_analysis)); memset(&cdio_analysis, 0, sizeof(cdio_analysis));
@@ -869,7 +869,7 @@ main(int argc, const char *argv[])
/* Parse our arguments; every option seen by `parse_opt' will /* Parse our arguments; every option seen by `parse_opt' will
be reflected in `arguments'. */ be reflected in `arguments'. */
parse_options(optCon); parse_options(argc, argv);
print_version(opts.version_only); print_version(opts.version_only);

View File

@@ -1,5 +1,5 @@
/* /*
$Id: cd-read.c,v 1.3 2003/09/19 04:36:06 rocky Exp $ $Id: cd-read.c,v 1.4 2003/09/21 03:35:40 rocky Exp $
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
@@ -28,24 +28,143 @@
#include <sys/types.h> #include <sys/types.h>
#include <cdio/cdio.h> #include <cdio/cdio.h>
#include <cdio/logging.h> #include <cdio/logging.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h> #include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <ctype.h> #include <ctype.h>
#include <popt.h>
/* Accomodate to older popt that doesn't support the "optional" flag */
#ifndef POPT_ARGFLAG_OPTIONAL
#define POPT_ARGFLAG_OPTIONAL 0
#endif
#ifdef ENABLE_NLS
#include <locale.h>
# include <libintl.h>
# define _(String) dgettext ("cdinfo", String)
#else
/* Stubs that do something close enough. */
# define _(String) (String)
#endif
/* The following test is to work around the gross typo in
systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE
is defined to 0, not 1. */
#if !EXIT_FAILURE
# undef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
#endif
#define err_exit(fmt, args...) \
fprintf(stderr, "%s: "fmt, program_name, ##args); \
myexit(cdio, EXIT_FAILURE)
char *source_name = NULL;
char *program_name;
typedef enum
{
IMAGE_AUTO,
IMAGE_DEVICE,
IMAGE_BIN,
IMAGE_CUE,
IMAGE_NRG,
IMAGE_UNKNOWN
} source_image_t;
/* Configuration option codes */
enum {
/* These correspond to driver_id_t in cdio.h and have to MATCH! */
OP_SOURCE_UNDEF = DRIVER_UNKNOWN,
OP_SOURCE_AUTO,
OP_SOURCE_BIN,
OP_SOURCE_CUE,
OP_SOURCE_NRG = DRIVER_NRG,
OP_SOURCE_DEVICE = DRIVER_DEVICE,
/* These are the remaining configuration options */
OP_READ_MODE,
OP_VERSION,
};
typedef enum
{
READ_MODE_UNINIT,
READ_AUDIO,
READ_M1F1,
READ_M1F2,
READ_M2F1,
READ_M2F2
} read_mode_t;
/* Structure used so we can binary sort and set the --mode switch. */
typedef struct
{
char name[30];
read_mode_t read_mode;
lsn_t start_lsn;
} subopt_entry_t;
/* Sub-options for --mode. Note: entries must be sorted! */
subopt_entry_t modes_sublist[] = {
{"audio", READ_AUDIO},
{"m1f1", READ_M1F1},
{"m1f2", READ_M1F2},
{"m2f1", READ_M2F1},
{"m2f2", READ_M2F2},
{"mode1form1", READ_M1F1},
{"mode1form2", READ_M1F2},
{"mode2form1", READ_M2F1},
{"mode2form2", READ_M2F2},
{"red", READ_AUDIO},
};
/* Used by `main' to communicate with `parse_opt'. And global options
*/
struct arguments
{
int debug_level;
read_mode_t read_mode;
int version_only;
int no_header;
int print_iso9660;
source_image_t source_image;
lsn_t start_lsn;
} opts;
/* Comparison function called by bearch() to find sub-option record. */
static int
compare_subopts(const void *key1, const void *key2)
{
subopt_entry_t *a = (subopt_entry_t *) key1;
subopt_entry_t *b = (subopt_entry_t *) key2;
return (strncmp(a->name, b->name, 30));
}
/* CDIO logging routines */ /* CDIO logging routines */
static cdio_log_handler_t gl_default_cdio_log_handler = NULL; static cdio_log_handler_t gl_default_cdio_log_handler = NULL;
static int debug_level = 0;
static void static void
_log_handler (cdio_log_level_t level, const char message[]) _log_handler (cdio_log_level_t level, const char message[])
{ {
if (level == CDIO_LOG_DEBUG && debug_level < 3) if (level == CDIO_LOG_DEBUG && opts.debug_level < 3)
return; return;
if (level == CDIO_LOG_INFO && debug_level < 2) if (level == CDIO_LOG_INFO && opts.debug_level < 2)
return; return;
if (level == CDIO_LOG_WARN && debug_level < 1) if (level == CDIO_LOG_WARN && opts.debug_level < 1)
return; return;
gl_default_cdio_log_handler (level, message); gl_default_cdio_log_handler (level, message);
@@ -75,44 +194,311 @@ hexdump (uint8_t * buffer, unsigned int len)
printf ("\n"); printf ("\n");
} }
/* Do processing of a --mode sub option.
Basically we find the option in the array, set it's corresponding
flag variable to true as well as the "show.all" false.
*/
static void
process_suboption(const char *subopt, subopt_entry_t *sublist, const int num,
const char *subopt_name)
{
subopt_entry_t *subopt_rec =
bsearch(subopt, sublist, num, sizeof(subopt_entry_t),
&compare_subopts);
if (subopt_rec != NULL) {
opts.read_mode = subopt_rec->read_mode;
return;
} else {
unsigned int i;
bool is_help=strcmp(subopt, "help")==0;
if (is_help) {
fprintf (stderr, "The list of sub options for \"%s\" are:\n",
subopt_name);
} else {
fprintf (stderr, "Invalid option following \"%s\": %s.\n",
subopt_name, subopt);
fprintf (stderr, "Should be one of: ");
}
for (i=0; i<num-1; i++) {
fprintf(stderr, "%s, ", sublist[i].name);
}
fprintf(stderr, "or %s.\n", sublist[num-1].name);
exit (is_help ? EXIT_SUCCESS : EXIT_FAILURE);
}
}
#define DEV_PREFIX "/dev/"
static char *
fillout_device_name(const char *device_name)
{
#if defined(HAVE_WIN32_CDROM)
return strdup(device_name);
#else
unsigned int prefix_len=strlen(DEV_PREFIX);
if (0 == strncmp(device_name, DEV_PREFIX, prefix_len))
return strdup(device_name);
else {
char *full_device_name=malloc(strlen(device_name)+prefix_len);
sprintf(full_device_name, DEV_PREFIX "%s", device_name);
return full_device_name;
}
#endif
}
static void
print_version (void)
{
if (!opts.no_header)
printf( _("cd-read %s (c) 2003 R. Bernstein\n"),
VERSION);
printf( _("This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
PARTICULAR PURPOSE.\n\
"));
exit(100);
}
/* Parse a options. */
static bool
parse_options (int argc, const char *argv[])
{
int opt;
char *opt_arg;
/* Command-line options */
struct poptOption optionsTable[] = {
{"mode", 'm',
POPT_ARG_STRING, &opt_arg,
OP_READ_MODE,
"set CD-ROM read mode (audio, m1f1, m1f2, m2mf1, m2f2)",
"MODE-TYPE"},
{"debug", 'd',
POPT_ARG_INT, &opts.debug_level, 0,
"Set debugging to LEVEL"},
{"start", 's',
POPT_ARG_INT, &opts.start_lsn, 0,
"Set LBA to start reading from"},
{"bin-file", 'b', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
OP_SOURCE_BIN, "set \"bin\" CD-ROM disk image file as source", "FILE"},
{"cue-file", 'c', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
OP_SOURCE_CUE, "set \"cue\" CD-ROM disk image file as source", "FILE"},
{"input", 'i', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
OP_SOURCE_AUTO,
"set source and determine if \"bin\" image or device", "FILE"},
{"cdrom-device", 'C', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
OP_SOURCE_DEVICE,
"set CD-ROM device as source", "DEVICE"},
{"nrg-file", 'N', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
OP_SOURCE_NRG, "set Nero CD-ROM disk image file as source", "FILE"},
{"version", 'V', POPT_ARG_NONE, NULL, OP_VERSION,
"display version and copyright information and exit"},
POPT_AUTOHELP {NULL, 0, 0, NULL, 0}
};
poptContext optCon = poptGetContext (NULL, argc, argv, optionsTable, 0);
while ((opt = poptGetNextOpt (optCon)) != -1)
switch (opt)
{
case OP_SOURCE_AUTO:
case OP_SOURCE_BIN:
case OP_SOURCE_CUE:
case OP_SOURCE_NRG:
case OP_SOURCE_DEVICE:
if (opts.source_image != IMAGE_UNKNOWN) {
fprintf(stderr,
"%s: another source type option given before.\n",
program_name);
fprintf(stderr, "%s: give only one source type option.\n",
program_name);
break;
}
switch (opt) {
case OP_SOURCE_BIN:
opts.source_image = IMAGE_BIN;
break;
case OP_SOURCE_CUE:
opts.source_image = IMAGE_CUE;
break;
case OP_SOURCE_NRG:
opts.source_image = IMAGE_NRG;
break;
case OP_SOURCE_AUTO:
opts.source_image = IMAGE_AUTO;
break;
case OP_SOURCE_DEVICE:
opts.source_image = IMAGE_DEVICE;
source_name = fillout_device_name(source_name);
break;
}
break;
case OP_READ_MODE:
process_suboption(opt_arg, modes_sublist,
sizeof(modes_sublist) / sizeof(subopt_entry_t),
"--mode");
break;
case OP_VERSION:
print_version();
exit (EXIT_SUCCESS);
break;
default:
fprintf (stderr, "%s: %s\n",
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
poptStrerror(opt));
fprintf (stderr, "error while parsing command line - try --help\n");
exit (EXIT_FAILURE);
}
if (poptGetArgs (optCon) != NULL)
{
fprintf (stderr, "error - no arguments expected! - try --help\n");
exit (EXIT_FAILURE);
}
{
const char *remaining_arg = poptGetArg(optCon);
if ( remaining_arg != NULL) {
if (opts.source_image != IMAGE_UNKNOWN) {
fprintf (stderr,
"%s: Source specified in option %s and as %s\n",
program_name, source_name, remaining_arg);
exit (EXIT_FAILURE);
}
if (opts.source_image == OP_SOURCE_DEVICE)
source_name = fillout_device_name(remaining_arg);
if ( (poptGetArgs(optCon)) != NULL) {
fprintf (stderr,
"%s: Source specified in previously %s and %s\n",
program_name, source_name, remaining_arg);
exit (EXIT_FAILURE);
}
}
}
if (opts.read_mode == READ_MODE_UNINIT) {
fprintf(stderr,
"%s: Need to give a read mode (audio, m1f1, m1f2, m1f2 or m2f2)\n",
program_name);
exit(10);
}
if (opts.start_lsn == CDIO_INVALID_LSN) {
fprintf(stderr,
"%s: Need to give a starting LBA\n",
program_name);
exit(11);
}
return true;
}
static void
myexit(CdIo *cdio, int rc)
{
if (NULL != cdio)
cdio_destroy(cdio);
exit(rc);
}
int int
main(int argc, const char *argv[]) main(int argc, const char *argv[])
{ {
uint8_t buffer[CDIO_CD_FRAMESIZE_RAW] = { 0, }; uint8_t buffer[CDIO_CD_FRAMESIZE_RAW] = { 0, };
lsn_t lsn;
unsigned int blocklen=CDIO_CD_FRAMESIZE_RAW; unsigned int blocklen=CDIO_CD_FRAMESIZE_RAW;
CdIo *cdio=NULL;
program_name = strrchr(argv[0],'/');
program_name = program_name ? program_name+1 : strdup(argv[0]);
opts.debug_level = 0;
opts.start_lsn = CDIO_INVALID_LSN;
opts.read_mode = READ_MODE_UNINIT;
opts.source_image = IMAGE_UNKNOWN;
gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler); gl_default_cdio_log_handler = cdio_log_set_handler (_log_handler);
if (argc != 4) { /* Parse our arguments; every option seen by `parse_opt' will
printf("need to give 3 things: device/filename, type of read, & lsn\n"); be reflected in `arguments'. */
return 10; parse_options(argc, argv);
/* end of local declarations */
switch (opts.source_image) {
case IMAGE_UNKNOWN:
case IMAGE_AUTO:
cdio = cdio_open (source_name, DRIVER_UNKNOWN);
if (cdio==NULL) {
err_exit("%s: Error in automatically selecting driver with input\n",
program_name);
}
break;
case IMAGE_DEVICE:
cdio = cdio_open (source_name, DRIVER_DEVICE);
if (cdio==NULL) {
err_exit("%s: Error in automatically selecting device with input\n",
program_name);
}
break;
case IMAGE_BIN:
cdio = cdio_open (source_name, DRIVER_BINCUE);
if (cdio==NULL) {
err_exit("%s: Error in opeing bin/cue\n",
program_name);
}
break;
case IMAGE_CUE:
cdio = cdio_open_cue(source_name);
if (cdio==NULL) {
err_exit("%s: Error in opening cue/bin with input\n",
program_name);
}
break;
case IMAGE_NRG:
cdio = cdio_open (source_name, DRIVER_NRG);
if (cdio==NULL) {
err_exit("%s: Error in opening NRG with input\n",
program_name);
}
break;
} }
CdIo *cdio = cdio_open (argv[1], DRIVER_UNKNOWN); switch (opts.read_mode) {
case READ_AUDIO:
lsn = atoi(argv[3]); cdio_read_audio_sector(cdio, &buffer, opts.start_lsn);
switch (argv[2][0]) {
case '1':
cdio_read_audio_sector(cdio, &buffer, lsn);
break; break;
case '2': case READ_M1F1:
cdio_read_mode1_sector(cdio, &buffer, lsn, false); cdio_read_mode1_sector(cdio, &buffer, opts.start_lsn, false);
blocklen=CDIO_CD_FRAMESIZE; blocklen=CDIO_CD_FRAMESIZE;
break; break;
case '3': case READ_M1F2:
cdio_read_mode1_sector(cdio, &buffer, lsn, true); cdio_read_mode1_sector(cdio, &buffer, opts.start_lsn, true);
break; break;
case '4': case READ_M2F1:
cdio_read_mode2_sector(cdio, &buffer, lsn, false); cdio_read_mode2_sector(cdio, &buffer, opts.start_lsn, false);
break; break;
case '5': case READ_M2F2:
cdio_read_mode2_sector(cdio, &buffer, lsn, true); cdio_read_mode2_sector(cdio, &buffer, opts.start_lsn, true);
break;
case READ_MODE_UNINIT:
err_exit("%s: Reading mode not set\n", program_name);
break; break;
default:
printf("Expecting 1..5 as the second argument.\n");
return 20;
} }
hexdump(buffer, blocklen); hexdump(buffer, blocklen);

View File

@@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
#$Id: check_cd_read.sh,v 1.3 2003/09/20 00:28:32 rocky Exp $ #$Id: check_cd_read.sh,v 1.4 2003/09/21 03:35:40 rocky Exp $
# #
# Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> # Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
# #
@@ -33,14 +33,14 @@ BASE=`basename $0 .sh`
fname=cdda fname=cdda
testnum=CD-DA testnum=CD-DA
test_cd_read "${srcdir}/${fname}.cue 1 0" \ test_cd_read "-c ${srcdir}/${fname}.cue --mode=red --start=0" \
${fname}-read.dump ${srcdir}/${fname}-read.right ${fname}-read.dump ${srcdir}/${fname}-read.right
RC=$? RC=$?
check_result $RC "cd-read CUE test $testnum" check_result $RC "cd-read CUE test $testnum"
fname=isofs-m1 fname=isofs-m1
testnum=MODE1 testnum=MODE1
test_cd_read "${srcdir}/${fname}.cue 1 0" \ test_cd_read "-i ${srcdir}/${fname}.cue --mode m1f1 -s 26" \
${fname}-read.dump ${srcdir}/${fname}-read.right ${fname}-read.dump ${srcdir}/${fname}-read.right
RC=$? RC=$?
check_result $RC "cd-read CUE test $testnum" check_result $RC "cd-read CUE test $testnum"

View File

@@ -1,148 +1,129 @@
0x0000: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0000: 0909 2020 2020 474e 5520 4745 4e45 5241 .. GNU GENERA
0x0010: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0010: 4c20 5055 424c 4943 204c 4943 454e 5345 L PUBLIC LICENSE
0x0020: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0020: 0a09 0920 2020 2020 2020 5665 7273 696f ... Versio
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0030: 6e20 322c 204a 756e 6520 3139 3931 0a0a n 2, June 1991..
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0040: 2043 6f70 7972 6967 6874 2028 4329 2031 Copyright (C) 1
0x0050: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0050: 3938 392c 2031 3939 3120 4672 6565 2053 989, 1991 Free S
0x0060: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0060: 6f66 7477 6172 6520 466f 756e 6461 7469 oftware Foundati
0x0070: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0070: 6f6e 2c20 496e 632e 0a20 2020 2020 3539 on, Inc.. 59
0x0080: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0080: 2054 656d 706c 6520 506c 6163 652c 2053 Temple Place, S
0x0090: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0090: 7569 7465 2033 3330 2c20 426f 7374 6f6e uite 330, Boston
0x00a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x00a0: 2c20 4d41 2020 3032 3131 312d 3133 3037 , MA 02111-1307
0x00b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x00b0: 2020 5553 410a 2045 7665 7279 6f6e 6520 USA. Everyone
0x00c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x00c0: 6973 2070 6572 6d69 7474 6564 2074 6f20 is permitted to
0x00d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x00d0: 636f 7079 2061 6e64 2064 6973 7472 6962 copy and distrib
0x00e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x00e0: 7574 6520 7665 7262 6174 696d 2063 6f70 ute verbatim cop
0x00f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x00f0: 6965 730a 206f 6620 7468 6973 206c 6963 ies. of this lic
0x0100: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0100: 656e 7365 2064 6f63 756d 656e 742c 2062 ense document, b
0x0110: 00ff ffff ffff ffff ffff ff00 0002 0001 ................ 0x0110: 7574 2063 6861 6e67 696e 6720 6974 2069 ut changing it i
0x0120: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0120: 7320 6e6f 7420 616c 6c6f 7765 642e 0a0a s not allowed...
0x0130: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0130: 0909 0920 2020 2050 7265 616d 626c 650a ... Preamble.
0x0140: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0140: 0a20 2054 6865 206c 6963 656e 7365 7320 . The licenses
0x0150: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0150: 666f 7220 6d6f 7374 2073 6f66 7477 6172 for most softwar
0x0160: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0160: 6520 6172 6520 6465 7369 676e 6564 2074 e are designed t
0x0170: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0170: 6f20 7461 6b65 2061 7761 7920 796f 7572 o take away your
0x0180: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0180: 0a66 7265 6564 6f6d 2074 6f20 7368 6172 .freedom to shar
0x0190: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0190: 6520 616e 6420 6368 616e 6765 2069 742e e and change it.
0x01a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x01a0: 2020 4279 2063 6f6e 7472 6173 742c 2074 By contrast, t
0x01b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x01b0: 6865 2047 4e55 2047 656e 6572 616c 2050 he GNU General P
0x01c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x01c0: 7562 6c69 630a 4c69 6365 6e73 6520 6973 ublic.License is
0x01d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x01d0: 2069 6e74 656e 6465 6420 746f 2067 7561 intended to gua
0x01e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x01e0: 7261 6e74 6565 2079 6f75 7220 6672 6565 rantee your free
0x01f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x01f0: 646f 6d20 746f 2073 6861 7265 2061 6e64 dom to share and
0x0200: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0200: 2063 6861 6e67 6520 6672 6565 0a73 6f66 change free.sof
0x0210: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0210: 7477 6172 652d 2d74 6f20 6d61 6b65 2073 tware--to make s
0x0220: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0220: 7572 6520 7468 6520 736f 6674 7761 7265 ure the software
0x0230: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0230: 2069 7320 6672 6565 2066 6f72 2061 6c6c is free for all
0x0240: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0240: 2069 7473 2075 7365 7273 2e20 2054 6869 its users. Thi
0x0250: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0250: 730a 4765 6e65 7261 6c20 5075 626c 6963 s.General Public
0x0260: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0260: 204c 6963 656e 7365 2061 7070 6c69 6573 License applies
0x0270: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0270: 2074 6f20 6d6f 7374 206f 6620 7468 6520 to most of the
0x0280: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0280: 4672 6565 2053 6f66 7477 6172 650a 466f Free Software.Fo
0x0290: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0290: 756e 6461 7469 6f6e 2773 2073 6f66 7477 undation's softw
0x02a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x02a0: 6172 6520 616e 6420 746f 2061 6e79 206f are and to any o
0x02b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x02b0: 7468 6572 2070 726f 6772 616d 2077 686f ther program who
0x02c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x02c0: 7365 2061 7574 686f 7273 2063 6f6d 6d69 se authors commi
0x02d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x02d0: 7420 746f 0a75 7369 6e67 2069 742e 2020 t to.using it.
0x02e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x02e0: 2853 6f6d 6520 6f74 6865 7220 4672 6565 (Some other Free
0x02f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x02f0: 2053 6f66 7477 6172 6520 466f 756e 6461 Software Founda
0x0300: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0300: 7469 6f6e 2073 6f66 7477 6172 6520 6973 tion software is
0x0310: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0310: 2063 6f76 6572 6564 2062 790a 7468 6520 covered by.the
0x0320: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0320: 474e 5520 4c69 6272 6172 7920 4765 6e65 GNU Library Gene
0x0330: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0330: 7261 6c20 5075 626c 6963 204c 6963 656e ral Public Licen
0x0340: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0340: 7365 2069 6e73 7465 6164 2e29 2020 596f se instead.) Yo
0x0350: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0350: 7520 6361 6e20 6170 706c 7920 6974 2074 u can apply it t
0x0360: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0360: 6f0a 796f 7572 2070 726f 6772 616d 732c o.your programs,
0x0370: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0370: 2074 6f6f 2e0a 0a20 2057 6865 6e20 7765 too... When we
0x0380: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0380: 2073 7065 616b 206f 6620 6672 6565 2073 speak of free s
0x0390: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0390: 6f66 7477 6172 652c 2077 6520 6172 6520 oftware, we are
0x03a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x03a0: 7265 6665 7272 696e 6720 746f 2066 7265 referring to fre
0x03b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x03b0: 6564 6f6d 2c20 6e6f 740a 7072 6963 652e edom, not.price.
0x03c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x03c0: 2020 4f75 7220 4765 6e65 7261 6c20 5075 Our General Pu
0x03d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x03d0: 626c 6963 204c 6963 656e 7365 7320 6172 blic Licenses ar
0x03e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x03e0: 6520 6465 7369 676e 6564 2074 6f20 6d61 e designed to ma
0x03f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x03f0: 6b65 2073 7572 6520 7468 6174 2079 6f75 ke sure that you
0x0400: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0400: 0a68 6176 6520 7468 6520 6672 6565 646f .have the freedo
0x0410: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0410: 6d20 746f 2064 6973 7472 6962 7574 6520 m to distribute
0x0420: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0420: 636f 7069 6573 206f 6620 6672 6565 2073 copies of free s
0x0430: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0430: 6f66 7477 6172 6520 2861 6e64 2063 6861 oftware (and cha
0x0440: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0440: 7267 6520 666f 720a 7468 6973 2073 6572 rge for.this ser
0x0450: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0450: 7669 6365 2069 6620 796f 7520 7769 7368 vice if you wish
0x0460: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0460: 292c 2074 6861 7420 796f 7520 7265 6365 ), that you rece
0x0470: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0470: 6976 6520 736f 7572 6365 2063 6f64 6520 ive source code
0x0480: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0480: 6f72 2063 616e 2067 6574 2069 740a 6966 or can get it.if
0x0490: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0490: 2079 6f75 2077 616e 7420 6974 2c20 7468 you want it, th
0x04a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x04a0: 6174 2079 6f75 2063 616e 2063 6861 6e67 at you can chang
0x04b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x04b0: 6520 7468 6520 736f 6674 7761 7265 206f e the software o
0x04c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x04c0: 7220 7573 6520 7069 6563 6573 206f 6620 r use pieces of
0x04d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x04d0: 6974 0a69 6e20 6e65 7720 6672 6565 2070 it.in new free p
0x04e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x04e0: 726f 6772 616d 733b 2061 6e64 2074 6861 rograms; and tha
0x04f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x04f0: 7420 796f 7520 6b6e 6f77 2079 6f75 2063 t you know you c
0x0500: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0500: 616e 2064 6f20 7468 6573 6520 7468 696e an do these thin
0x0510: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0510: 6773 2e0a 0a20 2054 6f20 7072 6f74 6563 gs... To protec
0x0520: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0520: 7420 796f 7572 2072 6967 6874 732c 2077 t your rights, w
0x0530: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0530: 6520 6e65 6564 2074 6f20 6d61 6b65 2072 e need to make r
0x0540: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0540: 6573 7472 6963 7469 6f6e 7320 7468 6174 estrictions that
0x0550: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0550: 2066 6f72 6269 640a 616e 796f 6e65 2074 forbid.anyone t
0x0560: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0560: 6f20 6465 6e79 2079 6f75 2074 6865 7365 o deny you these
0x0570: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0570: 2072 6967 6874 7320 6f72 2074 6f20 6173 rights or to as
0x0580: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0580: 6b20 796f 7520 746f 2073 7572 7265 6e64 k you to surrend
0x0590: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0590: 6572 2074 6865 2072 6967 6874 732e 0a54 er the rights..T
0x05a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x05a0: 6865 7365 2072 6573 7472 6963 7469 6f6e hese restriction
0x05b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x05b0: 7320 7472 616e 736c 6174 6520 746f 2063 s translate to c
0x05c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x05c0: 6572 7461 696e 2072 6573 706f 6e73 6962 ertain responsib
0x05d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x05d0: 696c 6974 6965 7320 666f 7220 796f 7520 ilities for you
0x05e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x05e0: 6966 2079 6f75 0a64 6973 7472 6962 7574 if you.distribut
0x05f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x05f0: 6520 636f 7069 6573 206f 6620 7468 6520 e copies of the
0x0600: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0600: 736f 6674 7761 7265 2c20 6f72 2069 6620 software, or if
0x0610: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0610: 796f 7520 6d6f 6469 6679 2069 742e 0a0a you modify it...
0x0620: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0620: 2020 466f 7220 6578 616d 706c 652c 2069 For example, i
0x0630: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0630: 6620 796f 7520 6469 7374 7269 6275 7465 f you distribute
0x0640: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0640: 2063 6f70 6965 7320 6f66 2073 7563 6820 copies of such
0x0650: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0650: 6120 7072 6f67 7261 6d2c 2077 6865 7468 a program, wheth
0x0660: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0660: 6572 0a67 7261 7469 7320 6f72 2066 6f72 er.gratis or for
0x0670: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0670: 2061 2066 6565 2c20 796f 7520 6d75 7374 a fee, you must
0x0680: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0680: 2067 6976 6520 7468 6520 7265 6369 7069 give the recipi
0x0690: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0690: 656e 7473 2061 6c6c 2074 6865 2072 6967 ents all the rig
0x06a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x06a0: 6874 7320 7468 6174 0a79 6f75 2068 6176 hts that.you hav
0x06b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x06b0: 652e 2020 596f 7520 6d75 7374 206d 616b e. You must mak
0x06c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x06c0: 6520 7375 7265 2074 6861 7420 7468 6579 e sure that they
0x06d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x06d0: 2c20 746f 6f2c 2072 6563 6569 7665 206f , too, receive o
0x06e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x06e0: 7220 6361 6e20 6765 7420 7468 650a 736f r can get the.so
0x06f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x06f0: 7572 6365 2063 6f64 652e 2020 416e 6420 urce code. And
0x0700: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0700: 796f 7520 6d75 7374 2073 686f 7720 7468 you must show th
0x0710: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0710: 656d 2074 6865 7365 2074 6572 6d73 2073 em these terms s
0x0720: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0720: 6f20 7468 6579 206b 6e6f 7720 7468 6569 o they know thei
0x0730: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0730: 720a 7269 6768 7473 2e0a 0a20 2057 6520 r.rights... We
0x0740: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0740: 7072 6f74 6563 7420 796f 7572 2072 6967 protect your rig
0x0750: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0750: 6874 7320 7769 7468 2074 776f 2073 7465 hts with two ste
0x0760: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0760: 7073 3a20 2831 2920 636f 7079 7269 6768 ps: (1) copyrigh
0x0770: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0770: 7420 7468 6520 736f 6674 7761 7265 2c20 t the software,
0x0780: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0780: 616e 640a 2832 2920 6f66 6665 7220 796f and.(2) offer yo
0x0790: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0790: 7520 7468 6973 206c 6963 656e 7365 2077 u this license w
0x07a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x07a0: 6869 6368 2067 6976 6573 2079 6f75 206c hich gives you l
0x07b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x07b0: 6567 616c 2070 6572 6d69 7373 696f 6e20 egal permission
0x07c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x07c0: 746f 2063 6f70 792c 0a64 6973 7472 6962 to copy,.distrib
0x07d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x07d0: 7574 6520 616e 642f 6f72 206d 6f64 6966 ute and/or modif
0x07e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x07e0: 7920 7468 6520 736f 6674 7761 7265 2e0a y the software..
0x07f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x07f0: 0a20 2041 6c73 6f2c 2066 6f72 2065 6163 . Also, for eac
0x0800: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0810: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0820: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0830: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0840: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0850: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0860: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0870: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0880: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0890: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x08a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x08b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x08c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x08d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x08e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x08f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0900: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0910: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0920: c513 682b 0000 0000 0000 0000 00f7 00f5 ..h+............