]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/tools/makeconv/makeconv.c
ICU-8.11.tar.gz
[apple/icu.git] / icuSources / tools / makeconv / makeconv.c
index f3b6443054427531c7b694a875db8787ba4d8f2b..1bd4bec366187d2d3559d2b544e845fcdc637221 100644 (file)
@@ -1,7 +1,7 @@
 /*
  ********************************************************************************
  *
 /*
  ********************************************************************************
  *
- *   Copyright (C) 1998-2004, International Business Machines
+ *   Copyright (C) 1998-2006, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  *
  ********************************************************************************
  *   Corporation and others.  All Rights Reserved.
  *
  ********************************************************************************
@@ -17,7 +17,6 @@
 
 #include <stdio.h>
 #include "unicode/putil.h"
 
 #include <stdio.h>
 #include "unicode/putil.h"
-#include "ucnv_io.h"
 #include "unicode/ucnv_err.h"
 #include "ucnv_bld.h"
 #include "ucnv_imp.h"
 #include "unicode/ucnv_err.h"
 #include "ucnv_bld.h"
 #include "ucnv_imp.h"
@@ -37,6 +36,7 @@
 
 #define DEBUG 0
 
 
 #define DEBUG 0
 
+
 typedef struct ConvData {
     UCMFile *ucm;
     NewConverter *cnvData, *extData;
 typedef struct ConvData {
     UCMFile *ucm;
     NewConverter *cnvData, *extData;
@@ -77,7 +77,6 @@ extern const UConverterStaticData * ucnv_converterStaticData[UCNV_NUMBER_OF_SUPP
  * Global - verbosity
  */
 UBool VERBOSE = FALSE;
  * Global - verbosity
  */
 UBool VERBOSE = FALSE;
-UBool TOUCHFILE = FALSE;
 
 static void
 createConverter(ConvData *data, const char* converterName, UErrorCode *pErrorCode);
 
 static void
 createConverter(ConvData *data, const char* converterName, UErrorCode *pErrorCode);
@@ -172,8 +171,6 @@ static UOption options[]={
     UOPTION_VERSION,             /* 3 */
     UOPTION_DESTDIR,             /* 4 */
     UOPTION_VERBOSE,             /* 5 */
     UOPTION_VERSION,             /* 3 */
     UOPTION_DESTDIR,             /* 4 */
     UOPTION_VERBOSE,             /* 5 */
-    UOPTION_PACKAGE_NAME,        /* 6 */
-    UOPTION_DEF( "touchfile", 't', UOPT_NO_ARG) /* 7 */
 };
 
 int main(int argc, char* argv[])
 };
 
 int main(int argc, char* argv[])
@@ -181,9 +178,7 @@ int main(int argc, char* argv[])
     ConvData data;
     UErrorCode err = U_ZERO_ERROR, localError;
     char outFileName[UCNV_MAX_FULL_FILE_NAME_LENGTH];
     ConvData data;
     UErrorCode err = U_ZERO_ERROR, localError;
     char outFileName[UCNV_MAX_FULL_FILE_NAME_LENGTH];
-    char touchFileName[UCNV_MAX_FULL_FILE_NAME_LENGTH];
     const char* destdir, *arg;
     const char* destdir, *arg;
-    const char *pkgName = NULL;
     size_t destdirlen;
     char* dot = NULL, *outBasename;
     char cnvName[UCNV_MAX_FULL_FILE_NAME_LENGTH];
     size_t destdirlen;
     char* dot = NULL, *outBasename;
     char cnvName[UCNV_MAX_FULL_FILE_NAME_LENGTH];
@@ -222,48 +217,16 @@ int main(int argc, char* argv[])
             "\t-d or --destdir     destination directory, followed by the path\n"
             "\t-v or --verbose     Turn on verbose output\n",
             argv[0]);
             "\t-d or --destdir     destination directory, followed by the path\n"
             "\t-v or --verbose     Turn on verbose output\n",
             argv[0]);
