Mercurial > hg > octave-nkf
annotate src/mkbuiltins @ 10771:82d9efde7e96
pr-output.cc: Avoid use of % operator on negative operands
to ensure compatability between C++ compilers.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 07 Jul 2010 15:27:17 -0700 |
parents | 8d20fb66a0dc |
children | fd0a3ac60b0e |
rev | line source |
---|---|
6218 | 1 #! /bin/sh |
7019 | 2 # |
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, | |
8920 | 4 # 2006, 2007, 2008, 2009 John W. Eaton |
7019 | 5 # |
6 # This file is part of Octave. | |
7 # | |
8 # Octave is free software; you can redistribute it and/or modify it | |
9 # under the terms of the GNU General Public License as published by the | |
10 # Free Software Foundation; either version 3 of the License, or (at | |
11 # your option) any later version. | |
12 # | |
13 # Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 # for more details. | |
17 # | |
18 # You should have received a copy of the GNU General Public License | |
19 # along with Octave; see the file COPYING. If not, see | |
20 # <http://www.gnu.org/licenses/>. | |
2335 | 21 |
9906 | 22 if test $# -eq 0; then |
23 echo "usage: mkbuiltins f1 f2 ..." 1>&2 | |
2907 | 24 exit 1 |
25 fi | |
26 | |
4299 | 27 SED=${SED:-'sed'} |
28 | |
2335 | 29 cat << \EOF |
30 // DO NOT EDIT! Generated automatically by mkbuiltins. | |
31 | |
32 #ifdef HAVE_CONFIG_H | |
33 #include "config.h" | |
34 #endif | |
35 | |
2968 | 36 #include "defun.h" |
2335 | 37 #include "oct-obj.h" |
38 #include "variables.h" | |
7210 | 39 #include "builtins.h" |
2335 | 40 |
3399 | 41 #if defined (quad) |
42 #undef quad | |
43 #endif | |
44 | |
4128 | 45 #if defined (ENABLE_DYNAMIC_LINKING) |
5796 | 46 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
47 #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, doc) |
5796 | 48 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
49 #define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, doc) |
5796 | 50 |
3364 | 51 #else |
5796 | 52 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
53 #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, doc) \ |
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
54 XDEFUN_INTERNAL(name, args_name, nargout_name, doc) |
5796 | 55 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
56 #define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, doc) \ |
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
57 XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, doc) |
5796 | 58 |
3364 | 59 #endif |
60 | |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
61 #define XDEFUN_FILE_NAME(name) |
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
62 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
63 #define XDEFUN_INTERNAL(name, args_name, nargout_name, doc) \ |
3295 | 64 extern DECLARE_FUN (name, args_name, nargout_name); \ |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
65 install_builtin_function (F ## name, #name, doc); \ |
4234 | 66 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
67 #define XDEFCONSTFUN_INTERNAL(name, args_name, nargout_name, doc) \ |
4234 | 68 extern DECLARE_FUN (name, args_name, nargout_name); \ |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
69 install_builtin_function (F ## name, #name, doc, false); \ |
3295 | 70 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
71 #define XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, doc) \ |
3744 | 72 extern DECLARE_FUNX (fname, args_name, nargout_name); \ |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
73 install_builtin_function (fname, name, doc); \ |
3744 | 74 |
3295 | 75 #define XDEFALIAS_INTERNAL(alias, name) \ |
76 alias_builtin (#alias, #name); | |
77 | |
3321 | 78 #define XDEFCONST_INTERNAL(name, defn, doc) |
3295 | 79 |
2373 | 80 EOF |
81 | |
9906 | 82 for arg |
83 do | |
84 fcn=`echo "$arg" | $SED 's,.*/,,; s/\.df//; s/-/_/g;'` | |
2373 | 85 echo "static void" |
86 echo "install_${fcn}_fcns (void)" | |
87 echo "{" | |
9906 | 88 cat "$arg" |
2373 | 89 echo "}" |
2907 | 90 echo "" |
91 done | |
92 | |
2373 | 93 cat << \EOF |
2907 | 94 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7210
diff
changeset
|
95 void |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7210
diff
changeset
|
96 install_builtins (void) |
2335 | 97 { |
98 EOF | |
99 | |
9906 | 100 for arg |
101 do | |
102 fcn=`echo "$arg" | $SED 's,.*/,,; s/\.df//; s/-/_/g;'` | |
2373 | 103 echo " install_${fcn}_fcns ();" |
104 done | |
2335 | 105 |
106 cat << \EOF | |
107 } | |
108 | |
109 EOF | |
110 | |
111 exit 0 |