Mercurial > hg > octave-nkf
annotate src/mkbuiltins @ 11542:695141f1c05c ss-3-3-55
snapshot 3.3.55
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 15 Jan 2011 04:53:04 -0500 |
parents | fd0a3ac60b0e |
children | 72c96de7a403 |
rev | line source |
---|---|
6218 | 1 #! /bin/sh |
7019 | 2 # |
11523 | 3 # Copyright (C) 1996-2011 John W. Eaton |
7019 | 4 # |
5 # This file is part of Octave. | |
6 # | |
7 # Octave 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 3 of the License, or (at | |
10 # your option) any later version. | |
11 # | |
12 # Octave 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 Octave; see the file COPYING. If not, see | |
19 # <http://www.gnu.org/licenses/>. | |
2335 | 20 |
9906 | 21 if test $# -eq 0; then |
22 echo "usage: mkbuiltins f1 f2 ..." 1>&2 | |
2907 | 23 exit 1 |
24 fi | |
25 | |
4299 | 26 SED=${SED:-'sed'} |
27 | |
2335 | 28 cat << \EOF |
29 // DO NOT EDIT! Generated automatically by mkbuiltins. | |
30 | |
31 #ifdef HAVE_CONFIG_H | |
32 #include "config.h" | |
33 #endif | |
34 | |
2968 | 35 #include "defun.h" |
2335 | 36 #include "oct-obj.h" |
37 #include "variables.h" | |
7210 | 38 #include "builtins.h" |
2335 | 39 |
3399 | 40 #if defined (quad) |
41 #undef quad | |
42 #endif | |
43 | |
4128 | 44 #if defined (ENABLE_DYNAMIC_LINKING) |
5796 | 45 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
46 #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, doc) |
5796 | 47 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
48 #define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, doc) |
5796 | 49 |
3364 | 50 #else |
5796 | 51 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
52 #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
|
53 XDEFUN_INTERNAL(name, args_name, nargout_name, doc) |
5796 | 54 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
55 #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
|
56 XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, doc) |
5796 | 57 |
3364 | 58 #endif |
59 | |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
60 #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
|
61 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
62 #define XDEFUN_INTERNAL(name, args_name, nargout_name, doc) \ |
3295 | 63 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
|
64 install_builtin_function (F ## name, #name, doc); \ |
4234 | 65 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
66 #define XDEFCONSTFUN_INTERNAL(name, args_name, nargout_name, doc) \ |
4234 | 67 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
|
68 install_builtin_function (F ## name, #name, doc, false); \ |
3295 | 69 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
70 #define XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, doc) \ |
3744 | 71 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
|
72 install_builtin_function (fname, name, doc); \ |
3744 | 73 |
3295 | 74 #define XDEFALIAS_INTERNAL(alias, name) \ |
75 alias_builtin (#alias, #name); | |
76 | |
3321 | 77 #define XDEFCONST_INTERNAL(name, defn, doc) |
3295 | 78 |
2373 | 79 EOF |
80 | |
9906 | 81 for arg |
82 do | |
83 fcn=`echo "$arg" | $SED 's,.*/,,; s/\.df//; s/-/_/g;'` | |
2373 | 84 echo "static void" |
85 echo "install_${fcn}_fcns (void)" | |
86 echo "{" | |
9906 | 87 cat "$arg" |
2373 | 88 echo "}" |
2907 | 89 echo "" |
90 done | |
91 | |
2373 | 92 cat << \EOF |
2907 | 93 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7210
diff
changeset
|
94 void |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7210
diff
changeset
|
95 install_builtins (void) |
2335 | 96 { |
97 EOF | |
98 | |
9906 | 99 for arg |
100 do | |
101 fcn=`echo "$arg" | $SED 's,.*/,,; s/\.df//; s/-/_/g;'` | |
2373 | 102 echo " install_${fcn}_fcns ();" |
103 done | |
2335 | 104 |
105 cat << \EOF | |
106 } | |
107 | |
108 EOF | |
109 | |
110 exit 0 |