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