annotate src/mkbuiltins @ 6909:fc55a5e1760b ss-2-9-14

[project @ 2007-09-17 20:47:40 by jwe]
author jwe
date Mon, 17 Sep 2007 20:47:41 +0000
parents c1b66b74937d
children 4270ded9ddc6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6218
c1b66b74937d [project @ 2006-12-27 17:43:50 by jwe]
jwe
parents: 5796
diff changeset
1 #! /bin/sh
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
2
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5307
diff changeset
3 if test $# -ne 1; then
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5307
diff changeset
4 echo "usage: mkbuiltins f1" 1>&2
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
5 exit 1
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
6 fi
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
7
4299
02fcb550f20c [project @ 2003-01-16 20:15:14 by jwe]
jwe
parents: 4234
diff changeset
8 SED=${SED:-'sed'}
02fcb550f20c [project @ 2003-01-16 20:15:14 by jwe]
jwe
parents: 4234
diff changeset
9
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
10 DEF_FILES=`cat $1`
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
11
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
12 if test -z "$DEF_FILES"; then
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
13 echo "mkbuiltins: DEF_FILES is empty!" 1>&2
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
14 exit 1
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
15 fi
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
16
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
17 cat << \EOF
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
18 // DO NOT EDIT! Generated automatically by mkbuiltins.
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
19
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
20 #ifdef HAVE_CONFIG_H
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
21 #include "config.h"
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
22 #endif
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
23
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2910
diff changeset
24 #include "defun.h"
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
25 #include "oct-obj.h"
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
26 #include "variables.h"
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
27
3399
e665633c76af [project @ 1999-12-22 22:11:50 by jwe]
jwe
parents: 3364
diff changeset
28 #if defined (quad)
e665633c76af [project @ 1999-12-22 22:11:50 by jwe]
jwe
parents: 3364
diff changeset
29 #undef quad
e665633c76af [project @ 1999-12-22 22:11:50 by jwe]
jwe
parents: 3364
diff changeset
30 #endif
e665633c76af [project @ 1999-12-22 22:11:50 by jwe]
jwe
parents: 3364
diff changeset
31
4128
919b2f6573ee [project @ 2002-10-25 20:36:14 by jwe]
jwe
parents: 4110
diff changeset
32 #if defined (ENABLE_DYNAMIC_LINKING)
5796
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
33
3364
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3321
diff changeset
34 #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc)
5796
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
35
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
36 #define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, \
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
37 is_text_fcn, doc)
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
38
3364
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3321
diff changeset
39 #else
5796
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
40
3364
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3321
diff changeset
41 #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3321
diff changeset
42 XDEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc)
5796
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
43
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
44 #define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, \
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
45 is_text_fcn, doc) \
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
46 XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, is_text_fcn, doc)
20f4bd627a74 [project @ 2006-05-09 02:04:54 by jwe]
jwe
parents: 5794
diff changeset
47
3364
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3321
diff changeset
48 #endif
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3321
diff changeset
49
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
50 #define XDEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
51 extern DECLARE_FUN (name, args_name, nargout_name); \
4234
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4128
diff changeset
52 install_builtin_function (F ## name, #name, doc, is_text_fcn); \
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4128
diff changeset
53
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4128
diff changeset
54 #define XDEFCONSTFUN_INTERNAL(name, args_name, nargout_name, \
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4128
diff changeset
55 is_text_fcn, doc) \
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4128
diff changeset
56 extern DECLARE_FUN (name, args_name, nargout_name); \
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4128
diff changeset
57 install_builtin_function (F ## name, #name, doc, is_text_fcn, false); \
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
58
3744
b0588fc1f3ca [project @ 2000-11-30 00:27:00 by jwe]
jwe
parents: 3399
diff changeset
59 #define XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, \
b0588fc1f3ca [project @ 2000-11-30 00:27:00 by jwe]
jwe
parents: 3399
diff changeset
60 is_text_fcn, doc) \
b0588fc1f3ca [project @ 2000-11-30 00:27:00 by jwe]
jwe
parents: 3399
diff changeset
61 extern DECLARE_FUNX (fname, args_name, nargout_name); \
4234
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4128
diff changeset
62 install_builtin_function (fname, name, doc, is_text_fcn); \
3744
b0588fc1f3ca [project @ 2000-11-30 00:27:00 by jwe]
jwe
parents: 3399
diff changeset
63
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
64 #define XDEFALIAS_INTERNAL(alias, name) \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
65 alias_builtin (#alias, #name);
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
66
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
67 #define XDEFCONST_INTERNAL(name, defn, doc)
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
68
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
69 #define XDEFUN_MAPPER_INTERNAL(name, ch_map, d_b_map, c_b_map, d_d_map, \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
70 d_c_map, c_c_map, lo, hi, \
4100
ed0090ecf80f [project @ 2002-10-11 16:37:45 by jwe]
jwe
parents: 3744
diff changeset
71 ch_map_flag, can_ret_cmplx_for_real, doc)
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
72
2373
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
73 EOF
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
74
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
75 for file in $DEF_FILES; do
4299
02fcb550f20c [project @ 2003-01-16 20:15:14 by jwe]
jwe
parents: 4234
diff changeset
76 fcn=`echo $file | $SED 's,^\./,,; s/\.df//; s/-/_/g'`
2373
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
77 echo "static void"
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
78 echo "install_${fcn}_fcns (void)"
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
79 echo "{"
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
80 cat $file
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
81 echo "}"
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
82 echo ""
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
83 done
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
84
2373
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
85 cat << \EOF
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
86
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
87 static void
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
88 install_builtin_functions (void)
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
89 {
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
90 EOF
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
91
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
92 for file in $DEF_FILES; do
4299
02fcb550f20c [project @ 2003-01-16 20:15:14 by jwe]
jwe
parents: 4234
diff changeset
93 fcn=`echo $file | $SED 's,^\./,,; s/\.df//; s/-/_/g'`
2373
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
94 echo " install_${fcn}_fcns ();"
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
95 done
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
96
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
97 cat << \EOF
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
98 }
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
99
2910
1da1af95082e [project @ 1997-04-30 06:42:17 by jwe]
jwe
parents: 2909
diff changeset
100 extern void install_mapper_functions (void);
1da1af95082e [project @ 1997-04-30 06:42:17 by jwe]
jwe
parents: 2909
diff changeset
101
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
102 void
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
103 install_builtins (void)
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
104 {
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
105 install_mapper_functions ();
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
106 install_builtin_functions ();
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
107 }
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
108 EOF
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
109
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
110 exit 0