Mercurial > hg > xemacs-beta
annotate src/inline.c @ 5191:71ee43b8a74d
Add #'equalp as a hash test by default; add #'define-hash-table-test, GNU API
tests/ChangeLog addition:
2010-04-05 Aidan Kehoe <kehoea@parhasard.net>
* automated/hash-table-tests.el:
Test the new built-in #'equalp hash table test. Test
#'define-hash-table-test.
* automated/lisp-tests.el:
When asserting that two objects are #'equalp, also assert that
their #'equalp-hash is identical.
man/ChangeLog addition:
2010-04-03 Aidan Kehoe <kehoea@parhasard.net>
* lispref/hash-tables.texi (Introduction to Hash Tables):
Document that we now support #'equalp as a hash table test by
default, and mention #'define-hash-table-test.
(Working With Hash Tables): Document #'define-hash-table-test.
src/ChangeLog addition:
2010-04-05 Aidan Kehoe <kehoea@parhasard.net>
* elhash.h:
* elhash.c (struct Hash_Table_Test, lisp_object_eql_equal)
(lisp_object_eql_hash, lisp_object_equal_equal)
(lisp_object_equal_hash, lisp_object_equalp_hash)
(lisp_object_equalp_equal, lisp_object_general_hash)
(lisp_object_general_equal, Feq_hash, Feql_hash, Fequal_hash)
(Fequalp_hash, define_hash_table_test, Fdefine_hash_table_test)
(init_elhash_once_early, mark_hash_table_tests, string_equalp_hash):
* glyphs.c (vars_of_glyphs):
Add a new hash table test in C, #'equalp.
Make it possible to specify new hash table tests with functions
define_hash_table_test, #'define-hash-table-test.
Use define_hash_table_test() in glyphs.c.
Expose the hash functions (besides that used for #'equal) to Lisp,
for people writing functions to be used with #'define-hash-table-test.
Call define_hash_table_test() very early in temacs, to create the
built-in hash table tests.
* ui-gtk.c (emacs_gtk_boxed_hash):
* specifier.h (struct specifier_methods):
* specifier.c (specifier_hash):
* rangetab.c (range_table_entry_hash, range_table_hash):
* number.c (bignum_hash, ratio_hash, bigfloat_hash):
* marker.c (marker_hash):
* lrecord.h (struct lrecord_implementation):
* keymap.c (keymap_hash):
* gui.c (gui_item_id_hash, gui_item_hash):
* glyphs.c (image_instance_hash, glyph_hash):
* glyphs-x.c (x_image_instance_hash):
* glyphs-msw.c (mswindows_image_instance_hash):
* glyphs-gtk.c (gtk_image_instance_hash):
* frame-msw.c (mswindows_set_title_from_ibyte):
* fontcolor.c (color_instance_hash, font_instance_hash):
* fontcolor-x.c (x_color_instance_hash):
* fontcolor-tty.c (tty_color_instance_hash):
* fontcolor-msw.c (mswindows_color_instance_hash):
* fontcolor-gtk.c (gtk_color_instance_hash):
* fns.c (bit_vector_hash):
* floatfns.c (float_hash):
* faces.c (face_hash):
* extents.c (extent_hash):
* events.c (event_hash):
* data.c (weak_list_hash, weak_box_hash):
* chartab.c (char_table_entry_hash, char_table_hash):
* bytecode.c (compiled_function_hash):
* alloc.c (vector_hash):
Change the various object hash methods to take a new EQUALP
parameter, hashing appropriately for #'equalp if it is true.
| author | Aidan Kehoe <kehoea@parhasard.net> |
|---|---|
| date | Mon, 05 Apr 2010 13:03:35 +0100 |
| parents | 97eb4942aec8 |
| children | 308d34e9f07d |
| rev | line source |
|---|---|
| 428 | 1 /* Repository for inline functions |
| 2 Copyright (C) 1995 Sun Microsystems, Inc. | |
| 5178 | 3 Copyright (C) 2010 Ben Wing. |
| 428 | 4 |
| 5 This file is part of XEmacs. | |
| 6 | |
| 7 XEmacs is free software; you can redistribute it and/or modify it | |
| 8 under the terms of the GNU General Public License as published by the | |
| 9 Free Software Foundation; either version 2, or (at your option) any | |
| 10 later version. | |
| 11 | |
| 12 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 15 for more details. | |
| 16 | |
| 17 You should have received a copy of the GNU General Public License | |
| 18 along with XEmacs; see the file COPYING. If not, write to | |
| 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
| 20 Boston, MA 02111-1307, USA. */ | |
| 21 | |
| 22 /* Synched up with: Not in FSF. */ | |
| 23 | |
| 24 /* The purpose of this file is so that there is at least one actual | |
| 25 definition of each inline function. This is needed under GCC. The | |
| 442 | 26 reason is that under GCC we declare our inline functions `inline |
| 27 extern', which causes the inlined version to get used only for | |
| 428 | 28 inlining, and in other cases to generate an external reference to |
| 29 the function. This is more efficient than declaring our inline | |
| 442 | 30 functions `inline static', which (in many cases) would cause a separate |
| 428 | 31 version of the function to get inserted into every source file that |
| 442 | 32 included the corresponding header file. See internals.texi. |
| 428 | 33 |
| 34 Some compilers that recognize `inline' may not do the same | |
| 442 | 35 `inline extern' business, so on those we just do `inline static'. |
| 428 | 36 */ |
| 37 | |
| 38 /* Note to maintainers: This file contains a list of all header files | |
|
5118
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
4677
diff
changeset
|
39 that use the INLINE macro, either directly, or by using DECLARE_LISP_OBJECT. |
|
e0db3c197671
merge up to latest default branch, doesn't compile yet
Ben Wing <ben@xemacs.org>
parents:
4677
diff
changeset
|
40 i.e. the output of ``grep -l -w 'DECLARE_LISP_OBJECT|INLINE_HEADER' *.h'' */ |
| 428 | 41 |
| 442 | 42 #define DONT_EXTERN_INLINE_HEADER_FUNCTIONS |
| 428 | 43 |
| 44 #include <config.h> | |
| 45 #include "lisp.h" | |
| 859 | 46 |
| 47 #include "sysfile.h" | |
| 48 | |
| 428 | 49 #include "buffer.h" |
| 50 #include "bytecode.h" | |
| 446 | 51 #include "casetab.h" |
| 428 | 52 #include "chartab.h" |
| 884 | 53 #include "device-impl.h" |
| 428 | 54 #include "elhash.h" |
| 55 #include "events.h" | |
| 884 | 56 #include "extents-impl.h" |
| 428 | 57 #include "faces.h" |
| 884 | 58 #include "frame-impl.h" |
| 428 | 59 #include "glyphs.h" |
| 442 | 60 #include "gui.h" |
| 428 | 61 #include "keymap.h" |
| 62 #include "lstream.h" | |
|
5176
8b2f75cecb89
rename objects* (.c, .h and .el files) to fontcolor*
Ben Wing <ben@xemacs.org>
parents:
4916
diff
changeset
|
63 #include "fontcolor-impl.h" |
| 428 | 64 #include "opaque.h" |
| 65 #include "process.h" | |
| 66 #include "rangetab.h" | |
| 67 #include "specifier.h" | |
|
4677
8f1ee2d15784
Support full Common Lisp multiple values in C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
3354
diff
changeset
|
68 #include "symeval.h" |
| 428 | 69 #include "syntax.h" |
| 70 #include "window.h" | |
| 71 | |
| 3050 | 72 /* If we demand !defined (HAVE_SHLIB) the INLINE_HEADERS aren't instantiated. |
| 73 This only shows up in --with-error-checking=types builds AFAIK. | |
| 74 On Mac OS X 10.3.9 with the Apple toolchain (GCC 3.3) gives a buildtime | |
| 75 link error (the lrecord error_check functions are undefined). | |
| 76 Debian GNU/Linux `sid' with GCC 4.0.3 prerelease & binutils 2.16.91 gives | |
| 77 a runtime link error (the lrecord error_check functions are undefined). | |
| 78 It is possible that this can be fixed trickily by appropriately defining | |
| 79 INLINE, or that it should be done in the module itself somehow. If you | |
| 80 can do it better or more elegantly, please feel free to consult me. | |
| 81 --stephen 2005-11-07 */ | |
| 82 #if defined (HAVE_LDAP) | |
| 996 | 83 #include "../modules/ldap/eldap.h" |
| 428 | 84 #endif |
| 85 | |
| 3050 | 86 /* We can't ask for !defined (HAVE_SHLIB). See HAVE_LDAP, above. */ |
| 87 #if defined (HAVE_POSTGRESQL) | |
| 996 | 88 #include "../modules/postgresql/postgresql.h" |
| 442 | 89 #endif |
| 90 | |
| 428 | 91 #ifdef HAVE_TOOLBARS |
| 92 #include "toolbar.h" | |
| 93 #endif | |
| 94 | |
| 617 | 95 #ifdef HAVE_SCROLLBARS |
| 96 #include "scrollbar.h" | |
| 97 #endif | |
| 98 | |
| 428 | 99 #ifdef HAVE_DATABASE |
| 100 #include "database.h" | |
| 101 #endif | |
| 102 | |
|
5120
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
103 #include "console-stream-impl.h" |
|
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
104 |
| 428 | 105 #ifdef HAVE_X_WINDOWS |
|
5120
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
106 #include "console-x-impl.h" |
|
4916
a6c778975d7d
split USE_XFT into HAVE_XFT/USE_XFT
Ben Wing <ben@xemacs.org>
parents:
4677
diff
changeset
|
107 #ifdef HAVE_XFT |
| 3354 | 108 #include "font-mgr.h" |
| 3094 | 109 #endif |
| 428 | 110 #endif |
| 111 | |
| 442 | 112 #ifdef HAVE_MS_WINDOWS |
|
5120
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
113 #include "console-msw-impl.h" |
|
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
114 #endif |
|
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
115 |
|
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
116 #ifdef HAVE_TTY |
|
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
117 #include "console-tty-impl.h" |
| 5178 | 118 #include "fontcolor-tty-impl.h" |
| 442 | 119 #endif |
| 120 | |
| 462 | 121 #ifdef HAVE_GTK |
|
5120
d1247f3cc363
latest work on lisp-object workspace;
Ben Wing <ben@xemacs.org>
parents:
5118
diff
changeset
|
122 #include "console-gtk-impl.h" |
| 462 | 123 #include "ui-gtk.h" |
| 124 #endif | |
| 125 | |
| 428 | 126 #include "file-coding.h" |
| 127 | |
| 128 #ifdef TOOLTALK | |
| 129 #include "tooltalk.h" | |
| 130 #endif |
