Lines Matching defs:header
88 /* swap the header */
113 // First check for format version 4+ which has a standard data header.
133 * check the length against the header size before reading the size field
135 UCATableHeader header;
136 uprv_memset(&header, 0, sizeof(header));
138 header.size=udata_readInt32(ds, inHeader->size);
139 } else if((length<(42*4) || length<(header.size=udata_readInt32(ds, inHeader->size)))) {
143 header.magic=ds->readUInt32(inHeader->magic);
145 header.magic==UCOL_HEADER_MAGIC &&
161 /* swap a header-less collation formatVersion=3 binary, inside a resource bundle or ucadata.icu */
171 UCATableHeader header;
194 * check the length against the header size before reading the size field
196 uprv_memset(&header, 0, sizeof(header));
198 header.size=udata_readInt32(ds, inHeader->size);
199 } else if((length<(42*4) || length<(header.size=udata_readInt32(ds, inHeader->size)))) {
200 udata_printError(ds, "ucol_swap(formatVersion=3): too few bytes (%d after header) for collation data\n",
206 header.magic=ds->readUInt32(inHeader->magic);
208 header.magic==UCOL_HEADER_MAGIC &&
213 header.magic,
229 uprv_memcpy(outBytes, inBytes, header.size);
235 header.options= ds->readUInt32(inHeader->options);
236 header.UCAConsts= ds->readUInt32(inHeader->UCAConsts);
237 header.contractionUCACombos= ds->readUInt32(inHeader->contractionUCACombos);
238 header.mappingPosition= ds->readUInt32(inHeader->mappingPosition);
239 header.expansion= ds->readUInt32(inHeader->expansion);
240 header.contractionIndex= ds->readUInt32(inHeader->contractionIndex);
241 header.contractionCEs= ds->readUInt32(inHeader->contractionCEs);
242 header.contractionSize= ds->readUInt32(inHeader->contractionSize);
243 header.endExpansionCE= ds->readUInt32(inHeader->endExpansionCE);
244 header.expansionCESize= ds->readUInt32(inHeader->expansionCESize);
245 header.endExpansionCECount= udata_readInt32(ds, inHeader->endExpansionCECount);
246 header.contractionUCACombosSize=udata_readInt32(ds, inHeader->contractionUCACombosSize);
247 header.scriptToLeadByte= ds->readUInt32(inHeader->scriptToLeadByte);
248 header.leadByteToScript= ds->readUInt32(inHeader->leadByteToScript);
250 /* swap the 32-bit integers in the header */
253 ds->swapArray32(ds, &(inHeader->scriptToLeadByte), sizeof(header.scriptToLeadByte) + sizeof(header.leadByteToScript),
260 if(header.options!=0) {
261 ds->swapArray32(ds, inBytes+header.options, header.expansion-header.options,
262 outBytes+header.options, pErrorCode);
266 if(header.mappingPosition!=0 && header.expansion!=0) {
267 if(header.contractionIndex!=0) {
269 count=header.contractionIndex-header.expansion;
272 count=header.mappingPosition-header.expansion;
274 ds->swapArray32(ds, inBytes+header.expansion, (int32_t)count,
275 outBytes+header.expansion, pErrorCode);
279 if(header.contractionSize!=0) {
281 ds->swapArray16(ds, inBytes+header.contractionIndex, header.contractionSize*2,
282 outBytes+header.contractionIndex, pErrorCode);
285 ds->swapArray32(ds, inBytes+header.contractionCEs, header.contractionSize*4,
286 outBytes+header.contractionCEs, pErrorCode);
290 if(header.mappingPosition!=0) {
291 count=header.endExpansionCE-header.mappingPosition;
292 utrie_swap(ds, inBytes+header.mappingPosition, (int32_t)count,
293 outBytes+header.mappingPosition, pErrorCode);
297 if(header.endExpansionCECount!=0) {
298 ds->swapArray32(ds, inBytes+header.endExpansionCE, header.endExpansionCECount*4,
299 outBytes+header.endExpansionCE, pErrorCode);
305 if(header.UCAConsts!=0) {
310 ds->swapArray32(ds, inBytes+header.UCAConsts, header.contractionUCACombos-header.UCAConsts,
311 outBytes+header.UCAConsts, pErrorCode);
315 if(header.contractionUCACombosSize!=0) {
316 count=header.contractionUCACombosSize*inHeader->contractionUCACombosWidth*U_SIZEOF_UCHAR;
317 ds->swapArray16(ds, inBytes+header.contractionUCACombos, (int32_t)count,
318 outBytes+header.contractionUCACombos, pErrorCode);
322 if(header.scriptToLeadByte!=0) {
323 int indexCount = ds->readUInt16(*((uint16_t*)(inBytes+header.scriptToLeadByte))); // each entry = 2 * uint16
324 int dataCount = ds->readUInt16(*((uint16_t*)(inBytes+header.scriptToLeadByte + 2))); // each entry = uint16
325 ds->swapArray16(ds, inBytes+header.scriptToLeadByte,
327 outBytes+header.scriptToLeadByte, pErrorCode);
331 if(header.leadByteToScript!=0) {
332 int indexCount = ds->readUInt16(*((uint16_t*)(inBytes+header.leadByteToScript))); // each entry = uint16
333 int dataCount = ds->readUInt16(*((uint16_t*)(inBytes+header.leadByteToScript + 2))); // each entry = uint16
334 ds->swapArray16(ds, inBytes+header.leadByteToScript,
336 outBytes+header.leadByteToScript, pErrorCode);
340 return header.size;
391 "(%d after header) for collation data\n",
400 "(%d after header) for collation data\n",
427 "(%d after header) for collation data\n",
557 // Try to swap the old format version which did not have a standard data header.
609 InverseUCATableHeader header={ 0,0,0,0,0,{0,0,0,0},{0,0,0,0,0,0,0,0} };
645 * check the length against the header size before reading the size field
648 header.byteSize=udata_readInt32(ds, inHeader->byteSize);
651 (uint32_t)(length-headerSize)<(header.byteSize=udata_readInt32(ds, inHeader->byteSize)))
653 udata_printError(ds, "ucol_swapInverseUCA(): too few bytes (%d after header) for inverse UCA collation data\n",
662 uprv_memcpy(outBytes, inBytes, header.byteSize);
668 header.tableSize= ds->readUInt32(inHeader->tableSize);
669 header.contsSize= ds->readUInt32(inHeader->contsSize);
670 header.table= ds->readUInt32(inHeader->table);
671 header.conts= ds->readUInt32(inHeader->conts);
673 /* swap the 32-bit integers in the header */
677 ds->swapArray32(ds, inBytes+header.table, header.tableSize*3*4,
678 outBytes+header.table, pErrorCode);
681 ds->swapArray16(ds, inBytes+header.conts, header.contsSize*U_SIZEOF_UCHAR,
682 outBytes+header.conts, pErrorCode);
685 return headerSize+header.byteSize;