Initial git import
[sxemacs] / src / ent / ent-optable.h
1 /*
2   ent-optable.h -- Optable magic
3   Copyright (C) 2006, 2007, 2008 Sebastian Freundt
4
5   Author:  Sebastian Freundt <hroptatyr@sxemacs.org>
6
7   * This file is part of SXEmacs.
8   * 
9   * Redistribution and use in source and binary forms, with or without
10   * modification, are permitted provided that the following conditions
11   * are met:
12   *
13   * 1. Redistributions of source code must retain the above copyright
14   *    notice, this list of conditions and the following disclaimer.
15   *
16   * 2. Redistributions in binary form must reproduce the above copyright
17   *    notice, this list of conditions and the following disclaimer in the
18   *    documentation and/or other materials provided with the distribution.
19   *
20   * 3. Neither the name of the author nor the names of any contributors
21   *    may be used to endorse or promote products derived from this
22   *    software without specific prior written permission.
23   *
24   * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
25   * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27   * DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31   * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32   * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33   * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34   * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35   */
36
37 /* Synched up with: Not in FSF. */
38
39 #ifndef INCLUDED_ent_optable_h_
40 #define INCLUDED_ent_optable_h_
41
42 /*************************/
43 /* new ASE optable magic */
44 /*************************/
45 /* the number types */
46 typedef int ase_object_type_t;
47 #define ASE_OPTABLE_SIZE        lrecord_type_last_built_in_type
48 extern Lisp_Object Qoptable_index;
49
50 #define INT_T           (ase_object_type_t)lrecord_first_ent_type
51 #define BIGZ_T          (ase_object_type_t)lrecord_type_bigz
52 #define BIGQ_T          (ase_object_type_t)lrecord_type_bigq
53 #define BIGF_T          (ase_object_type_t)lrecord_type_bigf
54 #define BIGFR_T         (ase_object_type_t)lrecord_type_bigfr
55 #define FLOAT_T         (ase_object_type_t)lrecord_type_float
56 #define BIGG_T          (ase_object_type_t)lrecord_type_bigg
57 #define BIGC_T          (ase_object_type_t)lrecord_type_bigc
58 #define QUATERN_T       (ase_object_type_t)lrecord_type_quatern
59 #define OCTON_T         (ase_object_type_t)-1
60 #define INDEF_T         (ase_object_type_t)lrecord_type_indef
61
62 \f
63 EXFUN(Ftype_of, 1);
64 extern int ase_optable_index(Lisp_Object arg);
65 extern int ase_optable_index_typesym(Lisp_Object typesym);
66
67 extern int ase_optable_add(Lisp_Object typesym);
68 extern void ase_optable_del(Lisp_Object typesym);
69
70 extern void init_ent_optables(void);
71
72 /* left-overs */
73 /* functions */
74 typedef Lisp_Object(*ase_ternary_operation_f)(
75         Lisp_Object, Lisp_Object, Lisp_Object);
76 typedef enum ase_ternary_operation_e ase_ternary_operation_t;
77
78 enum ase_ternary_operation_e {
79         ASE_TERNARY_FIRST_OP,
80         ASE_TERNARY_LAST_OP = ASE_TERNARY_FIRST_OP,
81         N_ASE_TERNARY_OPS
82 };
83
84
85 #endif  /* INCLUDED_ent_optable_h_ */