ICU-1721 need column count in uprops.dat

X-SVN-Rev: 7780
This commit is contained in:
Markus Scherer 2002-02-25 22:41:40 +00:00
parent 3e48299654
commit c3cb396f2f
3 changed files with 18 additions and 6 deletions

View File

@ -27,7 +27,10 @@ enum {
UPROPS_EXCEPTIONS_TOP_INDEX,
UPROPS_ADDITIONAL_TRIE_INDEX,
UPROPS_ADDITIONAL_VECTORS_INDEX,
UPROPS_ADDITIONAL_VECTORS_TOP_INDEX
UPROPS_ADDITIONAL_VECTORS_COLUMNS_INDEX,
UPROPS_RESERVED_INDEX,
UPROPS_INDEX_COUNT=16
};
/* number of properties vector words */
@ -43,4 +46,12 @@ enum {
#define UPROPS_AGE_MASK 0xff000000
#define UPROPS_AGE_SHIFT 24
/**
* Get a properties vector word for a code point.
* Implemented in uchar.c for uprops.c.
* @return 0 if no data or illegal argument
*/
U_CFUNC uint32_t
u_getUnicodeProperties(UChar32 c, int32_t column);
#endif

View File

@ -121,7 +121,7 @@ parseAge(const char *filename, uint32_t *pv, UErrorCode *pErrorCode) {
}
U_CFUNC int32_t
writeAdditionalData(uint8_t *p, int32_t capacity, int32_t indexes[16]) {
writeAdditionalData(uint8_t *p, int32_t capacity, int32_t indexes[UPROPS_INDEX_COUNT]) {
int32_t length;
UErrorCode errorCode;
@ -141,14 +141,16 @@ writeAdditionalData(uint8_t *p, int32_t capacity, int32_t indexes[16]) {
/* set indexes */
indexes[UPROPS_ADDITIONAL_VECTORS_INDEX]=
indexes[UPROPS_ADDITIONAL_TRIE_INDEX]+length/4;
indexes[UPROPS_ADDITIONAL_VECTORS_TOP_INDEX]=
indexes[UPROPS_ADDITIONAL_VECTORS_COLUMNS_INDEX]=
indexes[UPROPS_ADDITIONAL_VECTORS_INDEX]+pvCount;
indexes[UPROPS_ADDITIONAL_VECTORS_COLUMNS_INDEX]=UPROPS_VECTOR_WORDS;
}
if(p!=NULL && (pvCount*4)<=capacity) {
uprv_memcpy(p, pv, pvCount*4);
if(beVerbose) {
printf("number of additional props vectors: %5u\n", pvCount/UPROPS_VECTOR_WORDS);
printf("number of 32-bit words per vector: %5u\n", UPROPS_VECTOR_WORDS);
}
}
length+=pvCount*4;

View File

@ -35,7 +35,6 @@
/*
* ### TODO
* document structure with additional properties
* increment version number
* use index enums in uchar.c
* improve UTrie compaction: remove identical data blocks before folding! - need to remember which ones are skipped?!
*/
@ -253,7 +252,7 @@ static UDataInfo dataInfo={
0,
{ 0x55, 0x50, 0x72, 0x6f }, /* dataFormat="UPro" */
{ 2, 0, UTRIE_SHIFT, UTRIE_INDEX_SHIFT }, /* formatVersion */
{ 2, 1, UTRIE_SHIFT, UTRIE_INDEX_SHIFT }, /* formatVersion */
{ 3, 0, 0, 0 } /* dataVersion */
};
@ -770,7 +769,7 @@ getFoldedPropsValue(UNewTrie *trie, UChar32 start, int32_t offset) {
extern void
generateData(const char *dataDir) {
static int32_t indexes[16]={
static int32_t indexes[UPROPS_INDEX_COUNT]={
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,