1
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, |
|
4 2003, 2005, 2006, 2007 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_utils_h) |
|
25 #define octave_utils_h 1 |
1
|
26 |
3620
|
27 #include <cstdarg> |
|
28 |
3503
|
29 #include <iostream> |
1755
|
30 #include <string> |
|
31 |
4478
|
32 #include "dMatrix.h" |
1966
|
33 #include "lo-utils.h" |
|
34 |
3354
|
35 class octave_value; |
2086
|
36 class octave_value_list; |
1755
|
37 class string_vector; |
1
|
38 |
6109
|
39 extern OCTINTERP_API bool valid_identifier (const char *s); |
|
40 extern OCTINTERP_API bool valid_identifier (const std::string& s); |
607
|
41 |
6323
|
42 extern OCTINTERP_API bool |
|
43 same_file (const std::string& f, const std::string& g); |
|
44 |
|
45 extern OCTINTERP_API int almost_match (const std::string& std, |
|
46 const std::string& s, |
|
47 int min_match_len = 1, |
|
48 int case_sens = 1); |
607
|
49 |
6109
|
50 extern OCTINTERP_API int |
3072
|
51 keyword_almost_match (const char * const *std, int *min_len, |
3523
|
52 const std::string& s, int min_toks_to_match, |
1755
|
53 int max_toks); |
|
54 |
6323
|
55 extern OCTINTERP_API int empty_arg (const char *name, octave_idx_type nr, |
|
56 octave_idx_type nc); |
628
|
57 |
6109
|
58 extern OCTINTERP_API std::string |
4243
|
59 search_path_for_file (const std::string&, const string_vector&); |
4216
|
60 |
6109
|
61 extern OCTINTERP_API string_vector |
4243
|
62 search_path_for_all_files (const std::string&, const string_vector&); |
4216
|
63 |
6323
|
64 extern OCTINTERP_API std::string |
|
65 file_in_path (const std::string&, const std::string&); |
|
66 |
6109
|
67 extern OCTINTERP_API std::string fcn_file_in_path (const std::string&); |
|
68 extern OCTINTERP_API std::string oct_file_in_path (const std::string&); |
|
69 extern OCTINTERP_API std::string mex_file_in_path (const std::string&); |
2042
|
70 |
6109
|
71 extern OCTINTERP_API std::string do_string_escapes (const std::string& s); |
3103
|
72 |
6109
|
73 extern OCTINTERP_API const char *undo_string_escape (char c); |
4143
|
74 |
6109
|
75 extern OCTINTERP_API std::string undo_string_escapes (const std::string& s); |
801
|
76 |
6109
|
77 extern OCTINTERP_API void |
4513
|
78 check_dimensions (dim_vector& dim, const char *warnfor); |
4481
|
79 |
6109
|
80 extern OCTINTERP_API void |
4481
|
81 get_dimensions (const octave_value& a, const char *warn_for, |
4513
|
82 dim_vector& dim); |
4481
|
83 |
6109
|
84 extern OCTINTERP_API void |
3354
|
85 get_dimensions (const octave_value& a, const octave_value& b, |
6323
|
86 const char *warn_for, octave_idx_type& nr, |
|
87 octave_idx_type& nc); |
3354
|
88 |
6109
|
89 extern OCTINTERP_API void |
6323
|
90 get_dimensions (const octave_value& a,const char *warn_for, |
|
91 octave_idx_type& nr, octave_idx_type& nc); |
3354
|
92 |
6323
|
93 extern OCTINTERP_API Matrix |
|
94 identity_matrix (octave_idx_type nr, octave_idx_type nc); |
4478
|
95 |
6109
|
96 extern OCTINTERP_API int |
3622
|
97 octave_format (std::ostream& os, const char *fmt, ...); |
3620
|
98 |
6109
|
99 extern OCTINTERP_API int |
3622
|
100 octave_vformat (std::ostream& os, const char *fmt, va_list args); |
3620
|
101 |
6109
|
102 extern OCTINTERP_API char *octave_vsnprintf (const char *fmt, va_list args); |
4302
|
103 |
6109
|
104 extern OCTINTERP_API char *octave_snprintf (const char *fmt, ...); |
4302
|
105 |
6109
|
106 extern OCTINTERP_API void octave_sleep (double seconds); |
3308
|
107 |
6109
|
108 extern "C" OCTINTERP_API void octave_sleep (unsigned int seconds); |
4067
|
109 |
6109
|
110 extern "C" OCTINTERP_API void octave_usleep (unsigned int useconds); |
4086
|
111 |
6323
|
112 extern "C" OCTINTERP_API int |
|
113 octave_raw_vsnprintf (char *buf, size_t n, const char *fmt, va_list args); |
3620
|
114 |
1
|
115 #endif |
|
116 |
|
117 /* |
|
118 ;;; Local Variables: *** |
|
119 ;;; mode: C++ *** |
|
120 ;;; End: *** |
|
121 */ |