]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-11-19 Robert Millan <rmh.grub@aybabtu.com>
authorRobert Millan <rmh@aybabtu.com>
Wed, 18 Nov 2009 23:05:59 +0000 (23:05 +0000)
committerRobert Millan <rmh@aybabtu.com>
Wed, 18 Nov 2009 23:05:59 +0000 (23:05 +0000)
        * conf/common.rmk (grub_mkisofs_SOURCES): Add `gnulib/progname.c'.
        * util/mkisofs/mkisofs.c: Include `"progname.h"'.
        (program_name): Remove.
        (main): Initialize gettext support.

        * util/mkisofs/eltorito.c: Gettexttize.
        * util/mkisofs/joliet.c: Likewise.
        * util/mkisofs/mkisofs.c: Likewise.
        * util/mkisofs/mkisofs.h: Likewise.
        * util/mkisofs/multi.c: Likewise.
        * util/mkisofs/rock.c: Likewise.
        * util/mkisofs/tree.c: Likewise.
        * util/mkisofs/write.c: Likewise.

        * po/POTFILES: Update with new files.

conf/common.rmk
po/POTFILES
util/mkisofs/eltorito.c
util/mkisofs/joliet.c
util/mkisofs/mkisofs.c
util/mkisofs/mkisofs.h
util/mkisofs/multi.c
util/mkisofs/rock.c
util/mkisofs/tree.c
util/mkisofs/write.c

index 9888ab7e05f8f8d943c57aac7bb7620cf9c7f85f..173f24b62ab6109c6d544ef1af5c760e704a9e24 100644 (file)
@@ -37,7 +37,7 @@ grub_mkisofs_SOURCES = util/mkisofs/eltorito.c                                \
        util/mkisofs/write.c                                            \
        \
        gnulib/fnmatch.c gnulib/getopt1.c gnulib/getopt.c               \
-       gnulib/error.c
+       gnulib/error.c gnulib/progname.c
 grub_mkisofs_CFLAGS = -D_FILE_OFFSET_BITS=64                           \
        -I$(srcdir)/util/mkisofs/include                                \
        -Wno-all -Werror
index d99ec5449fde6b833f151db6b1a9b98cb01313b7..240124ef4ff399ba06be383946eb7a843352da49 100644 (file)
@@ -1,2 +1,11 @@
 # List of files which contain translatable strings.
 util/i386/pc/grub-mkimage.c
+
+util/mkisofs/eltorito.c
+util/mkisofs/joliet.c
+util/mkisofs/mkisofs.c
+util/mkisofs/mkisofs.h
+util/mkisofs/multi.c
+util/mkisofs/rock.c
+util/mkisofs/tree.c
+util/mkisofs/write.c
index 91235bd6c4ba29e40f4e3088b3f409e18aa59851..05a9040d6c289485682c2e8edf6511700a701e5c 100644 (file)
@@ -93,11 +93,11 @@ void FDECL1(init_boot_catalog, const char *, path)
        }
        else 
        {
-           fprintf(stderr, "A boot catalog exists and appears corrupted.\n");
-           fprintf(stderr, "Please check the following file: %s.\n",bootpath);
-           fprintf(stderr, "This file must be removed before a bootable CD can be done.\n");
-           free(bootpath);
-           exit(1);
+         fprintf (stderr, _("A boot catalog exists and appears corrupted.\n"));
+         fprintf (stderr, _("Please check the following file: %s.\n"), bootpath);
+         fprintf (stderr, _("This file must be removed before a bootable CD can be done.\n"));
+         free (bootpath);
+         exit (1);
        }
     }
     
@@ -107,11 +107,11 @@ void FDECL1(init_boot_catalog, const char *, path)
      */
     bcat = fopen (bootpath, "wb");
     if (bcat == NULL)
-      error (1, errno, "Error creating boot catalog (%s)", bootpath);
+      error (1, errno, _("Error creating boot catalog (%s)"), bootpath);
     
     buf = (char *) e_malloc( 2048 );
     if (fwrite (buf, 1, 2048, bcat) != 2048)
-      error (1, errno, "Error writing to boot catalog (%s)", bootpath);
+      error (1, errno, _("Error writing to boot catalog (%s)"), bootpath);
     fclose (bcat);
     chmod (bootpath, S_IROTH | S_IRGRP | S_IRWXU);
 
