~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/tools/genrb/reslist.h

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
*******************************************************************************
3
 
*
4
 
*   Copyright (C) 2000, International Business Machines
5
 
*   Corporation and others.  All Rights Reserved.
6
 
*
7
 
*******************************************************************************
8
 
*
9
 
* File reslist.h
10
 
*
11
 
* Modification History:
12
 
*
13
 
*   Date        Name        Description
14
 
*   02/21/00    weiv        Creation.
15
 
*******************************************************************************
16
 
*/
17
 
 
18
 
#ifndef RESLIST_H
19
 
#define RESLIST_H
20
 
 
21
 
#define KEY_SPACE_SIZE 65532
22
 
#define RESLIST_MAX_INT_VECTOR 2048
23
 
 
24
 
#include "unicode/utypes.h"
25
 
#include "unicode/ures.h"
26
 
#include "unicode/ustring.h"
27
 
#include "uresdata.h"
28
 
#include "cmemory.h"
29
 
#include "cstring.h"
30
 
#include "unewdata.h"
31
 
 
32
 
U_CDECL_BEGIN
33
 
 
34
 
/* Resource bundle root table */
35
 
struct SRBRoot {
36
 
  char *fLocale;
37
 
  uint16_t fKeyPoint;
38
 
  char *fKeys;
39
 
  int32_t fCount;
40
 
  struct SResource *fRoot; 
41
 
};
42
 
 
43
 
struct SRBRoot *bundle_open(UErrorCode *status);
44
 
void bundle_write(struct SRBRoot *bundle, const char *outputDir, char *writtenFilename, int writtenFilenameLen, UErrorCode *status);
45
 
 
46
 
/* write a java resource file */
47
 
void bundle_write_java(struct SRBRoot *bundle, const char *outputDir, const char* outputEnc, char *writtenFilename, int writtenFilenameLen, UErrorCode *status);
48
 
 
49
 
void bundle_close(struct SRBRoot *bundle, UErrorCode *status);
50
 
void bundle_setlocale(struct SRBRoot *bundle, UChar *locale, UErrorCode *status);
51
 
uint16_t bundle_addtag(struct SRBRoot *bundle, const char *tag, UErrorCode *status);
52
 
 
53
 
/* Various resource types */
54
 
 
55
 
struct SResTable {
56
 
    uint16_t fCount;
57
 
    uint32_t fChildrenSize;
58
 
    struct SResource *fFirst;
59
 
    struct SRBRoot *fRoot;
60
 
};
61
 
 
62
 
struct SResource* table_open(struct SRBRoot *bundle, char *tag, UErrorCode *status);
63
 
void table_close(struct SResource *table, UErrorCode *status);
64
 
void table_add(struct SResource *table, struct SResource *res, int linenumber, UErrorCode *status);
65
 
 
66
 
struct SResArray {
67
 
    uint32_t fCount;
68
 
    uint32_t fChildrenSize;
69
 
    struct SResource *fFirst;
70
 
    struct SResource *fLast;
71
 
};
72
 
 
73
 
struct SResource* array_open(struct SRBRoot *bundle, char *tag, UErrorCode *status);
74
 
void array_close(struct SResource *array, UErrorCode *status);
75
 
void array_add(struct SResource *array, struct SResource *res, UErrorCode *status);
76
 
 
77
 
struct SResString {
78
 
    uint32_t fLength;
79
 
    UChar *fChars;
80
 
};
81
 
 
82
 
struct SResource *string_open(struct SRBRoot *bundle, char *tag, UChar *value, int32_t len, UErrorCode *status);
83
 
void string_close(struct SResource *string, UErrorCode *status);
84
 
 
85
 
struct SResIntVector {
86
 
    uint32_t fCount;
87
 
    uint32_t *fArray;
88
 
};
89
 
 
90
 
struct SResource* intvector_open(struct SRBRoot *bundle, char *tag, UErrorCode *status);
91
 
void intvector_close(struct SResource *intvector, UErrorCode *status);
92
 
void intvector_add(struct SResource *intvector, int32_t value, UErrorCode *status);
93
 
 
94
 
struct SResInt {
95
 
    uint32_t fValue;
96
 
};
97
 
 
98
 
struct SResource *int_open(struct SRBRoot *bundle, char *tag, int32_t value, UErrorCode *status);
99
 
void int_close(struct SResource *intres, UErrorCode *status);
100
 
 
101
 
struct SResBinary {
102
 
    uint32_t fLength;
103
 
    uint8_t *fData;
104
 
};
105
 
 
106
 
struct SResource *bin_open(struct SRBRoot *bundle, const char *tag, uint32_t length, uint8_t *data, UErrorCode *status);
107
 
void bin_close(struct SResource *binres, UErrorCode *status);
108
 
 
109
 
/* Resource place holder */
110
 
 
111
 
struct SResource {
112
 
    UResType fType;
113
 
    uint16_t fKey;
114
 
    uint32_t fSize; /* Size in bytes outside the header part */
115
 
    int      line;  /* used internally to report duplicate keys in tables */
116
 
    struct SResource *fNext; /*This is for internal chaining while building*/
117
 
    union {
118
 
        struct SResTable fTable;
119
 
        struct SResArray fArray;
120
 
        struct SResString fString;
121
 
        struct SResIntVector fIntVector;
122
 
        struct SResInt fIntValue;
123
 
        struct SResBinary fBinaryValue;
124
 
    } u;
125
 
};
126
 
 
127
 
void res_close(struct SResource *res, UErrorCode *status);
128
 
void setIncludeCopyright(UBool val);
129
 
UBool getIncludeCopyright(void);
130
 
 
131
 
U_CDECL_END
132
 
#endif /* #ifndef RESLIST_H */