Build Fix -- compatibility issue with newer autoconf
[sxemacs] / src / ent / ent-unary-op.c
1 /*
2   ent-unary-op.c -- Global Unary Operations
3   Copyright (C) 2006-2012 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 #include <config.h>
40 #include "lisp.h"
41 #include "ent-optable.h"
42 #include "ent-unary-op.h"
43
44 extern Lisp_Object Qoperation_error;
45
46 ase_unary_operation_f ase_unary_optable
47 [N_ASE_UNARY_OPS][ASE_OPTABLE_SIZE];
48
49 \f
50 Lisp_Object
51 ase_unary_operation_undefined(Lisp_Object l)
52 {
53         Fsignal(Qoperation_error, list1(l));
54         return Qnil;
55 }
56
57 static inline void
58 _ase_unary_optable_init(ase_unary_operation_t op)
59 {
60         int i;
61         for (i = 0; i < ASE_OPTABLE_SIZE; i++) {
62                 ent_unop_unregister(op, i);
63         }
64 }
65
66 void
67 ase_unary_optable_init(void)
68 {
69         ase_unary_operation_t op;
70         for (op = ASE_UNARY_FIRST_OP; op < N_ASE_UNARY_OPS; op++) {
71                 _ase_unary_optable_init(op);
72         }
73 }
74
75 \f
76 DEFUN("negate", Fnegate, 1, 1, 0, /*
77 Return the negated object of OBJECT.
78 */
79       (object))
80 {
81         return ent_unop(ASE_UNARY_OP_NEG, object);
82 }
83
84 DEFUN("invert", Finvert, 1, 1, 0, /*
85 Return the inverse object of OBJECT.
86 */
87       (object))
88 {
89         return ent_unop(ASE_UNARY_OP_INV, object);
90 }
91
92 \f
93 void
94 syms_of_ent_unary_op(void)
95 {
96         DEFSUBR(Fnegate);
97         DEFSUBR(Finvert);
98 }
99
100 void
101 vars_of_ent_unary_op(void)
102 {
103 }
104
105 /* ent-unary-op.c ends here */