michael@0: /****************************************************************************** michael@0: * Copyright (C) 2008-2011, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: ******************************************************************************* michael@0: */ michael@0: michael@0: #ifndef __PKG_GENC_H__ michael@0: #define __PKG_GENC_H__ michael@0: michael@0: #include "unicode/utypes.h" michael@0: #include "toolutil.h" michael@0: michael@0: #include "unicode/putil.h" michael@0: #include "putilimp.h" michael@0: michael@0: /*** Platform #defines move here ***/ michael@0: #if U_PLATFORM_HAS_WIN32_API michael@0: #ifdef __GNUC__ michael@0: #define WINDOWS_WITH_GNUC michael@0: #else michael@0: #define WINDOWS_WITH_MSVC michael@0: #endif michael@0: #endif michael@0: michael@0: michael@0: #if !defined(WINDOWS_WITH_MSVC) michael@0: #define BUILD_DATA_WITHOUT_ASSEMBLY michael@0: #endif michael@0: michael@0: #ifndef U_DISABLE_OBJ_CODE /* testing */ michael@0: #if defined(WINDOWS_WITH_MSVC) || U_PLATFORM_IS_LINUX_BASED michael@0: #define CAN_WRITE_OBJ_CODE michael@0: #endif michael@0: #if U_PLATFORM_HAS_WIN32_API || defined(U_ELF) michael@0: #define CAN_GENERATE_OBJECTS michael@0: #endif michael@0: #endif michael@0: michael@0: #if U_PLATFORM == U_PF_CYGWIN || defined(CYGWINMSVC) michael@0: #define USING_CYGWIN michael@0: #endif michael@0: michael@0: /* michael@0: * When building the data library without assembly, michael@0: * some platforms use a single c code file for all of michael@0: * the data to generate the final data library. This can michael@0: * increase the performance of the pkdata tool. michael@0: */ michael@0: #if U_PLATFORM == U_PF_OS400 michael@0: #define USE_SINGLE_CCODE_FILE michael@0: #endif michael@0: michael@0: /* Need to fix the file seperator character when using MinGW. */ michael@0: #if defined(WINDOWS_WITH_GNUC) || defined(USING_CYGWIN) michael@0: #define PKGDATA_FILE_SEP_STRING "/" michael@0: #else michael@0: #define PKGDATA_FILE_SEP_STRING U_FILE_SEP_STRING michael@0: #endif michael@0: michael@0: #define LARGE_BUFFER_MAX_SIZE 2048 michael@0: #define SMALL_BUFFER_MAX_SIZE 512 michael@0: #define SMALL_BUFFER_FLAG_NAMES 32 michael@0: #define BUFFER_PADDING_SIZE 20 michael@0: michael@0: /** End platform defines **/ michael@0: michael@0: michael@0: michael@0: U_INTERNAL void U_EXPORT2 michael@0: printAssemblyHeadersToStdErr(void); michael@0: michael@0: U_INTERNAL UBool U_EXPORT2 michael@0: checkAssemblyHeaderName(const char* optAssembly); michael@0: michael@0: U_INTERNAL void U_EXPORT2 michael@0: writeCCode(const char *filename, const char *destdir, const char *optName, const char *optFilename, char *outFilePath); michael@0: michael@0: U_INTERNAL void U_EXPORT2 michael@0: writeAssemblyCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optFilename, char *outFilePath); michael@0: michael@0: U_INTERNAL void U_EXPORT2 michael@0: writeObjectCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optMatchArch, const char *optFilename, char *outFilePath); michael@0: michael@0: #endif