changeset 52075:cda0be6a7138

(Fclear_string): New function. (syms_of_fns): defsubr it.
author Richard M. Stallman <rms@gnu.org>
date Tue, 29 Jul 2003 17:36:52 +0000
parents 4cddcea7e034
children 039e1c55561e
files src/fns.c
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Tue Jul 29 10:11:01 2003 +0000
+++ b/src/fns.c	Tue Jul 29 17:36:52 2003 +0000
@@ -2325,6 +2325,20 @@
     }
   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 @@
   defsubr (&Slax_plist_put);
   defsubr (&Sequal);
   defsubr (&Sfillarray);
+  defsubr (&Sclear_string);
   defsubr (&Schar_table_subtype);
   defsubr (&Schar_table_parent);
   defsubr (&Sset_char_table_parent);