comparison src/lisp.h @ 112434:9de5a68b57e1

Promote SSDATA macro from gtkutil.c and xsmfns.c to lisp.h.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 22 Jan 2011 18:56:06 -0800
parents 42e22c4f06b7
children
comparison
equal deleted inserted replaced
112433:7b649f6eac4f 112434:9de5a68b57e1
632 #define SDATA(string) (XSTRING (string)->data + 0) 632 #define SDATA(string) (XSTRING (string)->data + 0)
633 #define SREF(string, index) (SDATA (string)[index] + 0) 633 #define SREF(string, index) (SDATA (string)[index] + 0)
634 #define SSET(string, index, new) (SDATA (string)[index] = (new)) 634 #define SSET(string, index, new) (SDATA (string)[index] = (new))
635 #define SCHARS(string) (XSTRING (string)->size + 0) 635 #define SCHARS(string) (XSTRING (string)->size + 0)
636 #define SBYTES(string) (STRING_BYTES (XSTRING (string)) + 0) 636 #define SBYTES(string) (STRING_BYTES (XSTRING (string)) + 0)
637
638 /* Avoid "differ in sign" warnings. */
639 #define SSDATA(x) ((char *) SDATA (x))
637 640
638 #define STRING_SET_CHARS(string, newsize) \ 641 #define STRING_SET_CHARS(string, newsize) \
639 (XSTRING (string)->size = (newsize)) 642 (XSTRING (string)->size = (newsize))
640 643
641 #define STRING_COPYIN(string, index, new, count) \ 644 #define STRING_COPYIN(string, index, new, count) \
1842 extern void defvar_int (struct Lisp_Intfwd *, const char *, EMACS_INT *); 1845 extern void defvar_int (struct Lisp_Intfwd *, const char *, EMACS_INT *);
1843 extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int); 1846 extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
1844 1847
1845 /* Macros we use to define forwarded Lisp variables. 1848 /* Macros we use to define forwarded Lisp variables.
1846 These are used in the syms_of_FILENAME functions. 1849 These are used in the syms_of_FILENAME functions.
1847 1850
1848 An ordinary (not in buffer_defaults, per-buffer, or per-keyboard) 1851 An ordinary (not in buffer_defaults, per-buffer, or per-keyboard)
1849 lisp variable is actually a field in `struct emacs_globals'. The 1852 lisp variable is actually a field in `struct emacs_globals'. The
1850 field's name begins with "f_", which is a convention enforced by 1853 field's name begins with "f_", which is a convention enforced by
1851 these macros. Each such global has a corresponding #define in 1854 these macros. Each such global has a corresponding #define in
1852 globals.h; the plain name should be used in the code. 1855 globals.h; the plain name should be used in the code.