diff options
| author | Kenichi Handa | 2007-05-14 11:55:50 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2007-05-14 11:55:50 +0000 |
| commit | 70b4969d0c56fb8c749f13785d72d9998d600e28 (patch) | |
| tree | e20b2c79dc839d858c1d98ac328a363ceeb354a5 /src | |
| parent | c8296a633e29c7b9edaaec931fc6461ad256e9be (diff) | |
| download | emacs-70b4969d0c56fb8c749f13785d72d9998d600e28.tar.gz emacs-70b4969d0c56fb8c749f13785d72d9998d600e28.zip | |
(Funibyte_string): New function.
(syms_of_character): Defsubr it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/character.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/character.c b/src/character.c index dd3771fc280..630eac9fc3b 100644 --- a/src/character.c +++ b/src/character.c | |||
| @@ -931,6 +931,29 @@ usage: (string &rest CHARACTERS) */) | |||
| 931 | return make_string_from_bytes ((char *) buf, n, p - buf); | 931 | return make_string_from_bytes ((char *) buf, n, p - buf); |
| 932 | } | 932 | } |
| 933 | 933 | ||
| 934 | DEFUN ("unibyte-string", Funibyte_string, Sunibyte_string, 0, MANY, 0, | ||
| 935 | doc: /* Concatenate all the argument bytes and make the result a unibyte string. */) | ||
| 936 | (n, args) | ||
| 937 | int n; | ||
| 938 | Lisp_Object *args; | ||
| 939 | { | ||
| 940 | int i; | ||
| 941 | unsigned char *buf = (unsigned char *) alloca (n); | ||
| 942 | unsigned char *p = buf; | ||
| 943 | unsigned c; | ||
| 944 | |||
| 945 | for (i = 0; i < n; i++) | ||
| 946 | { | ||
| 947 | CHECK_NATNUM (args[i]); | ||
| 948 | c = XFASTINT (args[i]); | ||
| 949 | if (c >= 256) | ||
| 950 | args_out_of_range_3 (args[i], make_number (0), make_number (255)); | ||
| 951 | *p++ = c; | ||
| 952 | } | ||
| 953 | |||
| 954 | return make_string_from_bytes ((char *) buf, n, p - buf); | ||
| 955 | } | ||
| 956 | |||
| 934 | void | 957 | void |
| 935 | init_character_once () | 958 | init_character_once () |
| 936 | { | 959 | { |
| @@ -956,6 +979,7 @@ syms_of_character () | |||
| 956 | defsubr (&Sstring_width); | 979 | defsubr (&Sstring_width); |
| 957 | defsubr (&Schar_direction); | 980 | defsubr (&Schar_direction); |
| 958 | defsubr (&Sstring); | 981 | defsubr (&Sstring); |
| 982 | defsubr (&Sunibyte_string); | ||
| 959 | 983 | ||
| 960 | DEFVAR_LISP ("translation-table-vector", &Vtranslation_table_vector, | 984 | DEFVAR_LISP ("translation-table-vector", &Vtranslation_table_vector, |
| 961 | doc: /* | 985 | doc: /* |