1819 |
|
|
1820 |
/* Make a string from NCHARS characters occupying NBYTES bytes at |
/* Make a string from NCHARS characters occupying NBYTES bytes at |
1821 |
CONTENTS. The argument MULTIBYTE controls whether to label the |
CONTENTS. The argument MULTIBYTE controls whether to label the |
1822 |
string as multibyte. */ |
string as multibyte. If NCHARS is negative, it counts the number of |
1823 |
|
characters by itself. */ |
1824 |
|
|
1825 |
Lisp_Object |
Lisp_Object |
1826 |
make_specified_string (contents, nchars, nbytes, multibyte) |
make_specified_string (contents, nchars, nbytes, multibyte) |
1829 |
int multibyte; |
int multibyte; |
1830 |
{ |
{ |
1831 |
register Lisp_Object val; |
register Lisp_Object val; |
1832 |
|
|
1833 |
|
if (nchars < 0) |
1834 |
|
{ |
1835 |
|
if (multibyte) |
1836 |
|
nchars = multibyte_chars_in_text (contents, nbytes); |
1837 |
|
else |
1838 |
|
nchars = nbytes; |
1839 |
|
} |
1840 |
val = make_uninit_multibyte_string (nchars, nbytes); |
val = make_uninit_multibyte_string (nchars, nbytes); |
1841 |
bcopy (contents, SDATA (val), nbytes); |
bcopy (contents, SDATA (val), nbytes); |
1842 |
if (!multibyte) |
if (!multibyte) |