comparison src/symeval.h @ 458:c33ae14dd6d0 r21-2-44

Import from CVS: tag r21-2-44
author cvs
date Mon, 13 Aug 2007 11:42:25 +0200
parents 3d3049ae1304
children 183866b06e0b
comparison
equal deleted inserted replaced
457:4b9290a33024 458:c33ae14dd6d0
29 29
30 enum symbol_value_type 30 enum symbol_value_type
31 { 31 {
32 /* The following tags use the 'symbol_value_forward' structure 32 /* The following tags use the 'symbol_value_forward' structure
33 and are strictly for variables DEFVARed on the C level. */ 33 and are strictly for variables DEFVARed on the C level. */
34 SYMVAL_FIXNUM_FORWARD, /* Forward C "int" */ 34 SYMVAL_FIXNUM_FORWARD, /* Forward C "Fixnum", really "EMACS_INT" */
35 SYMVAL_CONST_FIXNUM_FORWARD, /* Same, but can't be set */ 35 SYMVAL_CONST_FIXNUM_FORWARD, /* Same, but can't be set */
36 SYMVAL_BOOLEAN_FORWARD, /* Forward C boolean ("int") */ 36 SYMVAL_BOOLEAN_FORWARD, /* Forward C boolean ("int") */
37 SYMVAL_CONST_BOOLEAN_FORWARD, /* Same, but can't be set */ 37 SYMVAL_CONST_BOOLEAN_FORWARD, /* Same, but can't be set */
38 SYMVAL_OBJECT_FORWARD, /* Forward C Lisp_Object */ 38 SYMVAL_OBJECT_FORWARD, /* Forward C Lisp_Object */
39 SYMVAL_CONST_OBJECT_FORWARD, /* Same, but can't be set */ 39 SYMVAL_CONST_OBJECT_FORWARD, /* Same, but can't be set */
67 /* NYI */ 67 /* NYI */
68 SYMVAL_CONSTANT_SYMBOL, /* Self-evaluating symbol */ 68 SYMVAL_CONSTANT_SYMBOL, /* Self-evaluating symbol */
69 /* NYI */ 69 /* NYI */
70 #endif 70 #endif
71 }; 71 };
72
73 /* Underlying C type used to implement DEFVAR_INT */
74 typedef EMACS_INT Fixnum;
72 75
73 struct symbol_value_magic 76 struct symbol_value_magic
74 { 77 {
75 struct lcrecord_header lcheader; 78 struct lcrecord_header lcheader;
76 void *value; 79 void *value;
343 defvar_magic ((lname), &I_hate_C); \ 346 defvar_magic ((lname), &I_hate_C); \
344 } while (0) 347 } while (0)
345 348
346 #define DEFVAR_SYMVAL_FWD_INT(lname, c_location, forward_type, magicfun) do{ \ 349 #define DEFVAR_SYMVAL_FWD_INT(lname, c_location, forward_type, magicfun) do{ \
347 DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ 350 DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \
348 dump_add_opaque (c_location, sizeof(int)); \ 351 dump_add_opaque_int (c_location); \
349 } while (0) 352 } while (0)
350 353
351 #define DEFVAR_SYMVAL_FWD_OBJECT(lname, c_location, forward_type, magicfun) do{ \ 354 #define DEFVAR_SYMVAL_FWD_FIXNUM(lname, c_location, forward_type, magicfun) do{ \
352 DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ 355 DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \
353 staticpro (c_location); \ 356 dump_add_opaque_fixnum (c_location); \
354 if (EQ (*c_location, Qnull_pointer)) *c_location = Qnil; \ 357 } while (0)
358
359 #define DEFVAR_SYMVAL_FWD_OBJECT(lname, c_location, forward_type, magicfun) do{ \
360 DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \
361 { \
362 Lisp_Object *DSF_location = c_location; /* Type check */ \
363 staticpro (DSF_location); \
364 if (EQ (*DSF_location, Qnull_pointer)) *DSF_location = Qnil; \
365 } \
355 } while (0) 366 } while (0)
356 367
357 #define DEFVAR_LISP(lname, c_location) \ 368 #define DEFVAR_LISP(lname, c_location) \
358 DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, 0) 369 DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, 0)
359 #define DEFVAR_CONST_LISP(lname, c_location) \ 370 #define DEFVAR_CONST_LISP(lname, c_location) \
360 DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_CONST_OBJECT_FORWARD, 0) 371 DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_CONST_OBJECT_FORWARD, 0)
361 #define DEFVAR_SPECIFIER(lname, c_location) \ 372 #define DEFVAR_SPECIFIER(lname, c_location) \
362 DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_CONST_SPECIFIER_FORWARD, 0) 373 DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_CONST_SPECIFIER_FORWARD, 0)
363 #define DEFVAR_INT(lname, c_location) \ 374 #define DEFVAR_INT(lname, c_location) \
364 DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_FIXNUM_FORWARD, 0) 375 DEFVAR_SYMVAL_FWD_FIXNUM (lname, c_location, SYMVAL_FIXNUM_FORWARD, 0)
365 #define DEFVAR_CONST_INT(lname, c_location) \ 376 #define DEFVAR_CONST_INT(lname, c_location) \
366 DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_CONST_FIXNUM_FORWARD, 0) 377 DEFVAR_SYMVAL_FWD_FIXNUM (lname, c_location, SYMVAL_CONST_FIXNUM_FORWARD, 0)
367 #define DEFVAR_BOOL(lname, c_location) \ 378 #define DEFVAR_BOOL(lname, c_location) \
368 DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, 0) 379 DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, 0)
369 #define DEFVAR_CONST_BOOL(lname, c_location) \ 380 #define DEFVAR_CONST_BOOL(lname, c_location) \
370 DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_CONST_BOOLEAN_FORWARD, 0) 381 DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_CONST_BOOLEAN_FORWARD, 0)
371 #define DEFVAR_LISP_MAGIC(lname, c_location, magicfun) \ 382 #define DEFVAR_LISP_MAGIC(lname, c_location, magicfun) \
372 DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, magicfun) 383 DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, magicfun)
373 #define DEFVAR_INT_MAGIC(lname, c_location, magicfun) \ 384 #define DEFVAR_INT_MAGIC(lname, c_location, magicfun) \
374 DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun) 385 DEFVAR_SYMVAL_FWD_FIXNUM (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun)
375 #define DEFVAR_BOOL_MAGIC(lname, c_location, magicfun) \ 386 #define DEFVAR_BOOL_MAGIC(lname, c_location, magicfun) \
376 DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, magicfun) 387 DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, magicfun)
377 388
378 void flush_all_buffer_local_cache (void); 389 void flush_all_buffer_local_cache (void);
379 390