Mercurial > hg > xemacs-beta
comparison src/lisp.h @ 410:de805c49cfc1 r21-2-35
Import from CVS: tag r21-2-35
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:19:21 +0200 |
parents | 501cfd01ee6d |
children | 697ef44129c6 |
comparison
equal
deleted
inserted
replaced
409:301b9ebbdf3b | 410:de805c49cfc1 |
---|---|
39 #include <stdio.h> /* NULL, etc. */ | 39 #include <stdio.h> /* NULL, etc. */ |
40 #include <ctype.h> | 40 #include <ctype.h> |
41 #include <stdarg.h> | 41 #include <stdarg.h> |
42 #include <stddef.h> /* offsetof */ | 42 #include <stddef.h> /* offsetof */ |
43 #include <sys/types.h> | 43 #include <sys/types.h> |
44 #include <limits.h> | |
44 | 45 |
45 /* ---- Dynamic arrays ---- */ | 46 /* ---- Dynamic arrays ---- */ |
46 | 47 |
47 #define Dynarr_declare(type) \ | 48 #define Dynarr_declare(type) \ |
48 type *base; \ | 49 type *base; \ |
218 in production binaries. */ | 219 in production binaries. */ |
219 | 220 |
220 #ifdef USE_ASSERTIONS | 221 #ifdef USE_ASSERTIONS |
221 /* Highly dubious kludge */ | 222 /* Highly dubious kludge */ |
222 /* (thanks, Jamie, I feel better now -- ben) */ | 223 /* (thanks, Jamie, I feel better now -- ben) */ |
223 DECLARE_DOESNT_RETURN (assert_failed (const char *, int, const char *)); | 224 void assert_failed (const char *, int, const char *); |
224 # define abort() (assert_failed (__FILE__, __LINE__, "abort()")) | 225 # define abort() (assert_failed (__FILE__, __LINE__, "abort()")) |
225 # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x)) | 226 # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x)) |
226 #else | 227 #else |
227 # ifdef DEBUG_XEMACS | 228 # ifdef DEBUG_XEMACS |
228 # define assert(x) ((x) ? (void) 0 : (void) abort ()) | 229 # define assert(x) ((x) ? (void) 0 : (void) abort ()) |
942 #define string_byte(s, i) ((s)->data[i] + 0) | 943 #define string_byte(s, i) ((s)->data[i] + 0) |
943 #define XSTRING_BYTE(s, i) string_byte (XSTRING (s), i) | 944 #define XSTRING_BYTE(s, i) string_byte (XSTRING (s), i) |
944 #define string_byte_addr(s, i) (&((s)->data[i])) | 945 #define string_byte_addr(s, i) (&((s)->data[i])) |
945 #define set_string_length(s, len) ((void) ((s)->size = (len))) | 946 #define set_string_length(s, len) ((void) ((s)->size = (len))) |
946 #define set_string_data(s, ptr) ((void) ((s)->data = (ptr))) | 947 #define set_string_data(s, ptr) ((void) ((s)->data = (ptr))) |
947 #define set_string_byte(s, i, c) ((void) ((s)->data[i] = (c))) | 948 #define set_string_byte(s, i, b) ((void) ((s)->data[i] = (b))) |
948 | 949 |
949 void resize_string (Lisp_String *s, Bytecount pos, Bytecount delta); | 950 void resize_string (Lisp_String *s, Bytecount pos, Bytecount delta); |
950 | 951 |
951 #ifdef MULE | 952 #ifdef MULE |
952 | 953 |
964 #else /* not MULE */ | 965 #else /* not MULE */ |
965 | 966 |
966 # define string_char_length(s) string_length (s) | 967 # define string_char_length(s) string_length (s) |
967 # define string_char(s, i) ((Emchar) string_byte (s, i)) | 968 # define string_char(s, i) ((Emchar) string_byte (s, i)) |
968 # define string_char_addr(s, i) string_byte_addr (s, i) | 969 # define string_char_addr(s, i) string_byte_addr (s, i) |
969 # define set_string_char(s, i, c) set_string_byte (s, i, c) | 970 # define set_string_char(s, i, c) set_string_byte (s, i, (Bufbyte)c) |
970 | 971 |
971 #endif /* not MULE */ | 972 #endif /* not MULE */ |
972 | 973 |
973 /* Return the true size of a struct with a variable-length array field. */ | 974 /* Return the true size of a struct with a variable-length array field. */ |
974 #define FLEXIBLE_ARRAY_STRUCT_SIZEOF(flexible_array_structtype, \ | 975 #define FLEXIBLE_ARRAY_STRUCT_SIZEOF(flexible_array_structtype, \ |
1177 return XCHARVAL (obj); | 1178 return XCHARVAL (obj); |
1178 } | 1179 } |
1179 | 1180 |
1180 #else | 1181 #else |
1181 | 1182 |
1182 #define XCHAR(x) XCHARVAL (x) | 1183 #define XCHAR(x) ((Emchar)XCHARVAL (x)) |
1183 | 1184 |
1184 #endif | 1185 #endif |
1185 | 1186 |
1186 #define CHECK_CHAR(x) CHECK_NONRECORD (x, Lisp_Type_Char, Qcharacterp) | 1187 #define CHECK_CHAR(x) CHECK_NONRECORD (x, Lisp_Type_Char, Qcharacterp) |
1187 #define CONCHECK_CHAR(x) CONCHECK_NONRECORD (x, Lisp_Type_Char, Qcharacterp) | 1188 #define CONCHECK_CHAR(x) CONCHECK_NONRECORD (x, Lisp_Type_Char, Qcharacterp) |
1386 cdr is unmarked. */ | 1387 cdr is unmarked. */ |
1387 WEAK_LIST_ASSOC, | 1388 WEAK_LIST_ASSOC, |
1388 /* element disappears if it's a cons and its car is unmarked. */ | 1389 /* element disappears if it's a cons and its car is unmarked. */ |
1389 WEAK_LIST_KEY_ASSOC, | 1390 WEAK_LIST_KEY_ASSOC, |
1390 /* element disappears if it's a cons and its cdr is unmarked. */ | 1391 /* element disappears if it's a cons and its cdr is unmarked. */ |
1391 WEAK_LIST_VALUE_ASSOC | 1392 WEAK_LIST_VALUE_ASSOC, |
1393 /* element disappears if it's a cons and neither its car nor | |
1394 its cdr is marked. */ | |
1395 WEAK_LIST_FULL_ASSOC | |
1392 }; | 1396 }; |
1393 | 1397 |
1394 struct weak_list | 1398 struct weak_list |
1395 { | 1399 { |
1396 struct lcrecord_header header; | 1400 struct lcrecord_header header; |
1610 #define HASH7(a,b,c,d,e,f,g) (GOOD_HASH * HASH6 (a,b,c,d,e,f) + (g)) | 1614 #define HASH7(a,b,c,d,e,f,g) (GOOD_HASH * HASH6 (a,b,c,d,e,f) + (g)) |
1611 #define HASH8(a,b,c,d,e,f,g,h) (GOOD_HASH * HASH7 (a,b,c,d,e,f,g) + (h)) | 1615 #define HASH8(a,b,c,d,e,f,g,h) (GOOD_HASH * HASH7 (a,b,c,d,e,f,g) + (h)) |
1612 #define HASH9(a,b,c,d,e,f,g,h,i) (GOOD_HASH * HASH8 (a,b,c,d,e,f,g,h) + (i)) | 1616 #define HASH9(a,b,c,d,e,f,g,h,i) (GOOD_HASH * HASH8 (a,b,c,d,e,f,g,h) + (i)) |
1613 | 1617 |
1614 #define LISP_HASH(obj) ((unsigned long) LISP_TO_VOID (obj)) | 1618 #define LISP_HASH(obj) ((unsigned long) LISP_TO_VOID (obj)) |
1615 unsigned long string_hash (const void *xv); | 1619 unsigned long string_hash (const char *xv); |
1616 unsigned long memory_hash (const void *xv, size_t size); | 1620 unsigned long memory_hash (const void *xv, size_t size); |
1617 unsigned long internal_hash (Lisp_Object obj, int depth); | 1621 unsigned long internal_hash (Lisp_Object obj, int depth); |
1618 unsigned long internal_array_hash (Lisp_Object *arr, int size, int depth); | 1622 unsigned long internal_array_hash (Lisp_Object *arr, int size, int depth); |
1619 | 1623 |
1620 | 1624 |
2057 /* Defined in console.c */ | 2061 /* Defined in console.c */ |
2058 void stuff_buffered_input (Lisp_Object); | 2062 void stuff_buffered_input (Lisp_Object); |
2059 | 2063 |
2060 /* Defined in console-msw.c */ | 2064 /* Defined in console-msw.c */ |
2061 EXFUN (Fmswindows_message_box, 3); | 2065 EXFUN (Fmswindows_message_box, 3); |
2066 extern int mswindows_message_outputted; | |
2062 | 2067 |
2063 /* Defined in data.c */ | 2068 /* Defined in data.c */ |
2064 DECLARE_DOESNT_RETURN (c_write_error (Lisp_Object)); | 2069 DECLARE_DOESNT_RETURN (c_write_error (Lisp_Object)); |
2065 DECLARE_DOESNT_RETURN (lisp_write_error (Lisp_Object)); | 2070 DECLARE_DOESNT_RETURN (lisp_write_error (Lisp_Object)); |
2066 DECLARE_DOESNT_RETURN (args_out_of_range (Lisp_Object, Lisp_Object)); | 2071 DECLARE_DOESNT_RETURN (args_out_of_range (Lisp_Object, Lisp_Object)); |
2794 EXFUN (Fwiden, 1); | 2799 EXFUN (Fwiden, 1); |
2795 | 2800 |
2796 | 2801 |
2797 extern Lisp_Object Q_style, Qabort, Qactually_requested; | 2802 extern Lisp_Object Q_style, Qabort, Qactually_requested; |
2798 extern Lisp_Object Qactivate_menubar_hook; | 2803 extern Lisp_Object Qactivate_menubar_hook; |
2799 extern Lisp_Object Qafter, Qall, Qand; | 2804 extern Lisp_Object Qafter, Qall, Qand, Qappend; |
2800 extern Lisp_Object Qarith_error, Qarrayp, Qassoc, Qat, Qautodetect, Qautoload; | 2805 extern Lisp_Object Qarith_error, Qarrayp, Qassoc, Qat, Qautodetect, Qautoload; |
2801 extern Lisp_Object Qbackground, Qbackground_pixmap, Qbad_variable, Qbefore; | 2806 extern Lisp_Object Qbackground, Qbackground_pixmap, Qbad_variable, Qbefore; |
2802 extern Lisp_Object Qbeginning_of_buffer, Qbig5, Qbinary; | 2807 extern Lisp_Object Qbeginning_of_buffer, Qbig5, Qbinary; |
2803 extern Lisp_Object Qbitmap, Qbitp, Qblinking; | 2808 extern Lisp_Object Qbitmap, Qbitp, Qblinking; |
2804 extern Lisp_Object Qboolean, Qbottom, Qbottom_margin, Qbuffer; | 2809 extern Lisp_Object Qboolean, Qbottom, Qbottom_margin, Qbuffer; |
2809 extern Lisp_Object Qchars, Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3; | 2814 extern Lisp_Object Qchars, Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3; |
2810 extern Lisp_Object Qcenter, Qcircular_list, Qcircular_property_list; | 2815 extern Lisp_Object Qcenter, Qcircular_list, Qcircular_property_list; |
2811 extern Lisp_Object Qcoding_system_error; | 2816 extern Lisp_Object Qcoding_system_error; |
2812 extern Lisp_Object Qcolor, Qcolor_pixmap_image_instance_p; | 2817 extern Lisp_Object Qcolor, Qcolor_pixmap_image_instance_p; |
2813 extern Lisp_Object Qcolumns, Qcommand, Qcommandp, Qcompletion_ignore_case; | 2818 extern Lisp_Object Qcolumns, Qcommand, Qcommandp, Qcompletion_ignore_case; |
2814 extern Lisp_Object Qconsole, Qconsole_live_p, Qconst_specifier, Qcr, Qcritical; | 2819 extern Lisp_Object Qconsole, Qconsole_live_p, Qconst_specifier, Qcopies, Qcr; |
2815 extern Lisp_Object Qcrlf, Qctext, Qcurrent_menubar, Qctext, Qcursor; | 2820 extern Lisp_Object Qcritical, Qcrlf, Qctext, Qcurrent_menubar, Qctext, Qcursor; |
2816 extern Lisp_Object Qcyclic_variable_indirection, Qdata, Qdead, Qdecode; | 2821 extern Lisp_Object Qcyclic_variable_indirection, Qdata, Qdead, Qdecode; |
2817 extern Lisp_Object Qdefault, Qdefun, Qdelete, Qdelq, Qdevice, Qdevice_live_p; | 2822 extern Lisp_Object Qdefault, Qdefun, Qdelete, Qdelq, Qdevice, Qdevice_live_p; |
2818 extern Lisp_Object Qdialog; | 2823 extern Lisp_Object Qdialog; |
2819 extern Lisp_Object Qdim, Qdimension, Qdisabled, Qdisplay, Qdisplay_table; | 2824 extern Lisp_Object Qdim, Qdimension, Qdisabled, Qdisplay, Qdisplay_table; |
2820 extern Lisp_Object Qdoc_string, Qdomain_error, Qduplex, Qdynarr_overhead; | 2825 extern Lisp_Object Qdoc_string, Qdomain_error, Qduplex, Qdynarr_overhead; |
2824 extern Lisp_Object Qeval, Qevent_live_p, Qexit, Qextent_live_p, Qextents; | 2829 extern Lisp_Object Qeval, Qevent_live_p, Qexit, Qextent_live_p, Qextents; |
2825 extern Lisp_Object Qexternal_debugging_output, Qface, Qfeaturep; | 2830 extern Lisp_Object Qexternal_debugging_output, Qface, Qfeaturep; |
2826 extern Lisp_Object Qfile_name, Qfile_error; | 2831 extern Lisp_Object Qfile_name, Qfile_error; |
2827 extern Lisp_Object Qfont, Qforce_g0_on_output, Qforce_g1_on_output; | 2832 extern Lisp_Object Qfont, Qforce_g0_on_output, Qforce_g1_on_output; |
2828 extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output, Qforeground; | 2833 extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output, Qforeground; |
2829 extern Lisp_Object Qformat, Qframe, Qframe_live_p, Qfuncall, Qfunction; | 2834 extern Lisp_Object Qformat, Qframe, Qframe_live_p, Qfrom_page, Qfull_assoc; |
2835 extern Lisp_Object Qfuncall, Qfunction; | |
2830 extern Lisp_Object Qgap_overhead, Qgeneric, Qgeometry, Qglobal, Qheight; | 2836 extern Lisp_Object Qgap_overhead, Qgeneric, Qgeometry, Qglobal, Qheight; |
2831 extern Lisp_Object Qhelp, Qhighlight, Qhorizontal, Qicon; | 2837 extern Lisp_Object Qhelp, Qhighlight, Qhorizontal, Qicon; |
2832 extern Lisp_Object Qicon_glyph_p, Qid, Qidentity, Qignore, Qimage, Qinfo; | 2838 extern Lisp_Object Qicon_glyph_p, Qid, Qidentity, Qignore, Qimage, Qinfo; |
2833 extern Lisp_Object Qinherit; | 2839 extern Lisp_Object Qinherit; |
2834 extern Lisp_Object Qinhibit_quit, Qinhibit_read_only; | 2840 extern Lisp_Object Qinhibit_quit, Qinhibit_read_only; |
2870 extern Lisp_Object Qseven, Qshift_jis, Qshort; | 2876 extern Lisp_Object Qseven, Qshift_jis, Qshort; |
2871 extern Lisp_Object Qsignal, Qsimple, Qsingularity_error, Qsize, Qspace; | 2877 extern Lisp_Object Qsignal, Qsimple, Qsingularity_error, Qsize, Qspace; |
2872 extern Lisp_Object Qspecifier, Qstandard_input, Qstandard_output, Qstart_open; | 2878 extern Lisp_Object Qspecifier, Qstandard_input, Qstandard_output, Qstart_open; |
2873 extern Lisp_Object Qstream, Qstring, Qstring_lessp, Qsubwindow; | 2879 extern Lisp_Object Qstream, Qstring, Qstring_lessp, Qsubwindow; |
2874 extern Lisp_Object Qsubwindow_image_instance_p; | 2880 extern Lisp_Object Qsubwindow_image_instance_p; |
2875 extern Lisp_Object Qsymbol, Qsyntax, Qt, Qterminal, Qtest, Qtext; | 2881 extern Lisp_Object Qsymbol, Qsyntax, Qt, Qterminal, Qtest; |
2876 extern Lisp_Object Qtext_image_instance_p, Qthis_command, Qtimeout, Qtimestamp; | 2882 extern Lisp_Object Qtext, Qtext_image_instance_p, Qthis_command, Qtimeout; |
2877 extern Lisp_Object Qtoolbar, Qtop, Qtop_margin, Qtop_level; | 2883 extern Lisp_Object Qtimestamp, Qtoolbar, Qtop, Qtop_margin, Qtop_level; |
2878 extern Lisp_Object Qtrue_list_p, Qtty, Qtype; | 2884 extern Lisp_Object Qto_page, Qtrue_list_p, Qtty, Qtype; |
2879 extern Lisp_Object Qunbound, Qundecided, Qundefined, Qunderflow_error; | 2885 extern Lisp_Object Qunbound, Qundecided, Qundefined, Qunderflow_error; |
2880 extern Lisp_Object Qunderline, Qunimplemented, Quser_files_and_directories; | 2886 extern Lisp_Object Qunderline, Qunimplemented, Quser_files_and_directories; |
2881 extern Lisp_Object Qvalue_assoc, Qvalues; | 2887 extern Lisp_Object Qvalue_assoc, Qvalues; |
2882 extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvertical; | 2888 extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvertical; |
2883 extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning; | 2889 extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning; |