-        fprintf(stderr,
-            "\t-p or --pkgname     sets the 'package' name for output files.\n"
-            "\t                    If name is ICUDATA, then the default icu package\n"
-            "\t                    name will be used.\n"
-            "\t-t or --touchfile   Generate additional small file without packagename, for nmake\n");
         return argc<0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
     }
 
     if(options[3].doesOccur) {
         return argc<0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
     }
 
     if(options[3].doesOccur) {
-      fprintf(stderr,"makeconv version %hu.%hu, ICU tool to read .ucm codepage mapping files and write .cnv files\n",
+        fprintf(stderr,"makeconv version %hu.%hu, ICU tool to read .ucm codepage mapping files and write .cnv files\n",
             dataInfo.formatVersion[0], dataInfo.formatVersion[1]);
             dataInfo.formatVersion[0], dataInfo.formatVersion[1]);
-      fprintf(stderr, "Copyright (C) 1998-2000, International Business Machines\n");
-      fprintf(stderr,"Corporation and others.  All Rights Reserved.\n");
+        fprintf(stderr, U_COPYRIGHT_STRING "\n");
         exit(0);
     }
 
         exit(0);
     }
 
-   TOUCHFILE = options[7].doesOccur;
-
-   if(!options[6].doesOccur)
-    {
-      pkgName=NULL;
-    }
-    else
-    {
-        pkgName =options[6].value;
-        if(!strcmp(pkgName, "ICUDATA"))
-        {
-            pkgName = U_ICUDATA_NAME;
-        }
-        if(pkgName[0] == 0)
-        {
-            pkgName = NULL;
-
-            if(TOUCHFILE)
-            {
-                fprintf(stderr, "%s: Don't use touchfile option with an empty packagename.\n",
-                        argv[0]);
-                exit(1);
-            }
-        }
-    }
-
     /* get the options values */
     haveCopyright = options[2].doesOccur;
     destdir = options[4].value;
     /* get the options values */
     haveCopyright = options[2].doesOccur;
     destdir = options[4].value;
@@ -324,21 +287,6 @@ int main(int argc, char* argv[])
         /* the basename without extension is the converter name */
         uprv_strcpy(cnvName, outBasename);
 
         /* the basename without extension is the converter name */
         uprv_strcpy(cnvName, outBasename);
 
-        if(TOUCHFILE)
-        {
-            uprv_strcpy(touchFileName, outBasename);
-            uprv_strcat(touchFileName, ".cnv");
-        }
-
-        if(pkgName != NULL)
-        {
-            /* changes both basename and filename */
-            uprv_strcpy(outBasename, pkgName);
-            uprv_strcat(outBasename, "_");
-            uprv_strcat(outBasename, cnvName);
-        }
-
-
         /*Adds the target extension*/
         uprv_strcat(outBasename, CONVERTER_FILE_EXTENSION);
 
         /*Adds the target extension*/
         uprv_strcat(outBasename, CONVERTER_FILE_EXTENSION);
 
@@ -382,40 +330,10 @@ int main(int argc, char* argv[])
                 }
             }
 
                 }
             }
 
-            if(pkgName == NULL)
-            {
-                uprv_strcpy(cnvNameWithPkg, cnvName);
-            }
-            else
-            {
-                uprv_strcpy(cnvNameWithPkg, pkgName);
-                uprv_strcat(cnvNameWithPkg, "_");
-                uprv_strcat(cnvNameWithPkg, cnvName);
-            }
+            uprv_strcpy(cnvNameWithPkg, cnvName);
 
             localError = U_ZERO_ERROR;
             writeConverterData(&data, cnvNameWithPkg, destdir, &localError);
 
             localError = U_ZERO_ERROR;
             writeConverterData(&data, cnvNameWithPkg, destdir, &localError);
-            if(TOUCHFILE)
-            {
-                FileStream *q;
-                char msg[1024];
-
-                sprintf(msg, "This empty file tells nmake that %s in package %s has been updated.\n",
-                    cnvName, pkgName);
-
-                q = T_FileStream_open(touchFileName, "w");
-                if(q == NULL)
-                {
-                    fprintf(stderr, "Error writing touchfile \"%s\"\n", touchFileName);
-                    localError = U_FILE_ACCESS_ERROR;
-                }
-
-                else
-                {
-                    T_FileStream_write(q, msg, (int32_t)uprv_strlen(msg));
-                    T_FileStream_close(q);
-                }
-            }
 
             if(U_FAILURE(localError))
             {
 
             if(U_FAILURE(localError))
             {