Lines Matching defs:length

69 *   Instead, they are preceeded by their length, written in a variable-length sequence:
70 * For each of the 32 group strings, one or two nibbles are stored for its length.
72 * A nibble with a value of 0..11 directly indicates the length of the name string.
174 int16_t length;
179 int32_t weight; /* -(cost for token) + (number of occurences) * (length-1) */
181 int16_t length;
240 parseName(const char *name, int16_t length);
255 compressLine(uint8_t *s, int16_t length, int16_t *pGroupTop);
261 findToken(uint8_t *s, int16_t length);
264 findWord(const char *s, int16_t length);
267 addWord(const char *s, int16_t length);
276 addGroup(uint32_t groupMSB, uint8_t *strings, int16_t length);
279 addToken(uint8_t *s, int16_t length);
282 appendLineLength(int16_t length);
288 allocLine(int32_t length);
291 allocWord(uint32_t length);
341 parseName(const char *name, int16_t length) {
345 while(start<length) {
347 limit=skipNoise(name, start, length);
352 if(start==length) {
357 limit=getWord(name, start, length);
526 words[wordNumber].length, words[wordNumber].s);
580 words[0].length, words[0].s);
597 words[wordNumber].length, words[wordNumber].s);
612 words[wordNumber].length, words[wordNumber].s);
676 appendLineLength(compressLine(line->s, line->length, &groupTop));
702 compressLine(uint8_t *s, int16_t length, int16_t *pGroupTop) {
708 limit=skipNoise((char *)s, start, length);
713 if(start==length) {
718 limit=getWord((char *)s, start, length);
735 } while(start<length);
737 length=(int16_t)(groupTop-*pGroupTop);
739 return length;
788 tokens[i]=(int16_t)(addToken(words[token].s, words[token].length)-groupTop);
852 size=algNamesOffset+4+algRanges.length();
856 "total data length %lu, token strings %lu, compressed strings %lu, algorithmic names %lu\n",
858 (unsigned long)(groupTop-groupBottom), (unsigned long)(4+algRanges.length()));
899 udata_writeBlock(pData, algRanges.data(), algRanges.length());
909 fprintf(stderr, "gennames: data length %ld != calculated size %lu\n",
918 findToken(uint8_t *s, int16_t length) {
923 if(token>=0 && length==words[token].length && 0==uprv_memcmp(s, words[token].s, length)) {
932 findWord(const char *s, int16_t length) {
936 if(length==words[i].length && 0==uprv_memcmp(s, words[i].s, length)) {
945 addWord(const char *s, int16_t length) {
954 stringStart=allocWord(length);
955 uprv_memcpy(stringStart, s, length);
963 word->weight=-(length+1+2);
965 word->length=length;
975 /* add to the weight the savings: the length of the word minus 1 byte for the token */
976 word->weight+=word->length-1;
984 int16_t i, length;
1001 length=count-1;
1005 length+=lengths[--i];
1009 stringStart=allocLine(length);
1012 length=0; /* number of chars copied so far */
1015 stringStart[length++]=NAME_SEPARATOR_CHAR;
1018 uprv_memcpy(stringStart+length, names[i], lengths[i]);
1019 length+=lengths[i];
1026 line->length=length;
1032 while(length>0) {
1033 tokens[stringStart[--length]]=-1;
1038 addGroup(uint32_t groupMSB, uint8_t *strings, int16_t length) {
1049 stringStart=allocLine(lineLengthsTop+length);
1051 uprv_memcpy(stringStart+lineLengthsTop, strings, length);
1056 line->length=length;
1063 addToken(uint8_t *s, int16_t length) {
1066 stringStart=allocLine(length+1);
1067 uprv_memcpy(stringStart, s, length);
1068 stringStart[length]=0;
1074 appendLineLength(int16_t length) {
1075 if(length>=76) {
1079 if(length>=12) {
1080 length-=12;
1081 appendLineLengthNibble((uint8_t)((length>>4)|12));
1083 appendLineLengthNibble((uint8_t)length);
1097 allocLine(int32_t length) {
1098 uint32_t top=lineTop+length;
1111 allocWord(uint32_t length) {
1112 uint32_t bottom=wordBottom-length;