@@ -141,8 +141,8 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
     de2 = search_tree_file(root, boot_catalog);
     if (!de2) 
     {
-       fprintf(stderr,"Uh oh, I cant find the boot catalog!\n");
-       exit(1);
+      fprintf (stderr, _("Boot catalog cannot be found!\n"));
+      exit (1);
     }
     
     set_731(boot_desc->bootcat_ptr,
@@ -155,8 +155,8 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
     de=search_tree_file(root, boot_image);
     if (!de) 
     {
-       fprintf(stderr,"Uh oh, I cant find the boot image!\n");
-       exit(1);
+      fprintf (stderr, _("Boot image cannot be found!\n"));
+      exit (1);
     } 
     
     /* 
@@ -218,12 +218,13 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
      * assume 512 bytes/sector on a bootable floppy
      */
     nsectors = ((de->size + 511) & ~(511))/512;
-    fprintf(stderr, "\nSize of boot image is %d sectors -> ", nsectors); 
+    fprintf (stderr, _("\nSize of boot image is %d sectors"), nsectors); 
+    fprintf (stderr, " -> "); 
 
     if (! use_eltorito_emul_floppy)
       {
        default_desc.boot_media[0] = EL_TORITO_MEDIA_NOEMUL;
-       fprintf (stderr, "No emulation\n");
+       fprintf (stderr, _("No emulation\n"));
       }
     else if (nsectors == 2880 ) 
       /*
@@ -231,22 +232,22 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
        */
       {
        default_desc.boot_media[0] = EL_TORITO_MEDIA_144FLOP;
-       fprintf(stderr, "Emulating a 1.44 meg floppy\n");
+       fprintf (stderr, _("Emulating a 1.44 meg floppy\n"));
       }
     else if (nsectors == 5760 ) 
       {
        default_desc.boot_media[0] = EL_TORITO_MEDIA_288FLOP;
-       fprintf(stderr,"Emulating a 2.88 meg floppy\n");
+       fprintf (stderr, _("Emulating a 2.88 meg floppy\n"));
       }
     else if (nsectors == 2400 ) 
       {
        default_desc.boot_media[0] = EL_TORITO_MEDIA_12FLOP;
-       fprintf(stderr,"Emulating a 1.2 meg floppy\n");
+       fprintf (stderr, _("Emulating a 1.2 meg floppy\n"));
       }
     else 
       {
-       fprintf(stderr,"\nError - boot image is not the an allowable size.\n");
-       exit(1);
+       fprintf (stderr, _("\nError - boot image is not the an allowable size.\n"));
+       exit (1);
       }
     
     /* 
@@ -265,15 +266,15 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
      */
     bootcat = fopen (de2->whole_name, "r+b");
     if (bootcat == NULL) 
-      error (1, errno, "Error opening boot catalog for update");
+      error (1, errno, _("Error opening boot catalog for update"));
 
     /* 
      * write out 
      */
     if (fwrite (&valid_desc, 1, 32, bootcat) != 32)
-      error (1, errno, "Error writing to boot catalog");
+      error (1, errno, _("Error writing to boot catalog"));
     if (fwrite (&default_desc, 1, 32, bootcat) != 32)
-      error (1, errno, "Error writing to boot catalog");
+      error (1, errno, _("Error writing to boot catalog"));
     fclose (bootcat);
 
     /* If the user has asked for it, patch the boot image */
@@ -287,7 +288,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
        struct eltorito_boot_info bi_table;
        bootimage = fopen (de->whole_name, "r+b");
        if (bootimage == NULL)
-         error (1, errno, "Error opening boot image file '%s' for update",
+         error (1, errno, _("Error opening boot image file '%s' for update"),
                 de->whole_name);
        /* Compute checksum of boot image, sans 64 bytes */
        total_len = 0;
@@ -295,7 +296,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
        while ((len = fread (csum_buffer, 1, SECTOR_SIZE, bootimage)) > 0)
          {
            if (total_len & 3)
-             error (1, 0, "Odd alignment at non-end-of-file in boot image '%s'",
+             error (1, 0, _("Odd alignment at non-end-of-file in boot image '%s'"),
                     de->whole_name);
            if (total_len < 64)
              memset (csum_buffer, 0, 64 - total_len);
@@ -307,7 +308,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
          }
 
        if (total_len != de->size)
-         error (1, 0, "Boot image file '%s' changed underneath us",
+         error (1, 0, _("Boot image file '%s' changed unexpectedly"),
                 de->whole_name);
        /* End of file, set position to byte 8 */
        fseeko (bootimage, (off_t) 8, SEEK_SET);
@@ -319,7 +320,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
        set_731 (bi_table.file_checksum, bi_checksum);
 
        if (fwrite (&bi_table, 1, sizeof (bi_table), bootimage) != sizeof (bi_table))
-         error (1, errno, "Error writing to boot image (%s)", bootimage);
+         error (1, errno, _("Error writing to boot image (%s)"), bootimage);
        fclose (bootimage);
       }
 
index 505a54bc76bb58d775bb92ffd97e80c71fc91b49..736037df9605266397fb4a510f304bcdae97dedf 100644 (file)
@@ -356,9 +356,9 @@ static int generate_joliet_path_tables()
 
   if( next_jpath_index > 0xffff )
   {
-      fprintf(stderr, "Unable to generate sane path tables - too many directories (%d)\n",
-             next_jpath_index);
-      exit(1);
+      fprintf (stderr, _("Unable to generate sane path tables - too many directories (%d)\n"),
+              next_jpath_index);
+      exit (1);
   }
   /*
    * Now start filling in the path tables.  Start with root directory 
@@ -395,8 +395,8 @@ static int generate_joliet_path_tables()
        dpnt = jpathlist[j];
        if(!dpnt)
        {
-           fprintf(stderr,"Entry %d not in path tables\n", j);
-           exit(1);
+           fprintf (stderr, _("Entry %d not in path tables\n"), j);
+           exit (1);
        }
        npnt = dpnt->de_name;
        
@@ -409,8 +409,8 @@ static int generate_joliet_path_tables()
        de = dpnt->self;
        if(!de) 
        {
-           fprintf(stderr,"Fatal goof - directory has amnesia\n"); 
-           exit(1);
+           fprintf (stderr, _("Fatal goof - directory has amnesia\n")); 
+           exit (1);
        }
        
        namelen = joliet_strlen(de->name);
@@ -475,7 +475,7 @@ static int generate_joliet_path_tables()
   free(jpathlist);
   if(jpath_table_index != jpath_table_size)
   {
-       fprintf(stderr,"Joliet path table lengths do not match %d %d\n",
+       fprintf(stderr, _("Joliet path table lengths do not match %d %d\n"),
               jpath_table_index,
               jpath_table_size);
   }
@@ -527,8 +527,8 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
                     /*
                      * We got trouble.
                      */
-                    fprintf(stderr, "Unable to locate relocated directory\n");
-                    exit(1);
+                    fprintf (stderr, _("Unable to locate relocated directory\n"));
+                    exit (1);
                 }
             }
             else
@@ -602,7 +602,8 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
                         finddir = finddir->next;
                         if(!finddir) 
                         {
-                            fprintf(stderr,"Fatal goof - unable to find directory location\n"); exit(1);
+                            fprintf (stderr, _("Fatal goof - unable to find directory location\n"));
+                            exit (1);
                         }
                     }
                     set_733((char *) jrec.extent, finddir->jextent);
@@ -650,8 +651,8 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
      
      if(dpnt->jsize != dir_index)
      {
-        fprintf(stderr,"Unexpected joliet directory length %d %d %s\n",dpnt->jsize, 
-                dir_index, dpnt->de_name);
+        fprintf (stderr, _("Unexpected joliet directory length %d %d %s\n"),
+                 dpnt->jsize, dir_index, dpnt->de_name);
      }
      
      xfwrite(directory_buffer, 1, total_size, outfile);
index 1f55703cb08b496b75a3949961d3cc57ab21b6ff..4ce69e035fbca30eeab6aa83f60e4130d37c3592 100644 (file)
@@ -22,8 +22,6 @@
    along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-const char *program_name = "grub-mkisofs";
-
 #include <errno.h>
 #include "config.h"
 #include "mkisofs.h"
@@ -66,6 +64,8 @@ struct directory * root = NULL;
 
 static char version_string[] = "mkisofs 1.12b5";
 
+#include "progname.h"
+
 char * outfile;
 FILE * discimage;
 uint64_t next_extent = 0;
@@ -370,7 +370,7 @@ void FDECL1(read_rcfile, char *, appname)
     return;
   if ( verbose > 0 )
     {
-      fprintf(stderr, "Using \"%s\"\n", filename);
+      fprintf (stderr, _("Using \"%s\"\n"), filename);
     }
 
   /* OK, we got it.  Now read in the lines and parse them */
