summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-02-08 20:58:53 +0000
committerRichard M. Stallman <rms@gnu.org>1998-02-08 20:58:53 +0000
commit05629176778f438c7f5e41e09805d874e3c0651a (patch)
treea711adb82ca03658078815b8a3481c3a861d94e5
parent217cfb8b3b25ed1fc4ebf2834e496bd5e6268bf5 (diff)
downloademacs-05629176778f438c7f5e41e09805d874e3c0651a.tar.gz
(Fstring_bytes): New function.
(syms_of_fns): defsubr it.
-rw-r--r--src/fns.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fns.c b/src/fns.c
index bb323f765f7..bc14b280002 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -179,6 +179,15 @@ which is at least the number of distinct elements.")
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 @@ invoked by mouse clicks and mouse menu items.");
defsubr (&Srandom);
defsubr (&Slength);
defsubr (&Ssafe_length);
+ defsubr (&Sstring_bytes);
defsubr (&Sstring_equal);
defsubr (&Sstring_lessp);
defsubr (&Sappend);