802 |
|
|
803 |
int |
int |
804 |
find_charset_in_text (ptr, nchars, nbytes, charsets, table) |
find_charset_in_text (ptr, nchars, nbytes, charsets, table) |
805 |
unsigned char *ptr; |
const unsigned char *ptr; |
806 |
int nchars, nbytes, *charsets; |
int nchars, nbytes, *charsets; |
807 |
Lisp_Object table; |
Lisp_Object table; |
808 |
{ |
{ |
810 |
{ |
{ |
811 |
if (charsets && nbytes > 0) |
if (charsets && nbytes > 0) |
812 |
{ |
{ |
813 |
unsigned char *endp = ptr + nbytes; |
const unsigned char *endp = ptr + nbytes; |
814 |
int maskbits = 0; |
int maskbits = 0; |
815 |
|
|
816 |
while (ptr < endp && maskbits != 7) |
while (ptr < endp && maskbits != 7) |
1271 |
|
|
1272 |
int |
int |
1273 |
c_string_width (str, len, precision, nchars, nbytes) |
c_string_width (str, len, precision, nchars, nbytes) |
1274 |
unsigned char *str; |
const unsigned char *str; |
1275 |
int precision, *nchars, *nbytes; |
int precision, *nchars, *nbytes; |
1276 |
{ |
{ |
1277 |
int i = 0, i_byte = 0; |
int i = 0, i_byte = 0; |
1337 |
{ |
{ |
1338 |
int len = SCHARS (string); |
int len = SCHARS (string); |
1339 |
int len_byte = SBYTES (string); |
int len_byte = SBYTES (string); |
1340 |
unsigned char *str = SDATA (string); |
const unsigned char *str = SDATA (string); |
1341 |
int i = 0, i_byte = 0; |
int i = 0, i_byte = 0; |
1342 |
int width = 0; |
int width = 0; |
1343 |
struct Lisp_Char_Table *dp = buffer_display_table (); |
struct Lisp_Char_Table *dp = buffer_display_table (); |
1451 |
|
|
1452 |
int |
int |
1453 |
chars_in_text (ptr, nbytes) |
chars_in_text (ptr, nbytes) |
1454 |
unsigned char *ptr; |
const unsigned char *ptr; |
1455 |
int nbytes; |
int nbytes; |
1456 |
{ |
{ |
1457 |
/* current_buffer is null at early stages of Emacs initialization. */ |
/* current_buffer is null at early stages of Emacs initialization. */ |
1468 |
|
|
1469 |
int |
int |
1470 |
multibyte_chars_in_text (ptr, nbytes) |
multibyte_chars_in_text (ptr, nbytes) |
1471 |
unsigned char *ptr; |
const unsigned char *ptr; |
1472 |
int nbytes; |
int nbytes; |
1473 |
{ |
{ |
1474 |
unsigned char *endp; |
const unsigned char *endp; |
1475 |
int chars, bytes; |
int chars, bytes; |
1476 |
|
|
1477 |
endp = ptr + nbytes; |
endp = ptr + nbytes; |
1493 |
0x80..0x9F are represented by 2 bytes in multibyte text. */ |
0x80..0x9F are represented by 2 bytes in multibyte text. */ |
1494 |
void |
void |
1495 |
parse_str_as_multibyte (str, len, nchars, nbytes) |
parse_str_as_multibyte (str, len, nchars, nbytes) |
1496 |
unsigned char *str; |
const unsigned char *str; |
1497 |
int len, *nchars, *nbytes; |
int len, *nchars, *nbytes; |
1498 |
{ |
{ |
1499 |
unsigned char *endp = str + len; |
const unsigned char *endp = str + len; |
1500 |
int n, chars = 0, bytes = 0; |
int n, chars = 0, bytes = 0; |
1501 |
|
|
1502 |
while (str < endp) |
while (str < endp) |