annotate src/mkbuiltins @ 3295:35a6d027772c

[project @ 1999-10-19 10:13:02 by jwe]
author jwe
date Tue, 19 Oct 1999 10:13:06 +0000
parents 7aae2c3636a7
children 6923abb04e16
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
1 #!/bin/sh
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
2
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
3 if test $# -ne 2; then
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
4 echo "usage: mkbuiltins f1 f2" 1>&2
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
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
8 DEF_FILES=`cat $1`
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
9 VAR_FILES=`cat $2`
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
10
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
11 if test -z "$DEF_FILES"; then
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
12 echo "mkbuiltins: DEF_FILES is empty!" 1>&2
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
13 exit 1
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
14 fi
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
15
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
16 if test -z "$VAR_FILES"; then
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
17 echo "mkbuiltins: VAR_FILES is empty!" 1>&2
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
18 exit 1
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
19 fi
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
20
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
21 cat << \EOF
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
22 // DO NOT EDIT! Generated automatically by mkbuiltins.
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
23
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
24 #ifdef HAVE_CONFIG_H
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
25 #include "config.h"
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
26 #endif
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
27
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2910
diff changeset
28 #include "defun.h"
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
29 #include "oct-obj.h"
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
30 #include "variables.h"
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
31
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
32 #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
33 extern DECLARE_FUN (name, args_name, nargout_name); \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
34 install_builtin_function (F ## name, #name, doc, is_text_fcn); \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
35
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
36 #define XDEFALIAS_INTERNAL(alias, name) \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
37 alias_builtin (#alias, #name);
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
38
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
39 #define XDEFVAR_INTERNAL(name, sname, defn, protect, chg_fcn, doc)
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
40
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
41 #define XDEFCONST_INTERNAL(name, sname, defn, protect, doc)
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
42
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
43 #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
44 d_c_map, c_c_map, lo, hi, \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
45 can_ret_cmplx_for_real, doc)
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3225
diff changeset
46
2373
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
47 EOF
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
48
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
49 for file in $DEF_FILES; do
3225
7aae2c3636a7 [project @ 1998-12-04 23:20:12 by jwe]
jwe
parents: 2968
diff changeset
50 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
51 echo "static void"
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
52 echo "install_${fcn}_fcns (void)"
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
53 echo "{"
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
54 cat $file
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
55 echo "}"
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
56 echo ""
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
57 done
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
58
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
59 for file in $VAR_FILES; do
3225
7aae2c3636a7 [project @ 1998-12-04 23:20:12 by jwe]
jwe
parents: 2968
diff changeset
60 f=`echo $file | sed 's,^\./,,; s/-/_/g'`
2909
057273789b87 [project @ 1997-04-30 06:34:32 by jwe]
jwe
parents: 2907
diff changeset
61 echo "extern void symbols_of_${f} (void);"
2373
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
62 done
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
63
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
64 cat << \EOF
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
65
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
66 static void
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
67 install_builtin_variables (void)
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
68 {
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
69 EOF
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
70
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
71 for file in $VAR_FILES; do
3225
7aae2c3636a7 [project @ 1998-12-04 23:20:12 by jwe]
jwe
parents: 2968
diff changeset
72 f=`echo $file | sed 's,^\./,,; s/-/_/g'`
2909
057273789b87 [project @ 1997-04-30 06:34:32 by jwe]
jwe
parents: 2907
diff changeset
73 echo " symbols_of_${f} ();"
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
74 done
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
75
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
76 cat << \EOF
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
77 }
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
78
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
79 static void
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
80 install_builtin_functions (void)
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
81 {
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
82 EOF
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
83
2907
8bb31a2b480b [project @ 1997-04-30 05:01:46 by jwe]
jwe
parents: 2890
diff changeset
84 for file in $DEF_FILES; do
3225
7aae2c3636a7 [project @ 1998-12-04 23:20:12 by jwe]
jwe
parents: 2968
diff changeset
85 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
86 echo " install_${fcn}_fcns ();"
d423dcc0ac32 [project @ 1996-10-12 00:19:58 by jwe]
jwe
parents: 2335
diff changeset
87 done
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
88
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
89 cat << \EOF
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
90 }
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
91
2910
1da1af95082e [project @ 1997-04-30 06:42:17 by jwe]
jwe
parents: 2909
diff changeset
92 extern void install_mapper_functions (void);
1da1af95082e [project @ 1997-04-30 06:42:17 by jwe]
jwe
parents: 2909
diff changeset
93
2335
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
94 void
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
95 install_builtins (void)
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 install_builtin_variables ();
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
98 install_mapper_functions ();
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
99 install_builtin_functions ();
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
100 }
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
101 EOF
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
102
4a9feb849125 [project @ 1996-07-19 02:51:02 by jwe]
jwe
parents:
diff changeset
103 exit 0