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 |
|
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 |
991
|
71 extern char *get_help_from_file (const char *f); |
|
72 |
593
|
73 extern char *builtin_string_variable (const char *); |
|
74 extern int builtin_real_scalar_variable (const char *, double&); |
1093
|
75 extern tree_constant builtin_any_variable (const char *); |
593
|
76 |
|
77 extern void link_to_global_variable (symbol_record *sr); |
|
78 extern void link_to_builtin_variable (symbol_record *sr); |
|
79 extern void link_to_builtin_or_function (symbol_record *sr); |
|
80 |
|
81 extern void force_link_to_function (const char *s); |
|
82 |
|
83 extern int is_builtin_variable (const char *name); |
607
|
84 extern int is_text_function_name (const char *name); |
|
85 extern int is_globally_visible (const char *name); |
593
|
86 |
|
87 extern tree_fvc *is_valid_function (const tree_constant&, char *, |
|
88 int warn = 0); |
|
89 extern int takes_correct_nargs (tree_fvc *, int, char *, int warn = 0); |
|
90 |
|
91 extern char **make_name_list (void); |
195
|
92 |
529
|
93 extern void install_builtin_mapper (builtin_mapper_function *mf); |
195
|
94 |
529
|
95 extern void install_builtin_function (builtin_function *gf); |
195
|
96 |
529
|
97 extern void install_builtin_variable (builtin_variable *v); |
195
|
98 |
|
99 extern void install_builtin_variable_as_function (const char *name, |
|
100 tree_constant *val, |
|
101 int protect = 0, |
529
|
102 int eternal = 0, |
|
103 const char *help = 0); |
195
|
104 |
548
|
105 extern void alias_builtin (const char *alias, const char *name); |
|
106 |
195
|
107 extern void bind_nargin_and_nargout (symbol_table *sym_tab, |
|
108 int nargin, int nargout); |
|
109 |
|
110 extern void bind_builtin_variable (const char *, tree_constant *, |
|
111 int protect = 0, int eternal = 0, |
|
112 sv_Function f = (sv_Function) 0, |
529
|
113 const char *help = 0); |
195
|
114 |
529
|
115 extern void install_builtin_variables (void); |
|
116 |
|
117 extern char *octave_lib_dir (void); |
686
|
118 extern char *octave_arch_lib_dir (void); |
798
|
119 extern char *octave_bin_dir (void); |
529
|
120 extern char *default_path (void); |
|
121 extern char *default_info_file (void); |
|
122 extern char *default_editor (void); |
|
123 extern char *get_site_defaults (void); |
|
124 |
1
|
125 // Symbol table for symbols at the top level. |
|
126 extern symbol_table *top_level_sym_tab; |
|
127 |
|
128 // Symbol table for the current scope. |
|
129 extern symbol_table *curr_sym_tab; |
|
130 |
|
131 // Symbol table for global symbols. |
|
132 extern symbol_table *global_sym_tab; |
|
133 |
|
134 #endif |
|
135 |
|
136 /* |
|
137 ;;; Local Variables: *** |
|
138 ;;; mode: C++ *** |
|
139 ;;; page-delimiter: "^/\\*" *** |
|
140 ;;; End: *** |
|
141 */ |