1
|
1 // variables.h -*- C++ -*- |
|
2 /* |
|
3 |
296
|
4 Copyright (C) 1992, 1993, 1994 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 |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
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 nargin_max; |
|
59 int nargout_max; |
|
60 int is_text_fcn; |
|
61 Octave_builtin_fcn fcn; |
|
62 char *help_string; |
|
63 }; |
195
|
64 |
|
65 extern void initialize_symbol_tables (void); |
|
66 |
581
|
67 extern int lookup (symbol_record *s, int exec_script = 1); |
|
68 |
|
69 extern symbol_record *lookup_by_name (const char *nm, int exec_script = 1); |
|
70 |
593
|
71 extern char *builtin_string_variable (const char *); |
|
72 extern int builtin_real_scalar_variable (const char *, double&); |
|
73 |
|
74 extern void link_to_global_variable (symbol_record *sr); |
|
75 extern void link_to_builtin_variable (symbol_record *sr); |
|
76 extern void link_to_builtin_or_function (symbol_record *sr); |
|
77 |
|
78 extern void force_link_to_function (const char *s); |
|
79 |
|
80 extern int is_builtin_variable (const char *name); |
607
|
81 extern int is_text_function_name (const char *name); |
|
82 extern int is_globally_visible (const char *name); |
593
|
83 |
|
84 extern tree_fvc *is_valid_function (const tree_constant&, char *, |
|
85 int warn = 0); |
|
86 extern int takes_correct_nargs (tree_fvc *, int, char *, 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 |
195
|
104 extern void bind_nargin_and_nargout (symbol_table *sym_tab, |
|
105 int nargin, int nargout); |
|
106 |
|
107 extern void bind_builtin_variable (const char *, tree_constant *, |
|
108 int protect = 0, int eternal = 0, |
|
109 sv_Function f = (sv_Function) 0, |
529
|
110 const char *help = 0); |
195
|
111 |
529
|
112 extern void install_builtin_variables (void); |
|
113 |
|
114 extern char *octave_lib_dir (void); |
|
115 extern char *default_path (void); |
|
116 extern char *default_info_file (void); |
|
117 extern char *default_editor (void); |
|
118 extern char *get_site_defaults (void); |
|
119 |
1
|
120 // Symbol table for symbols at the top level. |
|
121 extern symbol_table *top_level_sym_tab; |
|
122 |
|
123 // Symbol table for the current scope. |
|
124 extern symbol_table *curr_sym_tab; |
|
125 |
|
126 // Symbol table for global symbols. |
|
127 extern symbol_table *global_sym_tab; |
|
128 |
|
129 #endif |
|
130 |
|
131 /* |
|
132 ;;; Local Variables: *** |
|
133 ;;; mode: C++ *** |
|
134 ;;; page-delimiter: "^/\\*" *** |
|
135 ;;; End: *** |
|
136 */ |