From 9a6483bf776a68451a672b8e5f9c47c1d5aefbe2 Mon Sep 17 00:00:00 2001 From: Ram Viswanadha Date: Fri, 22 Mar 2002 18:57:09 +0000 Subject: [PATCH] ICU-1802 Donot add copyright in gernerated java files by default, add only when requested explicitly with -c option X-SVN-Rev: 8208 --- icu4c/source/tools/genrb/genrb.c | 2 +- icu4c/source/tools/genrb/reslist.c | 4 +++- icu4c/source/tools/genrb/reslist.h | 1 + icu4c/source/tools/genrb/wrtjava.c | 9 +++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/icu4c/source/tools/genrb/genrb.c b/icu4c/source/tools/genrb/genrb.c index 91da1f87e9c..f0767a46f97 100644 --- a/icu4c/source/tools/genrb/genrb.c +++ b/icu4c/source/tools/genrb/genrb.c @@ -284,7 +284,7 @@ processFile(const char *filename, const char *cp, const char *inputDir, const ch bundle_write_java(data,outputDir,outputEnc, outputFileName, sizeof(outputFileName), status); } if (U_FAILURE(*status)) { - fprintf(stderr, "couldn't write bundle %s\n", outputFileName); + fprintf(stderr, "couldn't write bundle %s. Error:%s\n", outputFileName,u_errorName(*status)); } bundle_close(data, status); diff --git a/icu4c/source/tools/genrb/reslist.c b/icu4c/source/tools/genrb/reslist.c index 0701ea10f8c..11dbc1be5a8 100644 --- a/icu4c/source/tools/genrb/reslist.c +++ b/icu4c/source/tools/genrb/reslist.c @@ -51,7 +51,9 @@ static uint8_t calcPadding(uint32_t size) { void setIncludeCopyright(UBool val){ gIncludeCopyright=val; } - +UBool getIncludeCopyright(void){ + return gIncludeCopyright; +} /* Writing Functions */ static uint32_t string_write(UNewDataMemory *mem, struct SResource *res, uint32_t usedOffset, UErrorCode *status) { diff --git a/icu4c/source/tools/genrb/reslist.h b/icu4c/source/tools/genrb/reslist.h index 81865894fab..5cfe729753e 100644 --- a/icu4c/source/tools/genrb/reslist.h +++ b/icu4c/source/tools/genrb/reslist.h @@ -126,6 +126,7 @@ struct SResource { void res_close(struct SResource *res, UErrorCode *status); void setIncludeCopyright(UBool val); +UBool getIncludeCopyright(void); U_CDECL_END #endif /* #ifndef RESLIST_H */ diff --git a/icu4c/source/tools/genrb/wrtjava.c b/icu4c/source/tools/genrb/wrtjava.c index 777fedcb567..6e72940e405 100644 --- a/icu4c/source/tools/genrb/wrtjava.c +++ b/icu4c/source/tools/genrb/wrtjava.c @@ -39,8 +39,8 @@ static const char* copyRight = "/* \n" " *\n" " *******************************************************************************\n" " * $Source: /xsrl/Nsvn/icu/icu/source/tools/genrb/wrtjava.c,v $ \n" - " * $Date: 2002/03/22 03:15:27 $ \n" - " * $Revision: 1.5 $ \n" + " * $Date: 2002/03/22 18:57:09 $ \n" + " * $Revision: 1.6 $ \n" " *******************************************************************************\n" " */\n\n" "/*******************************************************************************\n" @@ -775,8 +775,9 @@ bundle_write_java(struct SRBRoot *bundle, const char *outputDir,const char* outp *status = U_FILE_ACCESS_ERROR; return; } - - T_FileStream_write(out,copyRight,uprv_strlen(copyRight)); + if(getIncludeCopyright()){ + T_FileStream_write(out,copyRight,uprv_strlen(copyRight)); + } T_FileStream_write(out,javaClass,uprv_strlen(javaClass)); T_FileStream_write(out,className,uprv_strlen(className)); if(j1){