GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
utils.cc File Reference
#include <cerrno>
#include <cstring>
#include <fstream>
#include <limits>
#include <ostream>
#include <string>
#include "dir-ops.h"
#include "file-ops.h"
#include "file-stat.h"
#include "lo-mappers.h"
#include "lo-utils.h"
#include "nanosleep-wrapper.h"
#include "oct-cmplx.h"
#include "oct-env.h"
#include "oct-locbuf.h"
#include "oct-string.h"
#include "pathsearch.h"
#include "quit.h"
#include "str-vec.h"
#include "vasprintf-wrapper.h"
#include "Cell.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "graphics.h"
#include "interpreter-private.h"
#include "interpreter.h"
#include "lex.h"
#include "load-path.h"
#include "oct-errno.h"
#include "oct-hist.h"
#include "ovl.h"
#include "ov-range.h"
#include "pager.h"
#include "parse.h"
#include "sysdep.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
#include "ov.h"
Include dependency graph for utils.cc:

Go to the source code of this file.

Namespaces

 octave
 

Functions

int octave::almost_match (const std::string &std, const std::string &s, int min_match_len, int case_sens)
 
int almost_match (const std::string &std, const std::string &s, int min_match_len, int case_sens)
 
std::string octave::asprintf (const char *fmt,...)
 
void octave::check_dimensions (dim_vector &dim, const char *warnfor)
 
void check_dimensions (dim_vector &dim, const char *warnfor)
 
static void octave::check_dimensions (octave_idx_type &nr, octave_idx_type &nc, const char *warnfor)
 
std::string octave::contents_file_in_path (const std::string &dir)
 
std::string contents_file_in_path (const std::string &s)
 
octave_idx_type dims_to_numel (const dim_vector &dims, const octave_value_list &idx)
 
octave_idx_type octave::dims_to_numel (const dim_vector &dims, const octave_value_list &idx_arg)
 
octave_value octave::do_simple_cellfun (octave_value_list(*fun)(const octave_value_list &, int), const char *fun_name, const octave_value_list &args)
 
octave_value do_simple_cellfun (octave_value_list(*fun)(const octave_value_list &, int), const char *fun_name, const octave_value_list &args)
 
octave_value_list octave::do_simple_cellfun (octave_value_list(*fun)(const octave_value_list &, int), const char *fun_name, const octave_value_list &args, int nargout)
 
octave_value_list do_simple_cellfun (octave_value_list(*fun)(const octave_value_list &, int), const char *fun_name, const octave_value_list &args, int nargout)
 
std::string octave::do_string_escapes (const std::string &s)
 
std::string do_string_escapes (const std::string &s)
 
std::string octave::fcn_file_in_path (const std::string &name)
 
std::string fcn_file_in_path (const std::string &s)
 
