00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined (octave_utils_h)
00025 #define octave_utils_h 1
00026
00027 #include <cstdarg>
00028
00029 #include <iosfwd>
00030 #include <string>
00031
00032 #include "dMatrix.h"
00033 #include "lo-utils.h"
00034
00035 class octave_value;
00036 class octave_value_list;
00037 class string_vector;
00038
00039 extern OCTINTERP_API bool valid_identifier (const char *s);
00040 extern OCTINTERP_API bool valid_identifier (const std::string& s);
00041
00042 extern OCTINTERP_API bool
00043 same_file (const std::string& f, const std::string& g);
00044
00045 extern OCTINTERP_API int almost_match (const std::string& std,
00046 const std::string& s,
00047 int min_match_len = 1,
00048 int case_sens = 1);
00049
00050 extern OCTINTERP_API int
00051 keyword_almost_match (const char * const *std, int *min_len,
00052 const std::string& s, int min_toks_to_match,
00053 int max_toks);
00054
00055 extern OCTINTERP_API int empty_arg (const char *name, octave_idx_type nr,
00056 octave_idx_type nc);
00057
00058 extern OCTINTERP_API std::string
00059 search_path_for_file (const std::string&, const string_vector&);
00060
00061 extern OCTINTERP_API string_vector
00062 search_path_for_all_files (const std::string&, const string_vector&);
00063
00064 extern OCTINTERP_API std::string
00065 file_in_path (const std::string&, const std::string&);
00066
00067 extern OCTINTERP_API std::string contents_file_in_path (const std::string&);
00068
00069 extern OCTINTERP_API std::string fcn_file_in_path (const std::string&);
00070 extern OCTINTERP_API std::string oct_file_in_path (const std::string&);
00071 extern OCTINTERP_API std::string mex_file_in_path (const std::string&);
00072
00073 extern OCTINTERP_API std::string do_string_escapes (const std::string& s);
00074
00075 extern OCTINTERP_API const char *undo_string_escape (char c);
00076
00077 extern OCTINTERP_API std::string undo_string_escapes (const std::string& s);
00078
00079 extern OCTINTERP_API void
00080 check_dimensions (dim_vector& dim, const char *warnfor);
00081
00082 extern OCTINTERP_API void
00083 get_dimensions (const octave_value& a, const char *warn_for,
00084 dim_vector& dim);
00085
00086 extern OCTINTERP_API void
00087 get_dimensions (const octave_value& a, const octave_value& b,
00088 const char *warn_for, octave_idx_type& nr,
00089 octave_idx_type& nc);
00090
00091 extern OCTINTERP_API void
00092 get_dimensions (const octave_value& a,const char *warn_for,
00093 octave_idx_type& nr, octave_idx_type& nc);
00094
00095 extern OCTINTERP_API octave_idx_type
00096 dims_to_numel (const dim_vector& dims, const octave_value_list& idx);
00097
00098
00099
00100 extern OCTINTERP_API Matrix
00101 identity_matrix (octave_idx_type nr, octave_idx_type nc);
00102
00103 extern OCTINTERP_API FloatMatrix
00104 float_identity_matrix (octave_idx_type nr, octave_idx_type nc);
00105
00106 extern OCTINTERP_API int
00107 octave_format (std::ostream& os, const char *fmt, ...);
00108
00109 extern OCTINTERP_API int
00110 octave_vformat (std::ostream& os, const char *fmt, va_list args);
00111
00112 extern OCTINTERP_API char *octave_vsnprintf (const char *fmt, va_list args);
00113
00114 extern OCTINTERP_API char *octave_snprintf (const char *fmt, ...);
00115
00116 extern OCTINTERP_API void octave_sleep (double seconds);
00117
00118 extern "C" OCTINTERP_API void octave_sleep (unsigned int seconds);
00119
00120 extern "C" OCTINTERP_API void octave_usleep (unsigned int useconds);
00121
00122 extern "C" OCTINTERP_API int
00123 octave_raw_vsnprintf (char *buf, size_t n, const char *fmt, va_list args);
00124
00125 #endif
00126
00127
00128
00129
00130
00131