Lines Matching refs:value
19 * to the string and the length of the string. It sets 'value' to the value of
31 unsigned long value;
37 /* Check syntax and work out the encoded value (if correct) */
39 value = *p++ & 0x7f;
46 value = (*p++ & 0x1f) << 6;
47 value |= *p++ & 0x3f;
48 if (value < 0x80)
57 value = (*p++ & 0xf) << 12;
58 value |= (*p++ & 0x3f) << 6;
59 value |= *p++ & 0x3f;
60 if (value < 0x800)
62 if (is_unicode_surrogate(value))
72 value = ((unsigned long)(*p++ & 0x7)) << 18;
73 value |= (*p++ & 0x3f) << 12;
74 value |= (*p++ & 0x3f) << 6;
75 value |= *p++ & 0x3f;
76 if (value < 0x10000)
81 *val = value;
86 * This takes a character 'value' and writes the UTF8 encoded value in 'str'
88 * characters written, -1 if 'len' is too small or -2 if 'value' is out of
93 int UTF8_putc(unsigned char *str, int len, unsigned long value)
99 if (value < 0x80) {
101 *str = (unsigned char)value;
104 if (value < 0x800) {
108 *str++ = (unsigned char)(((value >> 6) & 0x1f) | 0xc0);
109 *str = (unsigned char)((value & 0x3f) | 0x80);
113 if (value < 0x10000) {
114 if (is_unicode_surrogate(value))
119 *str++ = (unsigned char)(((value >> 12) & 0xf) | 0xe0);
120 *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
121 *str = (unsigned char)((value & 0x3f) | 0x80);
125 if (value < UNICODE_LIMIT) {
129 *str++ = (unsigned char)(((value >> 18) & 0x7) | 0xf0);
130 *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80);
131 *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
132 *str = (unsigned char)((value & 0x3f) | 0x80);