Mercurial > hg > octave-nkf
annotate src/mkbuiltins @ 7948:af10baa63915 ss-3-1-50
3.1.50 snapshot
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 18 Jul 2008 17:42:48 -0400 |
parents | 8c32f95c2639 |
children | 5dd06f19e9be |
rev | line source |
---|---|
6218 | 1 #! /bin/sh |
7019 | 2 # |
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, | |
4 # 2006, 2007 John W. Eaton | |
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 |
5794 | 22 if test $# -ne 1; then |
23 echo "usage: mkbuiltins f1" 1>&2 | |
2907 | 24 exit 1 |
25 fi | |
26 | |
4299 | 27 SED=${SED:-'sed'} |
28 | |
2907 | 29 DEF_FILES=`cat $1` |
30 | |
31 if test -z "$DEF_FILES"; then | |
32 echo "mkbuiltins: DEF_FILES is empty!" 1>&2 | |
33 exit 1 | |
34 fi | |
35 | |
2335 | 36 cat << \EOF |
37 // DO NOT EDIT! Generated automatically by mkbuiltins. | |
38 | |
39 #ifdef HAVE_CONFIG_H | |
40 #include "config.h" | |
41 #endif | |
42 | |
2968 | 43 #include "defun.h" |
2335 | 44 #include "oct-obj.h" |
45 #include "variables.h" | |
7210 | 46 #include "builtins.h" |
2335 | 47 |
3399 | 48 #if defined (quad) |
49 #undef quad | |
50 #endif | |
51 | |
4128 | 52 #if defined (ENABLE_DYNAMIC_LINKING) |
5796 | 53 |
3364 | 54 #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) |
5796 | 55 |
56 #define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, \ | |
57 is_text_fcn, doc) | |
58 | |
3364 | 59 #else |
5796 | 60 |
3364 | 61 #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \ |
62 XDEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) | |
5796 | 63 |
64 #define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, \ | |
65 is_text_fcn, doc) \ | |
66 XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, is_text_fcn, doc) | |
67 | |
3364 | 68 #endif |
69 | |
3295 | 70 #define XDEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \ |
71 extern DECLARE_FUN (name, args_name, nargout_name); \ | |
4234 | 72 install_builtin_function (F ## name, #name, doc, is_text_fcn); \ |
73 | |
74 #define XDEFCONSTFUN_INTERNAL(name, args_name, nargout_name, \ | |
75 is_text_fcn, doc) \ | |
76 extern DECLARE_FUN (name, args_name, nargout_name); \ | |
77 install_builtin_function (F ## name, #name, doc, is_text_fcn, false); \ | |
3295 | 78 |
3744 | 79 #define XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, \ |
80 is_text_fcn, doc) \ | |
81 extern DECLARE_FUNX (fname, args_name, nargout_name); \ | |
4234 | 82 install_builtin_function (fname, name, doc, is_text_fcn); \ |
3744 | 83 |
3295 | 84 #define XDEFALIAS_INTERNAL(alias, name) \ |
85 alias_builtin (#alias, #name); | |
86 | |
3321 | 87 #define XDEFCONST_INTERNAL(name, defn, doc) |
3295 | 88 |
2373 | 89 EOF |
90 | |
2907 | 91 for file in $DEF_FILES; do |
4299 | 92 fcn=`echo $file | $SED 's,^\./,,; s/\.df//; s/-/_/g'` |
2373 | 93 echo "static void" |
94 echo "install_${fcn}_fcns (void)" | |
95 echo "{" | |
96 cat $file | |
97 echo "}" | |
2907 | 98 echo "" |
99 done | |
100 | |
2373 | 101 cat << \EOF |
2907 | 102 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7210
diff
changeset
|
103 void |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7210
diff
changeset
|
104 install_builtins (void) |
2335 | 105 { |
106 EOF | |
107 | |
2907 | 108 for file in $DEF_FILES; do |
4299 | 109 fcn=`echo $file | $SED 's,^\./,,; s/\.df//; s/-/_/g'` |
2373 | 110 echo " install_${fcn}_fcns ();" |
111 done | |
2335 | 112 |
113 cat << \EOF | |
114 } | |
115 | |
116 EOF | |
117 | |
118 exit 0 |