]> git.eshelyaron.com Git - emacs.git/commitdiff
(SREF, SDATA, SCHARS, SBYTES, SMBP): New macros.
authorGerd Moellmann <gerd@gnu.org>
Fri, 8 Mar 2002 10:26:32 +0000 (10:26 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 8 Mar 2002 10:26:32 +0000 (10:26 +0000)
src/lisp.h

index cc464b95e92e888507704b433ba0579325b56136..234ab3ea9c744d749c45033c2d4b64043435014e 100644 (file)
@@ -1,5 +1,5 @@
 /* Fundamental definitions for GNU Emacs Lisp interpreter.
-   Copyright (C) 1985,86,87,93,94,95,97,98,1999,2000, 2001
+   Copyright (C) 1985,86,87,93,94,95,97,98,1999,2000, 2001, 2002
      Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -535,6 +535,14 @@ extern Lisp_Object make_number ();
 #define ASET(ARRAY, IDX, VAL)  (AREF ((ARRAY), (IDX)) = (VAL))
 #define ASIZE(ARRAY)           XVECTOR ((ARRAY))->size
 
+/* Convenience macros for dealing with Lisp strings.  */
+
+#define SREF(string, index)    XSTRING (string)->data[index]
+#define SDATA(string)          XSTRING (string)->data
+#define SCHARS(string)         XSTRING (string)->size
+#define SBYTES(string)         XSTRING (string)->size_bytes
+#define SMBP(string)           STRING_MULTIBYTE (string)
+
 \f
 /* Basic data type for use of intervals.  See the macros in intervals.h.  */