Lines Matching defs:byte

146         unsigned byte;
148 byte = (unsigned char)string[i];
149 if ( (byte & 0x80) == 0 ) { /* 1byte encoding */
151 if ( byte == 0 ) {
152 newLength++; /* We gain one byte in length on NULL bytes */
154 } else if ( (byte & 0xE0) == 0xC0 ) { /* 2byte encoding */
159 i++; /* Skip next byte */
161 } else if ( (byte & 0xF0) == 0xE0 ) { /* 3byte encoding */
169 } else if ( (byte & 0xF8) == 0xF0 ) { /* 4byte encoding */
177 newLength += 6; /* 4byte encoding turns into 2 3byte ones */
209 if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
215 /* Single byte */
218 } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
221 } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
225 } else if ( (byte1 & 0xF8) == 0xF0 ) { /* 4byte encoding */
226 /* Beginning of 4byte encoding, turn into 2 3byte encodings */
271 if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
273 } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
280 newLength += 2; /* Normal 2byte encoding, not 0xC080 */
284 } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
293 /* Possible process a second 3byte encoding */
295 /* See if this is a pair of 3byte encodings */
300 /* Check encoding of 3rd byte */
304 newLength++; /* New string will have 4byte encoding */
338 if ( (byte1 & 0x80) == 0 ) { /* 1byte encoding */
339 /* Single byte */
341 } else if ( (byte1 & 0xE0) == 0xC0 ) { /* 2byte encoding */
349 } else if ( (byte1 & 0xF0) == 0xE0 ) { /* 3byte encoding */
353 /* See if this is a pair of 3byte encodings */
372 /* Convert to 4byte encoding */
380 /* Normal 3byte encoding */
396 * Convert any byte array into a printable string.
412 unsigned byte;
414 byte = bytes[i];
418 if ( byte <= 0x7f && isprint(byte) && !iscntrl(byte) ) {
419 output[outputLen++] = (char)byte;
421 (void)sprintf(output+outputLen,"\\x%02x",byte);