]> git.saurik.com Git - apple/icu.git/blame - icuSources/tools/pkgdata/pkgtypes.h
ICU-66108.tar.gz
[apple/icu.git] / icuSources / tools / pkgdata / pkgtypes.h
CommitLineData
f3c0d7a5
A
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
b75a7d8f
A
3/**************************************************************************
4*
4388f060 5* Copyright (C) 2000-2012, International Business Machines
b75a7d8f
A
6* Corporation and others. All Rights Reserved.
7*
8***************************************************************************
9* file name: pkgdata.c
10* encoding: ANSI X3.4 (1968)
11* tab size: 8 (not used)
12* indentation:4
13*
14* created on: 2000may16
15* created by: Steven \u24C7 Loomis
16*
17* common types for pkgdata
18*/
19
20#ifndef _PKGTYPES
21#define _PKGTYPES
22
23/* headers */
24#include "unicode/utypes.h"
25#include "filestrm.h"
26
27/* linked list */
28struct _CharList;
29
30typedef struct _CharList
31{
32 const char *str;
33 struct _CharList *next;
34} CharList;
35
36
37
729e4ab9 38/*
b75a7d8f
A
39 * write CharList 'l' into stream 's' using deliminter 'delim' (delim can be NULL). quoted: -1 remove, 0 as is, 1 add quotes
40 */
41const char *pkg_writeCharList(FileStream *s, CharList *l, const char *delim, int32_t quoted);
42
43/*
44 * Same, but use line breaks. quoted: -1 remove, 0 as is, 1 add quotes
45 */
46const char *pkg_writeCharListWrap(FileStream *s, CharList *l, const char *delim, const char *brk, int32_t quoted);
47
48
49/*
50 * Count items . 0 if null
51 */
52uint32_t pkg_countCharList(CharList *l);
53
729e4ab9 54/*
b75a7d8f
A
55 * Prepend string to CharList. Str is adopted!
56 */
57CharList *pkg_prependToList(CharList *l, const char *str);
58
729e4ab9
A
59/*
60 * append string to CharList. *end or even end can be null if you don't
b75a7d8f
A
61 * know it.[slow]
62 * Str is adopted!
63 */
64CharList *pkg_appendToList(CharList *l, CharList** end, const char *str);
65
729e4ab9 66/*
374ca955 67 * strAlias is an alias to a full or relative path to a FILE. This function
729e4ab9 68 * will search strAlias for the directory name (with strrchr). Then, it will
374ca955 69 * determine if that directory is already in list l. If not, it will add it
729e4ab9 70 * with strdup(strAlias).
374ca955 71 * @param l list to append to , or NULL
729e4ab9 72 * @param end end pointer-to-pointer. Can point to null, or be null.
374ca955
A
73 * @param strAlias alias to full path string
74 * @return new list
75 */
76CharList *pkg_appendUniqueDirToList(CharList *l, CharList** end, const char *strAlias);
77
b75a7d8f
A
78/*
79 * does list contain string? Returns: t/f
80 */
81UBool pkg_listContains(CharList *l, const char *str);
82
83/*
729e4ab9 84 * Delete list
b75a7d8f
A
85 */
86void pkg_deleteList(CharList *l);
87
b75a7d8f
A
88/*
89 * Mode package function
90 */
91struct UPKGOptions_;
92typedef void (UPKGMODE)(struct UPKGOptions_ *, FileStream *s, UErrorCode *status);
93
94/*
729e4ab9 95 * Static mode - write the readme file
b75a7d8f
A
96 * @param opt UPKGOptions
97 * @param libName Name of the .lib, etc file
98 * @param status ICU error code
99 */
100void pkg_sttc_writeReadme(struct UPKGOptions_ *opt, const char *libName, UErrorCode *status);
101
729e4ab9 102/*
b75a7d8f
A
103 * Options to be passed throughout the program
104 */
105
106typedef struct UPKGOptions_
107{
108 CharList *fileListFiles; /* list of files containing files for inclusion in the package */
109 CharList *filePaths; /* All the files, with long paths */
110 CharList *files; /* All the files */
111 CharList *outFiles; /* output files [full paths] */
112
113 const char *shortName; /* name of what we're building */
114 const char *cShortName; /* name of what we're building as a C identifier */
115 const char *entryName; /* special entrypoint name */
374ca955
A
116 const char *targetDir; /* dir for packaged data to go */
117 const char *dataDir; /* parent of dir for package (default: tmpdir) */
729e4ab9 118 const char *tmpDir;
b75a7d8f
A
119 const char *srcDir;
120 const char *options; /* Options arg */
121 const char *mode; /* Mode of building */
122 const char *version; /* Library version */
b75a7d8f 123 const char *comment; /* comment string */
b75a7d8f
A
124 const char *install; /* Where to install to (NULL = don't install) */
125 const char *icuroot; /* where does ICU lives */
374ca955 126 const char *libName; /* name for library (default: shortName) */
b75a7d8f 127 UBool rebuild;
b75a7d8f 128 UBool verbose;
374ca955 129 UBool quiet;
4388f060
A
130 UBool withoutAssembly;
131 UBool pdsbuild; /* for building PDS in z/OS */
b75a7d8f
A
132} UPKGOptions;
133
73c04bcf
A
134char * convertToNativePathSeparators(char *path);
135
b75a7d8f
A
136
137/* set up common defines for library naming */
138
4388f060 139#if U_PLATFORM_HAS_WIN32_API
b75a7d8f 140# ifndef UDATA_SO_SUFFIX
46f4442e 141# define UDATA_SO_SUFFIX ".dll"
b75a7d8f
A
142# endif
143# define LIB_PREFIX ""
374ca955 144# define LIB_STATIC_PREFIX ""
b75a7d8f 145# define OBJ_SUFFIX ".obj"
46f4442e 146# define UDATA_LIB_SUFFIX ".lib"
b75a7d8f 147
4388f060 148#elif U_PLATFORM == U_PF_CYGWIN
374ca955
A
149# define LIB_PREFIX "cyg"
150# define LIB_STATIC_PREFIX "lib"
151# define OBJ_SUFFIX ".o"
152# define UDATA_LIB_SUFFIX ".a"
153
b75a7d8f
A
154#else /* POSIX? */
155# define LIB_PREFIX "lib"
374ca955 156# define LIB_STATIC_PREFIX "lib"
b75a7d8f
A
157# define OBJ_SUFFIX ".o"
158# define UDATA_LIB_SUFFIX ".a"
729e4ab9 159#endif
b75a7d8f 160
374ca955
A
161#define ASM_SUFFIX ".s"
162
b75a7d8f
A
163/* defines for common file names */
164#define UDATA_CMN_PREFIX ""
165#define UDATA_CMN_SUFFIX ".dat"
166#define UDATA_CMN_INTERMEDIATE_SUFFIX "_dat"
167
729e4ab9
A
168#define ICUDATA_RES_FILE "icudata.res"
169
374ca955 170#define PKGDATA_DERIVED_PATH '\t'
b75a7d8f
A
171
172#endif