From 85cad5793c0ea4cfd3108f9519a283b59de573a6 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 29 Jul 2003 17:36:52 +0000 Subject: [PATCH] (Fclear_string): New function. (syms_of_fns): defsubr it. --- src/fns.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/fns.c b/src/fns.c index 93ef4093b29..9ee15ff4994 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2325,6 +2325,20 @@ ARRAY is a vector, string, char-table, or bool-vector. */) } return array; } + +DEFUN ("clear-string", Fclear_string, Sclear_string, + 1, 1, 0, + doc: /* Clear the contents of STRING. +This makes STRING unibyte and may change its length. */) + (string) + Lisp_Object string; +{ + int len = SBYTES (string); + bzero (SDATA (string), len); + STRING_SET_CHARS (string, len); + STRING_SET_UNIBYTE (string); + return Qnil; +} DEFUN ("char-table-subtype", Fchar_table_subtype, Schar_table_subtype, 1, 1, 0, @@ -5659,6 +5673,7 @@ invoked by mouse clicks and mouse menu items. */); defsubr (&Slax_plist_put); defsubr (&Sequal); defsubr (&Sfillarray); + defsubr (&Sclear_string); defsubr (&Schar_table_subtype); defsubr (&Schar_table_parent); defsubr (&Sset_char_table_parent); -- 2.39.2