OCTAVE_EXPORT octave_value_list Fdir_in_loadpath (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fdo_string_escapes (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Ferrno (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Ferrno_list (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Ffile_in_loadpath (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Ffile_in_path (const octave_value_list &args, int)
 
std::string octave::file_in_path (const std::string &name, const std::string &suffix)
 
std::string file_in_path (const std::string &name, const std::string &suffix)
 
std::string octave::find_data_file_in_load_path (const std::string &fcn, const std::string &file, bool require_regular_file)
 
std::string find_data_file_in_load_path (const std::string &fcn, const std::string &file, bool require_regular_file)
 
OCTAVE_EXPORT octave_value_list Fis_absolute_filename (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fis_rooted_relative_filename (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fis_same_file (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fisindex (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fisstudent (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fisvarname (const octave_value_list &args, int)
 
FloatMatrix octave::float_identity_matrix (octave_idx_type nr, octave_idx_type nc)
 
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)
 
size_t octave::format (std::ostream &os, const char *fmt,...)
 
size_t octave::format (std::ostream &os, const std::string &enc, const char *fmt,...)
 
OCTAVE_EXPORT octave_value_list Fundo_string_escapes (const octave_value_list &args, int)
 
void octave::get_dimensions (const octave_value &a, const char *warn_for, dim_vector &dim)
 
void get_dimensions (const octave_value &a, const char *warn_for, dim_vector &dim)
 
void octave::get_dimensions (const octave_value &a, const char *warn_for, octave_idx_type &nr, octave_idx_type &nc)
 
void get_dimensions (const octave_value &a, const char *warn_for, octave_idx_type &nr, octave_idx_type &nc)
 
void octave::get_dimensions (const octave_value &a, const octave_value &b, const char *warn_for, octave_idx_type &nr, octave_idx_type &nc)
 
void get_dimensions (const octave_value &a, const octave_value &b, const char *warn_for, octave_idx_type &nr, octave_idx_type &nc)
 
Matrix octave::identity_matrix (octave_idx_type nr, octave_idx_type nc)
 
Matrix identity_matrix (octave_idx_type nr, octave_idx_type nc)
 
int octave::keyword_almost_match (const char *const *std, int *min_len, const std::string &s, int min_toks_to_match, int max_toks)
 
int keyword_almost_match (const char *const *std, int *min_len, const std::string &s, int min_toks_to_match, int max_toks)
 
static string_vector octave::make_absolute (const string_vector &sv)
 
void octave_sleep (double seconds)
 
std::string octave_vasprintf (const char *fmt, va_list args)
 
size_t octave_vformat (std::ostream &os, const char *fmt, va_list args)
 
bool octave::same_file (const std::string &f, const std::string &g)
 
bool same_file (const std::string &f, const std::string &g)
 
string_vector octave::search_path_for_all_files (const std::string &path, const string_vector &names)
 
string_vector search_path_for_all_files (const std::string &path, const string_vector &names)
 
std::string octave::search_path_for_file (const std::string &path, const string_vector &names)
 
std::string search_path_for_file (const std::string &path, const string_vector &names)
 
void octave::sleep (double seconds, bool do_graphics_events)
 
const char * octave::undo_string_escape (char c)
 
const char * undo_string_escape (char c)
 
std::string octave::undo_string_escapes (const std::string &s)
 
std::string undo_string_escapes (const std::string &s)
 
bool octave::valid_identifier (const char *s)
 
bool valid_identifier (const char *s)
 
bool octave::valid_identifier (const std::string &s)
 
bool valid_identifier (const std::string &s)
 
std::string octave::vasprintf (const char *fmt, va_list args)
 
size_t octave::vformat (std::ostream &os, const char *fmt, va_list args)
 
size_t octave::vformat (std::ostream &os, const std::string &enc, const char *fmt, va_list args)
 

Function Documentation

◆ almost_match()

int almost_match ( const std::string &  std,
const std::string &  s,
int  min_match_len,
int  case_sens 
)

Definition at line 1681 of file utils.cc.

References octave::almost_match().

◆ check_dimensions()

void check_dimensions ( dim_vector dim,
const char *  warnfor 
)

Definition at line 1752 of file utils.cc.

References octave::check_dimensions().

◆ contents_file_in_path()

std::string contents_file_in_path ( const std::string &  s)

Definition at line 1722 of file utils.cc.

References octave::contents_file_in_path().

◆ dims_to_numel()

octave_idx_type dims_to_numel ( const dim_vector dims,
const octave_value_list idx 
)

Definition at line 1780 of file utils.cc.

References octave::dims_to_numel().

◆ do_simple_cellfun() [1/2]

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 1824 of file utils.cc.

References octave::do_simple_cellfun().

◆ do_simple_cellfun() [2/2]

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 1816 of file utils.cc.

References octave::do_simple_cellfun().

◆ do_string_escapes()

std::string do_string_escapes ( const std::string &  s)

Definition at line 1734 of file utils.cc.

References octave::do_string_escapes().

◆ fcn_file_in_path()

std::string fcn_file_in_path ( const std::string &  s)

Definition at line 1728 of file utils.cc.

References octave::fcn_file_in_path().

◆ Fdir_in_loadpath()

OCTAVE_EXPORT octave_value_list Fdir_in_loadpath ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ Fdo_string_escapes()

OCTAVE_EXPORT octave_value_list Fdo_string_escapes ( const octave_value_list args,
int   
)

Definition at line 789 of file utils.cc.

References octave::do_string_escapes(), ovl(), and print_usage().

◆ Ferrno()

OCTAVE_EXPORT octave_value_list Ferrno ( const octave_value_list args,
int   
)

◆ Ferrno_list()

OCTAVE_EXPORT octave_value_list Ferrno_list ( const octave_value_list args,
int   
)

Definition at line 1150 of file utils.cc.

References octave_errno::list(), ovl(), and print_usage().

◆ Ffile_in_loadpath()

◆ Ffile_in_path()

◆ file_in_path()

std::string file_in_path ( const std::string &  name,
const std::string &  suffix 
)

Definition at line 1709 of file utils.cc.

References octave::file_in_path(), and name.

◆ find_data_file_in_load_path()

std::string find_data_file_in_load_path ( const std::string &  fcn,
const std::string &  file,
bool  require_regular_file 
)

Definition at line 1715 of file utils.cc.

References octave::find_data_file_in_load_path().

◆ Fis_absolute_filename()

OCTAVE_EXPORT octave_value_list Fis_absolute_filename ( const octave_value_list args,
int   
)

Definition at line 962 of file utils.cc.

References octave::sys::env::absolute_pathname(), ovl(), and print_usage().

◆ Fis_rooted_relative_filename()

OCTAVE_EXPORT octave_value_list Fis_rooted_relative_filename ( const octave_value_list args,
int   
)

Definition at line 983 of file utils.cc.

References ovl(), print_usage(), and octave::sys::env::rooted_relative_pathname().

◆ Fis_same_file()

◆ Fisindex()

OCTAVE_EXPORT octave_value_list Fisindex ( octave::interpreter interp,
const octave_value_list args,
int   
)

Definition at line 1504 of file utils.cc.

References idx_vector::extent(), n, print_usage(), and retval.

◆ Fisstudent()

OCTAVE_EXPORT octave_value_list Fisstudent ( const octave_value_list args,
int   
)

Definition at line 1638 of file utils.cc.

References ovl(), and print_usage().

◆ Fisvarname()

OCTAVE_EXPORT octave_value_list Fisvarname ( const octave_value_list args,
int   
)

Definition at line 103 of file utils.cc.

References octave::iskeyword(), print_usage(), retval, and octave::valid_identifier().

◆ float_identity_matrix()

FloatMatrix float_identity_matrix ( octave_idx_type  nr,
octave_idx_type  nc 
)

Definition at line 1792 of file utils.cc.

References octave::float_identity_matrix().

◆ Fmake_absolute_filename()

OCTAVE_EXPORT octave_value_list Fmake_absolute_filename ( const octave_value_list args,
int   
)

Definition at line 1008 of file utils.cc.

References octave::sys::env::make_absolute(), ovl(), and print_usage().

◆ Fundo_string_escapes()

OCTAVE_EXPORT octave_value_list Fundo_string_escapes ( const octave_value_list args,
int   
)

Definition at line 925 of file utils.cc.

References ovl(), print_usage(), and octave::undo_string_escapes().

◆ get_dimensions() [1/3]

void get_dimensions ( const octave_value a,
const char *  warn_for,
dim_vector dim 
)

Definition at line 1758 of file utils.cc.

References octave::get_dimensions().

◆ get_dimensions() [2/3]

void get_dimensions ( const octave_value a,
const char *  warn_for,
octave_idx_type nr,
octave_idx_type nc 
)

Definition at line 1773 of file utils.cc.

References octave::get_dimensions().

◆ get_dimensions() [3/3]

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 1765 of file utils.cc.

References octave::get_dimensions().

◆ identity_matrix()

Matrix identity_matrix ( octave_idx_type  nr,
octave_idx_type  nc 
)

Definition at line 1786 of file utils.cc.

References octave::identity_matrix().

◆ keyword_almost_match()

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 1688 of file utils.cc.

References octave::keyword_almost_match().

◆ octave_sleep()

void octave_sleep ( double  seconds)

Definition at line 1810 of file utils.cc.

References octave::sleep().

◆ octave_vasprintf()

std::string octave_vasprintf ( const char *  fmt,
va_list  args 
)

Definition at line 1804 of file utils.cc.

References octave::vasprintf().

◆ octave_vformat()

size_t octave_vformat ( std::ostream &  os,
const char *  fmt,
va_list  args 
)

Definition at line 1798 of file utils.cc.

References octave::vformat().

◆ same_file()

bool same_file ( const std::string &  f,
const std::string &  g 
)

Definition at line 1675 of file utils.cc.

References f, and octave::same_file().

◆ search_path_for_all_files()

string_vector search_path_for_all_files ( const std::string &  path,
const string_vector names 
)

Definition at line 1703 of file utils.cc.

References path, and octave::search_path_for_all_files().

◆ search_path_for_file()

std::string search_path_for_file ( const std::string &  path,
const string_vector names 
)

Definition at line 1697 of file utils.cc.

References path, and octave::search_path_for_file().

◆ undo_string_escape()

const char* undo_string_escape ( char  c)

Definition at line 1740 of file utils.cc.

References octave::undo_string_escape().

◆ undo_string_escapes()

std::string undo_string_escapes ( const std::string &  s)

Definition at line 1746 of file utils.cc.

References octave::undo_string_escapes().

◆ valid_identifier() [1/2]

bool valid_identifier ( const char *  s)

Definition at line 1663 of file utils.cc.

References octave::valid_identifier().

◆ valid_identifier() [2/2]

bool valid_identifier ( const std::string &  s)

Definition at line 1669 of file utils.cc.

References octave::valid_identifier().