comparison src/lisp.h @ 74:54cc21c15cbb r20-0b32

Import from CVS: tag r20-0b32
author cvs
date Mon, 13 Aug 2007 09:04:33 +0200
parents 131b0175ea99
children 1ce6082ce73f
comparison
equal deleted inserted replaced
73:e2d7a37b7c8d 74:54cc21c15cbb
1054 #define symbol_function(s) ((s)->function) 1054 #define symbol_function(s) ((s)->function)
1055 #define symbol_plist(s) ((s)->plist) 1055 #define symbol_plist(s) ((s)->plist)
1056 1056
1057 /*********** subr ***********/ 1057 /*********** subr ***********/
1058 1058
1059 typedef Lisp_Object (*lisp_fn_t) (Lisp_Object, ...);
1060
1059 struct Lisp_Subr 1061 struct Lisp_Subr
1060 { 1062 {
1061 struct lrecord_header lheader; 1063 struct lrecord_header lheader;
1062 short min_args, max_args; 1064 short min_args, max_args;
1063 CONST char *prompt; 1065 CONST char *prompt;
1064 CONST char *doc; 1066 CONST char *doc;
1065 CONST char *name; 1067 CONST char *name;
1066 Lisp_Object (*subr_fn) (); 1068 lisp_fn_t subr_fn;
1067 }; 1069 };
1068 1070
1069 DECLARE_LRECORD (subr, struct Lisp_Subr); 1071 DECLARE_LRECORD (subr, struct Lisp_Subr);
1070 #define XSUBR(x) XRECORD (x, subr, struct Lisp_Subr) 1072 #define XSUBR(x) XRECORD (x, subr, struct Lisp_Subr)
1071 #define XSETSUBR(x, p) XSETRECORD (x, p, subr) 1073 #define XSETSUBR(x, p) XSETRECORD (x, p, subr)
1417 /* Can't be const, because then subr->doc is read-only and 1419 /* Can't be const, because then subr->doc is read-only and
1418 Snarf_documentation chokes */ 1420 Snarf_documentation chokes */
1419 1421
1420 #define DEFUN(lname, Fname, minargs, maxargs, prompt, arglist) \ 1422 #define DEFUN(lname, Fname, minargs, maxargs, prompt, arglist) \
1421 Lisp_Object Fname (DEFUN_ ## maxargs arglist) ; /* See below */ \ 1423 Lisp_Object Fname (DEFUN_ ## maxargs arglist) ; /* See below */ \
1422 static struct Lisp_Subr S##Fname \ 1424 static struct Lisp_Subr S##Fname = { {lrecord_subr}, \
1423 = { {lrecord_subr}, minargs, maxargs, prompt, 0, lname, Fname }; \ 1425 minargs, maxargs, prompt, 0, lname, (lisp_fn_t) Fname }; \
1424 Lisp_Object Fname (DEFUN_##maxargs arglist) 1426 Lisp_Object Fname (DEFUN_##maxargs arglist)
1425 1427
1426 1428
1427 /* Heavy ANSI C preprocessor hackery to get DEFUN to declare a 1429 /* Heavy ANSI C preprocessor hackery to get DEFUN to declare a
1428 prototype that matches maxargs, and add the obligatory 1430 prototype that matches maxargs, and add the obligatory
1741 1743
1742 #endif /* ! DEBUG_GCPRO */ 1744 #endif /* ! DEBUG_GCPRO */
1743 1745
1744 /* Another try to fix SunPro C compiler warnings */ 1746 /* Another try to fix SunPro C compiler warnings */
1745 /* "end-of-loop code not reached" */ 1747 /* "end-of-loop code not reached" */
1746 #ifdef __SUNPRO_C
1747 #define RETURN__ if (1) return
1748 #else
1749 #define RETURN__ return
1750 #endif
1751
1752 /* Another try to fix SunPro C compiler warnings */
1753 /* "end-of-loop code not reached" */
1754 /* "statement not reached */ 1748 /* "statement not reached */
1755 #ifdef __SUNPRO_C 1749 #ifdef __SUNPRO_C
1756 #define RETURN__ if (1) return 1750 #define RETURN__ if (1) return
1757 #define RETURN_NOT_REACHED(value) 1751 #define RETURN_NOT_REACHED(value)
1758 #else 1752 #else