Mercurial > hg > xemacs-beta
annotate src/libst.h @ 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 | 74fd4e045ea6 |
children | 697ef44129c6 |
rev | line source |
---|---|
0 | 1 /* libst.h - include file for portable sound tools library |
2 ** | |
3 ** Copyright (C) 1989 by Jef Poskanzer. | |
4 ** | |
5 ** Permission to use, copy, modify, and distribute this software and its | |
6 ** documentation for any purpose and without fee is hereby granted, provided | |
7 ** that the above copyright notice appear in all copies and that both that | |
8 ** copyright notice and this permission notice appear in supporting | |
9 ** documentation. This software is provided "as is" without express or | |
10 ** implied warranty. | |
11 */ | |
12 | |
13 /* Synched up with: Not in FSF. */ | |
14 | |
398 | 15 #ifndef INCLUDED_libst_h_ |
16 #define INCLUDED_libst_h_ | |
17 | |
0 | 18 #define SAMPLES_PER_SECOND 8192 |
19 | |
20 #define MINLIN -32768 | |
21 #define MAXLIN 32767 | |
22 #define LINCLIP(x) do { if ( x < MINLIN ) x = MINLIN ; else if ( x > MAXLIN ) x = MAXLIN; } while ( 0 ) | |
23 | |
24 unsigned char st_linear_to_ulaw( /* int sample */ ); | |
25 int st_ulaw_to_linear_slow( /* unsigned char ulawbyte */ ); | |
26 | |
27 /* | |
28 ** This macro converts from ulaw to 16 bit linear, faster. | |
29 ** | |
30 ** Jef Poskanzer | |
31 ** 23 October 1989 | |
32 ** | |
33 ** Input: 8 bit ulaw sample | |
34 ** Output: signed 16 bit linear sample | |
35 */ | |
36 #define st_ulaw_to_linear(ulawbyte) ulaw_table[ulawbyte] | |
37 | |
38 static int ulaw_table[256] = { | |
39 -32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956, | |
40 -23932, -22908, -21884, -20860, -19836, -18812, -17788, -16764, | |
41 -15996, -15484, -14972, -14460, -13948, -13436, -12924, -12412, | |
42 -11900, -11388, -10876, -10364, -9852, -9340, -8828, -8316, | |
43 -7932, -7676, -7420, -7164, -6908, -6652, -6396, -6140, | |
44 -5884, -5628, -5372, -5116, -4860, -4604, -4348, -4092, | |
45 -3900, -3772, -3644, -3516, -3388, -3260, -3132, -3004, | |
46 -2876, -2748, -2620, -2492, -2364, -2236, -2108, -1980, | |
47 -1884, -1820, -1756, -1692, -1628, -1564, -1500, -1436, | |
48 -1372, -1308, -1244, -1180, -1116, -1052, -988, -924, | |
49 -876, -844, -812, -780, -748, -716, -684, -652, | |
50 -620, -588, -556, -524, -492, -460, -428, -396, | |
51 -372, -356, -340, -324, -308, -292, -276, -260, | |
52 -244, -228, -212, -196, -180, -164, -148, -132, | |
53 -120, -112, -104, -96, -88, -80, -72, -64, | |
54 -56, -48, -40, -32, -24, -16, -8, 0, | |
55 32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956, | |
56 23932, 22908, 21884, 20860, 19836, 18812, 17788, 16764, | |
57 15996, 15484, 14972, 14460, 13948, 13436, 12924, 12412, | |
58 11900, 11388, 10876, 10364, 9852, 9340, 8828, 8316, | |
59 7932, 7676, 7420, 7164, 6908, 6652, 6396, 6140, | |
60 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092, | |
61 3900, 3772, 3644, 3516, 3388, 3260, 3132, 3004, | |
62 2876, 2748, 2620, 2492, 2364, 2236, 2108, 1980, | |
63 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436, | |
64 1372, 1308, 1244, 1180, 1116, 1052, 988, 924, | |
65 876, 844, 812, 780, 748, 716, 684, 652, | |
66 620, 588, 556, 524, 492, 460, 428, 396, | |
67 372, 356, 340, 324, 308, 292, 276, 260, | |
68 244, 228, 212, 196, 180, 164, 148, 132, | |
69 120, 112, 104, 96, 88, 80, 72, 64, | |
70 56, 48, 40, 32, 24, 16, 8, 0 }; | |
398 | 71 |
72 #endif /* INCLUDED_libst_h_ */ |