changeset 20864:ad9e06c97d95

(Fstring_bytes): New function. (syms_of_fns): defsubr it.
author Richard M. Stallman <rms@gnu.org>
date Sun, 08 Feb 1998 20:58:53 +0000
parents 6ee33d0e1682
children 7a730831aa0e
files src/fns.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/fns.c	Sun Feb 08 20:55:44 1998 +0000
+++ b/src/fns.c	Sun Feb 08 20:58:53 1998 +0000
@@ -179,6 +179,15 @@
   return length;
 }
 
+DEFUN ("string-bytes", Fstring_bytes, Sstring_bytes, 1, 1, 0,
+  "Return the number of bytes in STRING.\n\
+If STRING is a multibyte string, this is greater than the length of STRING.")
+  (string)
+{
+  CHECK_STRING (string, 1);
+  return make_number (XSTRING (string)->size_byte);
+}
+
 DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0,
   "Return t if two strings have identical contents.\n\
 Case is significant, but text properties are ignored.\n\
@@ -2541,6 +2550,7 @@
   defsubr (&Srandom);
   defsubr (&Slength);
   defsubr (&Ssafe_length);
+  defsubr (&Sstring_bytes);
   defsubr (&Sstring_equal);
   defsubr (&Sstring_lessp);
   defsubr (&Sappend);