Mercurial > hg > octave-nkf
annotate src/variables.h @ 10809:85cbd239fce2
try a better status bar for fltk backend
author | Shai Ayal <shaiay@users.sourceforge.net> |
---|---|
date | Tue, 20 Jul 2010 19:31:17 +0300 |
parents | 5c594472f75e |
children | fd0a3ac60b0e |
rev | line source |
---|---|
1 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, |
8920 | 4 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
1 | 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 | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
1 | 21 |
22 */ | |
23 | |
383 | 24 #if !defined (octave_variables_h) |
25 #define octave_variables_h 1 | |
1 | 26 |
2975 | 27 class octave_function; |
4700 | 28 class octave_user_function; |
1738 | 29 |
2390 | 30 class tree_identifier; |
2086 | 31 class octave_value; |
32 class octave_value_list; | |
2892 | 33 class octave_builtin; |
1755 | 34 class string_vector; |
35 | |
5794 | 36 #include <climits> |
37 #include <cfloat> | |
38 | |
1755 | 39 #include <string> |
1 | 40 |
2390 | 41 #include "ov.h" |
2975 | 42 #include "ov-builtin.h" |
2953 | 43 #include "symtab.h" |
195 | 44 |
6109 | 45 extern OCTINTERP_API void clear_mex_functions (void); |
195 | 46 |
6109 | 47 extern OCTINTERP_API octave_function * |
3523 | 48 is_valid_function (const octave_value&, const std::string& = std::string (), |
10313 | 49 bool warn = false); |
593 | 50 |
6109 | 51 extern OCTINTERP_API octave_function * |
3523 | 52 is_valid_function (const std::string&, const std::string& = std::string (), |
10313 | 53 bool warn = false); |
3178 | 54 |
6109 | 55 extern OCTINTERP_API octave_function * |
3523 | 56 extract_function (const octave_value& arg, const std::string& warn_for, |
10313 | 57 const std::string& fname, const std::string& header, |
58 const std::string& trailer); | |
2796 | 59 |
6109 | 60 extern OCTINTERP_API string_vector |
3523 | 61 get_struct_elts (const std::string& text); |
2921 | 62 |
6109 | 63 extern OCTINTERP_API string_vector |
3523 | 64 generate_struct_completions (const std::string& text, std::string& prefix, |
10313 | 65 std::string& hint); |
3020 | 66 |
6109 | 67 extern OCTINTERP_API bool |
3523 | 68 looks_like_struct (const std::string& text); |
2921 | 69 |
6109 | 70 extern OCTINTERP_API int |
4930 | 71 symbol_exist (const std::string& name, const std::string& type = "any"); |
4319 | 72 |
6109 | 73 extern OCTINTERP_API std::string |
4954 | 74 unique_symbol_name (const std::string& basename); |
75 | |
6109 | 76 extern OCTINTERP_API octave_value lookup_function_handle (const std::string& nm); |
4988 | 77 |
6109 | 78 extern OCTINTERP_API octave_value |
5027 | 79 get_global_value (const std::string& nm, bool silent = false); |
3020 | 80 |
10071
e42b1bbd1052
variables.cc (get_top_level_value, set_top_level_value): new functions
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
81 extern OCTINTERP_API void |
e42b1bbd1052
variables.cc (get_top_level_value, set_top_level_value): new functions
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
82 set_global_value (const std::string& nm, const octave_value& val); |
e42b1bbd1052
variables.cc (get_top_level_value, set_top_level_value): new functions
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
83 |
e42b1bbd1052
variables.cc (get_top_level_value, set_top_level_value): new functions
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
84 extern OCTINTERP_API octave_value |
e42b1bbd1052
variables.cc (get_top_level_value, set_top_level_value): new functions
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
85 get_top_level_value (const std::string& nm, bool silent = false); |
e42b1bbd1052
variables.cc (get_top_level_value, set_top_level_value): new functions
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
86 |
e42b1bbd1052
variables.cc (get_top_level_value, set_top_level_value): new functions
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
87 extern OCTINTERP_API void |
e42b1bbd1052
variables.cc (get_top_level_value, set_top_level_value): new functions
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
88 set_top_level_value (const std::string& nm, const octave_value& val); |
3020 | 89 |
6109 | 90 extern OCTINTERP_API octave_value |
5791 | 91 set_internal_variable (bool& var, const octave_value_list& args, |
10313 | 92 int nargout, const char *nm); |
5794 | 93 |
6109 | 94 extern OCTINTERP_API octave_value |
5794 | 95 set_internal_variable (char& var, const octave_value_list& args, |
10313 | 96 int nargout, const char *nm); |
5794 | 97 |
6109 | 98 extern OCTINTERP_API octave_value |
5794 | 99 set_internal_variable (int& var, const octave_value_list& args, |
10313 | 100 int nargout, const char *nm, |
101 int minval = INT_MIN, int maxval = INT_MAX); | |
5794 | 102 |
6109 | 103 extern OCTINTERP_API octave_value |
5794 | 104 set_internal_variable (double& var, const octave_value_list& args, |
10313 | 105 int nargout, const char *nm, |
106 double minval = DBL_MIN, double maxval = DBL_MAX); | |
5791 | 107 |
6109 | 108 extern OCTINTERP_API octave_value |
5791 | 109 set_internal_variable (std::string& var, const octave_value_list& args, |
10313 | 110 int nargout, const char *nm, bool empty_ok = true); |
5794 | 111 |
10638
e1559a8a60b4
general mechanism for string enum variables
Jaroslav Hajek <highegg@gmail.com>
parents:
10443
diff
changeset
|
112 extern OCTINTERP_API octave_value |
e1559a8a60b4
general mechanism for string enum variables
Jaroslav Hajek <highegg@gmail.com>
parents:
10443
diff
changeset
|
113 set_internal_variable (int& var, const octave_value_list& args, |
10640
5c594472f75e
determine string enum length by trailing null rather than sizeof
Jaroslav Hajek <highegg@gmail.com>
parents:
10638
diff
changeset
|
114 int nargout, const char *nm, const char **choices); |
10638
e1559a8a60b4
general mechanism for string enum variables
Jaroslav Hajek <highegg@gmail.com>
parents:
10443
diff
changeset
|
115 |
5794 | 116 #define SET_INTERNAL_VARIABLE(NM) \ |
117 set_internal_variable (V ## NM, args, nargout, #NM) | |
5791 | 118 |
5794 | 119 #define SET_NONEMPTY_INTERNAL_STRING_VARIABLE(NM) \ |
120 set_internal_variable (V ## NM, args, nargout, #NM, false) | |
121 | |
122 #define SET_INTERNAL_VARIABLE_WITH_LIMITS(NM, MINVAL, MAXVAL) \ | |
123 set_internal_variable (V ## NM, args, nargout, #NM, MINVAL, MAXVAL) | |
5791 | 124 |
10640
5c594472f75e
determine string enum length by trailing null rather than sizeof
Jaroslav Hajek <highegg@gmail.com>
parents:
10638
diff
changeset
|
125 // in the following, CHOICES must be a C string array terminated by null. |
10638
e1559a8a60b4
general mechanism for string enum variables
Jaroslav Hajek <highegg@gmail.com>
parents:
10443
diff
changeset
|
126 #define SET_INTERNAL_VARIABLE_CHOICES(NM, CHOICES) \ |
10640
5c594472f75e
determine string enum length by trailing null rather than sizeof
Jaroslav Hajek <highegg@gmail.com>
parents:
10638
diff
changeset
|
127 set_internal_variable (V ## NM, args, nargout, #NM, CHOICES) |
10638
e1559a8a60b4
general mechanism for string enum variables
Jaroslav Hajek <highegg@gmail.com>
parents:
10443
diff
changeset
|
128 |
6109 | 129 extern OCTINTERP_API std::string builtin_string_variable (const std::string&); |
130 extern OCTINTERP_API int builtin_real_scalar_variable (const std::string&, double&); | |
131 extern OCTINTERP_API octave_value builtin_any_variable (const std::string&); | |
3020 | 132 |
6109 | 133 extern OCTINTERP_API void bind_ans (const octave_value& val, bool print); |
1162 | 134 |
6109 | 135 extern OCTINTERP_API void |
5794 | 136 bind_internal_variable (const std::string& fname, const octave_value& val); |
1406 | 137 |
7336 | 138 extern OCTINTERP_API void mlock (void); |
6109 | 139 extern OCTINTERP_API void munlock (const std::string&); |
140 extern OCTINTERP_API bool mislocked (const std::string&); | |
4016 | 141 |
7336 | 142 extern OCTINTERP_API void clear_function (const std::string& nm); |
143 extern OCTINTERP_API void clear_variable (const std::string& nm); | |
144 extern OCTINTERP_API void clear_symbol (const std::string& nm); | |
4009 | 145 |
10443
34e51d4e199b
implement smart warnings about missing Matlab functionality
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
146 extern OCTINTERP_API void maybe_missing_function_hook (const std::string& name); |
34e51d4e199b
implement smart warnings about missing Matlab functionality
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
147 |
1 | 148 #endif |