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