ICU-564 add aliasing init functions

X-SVN-Rev: 2446
This commit is contained in:
Alan Liu 2000-09-19 16:33:22 +00:00
parent ad3a2dbdc4
commit c8a748528c
2 changed files with 26 additions and 1 deletions

View File

@ -306,6 +306,24 @@ CompactShortArray* ucmp16_initAlias(CompactShortArray *this_obj,
return this_obj;
}
CompactShortArray* ucmp16_initAliasWithBlockShift(CompactShortArray *this_obj,
uint16_t *indexArray,
int16_t *newValues,
int32_t count,
int16_t defaultValue,
int32_t blockShift)
{
ucmp16_initAlias(this_obj, indexArray, newValues, count, defaultValue);
if (this_obj) {
this_obj->kBlockShift = blockShift;
this_obj->kBlockMask = (uint32_t) (((uint32_t)1 << (uint32_t)blockShift) - (uint32_t)1);
}
return this_obj;
}
/*=======================================================*/
void ucmp16_close(CompactShortArray* this_obj)

View File

@ -70,7 +70,7 @@
* @see CompactIntArray
* @see CompactCharArray
* @see CompactStringArray
* @version $Revision: 1.12 $ 8/25/98
* @version $Revision: 1.13 $ 8/25/98
* @author Helena Shih
*/
@ -162,6 +162,13 @@ U_CAPI CompactShortArray* U_EXPORT2 ucmp16_initAlias(CompactShortArray *this_ob
int16_t defaultValue );
U_CAPI CompactShortArray* U_EXPORT2 ucmp16_initAliasWithBlockShift(CompactShortArray *this_obj,
uint16_t *indexArray,
int16_t *newValues,
int32_t count,
int16_t defaultValue,
int32_t blockShift);
U_CAPI void U_EXPORT2 ucmp16_close(CompactShortArray* array);
/**
* Returns TRUE if the creation of the compact array fails.