]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/tools/genrb/reslist.h
ICU-6.2.13.tar.gz
[apple/icu.git] / icuSources / tools / genrb / reslist.h
index 0799372304e6ecf78a9a6764a5dbb14ccbbbd4be..34e35fd27c4612cf478cdbb7c8d43e8bd362f409 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef RESLIST_H
 #define RESLIST_H
 
-#define KEY_SPACE_SIZE 65532
+#define KEY_SPACE_SIZE 65536
 #define RESLIST_MAX_INT_VECTOR 2048
 
 #include "unicode/utypes.h"
 #include "cmemory.h"
 #include "cstring.h"
 #include "unewdata.h"
+#include "ustr.h"
 
 U_CDECL_BEGIN
 
 /* Resource bundle root table */
 struct SRBRoot {
   char *fLocale;
-  uint32_t fKeyPoint;
+  int32_t fKeyPoint;
   char *fKeys;
+  int32_t fKeysCapacity;
   int32_t fCount;
-  struct SResource *fRoot; 
+  struct SResource *fRoot;
+  int32_t fMaxTableLength;
 };
 
-struct SRBRoot *bundle_open(UErrorCode *status);
+struct SRBRoot *bundle_open(const struct UString* comment, UErrorCode *status);
 void bundle_write(struct SRBRoot *bundle, const char *outputDir, const char *outputPkg, char *writtenFilename, int writtenFilenameLen, UErrorCode *status);
 
 /* write a java resource file */
@@ -58,18 +61,19 @@ void bundle_write_xml(struct SRBRoot *bundle, const char *outputDir,const char*
 
 void bundle_close(struct SRBRoot *bundle, UErrorCode *status);
 void bundle_setlocale(struct SRBRoot *bundle, UChar *locale, UErrorCode *status);
-uint16_t bundle_addtag(struct SRBRoot *bundle, const char *tag, UErrorCode *status);
+int32_t bundle_addtag(struct SRBRoot *bundle, const char *tag, UErrorCode *status);
 
 /* Various resource types */
+struct SResource* res_open(const struct UString* comment, UErrorCode* status);
 
 struct SResTable {
-    uint16_t fCount;
+    uint32_t fCount;
     uint32_t fChildrenSize;
     struct SResource *fFirst;
     struct SRBRoot *fRoot;
 };
 
-struct SResource* table_open(struct SRBRoot *bundle, char *tag, UErrorCode *status);
+struct SResource* table_open(struct SRBRoot *bundle, char *tag, const struct UString* comment, UErrorCode *status);
 void table_close(struct SResource *table, UErrorCode *status);
 void table_add(struct SResource *table, struct SResource *res, int linenumber, UErrorCode *status);
 
@@ -80,7 +84,7 @@ struct SResArray {
     struct SResource *fLast;
 };
 
-struct SResource* array_open(struct SRBRoot *bundle, char *tag, UErrorCode *status);
+struct SResource* array_open(struct SRBRoot *bundle, char *tag, const struct UString* comment, UErrorCode *status);
 void array_close(struct SResource *array, UErrorCode *status);
 void array_add(struct SResource *array, struct SResource *res, UErrorCode *status);
 
@@ -89,10 +93,10 @@ struct SResString {
     UChar *fChars;
 };
 
-struct SResource *string_open(struct SRBRoot *bundle, char *tag, const UChar *value, int32_t len, UErrorCode *status);
+struct SResource *string_open(struct SRBRoot *bundle, char *tag, const UChar *value, int32_t len, const struct UString* comment, UErrorCode *status);
 void string_close(struct SResource *string, UErrorCode *status);
 
-struct SResource *alias_open(struct SRBRoot *bundle, char *tag, UChar *value, int32_t len, UErrorCode *status);
+struct SResource *alias_open(struct SRBRoot *bundle, char *tag, UChar *value, int32_t len, const struct UString* comment, UErrorCode *status);
 void alias_close(struct SResource *string, UErrorCode *status);
 
 struct SResIntVector {
@@ -100,7 +104,7 @@ struct SResIntVector {
     uint32_t *fArray;
 };
 
-struct SResource* intvector_open(struct SRBRoot *bundle, char *tag, UErrorCode *status);
+struct SResource* intvector_open(struct SRBRoot *bundle, char *tag,  const struct UString* comment, UErrorCode *status);
 void intvector_close(struct SResource *intvector, UErrorCode *status);
 void intvector_add(struct SResource *intvector, int32_t value, UErrorCode *status);
 
@@ -108,7 +112,7 @@ struct SResInt {
     uint32_t fValue;
 };
 
-struct SResource *int_open(struct SRBRoot *bundle, char *tag, int32_t value, UErrorCode *status);
+struct SResource *int_open(struct SRBRoot *bundle, char *tag, int32_t value, const struct UString* comment, UErrorCode *status);
 void int_close(struct SResource *intres, UErrorCode *status);
 
 struct SResBinary {
@@ -117,17 +121,18 @@ struct SResBinary {
     char* fFileName; /* file name for binary or import binary tags if any */
 };
 
-struct SResource *bin_open(struct SRBRoot *bundle, const char *tag, uint32_t length, uint8_t *data, const char* fileName, UErrorCode *status);
+struct SResource *bin_open(struct SRBRoot *bundle, const char *tag, uint32_t length, uint8_t *data, const char* fileName, const struct UString* comment, UErrorCode *status);
 void bin_close(struct SResource *binres, UErrorCode *status);
 
 /* Resource place holder */
 
 struct SResource {
     UResType fType;
-    uint16_t fKey;
+    int32_t  fKey;
     uint32_t fSize; /* Size in bytes outside the header part */
     int      line;  /* used internally to report duplicate keys in tables */
     struct SResource *fNext; /*This is for internal chaining while building*/
+    struct UString *fComment;
     union {
         struct SResTable fTable;
         struct SResArray fArray;