1
|
1 // variables.h -*- C++ -*- |
|
2 /* |
|
3 |
1009
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
1
|
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 2, or (at your option) any |
|
11 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, write to the Free |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_variables_h) |
|
25 #define octave_variables_h 1 |
1
|
26 |
|
27 class istream; |
529
|
28 class ostrstream; |
1
|
29 class symbol_record; |
|
30 class symbol_table; |
|
31 class tree; |
490
|
32 class tree_fvc; |
1
|
33 class tree_constant; |
529
|
34 class Octave_object; |
1
|
35 |
529
|
36 struct builtin_mapper_function; |
|
37 struct builtin_function; |
|
38 struct builtin_variable; |
|
39 |
|
40 typedef int (*sv_Function)(void); |
195
|
41 |
529
|
42 struct builtin_variable |
|
43 { |
|
44 char *name; |
|
45 tree_constant *value; |
|
46 int install_as_function; |
|
47 int protect; |
|
48 int eternal; |
|
49 sv_Function sv_function; |
|
50 char *help_string; |
|
51 }; |
|
52 |
|
53 typedef Octave_object (*Octave_builtin_fcn)(const Octave_object&, int); |
|
54 |
|
55 struct builtin_function |
|
56 { |
|
57 char *name; |
|
58 int is_text_fcn; |
|
59 Octave_builtin_fcn fcn; |
|
60 char *help_string; |
|
61 }; |
195
|
62 |
|
63 extern void initialize_symbol_tables (void); |
|
64 |
581
|
65 extern int lookup (symbol_record *s, int exec_script = 1); |
|
66 |
|
67 extern symbol_record *lookup_by_name (const char *nm, int exec_script = 1); |
|
68 |
991
|
69 extern char *get_help_from_file (const char *f); |
|
70 |
593
|
71 extern char *builtin_string_variable (const char *); |
|
72 extern int builtin_real_scalar_variable (const char *, double&); |
1093
|
73 extern tree_constant builtin_any_variable (const char *); |
593
|
74 |
|
75 extern void link_to_global_variable (symbol_record *sr); |
|
76 extern void link_to_builtin_variable (symbol_record *sr); |
|
77 extern void link_to_builtin_or_function (symbol_record *sr); |
|
78 |
|
79 extern void force_link_to_function (const char *s); |
|
80 |
|
81 extern int is_builtin_variable (const char *name); |
607
|
82 extern int is_text_function_name (const char *name); |
|
83 extern int is_globally_visible (const char *name); |
593
|
84 |
|
85 extern tree_fvc *is_valid_function (const tree_constant&, char *, |
|
86 int warn = 0); |
|
87 |
|
88 extern char **make_name_list (void); |
195
|
89 |
529
|
90 extern void install_builtin_mapper (builtin_mapper_function *mf); |
195
|
91 |
529
|
92 extern void install_builtin_function (builtin_function *gf); |
195
|
93 |
529
|
94 extern void install_builtin_variable (builtin_variable *v); |
195
|
95 |
|
96 extern void install_builtin_variable_as_function (const char *name, |
|
97 tree_constant *val, |
|
98 int protect = 0, |
529
|
99 int eternal = 0, |
|
100 const char *help = 0); |
195
|
101 |
548
|
102 extern void alias_builtin (const char *alias, const char *name); |
|
103 |
1160
|
104 #if 0 |
195
|
105 extern void bind_nargin_and_nargout (symbol_table *sym_tab, |
|
106 int nargin, int nargout); |
1160
|
107 #endif |
195
|
108 |
1162
|
109 extern void bind_ans (const tree_constant& val, int print); |
|
110 |
1489
|
111 extern void bind_global_error_variable (void); |
|
112 |
|
113 extern void clear_global_error_variable (void *); |
|
114 |
195
|
115 extern void bind_builtin_variable (const char *, tree_constant *, |
|
116 int protect = 0, int eternal = 0, |
|
117 sv_Function f = (sv_Function) 0, |
529
|
118 const char *help = 0); |
195
|
119 |
1406
|
120 extern void bind_builtin_variable (const char *, const tree_constant&, |
|
121 int protect = 0, int eternal = 0, |
|
122 sv_Function f = (sv_Function) 0, |
|
123 const char *help = 0); |
|
124 |
529
|
125 extern void install_builtin_variables (void); |
|
126 |
1121
|
127 extern char *maybe_add_default_load_path (const char *p); |
|
128 |
529
|
129 extern char *octave_lib_dir (void); |
686
|
130 extern char *octave_arch_lib_dir (void); |
798
|
131 extern char *octave_bin_dir (void); |
529
|
132 extern char *default_path (void); |
|
133 extern char *default_info_file (void); |
|
134 extern char *default_editor (void); |
1476
|
135 extern char *get_local_site_defaults (void); |
529
|
136 extern char *get_site_defaults (void); |
|
137 |
1
|
138 // Symbol table for symbols at the top level. |
|
139 extern symbol_table *top_level_sym_tab; |
|
140 |
|
141 // Symbol table for the current scope. |
|
142 extern symbol_table *curr_sym_tab; |
|
143 |
|
144 // Symbol table for global symbols. |
|
145 extern symbol_table *global_sym_tab; |
|
146 |
|
147 #endif |
|
148 |
|
149 /* |
|
150 ;;; Local Variables: *** |
|
151 ;;; mode: C++ *** |
|
152 ;;; page-delimiter: "^/\\*" *** |
|
153 ;;; End: *** |
|
154 */ |