@@ -398,7 +398,7 @@ void FDECL1(read_rcfile, char *, appname)
        }
       if (name == pnt)
        {
-         fprintf(stderr, "%s:%d: name required\n", filename, linum);
+         fprintf(stderr, _("%s:%d: name required\n"), filename, linum);
          continue;
        }
       name_end = pnt;
@@ -408,7 +408,7 @@ void FDECL1(read_rcfile, char *, appname)
       /* silently ignore errors in the rc file. */
       if (*pnt != '=')
        {
-         fprintf(stderr, "%s:%d: equals sign required\n", filename, linum);
+         fprintf (stderr, _("%s:%d: equals sign required\n"), filename, linum);
          continue;
        }
       /* Skip pas the = sign, and any white space following it */
@@ -442,8 +442,8 @@ void FDECL1(read_rcfile, char *, appname)
       }
       if (rco->tag == NULL)
        {
-         fprintf(stderr, "%s:%d: field name \"%s\" unknown\n", filename, linum,
-                 name);
+         fprintf (stderr, _("%s:%d: field name \"%s\" unknown\n"), filename, linum,
+                            name);
        }
      }
   if (ferror(rcfile))
@@ -471,9 +471,9 @@ void usage(){
   unsigned int i;
 /*  const char **targets, **pp;*/
 
-  printf ("Usage: %s [options] file...\n", program_name);
+  printf (_("Usage: %s [options] file...\n"), program_name);
 
-  printf ("Options:\n");
+  printf (_("Options:\n"));
   for (i = 0; i < OPTION_COUNT; i++)
     {
       if (ld_options[i].doc != NULL)
@@ -632,6 +632,11 @@ int FDECL2(main, int, argc, char **, argv){
   int c;
   char *log_file = 0;
 
+  set_program_name (argv[0]);
+  setlocale (LC_ALL, "");
+  bindtextdomain (PACKAGE, LOCALEDIR);
+  textdomain (PACKAGE);
+
   if (argc < 2)
     usage();
 
@@ -698,7 +703,7 @@ int FDECL2(main, int, argc, char **, argv){
        cdwrite_data = optarg;
        break;
       case 'i':
-       fprintf(stderr, "-i option no longer supported.\n");
+       fprintf (stderr, _("-i option no longer supported.\n"));
        exit(1);
        break;
       case 'J':
@@ -710,55 +715,61 @@ int FDECL2(main, int, argc, char **, argv){
       case 'b':
        use_eltorito++;
        boot_image = optarg;  /* pathname of the boot image on cd */
-       if (boot_image == NULL) {
-               fprintf(stderr,"Required boot image pathname missing\n");
-               exit(1);
-       }
+       if (boot_image == NULL)
+         {
+           fprintf (stderr, _("Required boot image pathname missing\n"));
+           exit (1);
+         }
        break;
       case 'c':
        use_eltorito++;
        boot_catalog = optarg;  /* pathname of the boot image on cd */
-       if (boot_catalog == NULL) {
-               fprintf(stderr,"Required boot catalog pathname missing\n");
-               exit(1);
-       }
+       if (boot_catalog == NULL)
+         {
+           fprintf (stderr, _("Required boot catalog pathname missing\n"));
+           exit (1);
+         }
        break;
       case OPTION_BOOT_INFO_TABLE:
        use_boot_info_table = 1;
        break;
       case OPTION_NO_EMUL_BOOT:
-       fprintf (stderr, "Ignoring -no-emul-boot (no-emulation is the default behaviour)\n");
+       fprintf (stderr, _("Ignoring -no-emul-boot (no-emulation is the default behaviour)\n"));
        break;
       case OPTION_ELTORITO_EMUL_FLOPPY:
        use_eltorito_emul_floppy = 1;
        break;
       case OPTION_ABSTRACT:
        abstract = optarg;
-       if(strlen(abstract) > 37) {
-               fprintf(stderr,"Abstract filename string too long\n");
-               exit(1);
-       };
+       if(strlen(abstract) > 37)
+         {
+           fprintf (stderr, _("Abstract filename string too long\n"));
+           exit (1);
+         };
        break;
       case 'A':
        appid = optarg;
-       if(strlen(appid) > 128) {
-               fprintf(stderr,"Application-id string too long\n");
-               exit(1);
-       };
+       if(strlen(appid) > 128)
+         {
+           fprintf (stderr, _("Application-id string too long\n"));
+           exit (1);
+         };
        break;
       case OPTION_BIBLIO:
        biblio = optarg;
-       if(strlen(biblio) > 37) {
-               fprintf(stderr,"Bibliographic filename string too long\n");
-               exit(1);
-       };
+       if(strlen(biblio) > 37)
+         {
+           fprintf (stderr, _("Bibliographic filename string too long\n"));
+           exit (1);
+         };
        break;
       case OPTION_COPYRIGHT:
        copyright = optarg;
-       if(strlen(copyright) > 37) {
-               fprintf(stderr,"Copyright filename string too long\n");
-               exit(1);
-       };
+       if(strlen(copyright) > 37)
+         {
+           fprintf (stderr, _("Copyright filename string too long\n"));
+           exit (1);
+         };
        break;
       case 'd':
        omit_period++;
@@ -789,20 +800,22 @@ int FDECL2(main, int, argc, char **, argv){
        break;
       case 'p':
        preparer = optarg;
-       if(strlen(preparer) > 128) {
-               fprintf(stderr,"Preparer string too long\n");
-               exit(1);
-       };
+       if(strlen(preparer) > 128)
+         {
+           fprintf (stderr, _("Preparer string too long\n"));
+           exit (1);
+         };
        break;
       case OPTION_PRINT_SIZE:
        print_size++;
        break;
       case 'P':
        publisher = optarg;
-       if(strlen(publisher) > 128) {
-               fprintf(stderr,"Publisher string too long\n");
-               exit(1);
-       };
+       if(strlen(publisher) > 128)
+         {
+           fprintf (stderr, _("Publisher string too long\n"));
+           exit (1);
+         };
        break;
       case OPTION_QUIET:
        verbose = 0;
@@ -819,48 +832,47 @@ int FDECL2(main, int, argc, char **, argv){
        break;
       case OPTION_SYSID:
        system_id = optarg;
-       if(strlen(system_id) > 32) {
-               fprintf(stderr,"System ID string too long\n");
-               exit(1);
-       };
+       if(strlen(system_id) > 32)
+         {
+           fprintf (stderr, _("System ID string too long\n"));
+           exit (1);
+         };
        break;
       case 'T':
        generate_tables++;
        break;
       case 'V':
        volume_id = optarg;
-       if(strlen(volume_id) > 32) {
-               fprintf(stderr,"Volume ID string too long\n");
-               exit(1);
-       };
+       if(strlen(volume_id) > 32)
+         {
+           fprintf (stderr, _("Volume ID string too long\n"));
+           exit (1);
+         };
        break;
       case OPTION_VOLSET:
        volset_id = optarg;
-       if(strlen(volset_id) > 128) {
-               fprintf(stderr,"Volume set ID string too long\n");
-               exit(1);
-       };
+       if(strlen(volset_id) > 128)
+         {
+           fprintf (stderr, _("Volume set ID string too long\n"));
+           exit (1);
+         };
        break;
       case OPTION_VOLSET_SIZE:
        volume_set_size = atoi(optarg);
        break;
       case OPTION_VOLSET_SEQ_NUM:
        volume_sequence_number = atoi(optarg);
-       if (volume_sequence_number > volume_set_size) {
-               fprintf(stderr,"Volume set sequence number too big\n");
-               exit(1);
-       }
+       if (volume_sequence_number > volume_set_size)
+         {
+           fprintf (stderr, _("Volume set sequence number too big\n"));
+           exit (1);
+         }
        break;
       case 'v':
        verbose++;
        break;
       case 'z':
-#ifdef VMS
-       fprintf(stderr,"Transparent compression not supported with VMS\n");
-       exit(1);
-#else
        transparent_compression++;
-#endif
        break;
       case 'x':
       case 'm':
@@ -892,37 +904,41 @@ int FDECL2(main, int, argc, char **, argv){
        split_SL_field = 0;
        break;
       case OPTION_CREAT_DATE:
-       if (strlen (optarg) != 16) {
-         fprintf (stderr, "date string must be 16 characters.\n");
-         exit (1);
-       }
+       if (strlen (optarg) != 16)
+         {
+           fprintf (stderr, _("date string must be 16 characters.\n"));
+           exit (1);
+         }
        if (creation_date)
          free(creation_date);
        creation_date = strdup(optarg);
        break;
       case OPTION_MODIF_DATE:
-       if (strlen (optarg) != 16) {
-         fprintf (stderr, "date string must be 16 characters.\n");
-         exit (1);
-       }
+       if (strlen (optarg) != 16)
+         {
+           fprintf (stderr, _("date string must be 16 characters.\n"));
+           exit (1);
+         }
        if (modification_date)
          free(modification_date);
        modification_date = strdup(optarg);
        break;
       case OPTION_EXPIR_DATE:
-       if (strlen (optarg) != 16) {
-         fprintf (stderr, "date string must be 16 characters.\n");
-         exit (1);
-       }
+       if (strlen (optarg) != 16)
+         {
+           fprintf (stderr, _("date string must be 16 characters.\n"));
+           exit (1);
+         }
        if (expiration_date)
          free(expiration_date);
        expiration_date = strdup(optarg);
        break;
       case OPTION_EFFEC_DATE:
-       if (strlen (optarg) != 16) {
-         fprintf (stderr, "date string must be 16 characters.\n");
-         exit (1);
-       }
+       if (strlen (optarg) != 16)
+         {
+           fprintf (stderr, _("date string must be 16 characters.\n"));
+           exit (1);
+         }
        if (effective_date)
          free(effective_date);
        effective_date = strdup(optarg);
@@ -939,11 +955,11 @@ parse_input_files:
        int resource;
     struct rlimit rlp;
        if (getrlimit(RLIMIT_DATA,&rlp) == -1) 
-               perror("Warning: getrlimit");
+               perror (_("Warning: getrlimit"));
        else {
                rlp.rlim_cur=33554432;
                if (setrlimit(RLIMIT_DATA,&rlp) == -1)
-                       perror("Warning: setrlimit");
+                       perror (_("Warning: setrlimit"));
                }
        }
 #endif
@@ -959,13 +975,13 @@ parse_input_files:
 
   if(cdwrite_data == NULL && merge_image != NULL)
     {
-      fprintf(stderr,"Multisession usage bug: Must specify -C if -M is used.\n");
-      exit(0);
+      fprintf (stderr, _("Multisession usage bug: Must specify -C if -M is used.\n"));
+      exit (0);
     }
 
   if(cdwrite_data != NULL && merge_image == NULL)
     {
-      fprintf(stderr,"Warning: -C specified without -M: old session data will not be merged.\n");
+      fprintf (stderr, _("Warning: -C specified without -M: old session data will not be merged.\n"));
     }
 
   /*  The first step is to scan the directory tree, and take some notes */
@@ -1003,21 +1019,17 @@ parse_input_files:
     int i;
 
     /* open log file - test that we can open OK */
-    if ((lfp = fopen(log_file, "w")) == NULL) {
-      fprintf(stderr,"can't open logfile: %s\n", log_file);
-      exit (1);
-    }
+    if ((lfp = fopen(log_file, "w")) == NULL)
+      error (1, errno, _("can't open logfile: %s"), log_file);
     fclose(lfp);
 
     /* redirect all stderr message to log_file */
-    fprintf(stderr, "re-directing all messages to %s\n", 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) {
-      fprintf(stderr,"can't open logfile: %s\n", log_file);
-      exit (1);
-    }
+    if (freopen(log_file, "w", stderr) == NULL)
+      error (1, errno, _("can't open logfile: %s\n"), log_file);
     if(verbose > 1) {
       for (i=0;i<argc;i++)
        fprintf(stderr,"%s ", argv[i]);
@@ -1058,9 +1070,8 @@ parse_input_files:
          /*
           * Complain and die.
           */
-         fprintf(stderr,"Unable to open previous session image %s\n",
-                 merge_image);
-         exit(1);
+         error (1, 0, _("Unable to open previous session image %s\n"),
+                merge_image);
        }
 
       memcpy(&de.isorec.extent, mrootp->extent, 8);      
@@ -1170,8 +1181,7 @@ parse_input_files:
           * This is a fatal error - the user won't be getting what
           * they want if we were to proceed.
           */
-         fprintf(stderr, "Invalid node - %s\n", node);
-         exit(1);
+         error (1, 0, _("Invalid node - %s\n"), node);
        }
       else
        {
@@ -1233,10 +1243,7 @@ parse_input_files:
     }
 
   if (goof)
-    {
-      fprintf(stderr, "Joliet tree sort failed.\n");
-      exit(1);
-    }
+    error (1, 0, _("Joliet tree sort failed.\n"));
   
   /*
    * Fix a couple of things in the root directory so that everything
@@ -1250,17 +1257,12 @@ parse_input_files:
    */
   if (print_size){
          discimage = fopen("/dev/null", "wb");
-         if (!discimage){
-                 fprintf(stderr,"Unable to open /dev/null\n");
-                 exit(1);
-         }
+         if (!discimage)
+           error (1, errno, _("Unable to open /dev/null\n"));
   } else if (outfile){
          discimage = fopen(outfile, "wb");
-         if (!discimage){
-                 fprintf(stderr,"Unable to open disc image file\n");
-                 exit(1);
-
-         };
+         if (!discimage)
+           error (1, errno, _("Unable to open disc image file\n"));
   } else {
          discimage =  stdout;
 
@@ -1382,10 +1384,10 @@ parse_input_files:
   if( verbose > 0 )
     {
 #ifdef HAVE_SBRK
-      fprintf(stderr,"Max brk space used %x\n"
-             (unsigned int)(((unsigned long)sbrk(0)) - mem_start));
+      fprintf (stderr, _("Max brk space used %x\n")
+              (unsigned int)(((unsigned long)sbrk(0)) - mem_start));
 #endif
-      fprintf (stderr, "%llu extents written (%llu MiB)\n", last_extent, last_extent >> 9);
+      fprintf (stderr, _("%llu extents written (%llu MiB)\n"), last_extent, last_extent >> 9);
     }
 
 #ifdef VMS
@@ -1398,10 +1400,8 @@ parse_input_files:
 void *
 FDECL1(e_malloc, size_t, size)
 {
-void* pt = 0;
-       if( (size > 0) && ((pt=malloc(size))==NULL) ) {
-               fprintf(stderr, "Not enough memory\n");
-               exit (1);
-               }
+  void* pt = 0;
+  if( (size > 0) && ((pt = malloc (size)) == NULL))
+    error (1, errno, "malloc");
 return pt;
 }
index cd818cc2ff406f4c62fb3f1ea91c295749b0e052..720baa7e68437f0ab12ff10436f0e4bd19e71eb5 100644 (file)
 #include <prototyp.h>
 #include <sys/stat.h>
 
+#include <locale.h>
+#include <libintl.h>
+#define _(str) gettext(str)
+
 /* This symbol is used to indicate that we do not have things like
    symlinks, devices, and so forth available.  Just files and dirs */
 
index ef9afa9c1ba65e6c96e93c8883b4745ff8f77054..1e7f62aace098a938c2207c81b8f5f3c00d214dc 100644 (file)
@@ -4,9 +4,11 @@
  *
  * Written by Eric Youngdale (1996).
  *
+ * Copyright (C) 2009  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)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * 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.  
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-static char rcsid[] ="$Id: multi.c,v 1.14 1999/03/02 04:16:41 eric Exp $";
-
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
@@ -158,10 +157,8 @@ readsecs(startsecno, buffer, sectorcount)
 {
        int     f = fileno(in_image);
 
-       if (lseek(f, (off_t)startsecno * SECTOR_SIZE, 0) == (off_t)-1) {
-               fprintf(stderr," Seek error on old image\n");
-               exit(10);
-       }
+       if (lseek(f, (off_t)startsecno * SECTOR_SIZE, 0) == (off_t)-1)
+         error (10, errno, _("Seek error on old image\n"));
        return (read(f, buffer, sectorcount * SECTOR_SIZE));
 }
 #endif
@@ -179,7 +176,7 @@ FDECL3(parse_rr, unsigned char *, pnt, int, len, struct directory_entry *,dpnt)
 
        while(len >= 4){
                if(pnt[3] != 1) {
-                 fprintf(stderr,"**BAD RRVERSION");
+                 fprintf (stderr, _("**Bad RR version attribute"));
                  return -1;
                };
                if(strncmp((char *) pnt, "NM", 2) == 0) {
@@ -250,7 +247,7 @@ FDECL4(check_rr_dates, struct directory_entry *, dpnt,
         */
        while(len >= 4){
                if(pnt[3] != 1) {
-                 fprintf(stderr,"**BAD RRVERSION");
+                 fprintf (stderr, _("**Bad RR version attribute"));
                  return -1;
                };
 
@@ -546,9 +543,9 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
        * Warn the user that iso (8.3) 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 (8.3) file names have been used instead.\n");
+      fprintf (stderr, _("Warning: Neither Rock Ridge (-R) nor TRANS.TBL (-T) "
+                        "name translations were found on previous session. "
+                        "ISO (8.3) file names have been used instead.\n"));
       warning_given = 1;
     }
 
@@ -764,10 +761,7 @@ struct iso_directory_record * FDECL1(merge_isofs, char *, path)
     {
       if (readsecs(file_addr/SECTOR_SIZE, &buffer,
                   sizeof(buffer)/SECTOR_SIZE) != sizeof(buffer))
-       {
-         fprintf(stderr," Read error on old image %s\n", path);
-         exit(10);
-       }
+       error (10, errno, _("Read error on old image %s\n"), path);
 
       vdp = (struct iso_volume_descriptor *)buffer;
 
@@ -928,7 +922,7 @@ void FDECL3(merge_remaining_entries, struct directory *, this_dir,
     {
       if( strcmp(s_entry->name, "<translation table>") == 0)
        {
-         fprintf(stderr,"Should never get here\n");
+         fprintf (stderr, "Should never get here\n");
          set_733(s_entry->isorec.extent, ttbl_extent);
          return;
        }
@@ -1087,20 +1081,14 @@ FDECL1(get_session_start, int *, file_addr)
 #else
 
   if( cdwrite_data == NULL )
-    {
-      fprintf(stderr,"Special parameters for cdwrite not specified with -C\n");
-      exit(1);
-    }
+    error (1, 0, _("Special parameters for cdwrite not specified with -C\n"));
 
   /*
    * Next try and find the ',' in there which delimits the two numbers.
    */
   pnt = strchr(cdwrite_data, ',');
   if( pnt == NULL )
-    {
-      fprintf(stderr, "Malformed cdwrite parameters\n");
-      exit(1);
-    }
+    error (1, 0, _("Malformed cdwrite parameters\n"));
 
   *pnt = '\0';
   if (file_addr != NULL) {
index b3b109a2a117707dfb06007cd88647defdf2edec..224488af5714890c2b17d872cd9acdf1d247ca8a 100644 (file)
@@ -306,7 +306,7 @@ int deep_opt;
             * 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);
+           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();
      }
@@ -514,7 +514,7 @@ int deep_opt;
     zipfile = fopen(checkname, "rb");
     if(zipfile) {
       OK_flag = 0;
-      fprintf(stderr,"Unable to insert transparent compressed file - name conflict\n");
+      fprintf (stderr, _("Unable to insert transparent compressed file - name conflict\n"));
       fclose(zipfile);
     }
 
@@ -587,10 +587,8 @@ char * FDECL4(generate_rr_extension_record, char *, id,  char  *, descriptor,
   memcpy(Rock  + lipnt, source, len_src);
   lipnt += len_src;
 
-  if(lipnt  > SECTOR_SIZE) {
-         fprintf(stderr,"Extension record too  long\n");
-         exit(1);
-  };
+  if(lipnt  > SECTOR_SIZE)
+    error (1, 0, _("Extension record too long\n"));
   pnt = (char *) e_malloc(SECTOR_SIZE);
   memset(pnt, 0,  SECTOR_SIZE);
   memcpy(pnt, Rock, lipnt);
index d2abda2580f913fdc5200a22629c183b55240129..d11fdc2cde928e89b9738a54f404d86d37ecb13f 100644 (file)
@@ -223,10 +223,7 @@ static int FDECL1(sort_n_finish, struct directory *, this_dir)
        }
          
       if(s_entry1 == s_entry)
-       {
-         fprintf(stderr,"Fatal goof\n");
-         exit(1);
-       }
+       error (1, 0, _("Fatal goof\n"));
       
       /* 
        * OK, handle the conflicts.  Try substitute names until we come
@@ -284,8 +281,7 @@ static int FDECL1(sort_n_finish, struct directory *, this_dir)
       /*
        * If we fell off the bottom here, we were in real trouble.
        */
-      fprintf(stderr,"Unable to  generate unique  name for file %s\n", s_entry->name);
-      exit(1);
+      error (1, 0, _("Unable to  generate unique  name for file %s\n"), s_entry->name);
 
 got_valid_name:      
       /* 
@@ -296,9 +292,9 @@ got_valid_name:
        {
          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);
+             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 =  sizeof(struct iso_directory_record) -
@@ -318,7 +314,7 @@ got_valid_name:
          delete_file_hash(s_entry1);
          if( verbose > 0 )
            {
-             fprintf(stderr,"Using %s for  %s%s%s (%s)\n", newname,  
+             fprintf(stderr, _("Using %s for %s%s%s (%s)\n"), newname,  
                      this_dir->whole_name, SPATH_SEPARATOR, 
                      s_entry1->name, s_entry->name);
            }
@@ -442,19 +438,16 @@ got_valid_name:
       if (new_reclen & 1) new_reclen++;
       
       if(new_reclen > 0xff) 
-       {
-         fprintf(stderr,"Fatal error - RR overflow for file %s\n",
-                 s_entry->name);
-         exit(1);
-       }
+       error (1, 0, _("Fatal error - RR overflow for file %s\n"),
+              s_entry->name);
       s_entry->isorec.length[0] = new_reclen;
     }
 
   status = sort_directory(&this_dir->contents);
   if( status > 0 )
     {
-      fprintf(stderr, "Unable to sort directory %s\n", 
-             this_dir->whole_name);
+      fprintf (stderr, _("Unable to sort directory %s\n"),
+                       this_dir->whole_name);
     }
 
   /*
@@ -483,12 +476,9 @@ got_valid_name:
        s_entry->table = NULL;
       }
 
-      if(count !=  tablesize) 
-       {
-         fprintf(stderr,"Translation table size mismatch %d %d\n",
-                 count, tablesize);
-         exit(1);
-       }
+      if(count != tablesize) 
+       error (1, 0, _("Translation table size mismatch %d %d\n"),
+              count, tablesize);
     }
 
   /* 
@@ -752,10 +742,8 @@ void finish_cl_pl_entries(){
                  if(d_entry->self == s_entry) break;
                  d_entry = d_entry->next;
          };
-         if(!d_entry){
-                 fprintf(stderr,"Unable to locate directory parent\n");
-                 exit(1);
-         };
+         if(!d_entry)
+           error (1, 0, _("Unable to locate directory parent\n"));
 
          /* First fix the PL pointer in the directory in the rr_reloc dir */
          s_entry1 = d_entry->contents->next;
@@ -805,7 +793,7 @@ FDECL3(scan_directory_tree,struct directory *, this_dir,
 
     if (verbose > 1)
     {
-      fprintf(stderr, "Scanning %s\n", path);
+      fprintf (stderr, _("Scanning %s\n"), path);
     }
 
   current_dir = opendir(path);
@@ -820,7 +808,7 @@ FDECL3(scan_directory_tree,struct directory *, this_dir,
 
   if(!current_dir || !d_entry) 
     {
-      fprintf(stderr,"Unable to open directory %s\n", path);
+      fprintf (stderr, _("Unable to open directory %s\n"), path);
       de->isorec.flags[0] &= ~2; /* Mark as not a directory */
       if(current_dir) closedir(current_dir);
       return 0;
@@ -865,16 +853,14 @@ FDECL3(scan_directory_tree,struct directory *, this_dir,
              {
                if( verbose > 0 )
                  {
-                   fprintf(stderr, "Ignoring file %s\n", d_entry->d_name);
+                   fprintf (stderr, _("Ignoring file %s\n"), d_entry->d_name);
                  }
                continue;
              }
     }
 
-    if(strlen(path)+strlen(d_entry->d_name) + 2 > sizeof(whole_path)){
-      fprintf(stderr, "Overflow of stat buffer\n");
-      exit(1);
-    };
+    if(strlen(path)+strlen(d_entry->d_name) + 2 > sizeof(whole_path))
+      error (1, 0, _("Overflow of stat buffer\n"));
 
     /* Generate the complete ASCII path for this file */
     strcpy(whole_path, path);
@@ -887,7 +873,7 @@ FDECL3(scan_directory_tree,struct directory *, this_dir,
     /** 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);
+       fprintf (stderr, _("Excluded by match: %s\n"), whole_path);
       }
       continue;
     }
@@ -902,7 +888,7 @@ FDECL3(scan_directory_tree,struct directory *, this_dir,
         */
        if (verbose > 1) 
          {
-           fprintf(stderr, "Excluded: %s\n",whole_path);
+           fprintf (stderr, _("Excluded: %s\n"), whole_path);
          }
        continue;
       }
@@ -972,7 +958,7 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
        * This means that the file doesn't exist, or isn't accessible.
        * Sometimes this is because of NFS permissions problems.
        */
-      fprintf(stderr, "Non-existant or inaccessible: %s\n",whole_path);
+      fprintf (stderr, _("Non-existant or inaccessible: %s\n"),whole_path);
       return 0;
     }
   
@@ -1007,15 +993,15 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
            } else {
              if(follow_links) 
                {
-                 fprintf(stderr,
-                         "Unable to stat file %s - ignoring and continuing.\n",
-                         whole_path);
+                 fprintf (stderr,
+                          _("Unable to stat file %s - ignoring and continuing.\n"),
+                          whole_path);
                }
              else
                {
-                 fprintf(stderr,
-                         "Symlink %s ignored - continuing.\n",
-                         whole_path);
+                 fprintf (stderr,
+                          _("Symlink %s ignored - continuing.\n"),
+                          whole_path);
                  return 0;  /* Non Rock Ridge discs - ignore all symlinks */
                }
            }
@@ -1039,8 +1025,8 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
                {
                  if(!use_RockRidge) 
                    {
-                     fprintf(stderr, "Already cached directory seen (%s)\n", 
-                             whole_path);
+                     fprintf (stderr, _("Already cached directory seen (%s)\n"),
+                              whole_path);
                      return 0;
                    }
                  statbuf.st_size = 0;
@@ -1078,19 +1064,11 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
     {
       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)))
     {
-      fprintf(stderr, "File %s is not readable (errno = %d) - ignoring\n", 
-             whole_path, errno);
+      fprintf (stderr, _("File %s is not readable (%s) - ignoring\n"),
+              whole_path, strerror (errno));
       return 0;
     }
   
@@ -1101,12 +1079,10 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
        && strcmp(short_name, ".") 
        && strcmp(short_name, "..") ) 
     {
-      if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) {
-       fprintf(stderr,"Directory loop - fatal goof (%s %lx %lu).\n",
-               whole_path, (unsigned long) statbuf.st_dev,
-               (unsigned long) STAT_INODE(statbuf));
-       exit(1);
-      }
+      if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)))
+       error (1, 0, _("Directory loop - fatal goof (%s %lx %lu).\n"),
+              whole_path, (unsigned long) statbuf.st_dev,
+              (unsigned long) STAT_INODE(statbuf));
       add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf));
     }
   
@@ -1114,8 +1090,8 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
       !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)) {
-    fprintf(stderr,"Unknown file type %s - ignoring and continuing.\n",
-           whole_path);
+    fprintf (stderr, _("Unknown file type %s - ignoring and continuing.\n"),
+            whole_path);
     return 0;
   }
   
@@ -1123,9 +1099,9 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
   
   if(status) 
     {
-      fprintf(stderr,
-             "Unable to stat file %s - ignoring and continuing.\n",
-             whole_path);
+      fprintf (stderr,
+              _("Unable to stat file %s - ignoring and continuing.\n"),
+              whole_path);
       return 0; 
     }
   
@@ -1200,7 +1176,7 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
   else if (strcmp(short_name,".") && strcmp(short_name,"..")) {
     if (i_matches(short_name) || i_matches(whole_path)) {
       if (verbose > 1) {
-       fprintf(stderr, "Hidden from ISO9660 tree: %s\n", whole_path);
+       fprintf (stderr, _("Hidden from ISO9660 tree: %s\n"), whole_path);
       }
       s_entry->de_flags |= INHIBIT_ISO9660_ENTRY;
     }
@@ -1212,7 +1188,7 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
   else if (strcmp(short_name,".") && strcmp(short_name,"..")) {
     if (j_matches(short_name) || j_matches(whole_path)) {
       if (verbose > 1) {
-       fprintf(stderr, "Hidden from Joliet tree: %s\n", whole_path);
+       fprintf (stderr, _("Hidden from Joliet tree: %s\n"), whole_path);
       }
       s_entry->de_flags |= INHIBIT_JOLIET_ENTRY;
     }
@@ -1621,10 +1597,7 @@ struct directory * FDECL4(find_or_create_directory, struct directory *, parent,
       fprintf(stderr,"%s(%d) ", path, dpnt->depth);
 #endif
       if(parent->depth > RR_relocation_depth) 
-       {
-         fprintf(stderr,"Directories too deep  %s\n", path);
-         exit(1);
-       }
+       error (1, 0, _("Directories too deep  %s\n"), path);
       
       dpnt->parent = parent; 
       dpnt->depth = parent->depth + 1;
@@ -1656,10 +1629,7 @@ static void FDECL2(delete_directory, struct directory *, parent, struct director
   struct directory             * tdir;
 
   if( child->contents != NULL )
-    {
-      fprintf(stderr, "Unable to delete non-empty directory\n");
-      exit(1);
-    }
+    error (1, 0, _("Unable to delete non-empty directory\n"));
 
   free(child->whole_name);
   child->whole_name = NULL;
@@ -1682,10 +1652,7 @@ static void FDECL2(delete_directory, struct directory *, parent, struct director
            }
        }
       if( tdir == NULL )
-       {
-         fprintf(stderr, "Unable to locate child directory in parent list\n");
-         exit(1);
-       }
+       error (1, 0, _("Unable to locate child directory in parent list\n"));
     }
   free(child);
   return;
@@ -1802,8 +1769,8 @@ struct directory_entry * FDECL2(search_tree_file, struct directory *,
 
   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");
+      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, '/');
     }
@@ -1871,7 +1838,7 @@ struct directory_entry * FDECL2(search_tree_file, struct directory *,
        */
       return (NULL);
     }
-  fprintf(stderr,"We cant get here in search_tree_file :-/ \n");
+  fprintf (stderr, "We cant get here in search_tree_file :-/ \n");
 }
 
 void init_fstatbuf()
index fed00185058515d8dd125f9045c6b3fefe0799fe..73c22082741f3a57789bb318fcfe3bf9ca8c385c 100644 (file)
@@ -154,10 +154,8 @@ void FDECL4(xfwrite, void *, buffer, uint64_t, count, uint64_t, size, FILE *, fi
                        unlink(outfile);
                sprintf(nbuf, "%s_%02d", outfile, idx++);
                file = freopen(nbuf, "wb", file);
-               if (file == NULL) {
-                       fprintf(stderr, "Cannot open '%s'.\n", nbuf);
-                       exit(1);
-               }
+               if (file == NULL)
+                 error (1, errno, _("Cannot open '%s'"), nbuf);
 
        }
      while(count) 
@@ -165,10 +163,7 @@ void FDECL4(xfwrite, void *, buffer, uint64_t, count, uint64_t, size, FILE *, fi
          size_t got = fwrite (buffer, size, count, file);
 
          if (got != count)
-         {
-              fprintf(stderr,"cannot fwrite %llu*%llu\n",size,count);
-              exit(1);
-         }
+           error (1, errno, _("cannot fwrite %llu*%llu\n"), size, count);
          count-=got,*(char**)&buffer+=size*got;
      }
 }
@@ -250,14 +245,7 @@ static void FDECL3(write_one_file, char *, filename,
 
 
      if ((infile = fopen(filename, "rb")) == NULL) 
-     {
-#if defined(sun) || defined(_AUX_SOURCE)
-         fprintf(stderr, "cannot open %s: (%d)\n", filename, errno);
-#else
-         fprintf(stderr, "cannot open %s: %s\n", filename, strerror(errno));
-#endif
-         exit(1);
-     }
+       error (1, errno, _("cannot open %s\n"), filename);
      remain = size;
 
      while(remain > 0)
@@ -266,7 +254,7 @@ static void FDECL3(write_one_file, char *, filename,
          use = ROUND_UP(use); /* Round up to nearest sector boundary */
          memset(buffer, 0, use);
          if (fread(buffer, 1, use, infile) == 0) 
-           error (1, errno, "cannot read %llu bytes from %s", use, filename); 
+           error (1, errno, _("cannot read %llu bytes from %s"), use, filename); 
          xfwrite(buffer, 1, use, outfile);
          last_extent_written += use/SECTOR_SIZE;
 #if 0
@@ -284,8 +272,8 @@ static void FDECL3(write_one_file, char *, filename,
               time(&now);
               frac = last_extent_written / (double)last_extent;
               the_end = begun + (now - begun) / frac;
-              fprintf(stderr, "%6.2f%% done, estimate finish %s",
-                      frac * 100., ctime(&the_end));
+              fprintf (stderr, _("%6.2f%% done, estimate finish %s"),
+                       frac * 100., ctime(&the_end));
          }
 #endif
          remain -= use;
@@ -551,8 +539,8 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
               {
                    if(verbose > 2)
                    {
-                        fprintf(stderr, "Cache hit for %s%s%s\n",s_entry->filedir->de_name, 
-                                SPATH_SEPARATOR, s_entry->name);
+                     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);
@@ -573,10 +561,8 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
                    {
                         if(finddir->self == s_entry) break;
                         finddir = finddir->next;
-                        if(!finddir) 
-                        {
-                             fprintf(stderr,"Fatal goof\n"); exit(1);
-                        }
+                        if (!finddir) 
+                          error (1, 0, _("Fatal goof\n"));
                    }
                    set_733((char *) s_entry->isorec.extent, finddir->extent);
                    s_entry->starting_block = finddir->extent;
@@ -680,9 +666,9 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
 #ifdef DBG_ISO
                    if((ROUND_UP(s_entry->size) >> 11) > 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 %d extents\n", s_entry->size);
+                        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 %d extents\n", s_entry->size);
                         
                    }
 #endif
@@ -907,8 +893,8 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
 
      if(dpnt->size != dir_index)
      {
-         fprintf(stderr,"Unexpected directory length %d %d %s\n",dpnt->size, 
-           dir_index, dpnt->de_name);
+         fprintf (stderr, _("Unexpected directory length %d %d %s\n"), dpnt->size,
+                  dir_index, dpnt->de_name);
      }
 
      xfwrite(directory_buffer, 1, total_size, outfile);
@@ -919,8 +905,8 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
      {
          if(ce_index != dpnt->ce_bytes)
          {
-              fprintf(stderr,"Continuation entry record length mismatch (%d %d).\n",
-                      ce_index, dpnt->ce_bytes);
+           fprintf (stderr, _("Continuation entry record length mismatch (%d %d).\n"),
+                    ce_index, dpnt->ce_bytes);
          }
          xfwrite(ce_buffer, 1, ce_size, outfile);
          last_extent_written += ce_size >> 11;
@@ -992,9 +978,8 @@ static int generate_path_tables()
    */
   if( next_path_index > 0xffff )
   {
-      fprintf(stderr, "Unable to generate sane path tables - too many directories (%d)\n",
-             next_path_index);
-      exit(1);
+    error (1, 0, _("Unable to generate sane path tables - too many directories (%d)\n"),
+          next_path_index);
   }
 
   path_table_index = 0;
@@ -1029,8 +1014,7 @@ static int generate_path_tables()
        dpnt = pathlist[j];
        if(!dpnt)
        {
-           fprintf(stderr,"Entry %d not in path tables\n", j);
-           exit(1);
+        error (1, 0, _("Entry %d not in path tables\n"), j);
        }
        npnt = dpnt->de_name;
        
@@ -1050,8 +1034,7 @@ static int generate_path_tables()
        de = dpnt->self;
        if(!de) 
        {
-           fprintf(stderr,"Fatal goof\n"); 
-           exit(1);
+        error (1, 0, _("Fatal goof\n"));
        }
        
        
@@ -1086,9 +1069,9 @@ static int generate_path_tables()
   free(pathlist);
   if(path_table_index != path_table_size)
   {
-       fprintf(stderr,"Path table lengths do not match %d %d\n",
-              path_table_index,
-              path_table_size);
+    fprintf (stderr, _("Path table lengths do not match %d %d\n"),
+            path_table_index,
+            path_table_size);
   }
   return 0;
 } /* generate_path_tables(... */
@@ -1132,9 +1115,9 @@ static int FDECL1(file_write, FILE *, outfile)
 
   if( print_size > 0 )
     {
-      fprintf(stderr,"Total extents scheduled to be written = %llu\n", 
-             last_extent - session_start);
-       exit(0);
+      fprintf (stderr, _("Total extents scheduled to be written = %llu\n"),
+              last_extent - session_start);
+      exit (0);
     }
   if( verbose > 2 )
     {
@@ -1142,8 +1125,8 @@ static int FDECL1(file_write, FILE *, outfile)
       fprintf(stderr,"Total directory extents being written = %llu\n", last_extent);
 #endif
       
-      fprintf(stderr,"Total extents scheduled to be written = %llu\n"
-             last_extent - session_start);
+      fprintf (stderr, _("Total extents scheduled to be written = %llu\n")
+              last_extent - session_start);
     }
 
   /* 
@@ -1159,8 +1142,8 @@ static int FDECL1(file_write, FILE *, outfile)
       return 0;
     }
 
-  fprintf(stderr,"Total extents actually written = %llu\n", 
-         last_extent_written - session_start);
+  fprintf (stderr, _("Total extents actually written = %llu\n"),
+          last_extent_written - session_start);
 
   /* 
    * Hard links throw us off here 
@@ -1168,14 +1151,14 @@ static int FDECL1(file_write, FILE *, outfile)
   assert (last_extent > session_start);
   if(should_write + session_start != last_extent)
     {
-      fprintf(stderr,"Number of extents written not what was predicted.  Please fix.\n");
-      fprintf(stderr,"Predicted = %d, written = %llu\n", should_write, last_extent);
+      fprintf (stderr, _("Number of extents written different than what was predicted.  Please fix.\n"));
+      fprintf (stderr, _("Predicted = %d, written = %llu\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);
+  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",