1
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
1
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
1
|
20 |
|
21 */ |
|
22 |
383
|
23 #if !defined (octave_utils_h) |
|
24 #define octave_utils_h 1 |
1
|
25 |
3620
|
26 #include <cstdarg> |
|
27 |
3503
|
28 #include <iostream> |
1755
|
29 #include <string> |
|
30 |
4478
|
31 #include "dMatrix.h" |
1966
|
32 #include "lo-utils.h" |
|
33 |
3354
|
34 class octave_value; |
2086
|
35 class octave_value_list; |
1755
|
36 class string_vector; |
1
|
37 |
6109
|
38 extern OCTINTERP_API bool valid_identifier (const char *s); |
|
39 extern OCTINTERP_API bool valid_identifier (const std::string& s); |
607
|
40 |
6323
|
41 extern OCTINTERP_API bool |
|
42 same_file (const std::string& f, const std::string& g); |
|
43 |
|
44 extern OCTINTERP_API int almost_match (const std::string& std, |
|
45 const std::string& s, |
|
46 int min_match_len = 1, |
|
47 int case_sens = 1); |
607
|
48 |
6109
|
49 extern OCTINTERP_API int |
3072
|
50 keyword_almost_match (const char * const *std, int *min_len, |
3523
|
51 const std::string& s, int min_toks_to_match, |
1755
|
52 int max_toks); |
|
53 |
6323
|
54 extern OCTINTERP_API int empty_arg (const char *name, octave_idx_type nr, |
|
55 octave_idx_type nc); |
628
|
56 |
6109
|
57 extern OCTINTERP_API std::string |
4243
|
58 search_path_for_file (const std::string&, const string_vector&); |
4216
|
59 |
6109
|
60 extern OCTINTERP_API string_vector |
4243
|
61 search_path_for_all_files (const std::string&, const string_vector&); |
4216
|
62 |
6323
|
63 extern OCTINTERP_API std::string |
|
64 file_in_path (const std::string&, const std::string&); |
|
65 |
6109
|
66 extern OCTINTERP_API std::string fcn_file_in_path (const std::string&); |
|
67 extern OCTINTERP_API std::string oct_file_in_path (const std::string&); |
|
68 extern OCTINTERP_API std::string mex_file_in_path (const std::string&); |
2042
|
69 |
6109
|
70 extern OCTINTERP_API std::string do_string_escapes (const std::string& s); |
3103
|
71 |
6109
|
72 extern OCTINTERP_API const char *undo_string_escape (char c); |
4143
|
73 |
6109
|
74 extern OCTINTERP_API std::string undo_string_escapes (const std::string& s); |
801
|
75 |
6109
|
76 extern OCTINTERP_API void |
4513
|
77 check_dimensions (dim_vector& dim, const char *warnfor); |
4481
|
78 |
6109
|
79 extern OCTINTERP_API void |
4481
|
80 get_dimensions (const octave_value& a, const char *warn_for, |
4513
|
81 dim_vector& dim); |
4481
|
82 |
6109
|
83 extern OCTINTERP_API void |
3354
|
84 get_dimensions (const octave_value& a, const octave_value& b, |
6323
|
85 const char *warn_for, octave_idx_type& nr, |
|
86 octave_idx_type& nc); |
3354
|
87 |
6109
|
88 extern OCTINTERP_API void |
6323
|
89 get_dimensions (const octave_value& a,const char *warn_for, |
|
90 octave_idx_type& nr, octave_idx_type& nc); |
3354
|
91 |
6323
|
92 extern OCTINTERP_API Matrix |
|
93 identity_matrix (octave_idx_type nr, octave_idx_type nc); |
4478
|
94 |
6109
|
95 extern OCTINTERP_API int |
3622
|
96 octave_format (std::ostream& os, const char *fmt, ...); |
3620
|
97 |
6109
|
98 extern OCTINTERP_API int |
3622
|
99 octave_vformat (std::ostream& os, const char *fmt, va_list args); |
3620
|
100 |
6109
|
101 extern OCTINTERP_API char *octave_vsnprintf (const char *fmt, va_list args); |
4302
|
102 |
6109
|
103 extern OCTINTERP_API char *octave_snprintf (const char *fmt, ...); |
4302
|
104 |
6109
|
105 extern OCTINTERP_API void octave_sleep (double seconds); |
3308
|
106 |
6109
|
107 extern "C" OCTINTERP_API void octave_sleep (unsigned int seconds); |
4067
|
108 |
6109
|
109 extern "C" OCTINTERP_API void octave_usleep (unsigned int useconds); |
4086
|
110 |
6323
|
111 extern "C" OCTINTERP_API int |
|
112 octave_raw_vsnprintf (char *buf, size_t n, const char *fmt, va_list args); |
3620
|
113 |
1
|
114 #endif |
|
115 |
|
116 /* |
|
117 ;;; Local Variables: *** |
|
118 ;;; mode: C++ *** |
|
119 ;;; End: *** |
|
120 */ |