1 /**************************************************************************
3 * Copyright (C) 2000-2012, International Business Machines
4 * Corporation and others. All Rights Reserved.
6 ***************************************************************************
8 * encoding: ANSI X3.4 (1968)
9 * tab size: 8 (not used)
12 * created on: 2000may16
13 * created by: Steven \u24C7 Loomis
15 * common types for pkgdata
22 #include "unicode/utypes.h"
28 typedef struct _CharList
31 struct _CharList *next;
37 * write CharList 'l' into stream 's' using deliminter 'delim' (delim can be NULL). quoted: -1 remove, 0 as is, 1 add quotes
39 const char *pkg_writeCharList(FileStream *s, CharList *l, const char *delim, int32_t quoted);
42 * Same, but use line breaks. quoted: -1 remove, 0 as is, 1 add quotes
44 const char *pkg_writeCharListWrap(FileStream *s, CharList *l, const char *delim, const char *brk, int32_t quoted);
48 * Count items . 0 if null
50 uint32_t pkg_countCharList(CharList *l);
53 * Prepend string to CharList. Str is adopted!
55 CharList *pkg_prependToList(CharList *l, const char *str);
58 * append string to CharList. *end or even end can be null if you don't
62 CharList *pkg_appendToList(CharList *l, CharList** end, const char *str);
65 * strAlias is an alias to a full or relative path to a FILE. This function
66 * will search strAlias for the directory name (with strrchr). Then, it will
67 * determine if that directory is already in list l. If not, it will add it
68 * with strdup(strAlias).
69 * @param l list to append to , or NULL
70 * @param end end pointer-to-pointer. Can point to null, or be null.
71 * @param strAlias alias to full path string
74 CharList *pkg_appendUniqueDirToList(CharList *l, CharList** end, const char *strAlias);
77 * does list contain string? Returns: t/f
79 UBool pkg_listContains(CharList *l, const char *str);
84 void pkg_deleteList(CharList *l);
87 * Mode package function
90 typedef void (UPKGMODE)(struct UPKGOptions_ *, FileStream *s, UErrorCode *status);
93 * Static mode - write the readme file
94 * @param opt UPKGOptions
95 * @param libName Name of the .lib, etc file
96 * @param status ICU error code
98 void pkg_sttc_writeReadme(struct UPKGOptions_ *opt, const char *libName, UErrorCode *status);
101 * Options to be passed throughout the program
104 typedef struct UPKGOptions_
106 CharList *fileListFiles; /* list of files containing files for inclusion in the package */
107 CharList *filePaths; /* All the files, with long paths */
108 CharList *files; /* All the files */
109 CharList *outFiles; /* output files [full paths] */
111 const char *shortName; /* name of what we're building */
112 const char *cShortName; /* name of what we're building as a C identifier */
113 const char *entryName; /* special entrypoint name */
114 const char *targetDir; /* dir for packaged data to go */
115 const char *dataDir; /* parent of dir for package (default: tmpdir) */
118 const char *options; /* Options arg */
119 const char *mode; /* Mode of building */
120 const char *version; /* Library version */
121 const char *comment; /* comment string */
122 const char *install; /* Where to install to (NULL = don't install) */
123 const char *icuroot; /* where does ICU lives */
124 const char *libName; /* name for library (default: shortName) */
128 UBool withoutAssembly;
129 UBool pdsbuild; /* for building PDS in z/OS */
132 char * convertToNativePathSeparators(char *path);
135 /* set up common defines for library naming */
137 #if U_PLATFORM_HAS_WIN32_API
138 # ifndef UDATA_SO_SUFFIX
139 # define UDATA_SO_SUFFIX ".dll"
141 # define LIB_PREFIX ""
142 # define LIB_STATIC_PREFIX ""
143 # define OBJ_SUFFIX ".obj"
144 # define UDATA_LIB_SUFFIX ".lib"
146 #elif U_PLATFORM == U_PF_CYGWIN
147 # define LIB_PREFIX "cyg"
148 # define LIB_STATIC_PREFIX "lib"
149 # define OBJ_SUFFIX ".o"
150 # define UDATA_LIB_SUFFIX ".a"
153 # define LIB_PREFIX "lib"
154 # define LIB_STATIC_PREFIX "lib"
155 # define OBJ_SUFFIX ".o"
156 # define UDATA_LIB_SUFFIX ".a"
159 #define ASM_SUFFIX ".s"
161 /* defines for common file names */
162 #define UDATA_CMN_PREFIX ""
163 #define UDATA_CMN_SUFFIX ".dat"
164 #define UDATA_CMN_INTERMEDIATE_SUFFIX "_dat"
166 #define ICUDATA_RES_FILE "icudata.res"
168 #define PKGDATA_DERIVED_PATH '\t'