Subversion Repositories SvarDOS

Rev

Rev 2106 | Rev 2112 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2106 Rev 2108
Line 45... Line 45...
45
#define STRINGS_CAP 65000   /* string storage size in characters */
45
#define STRINGS_CAP 65000   /* string storage size in characters */
46
#define DICT_CAP    10000   /* dictionary size in elements */
46
#define DICT_CAP    10000   /* dictionary size in elements */
47
 
47
 
48
enum {                      /* DEFLANG output format */
48
enum {                      /* DEFLANG output format */
49
  C_OUTPUT,
49
  C_OUTPUT,
-
 
50
  NO_OUTPUT,
50
  ASM_OUTPUT,
51
  ASM_OUTPUT,
51
  NASM_OUTPUT
52
  NASM_OUTPUT
52
};
53
};
53
 
54
 
54
 
55
 
Line 622... Line 623...
622
    puts("converts a set of CATS-style translations in files EN.TXT, PL.TXT, etc");
623
    puts("converts a set of CATS-style translations in files EN.TXT, PL.TXT, etc");
623
    puts("into a single resource file (OUT.LNG). Also generates a deflang source");
624
    puts("into a single resource file (OUT.LNG). Also generates a deflang source");
624
    puts("file that contains a properly sized buffer pre-filled with the first");
625
    puts("file that contains a properly sized buffer pre-filled with the first");
625
    puts("(reference) language.");
626
    puts("(reference) language.");
626
    puts("");
627
    puts("");
627
    puts("usage: tlumacz [/c | /asm | /nasm] [/nocomp] [/excref] en fr pl ...");
628
    puts("usage: tlumacz [/c|/asm|/nasm|/nodef] [/nocomp] [/excref] en fr pl ...");
628
    puts("");
629
    puts("");
629
    puts("/c        generates deflang.c (default)");
630
    puts("/c        generates deflang.c (default)");
630
    puts("/asm      deflang ASM output");
631
    puts("/asm      deflang ASM output");
631
    puts("/nasm     deflang NASM output");
632
    puts("/nasm     deflang NASM output");
-
 
633
    puts("/nodef    does NOT generate a deflang source file (only an LNG file)");
632
    puts("/nocomp   disables compression of strings in the LNG file");
634
    puts("/nocomp   disables compression of strings in the LNG file");
633
    puts("/excref   excludes ref lang from the LNG file (inserted to deflang only)");
635
    puts("/excref   excludes ref lang from the LNG file (inserted to deflang only)");
634
    return(1);
636
    return(1);
635
  }
637
  }
636
 
638
 
Line 655... Line 657...
655
      output_format = NASM_OUTPUT;
657
      output_format = NASM_OUTPUT;
656
      continue;
658
      continue;
657
    } else if(!strcmp(argv[i], "/nocomp")) {
659
    } else if(!strcmp(argv[i], "/nocomp")) {
658
      mvcomp_enabled = 0;
660
      mvcomp_enabled = 0;
659
      continue;
661
      continue;
-
 
662
    } else if(!strcmp(argv[i], "/nodef")) {
-
 
663
      output_format = NO_OUTPUT;
-
 
664
      continue;
660
    } else if(!strcmp(argv[i], "/excref")) {
665
    } else if(!strcmp(argv[i], "/excref")) {
661
      excref = 1;
666
      excref = 1;
662
      continue;
667
      continue;
663
    }
668
    }
664
 
669
 
Line 723... Line 728...
723
    fprintf(stderr, "ERROR: NO LANGUAGE GIVEN\r\n");
728
    fprintf(stderr, "ERROR: NO LANGUAGE GIVEN\r\n");
724
    ecode = 1;
729
    ecode = 1;
725
    goto exit_main;
730
    goto exit_main;
726
  }
731
  }
727
 
732
 
728
  /* compute the deflang file containing a dump of the reference block */
733
  /* compute the deflang file containing a dump of the reference lang block */
729
  if (output_format == C_OUTPUT) {
734
  if (output_format == C_OUTPUT) {
730
    if (!svl_write_c_source(reflang, "deflang.c", biggest_langsz)) {
735
    if (!svl_write_c_source(reflang, "deflang.c", biggest_langsz)) {
731
      fprintf(stderr, "ERROR: FAILED TO OPEN OR CREATE DEFLANG.C\r\n");
736
      fprintf(stderr, "ERROR: FAILED TO OPEN OR CREATE DEFLANG.C\r\n");
732
      ecode = 1;
737
      ecode = 1;
733
    }
738
    }
734
  } else {
739
  } else if ((output_format == ASM_OUTPUT) || (output_format == NASM_OUTPUT)) {
735
    if (!svl_write_asm_source(reflang, "deflang.inc", biggest_langsz, output_format)) {
740
    if (!svl_write_asm_source(reflang, "deflang.inc", biggest_langsz, output_format)) {
736
      fprintf(stderr, "ERROR: FAILED TO OPEN OR CREATE DEFLANG.INC\r\n");
741
      fprintf(stderr, "ERROR: FAILED TO OPEN OR CREATE DEFLANG.INC\r\n");
737
      ecode = 1;
742
      ecode = 1;
738
    }
743
    }
739
  }
744
  }
740
 
745
 
741
exit_main:
746
exit_main:
742
  if (lang && lang != reflang) {
747
  if (lang && (lang != reflang)) {
743
    svl_lang_free(lang);
748
    svl_lang_free(lang);
744
  }
749
  }
745
  if (reflang) {
750
  if (reflang) {
746
    svl_lang_free(reflang);
751
    svl_lang_free(reflang);
747
    reflang = NULL;
752
    reflang = NULL;