Home | History | Annotate | Download | only in npt

Lines Matching defs:byte

152         unsigned byte;
154 byte = (unsigned char)string[i];
155 if ( (byte & 0x80) == 0 ) { /* 1byte encoding */
157 if ( byte == 0 ) {
158 newLength++; /* We gain one byte in length on NULL bytes */
160 } else if ( (byte & 0xE0) == 0xC0 ) { /* 2byte encoding */
165 i++; /* Skip next byte */
167 } else if ( (byte & 0xF0) == 0xE0 ) { /* 3byte encoding */
175 } else if ( (byte & 0xF8) == 0xF0 ) { /* 4byte encoding */
183 newLength += 6; /* 4byte encoding turns into 2 3byte ones */
215 if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
221 /* Single byte */
224 } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
227 } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
231 } else if ( (byte1 & 0xF8) == 0xF0 ) { /* 4byte encoding */
232 /* Beginning of 4byte encoding, turn into 2 3byte encodings */
277 if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
279 } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
286 newLength += 2; /* Normal 2byte encoding, not 0xC080 */
290 } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
299 /* Possible process a second 3byte encoding */
301 /* See if this is a pair of 3byte encodings */
306 /* Check encoding of 3rd byte */
310 newLength++; /* New string will have 4byte encoding */
344 if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
345 /* Single byte */
347 } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
355 } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
359 /* See if this is a pair of 3byte encodings */
378 /* Convert to 4byte encoding */
386 /* Normal 3byte encoding */
402 * Convert any byte array into a printable string.
418 unsigned byte;
420 byte = bytes[i];
421 if ( byte <= 0x7f && isprint(byte) && !iscntrl(byte) ) {
425 output[outputLen++] = (char)byte;
430 (void)sprintf(output+outputLen,"\\x%02x",byte);