]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /************************************************************************** |
2 | * | |
3 | * Copyright (C) 2000, International Business Machines | |
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 */ | |
26 | struct _CharList; | |
27 | ||
28 | typedef struct _CharList | |
29 | { | |
30 | const char *str; | |
31 | struct _CharList *next; | |
32 | } CharList; | |
33 | ||
34 | ||
35 | ||
36 | /* | |
37 | * write CharList 'l' into stream 's' using deliminter 'delim' (delim can be NULL). quoted: -1 remove, 0 as is, 1 add quotes | |
38 | */ | |
39 | const 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 | */ | |
44 | const 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 | */ | |
50 | uint32_t pkg_countCharList(CharList *l); | |
51 | ||
52 | /* | |
53 | * Prepend string to CharList. Str is adopted! | |
54 | */ | |
55 | CharList *pkg_prependToList(CharList *l, const char *str); | |
56 | ||
57 | /* | |
58 | * append string to CharList. *end or even end can be null if you don't | |
59 | * know it.[slow] | |
60 | * Str is adopted! | |
61 | */ | |
62 | CharList *pkg_appendToList(CharList *l, CharList** end, const char *str); | |
63 | ||
64 | /* | |
65 | * does list contain string? Returns: t/f | |
66 | */ | |
67 | UBool pkg_listContains(CharList *l, const char *str); | |
68 | ||
69 | /* | |
70 | * Delete list | |
71 | */ | |
72 | void pkg_deleteList(CharList *l); | |
73 | ||
74 | ||
75 | ||
76 | ||
77 | /* | |
78 | * Mode package function | |
79 | */ | |
80 | struct UPKGOptions_; | |
81 | typedef void (UPKGMODE)(struct UPKGOptions_ *, FileStream *s, UErrorCode *status); | |
82 | ||
83 | /* | |
84 | * Static mode - write the readme file | |
85 | * @param opt UPKGOptions | |
86 | * @param libName Name of the .lib, etc file | |
87 | * @param status ICU error code | |
88 | */ | |
89 | void pkg_sttc_writeReadme(struct UPKGOptions_ *opt, const char *libName, UErrorCode *status); | |
90 | ||
91 | /* | |
92 | * Options to be passed throughout the program | |
93 | */ | |
94 | ||
95 | typedef struct UPKGOptions_ | |
96 | { | |
97 | CharList *fileListFiles; /* list of files containing files for inclusion in the package */ | |
98 | CharList *filePaths; /* All the files, with long paths */ | |
99 | CharList *files; /* All the files */ | |
100 | CharList *outFiles; /* output files [full paths] */ | |
101 | ||
102 | const char *shortName; /* name of what we're building */ | |
103 | const char *cShortName; /* name of what we're building as a C identifier */ | |
104 | const char *entryName; /* special entrypoint name */ | |
105 | const char *targetDir; | |
106 | const char *tmpDir; | |
107 | const char *srcDir; | |
108 | const char *options; /* Options arg */ | |
109 | const char *mode; /* Mode of building */ | |
110 | const char *version; /* Library version */ | |
111 | const char *makeArgs; /* XXX Should be a CharList! */ | |
112 | const char *comment; /* comment string */ | |
113 | const char *makeFile; /* Makefile path */ | |
114 | const char *install; /* Where to install to (NULL = don't install) */ | |
115 | const char *icuroot; /* where does ICU lives */ | |
116 | ||
117 | UBool rebuild; | |
118 | UBool clean; | |
119 | UBool nooutput; | |
120 | UBool verbose; | |
121 | UBool hadStdin; /* Stdin was a dependency - don't make anything depend on the file list coming in. */ | |
122 | ||
123 | UPKGMODE *fcn; /* Handler function */ | |
124 | } UPKGOptions; | |
125 | ||
126 | ||
127 | /* set up common defines for library naming */ | |
128 | ||
129 | #ifdef WIN32 | |
130 | # ifndef UDATA_SO_SUFFIX | |
131 | # define UDATA_SO_SUFFIX ".DLL" | |
132 | # endif | |
133 | # define LIB_PREFIX "" | |
134 | # define OBJ_SUFFIX ".obj" | |
135 | # define UDATA_LIB_SUFFIX ".LIB" | |
136 | ||
137 | #else /* POSIX? */ | |
138 | # define LIB_PREFIX "lib" | |
139 | # define OBJ_SUFFIX ".o" | |
140 | # define UDATA_LIB_SUFFIX ".a" | |
141 | #endif | |
142 | ||
143 | ||
144 | /* defines for common file names */ | |
145 | #define UDATA_CMN_PREFIX "" | |
146 | #define UDATA_CMN_SUFFIX ".dat" | |
147 | #define UDATA_CMN_INTERMEDIATE_SUFFIX "_dat" | |
148 | ||
149 | ||
150 | #endif |