GNU Octave
4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include <cerrno>
#include <cstring>
#include <fstream>
#include <iostream>
#include <limits>
#include <string>
#include <sys/types.h>
#include <unistd.h>
#include "vasnprintf.h"
#include "dir-ops.h"
#include "file-ops.h"
#include "file-stat.h"
#include "lo-mappers.h"
#include "lo-utils.h"
#include "oct-cmplx.h"
#include "oct-env.h"
#include "oct-locbuf.h"
#include "pathsearch.h"
#include "quit.h"
#include "str-vec.h"
#include "Cell.h"
#include <defaults.h>
#include "defun.h"
#include "dirfns.h"
#include "error.h"
#include "gripes.h"
#include "input.h"
#include "lex.h"
#include "load-path.h"
#include "oct-errno.h"
#include "oct-hist.h"
#include "oct-obj.h"
#include "ov-range.h"
#include "pager.h"
#include "parse.h"
#include "sysdep.h"
#include "toplev.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
Go to the source code of this file.
int almost_match | ( | const std::string & | std, |
const std::string & | s, | ||
int | min_match_len, | ||
int | case_sens | ||
) |
Definition at line 139 of file utils.cc.
References octave_strncasecmp().
Referenced by keyword_almost_match().
|
static |
Definition at line 1108 of file utils.cc.
References warning_with_id().
Referenced by Fcell(), fill_matrix(), and get_dimensions().
void check_dimensions | ( | dim_vector & | dim, |
const char * | warnfor | ||
) |
Definition at line 1121 of file utils.cc.
References dim_vector::length(), and warning_with_id().
std::string contents_file_in_path | ( | const std::string & | dir | ) |
Definition at line 539 of file utils.cc.
References file_ops::concat(), base_file_stat::exists(), load_path::find_dir(), and octave_env::make_absolute().
octave_idx_type dims_to_numel | ( | const dim_vector & | dims, |
const octave_value_list & | idx | ||
) |
Definition at line 1221 of file utils.cc.
References error_state, octave_value::index_vector(), octave_value::is_magic_colon(), octave_value::is_numeric_type(), octave_value_list::length(), idx_vector::length(), dim_vector::numel(), octave_value::numel(), and dim_vector::redim().
Referenced by Fnumel(), and octave_base_value::numel().
octave_value_list do_simple_cellfun | ( | octave_value_list(*)(const octave_value_list &, int) | fun, |
const char * | fun_name, | ||
const octave_value_list & | args, | ||
int | nargout | ||
) |
Definition at line 1437 of file utils.cc.
References arg(), octave_value::cell_value(), clear(), Array< T >::dims(), error(), error_state, octave_value::is_cell(), octave_value_list::length(), Array< T >::numel(), and OCTAVE_LOCAL_BUFFER.
Referenced by do_simple_cellfun(), Fstrfind(), and Fstrrep().
octave_value do_simple_cellfun | ( | octave_value_list(*)(const octave_value_list &, int) | fun, |
const char * | fun_name, | ||
const octave_value_list & | args | ||
) |
Definition at line 1517 of file utils.cc.
References do_simple_cellfun(), and octave_value_list::length().
std::string do_string_escapes | ( | const std::string & | s | ) |
Definition at line 618 of file utils.cc.
References warning().
Referenced by Fdlmread(), Fdo_string_escapes(), install_utils_fcns(), octave_stream::oscanf(), octave_stream::printf(), and octave_stream::scanf().
int empty_arg | ( | const char * | , |
octave_idx_type | nr, | ||
octave_idx_type | nc | ||
) |
std::string fcn_file_in_path | ( | const std::string & | name | ) |
Definition at line 504 of file utils.cc.
References octave_env::absolute_pathname(), base_file_stat::exists(), load_path::find_fcn_file(), base_file_stat::is_dir(), and Vfilemarker.
Referenced by do_dbtype(), get_help_from_file(), and octave_user_function::mark_as_system_fcn_file().
OCTAVE_EXPORT octave_value_list Fdir_in_loadpath | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 981 of file utils.cc.
References error(), error_state, load_path::find_dir(), load_path::find_matching_dirs(), and print_usage().
OCTAVE_EXPORT octave_value_list Fdo_string_escapes | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 708 of file utils.cc.
References do_string_escapes(), error(), octave_value::length(), and print_usage().
OCTAVE_EXPORT octave_value_list Ferrno | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1037 of file utils.cc.
References error(), error_state, octave_errno::get(), octave_value::length(), octave_errno::lookup(), print_usage(), and octave_errno::set().
Referenced by install_utils_fcns().
OCTAVE_EXPORT octave_value_list Ferrno_list | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1089 of file utils.cc.
References octave_errno::list(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffile_in_loadpath | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 309 of file utils.cc.
References error(), error_state, load_path::find_all_first_of(), load_path::find_first_of(), Array< T >::length(), octave_value::length(), octave_env::make_absolute(), make_absolute(), names(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffile_in_path | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 388 of file utils.cc.
References error(), error_state, Array< T >::length(), octave_value::length(), make_absolute(), names(), print_usage(), search_path_for_all_files(), and search_path_for_file().
std::string file_in_path | ( | const std::string & | name, |
const std::string & | suffix | ||
) |
Definition at line 452 of file utils.cc.
References load_path::find_file(), and octave_env::make_absolute().
Referenced by install_utils_fcns(), and symbol_exist().
std::string find_data_file_in_load_path | ( | const std::string & | fcn, |
const std::string & | file, | ||
bool | require_regular_file | ||
) |
Definition at line 463 of file utils.cc.
References octave_env::absolute_pathname(), base_file_stat::exists(), load_path::find_file(), gripe_data_file_in_path(), base_file_stat::is_reg(), octave_env::make_absolute(), and octave_env::rooted_relative_pathname().
Referenced by do_stream_open(), find_file_to_load(), and Fmd5sum().
OCTAVE_EXPORT octave_value_list Fis_absolute_filename | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 887 of file utils.cc.
References octave_env::absolute_pathname(), and print_usage().
OCTAVE_EXPORT octave_value_list Fis_rooted_relative_filename | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 912 of file utils.cc.
References print_usage(), and octave_env::rooted_relative_pathname().
OCTAVE_EXPORT octave_value_list Fisindex | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1383 of file utils.cc.
References discard_error_messages, error_state, idx_vector::extent(), octave_value::length(), print_usage(), and action_container::protect_var().
OCTAVE_EXPORT octave_value_list Fisstudent | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1543 of file utils.cc.
References octave_value(), and print_usage().
OCTAVE_EXPORT octave_value_list Fisvarname | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 100 of file utils.cc.
References is_keyword(), octave_value::length(), print_usage(), and valid_identifier().
FloatMatrix float_identity_matrix | ( | octave_idx_type | nr, |
octave_idx_type | nc | ||
) |
OCTAVE_EXPORT octave_value_list Fmake_absolute_filename | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 940 of file utils.cc.
References error(), error_state, octave_env::make_absolute(), and print_usage().
OCTAVE_EXPORT octave_value_list Fundo_string_escapes | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 841 of file utils.cc.
References error(), octave_value::length(), print_usage(), and undo_string_escapes().
void get_dimensions | ( | const octave_value & | a, |
const char * | warn_for, | ||
dim_vector & | dim | ||
) |
Definition at line 1141 of file utils.cc.
References check_dimensions(), octave_value::columns(), error(), error_state, fix(), octave_value::int_value(), octave_value::is_scalar_type(), Array< T >::length(), dim_vector::resize(), octave_value::rows(), and octave_value::vector_value().
Referenced by Fcell(), Feye(), fill_matrix(), and Fsparse().
void get_dimensions | ( | const octave_value & | a, |
const char * | warn_for, | ||
octave_idx_type & | nr, | ||
octave_idx_type & | nc | ||
) |
Definition at line 1177 of file utils.cc.
References check_dimensions(), octave_value::columns(), error(), error_state, fix(), octave_value::int_value(), octave_value::is_scalar_type(), octave_value::rows(), and octave_value::vector_value().
void get_dimensions | ( | const octave_value & | a, |
const octave_value & | b, | ||
const char * | warn_for, | ||
octave_idx_type & | nr, | ||
octave_idx_type & | nc | ||
) |
Definition at line 1208 of file utils.cc.
References check_dimensions(), error(), error_state, octave_value::int_value(), and octave_value::is_empty().
Matrix identity_matrix | ( | octave_idx_type | nr, |
octave_idx_type | nc | ||
) |
int keyword_almost_match | ( | const char *const * | std, |
int * | min_len, | ||
const std::string & | s, | ||
int | min_toks_to_match, | ||
int | max_toks | ||
) |
Definition at line 155 of file utils.cc.
References almost_match(), and strsave().
Referenced by set_DASPK_options(), set_DASRT_options(), set_DASSL_options(), set_LSODE_options(), set_Quad_options(), show_DASPK_options(), show_DASRT_options(), show_DASSL_options(), show_LSODE_options(), and show_Quad_options().
|
static |
Definition at line 279 of file utils.cc.
References Array< T >::length(), and octave_env::make_absolute().
Referenced by Ffile_in_loadpath(), and Ffile_in_path().
std::string mex_file_in_path | ( | const std::string & | name | ) |
Definition at line 590 of file utils.cc.
References octave_env::absolute_pathname(), base_file_stat::exists(), and load_path::find_mex_file().
std::string oct_file_in_path | ( | const std::string & | name | ) |
Definition at line 561 of file utils.cc.
References octave_env::absolute_pathname(), base_file_stat::exists(), and load_path::find_oct_file().
std::string octave_asprintf | ( | const char * | fmt, |
... | |||
) |
Definition at line 1329 of file utils.cc.
References octave_vasprintf().
Definition at line 1286 of file utils.cc.
References octave_vformat().
Referenced by do_printf_conv().
void octave_sleep | ( | double | seconds | ) |
Definition at line 1344 of file utils.cc.
References max(), octave_sleep(), and octave_usleep().
Referenced by octave_sleep().
std::string octave_vasprintf | ( | const char * | fmt, |
va_list | args | ||
) |
Definition at line 1311 of file utils.cc.
References free().
Referenced by octave_asprintf(), and octave_vformat().
Definition at line 1301 of file utils.cc.
References octave_vasprintf().
Referenced by mexPrintf(), octave_format(), verror(), and vwarning().
bool same_file | ( | const std::string & | f, |
const std::string & | g | ||
) |
Definition at line 133 of file utils.cc.
References same_file_internal().
Referenced by load_path::do_contains_canonical(), execute_startup_files(), octave_qt_link::file_in_path(), and out_of_date_check().
string_vector search_path_for_all_files | ( | const std::string & | path, |
const string_vector & | names | ||
) |
Definition at line 264 of file utils.cc.
References dir_path::find_all_first_of(), Array< T >::length(), and octave_env::make_absolute().
Referenced by Ffile_in_path().
std::string search_path_for_file | ( | const std::string & | path, |
const string_vector & | names | ||
) |
Definition at line 254 of file utils.cc.
References dir_path::find_first_of(), and octave_env::make_absolute().
Referenced by Ffile_in_path(), and have_gnuplot_binary().
Definition at line 754 of file utils.cc.
Referenced by octave_lex(), and undo_string_escapes().
std::string undo_string_escapes | ( | const std::string & | s | ) |
Definition at line 802 of file utils.cc.
References undo_string_escape().
Referenced by Fundo_string_escapes(), install_utils_fcns(), octave_base_parser::make_constant(), octave_print_internal(), scanf_format_list::printme(), and printf_format_list::printme().
Definition at line 77 of file utils.cc.
Referenced by octave_cmd_eval::execute(), Farrayfun(), Fassignin(), Fcellfun(), Fisvarname(), get_fcn_files(), load_path::dir_info::get_file_list(), hdf5_read_next_data(), maybe_warn_invalid_field_name(), read_ascii_data(), read_mat_ascii_data(), workspace_model::setData(), and valid_identifier().
bool valid_identifier | ( | const std::string & | s | ) |
Definition at line 90 of file utils.cc.
References valid_identifier().