Mercurial > hg > xemacs-beta
annotate src/inline.c @ 5327:d1b17a33450b
Move the heavy lifting from cl-seq.el to C.
src/ChangeLog addition:
2010-12-30 Aidan Kehoe <kehoea@parhasard.net>
Move the heavy lifting from cl-seq.el to C, finally making those
functions first-class XEmacs citizens, with circularity checking,
built-in support for tests other than #'eql, and as much
compatibility with current Common Lisp as Paul Dietz' tests require.
* fns.c (check_eq_nokey, check_eq_key, check_eql_nokey)
(check_eql_key, check_equal_nokey, check_equal_key)
(check_equalp_nokey, check_equalp_key, check_string_match_nokey)
(check_string_match_key, check_other_nokey, check_other_key)
(check_if_nokey, check_if_key, check_match_eq_key)
(check_match_eql_key, check_match_equal_key)
(check_match_equalp_key, check_match_other_key): New. These are
basically to provide function pointers to be used by Lisp
functions that take TEST, TEST-NOT and KEY arguments.
(get_check_match_function_1, get_check_test_function)
(get_check_match_function): These functions work out which of the
previous list of functions to use, given the keywords supplied by
the user.
(count_with_tail): New. This is the bones of #'count.
(list_count_from_end, string_count_from_end): Utility functions
for #'count.
(Fcount): New, moved from cl-seq.el.
(list_position_cons_before): New. The implementation of #'member*,
and important in implementing various other functions.
(FmemberX, Fadjoin, FassocX, FrassocX, Fposition, Ffind)
(FdeleteX, FremoveX, Fdelete_duplicates, Fremove_duplicates)
(Fnsubstitute, Fsubstitute, Fsublis, Fnsublis, Fsubst, Fnsubst)
(Ftree_equal, Fmismatch, Fsearch, Fintersection, Fnintersection)
(Fsubsetp, Fset_difference, Fnset_difference, Fnunion, Funion)
(Fset_exclusive_or, Fnset_exclusive_or): New, moved here from
cl-seq.el.
(position): New. The implementation of #'find and #'position.
(list_delete_duplicates_from_end, subst, sublis, nsublis)
(tree_equal, mismatch_from_end, mismatch_list_list)
(mismatch_list_string, mismatch_list_array)
(mismatch_string_array, mismatch_string_string)
(mismatch_array_array, get_mismatch_func): Helper C functions for
the Lisp-visible functions.
(venn, nvenn): New. The implementation of the main Lisp functions that
treat lists as sets.
lisp/ChangeLog addition:
2010-12-30 Aidan Kehoe <kehoea@parhasard.net>
* cl-seq.el:
Move the heavy lifting from this file to C. Dump the
cl-parsing-keywords macro, but don't use defun* for the functions
we define that do take keywords, dynamic scope lossage makes that
not practical.
* subr.el (sort, fillarray): Move these aliases here.
(map-plist): #'nsublis is now built-in, but at this point #'eql
isn't necessarily available as a test; use #'eq.
* obsolete.el (cl-delete-duplicates): Make this available for old
compiler macros and old code.
(memql): Document that this is equivalent to #'member*, and worse.
* cl.el (adjoin, subst): Removed. These are in C.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 30 Dec 2010 01:59:52 +0000 |
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 |