26#if defined (HAVE_CONFIG_H)
91#if defined (HAVE_ZLIB)
99err_file_open (
const std::string& fcn,
const std::string& file)
102 error (
"%s: unable to open input file '%s'", fcn.c_str (), file.c_str ());
103 else if (fcn ==
"save")
104 error (
"%s: unable to open output file '%s'", fcn.c_str (), file.c_str ());
106 error (
"%s: unable to open file '%s'", fcn.c_str (), file.c_str ());
113 int num_pat,
const std::string& name)
115 for (
int i = pat_idx; i < num_pat; i++)
119 if (pattern.match (name))
127read_binary_file_header (std::istream& is,
bool& swap,
128 mach_info::float_format& flt_fmt,
131 const int magic_len = 10;
132 char magic[magic_len+1];
133 is.read (magic, magic_len);
134 magic[magic_len] =
'\0';
136 if (
strncmp (magic,
"Octave-1-L", magic_len) == 0)
137 swap = mach_info::words_big_endian ();
138 else if (
strncmp (magic,
"Octave-1-B", magic_len) == 0)
139 swap = ! mach_info::words_big_endian ();
143 error (
"load: unable to read binary file");
153 if (flt_fmt == mach_info::flt_fmt_unknown)
156 error (
"load: unrecognized binary format!");
164#if defined (HAVE_ZLIB)
166check_gzip_magic (
const std::string& fname)
170 std::ifstream file = sys::ifstream (fname.c_str (),
171 std::ios::in | std::ios::binary);
173 unsigned char magic[2];
174 if (file.read (
reinterpret_cast<char *
> (&magic[0]), 2)
175 && magic[0] == 0x1f && magic[1] == 0x8b)
185find_file_to_load (
const std::string& name,
const std::string& orig_name)
189 std::size_t dot_pos = fname.rfind (
'.');
190 std::size_t sep_pos = fname.find_last_of (sys::file_ops::dir_sep_chars ());
192 if (dot_pos == std::string::npos
193 || (sep_pos != std::string::npos && dot_pos < sep_pos))
198 if (! (sys::file_exists (fname,
false)))
199 fname = find_file_to_load (fname +
".mat", orig_name);
203 if (! (sys::file_exists (fname,
false)))
207 error (
"load: unable to find file %s", orig_name.c_str ());
217glob_pattern_p (
const std::string& pattern)
221 int len = pattern.length ();
223 for (
int i = 0; i <
len; i++)
256 : m_interpreter (interp),
257 m_crash_dumps_octave_core (true),
258 m_octave_core_file_limit (-1.0),
259 m_octave_core_file_name (
"octave-workspace"),
260 m_save_default_options (
"-text"),
261 m_octave_core_file_options (
"-binary"),
262 m_save_header_format_string (init_save_header_format ())
264#if defined (HAVE_HDF5)
271#if defined (HAVE_HDF5)
281 "crash_dumps_octave_core");
289 "octave_core_file_limit");
297 "octave_core_file_name",
false);
305 "save_default_options",
false);
313 "octave_core_file_options",
false);
321 "save_header_format_string");
326 const std::string& orig_fname,
327 bool& use_zlib,
bool quiet)
331#if defined (HAVE_HDF5_UTF8)
332 std::string ascii_fname = fname;
334 std::string ascii_fname = sys::get_ASCII_filename (fname);
337#if defined (HAVE_HDF5)
339 if (H5Fis_hdf5 (ascii_fname.c_str ()) > 0)
343#if defined (HAVE_ZLIB)
344 use_zlib = check_gzip_magic (fname);
351 std::ifstream file = sys::ifstream (fname.c_str (),
352 std::ios::in | std::ios::binary);
359 err_file_open (
"load", orig_fname);
361#if defined (HAVE_ZLIB)
364 gzifstream gzfile (fname.c_str (), std::ios::in | std::ios::binary);
371 err_file_open (
"load", orig_fname);
380 const std::string& orig_fname,
382 mach_info::float_format flt_fmt,
383 bool list_only,
bool swap,
bool verbose,
385 int argc,
int nargout)
391 std::ostringstream output_buf;
392 std::list<std::string> symbol_names;
423#if defined (HAVE_HDF5)
426 argv, argv_idx, argc);
446 error (
"load: unable to load variable '%s'", name.c_str ());
449 warning (
"load: loaded ASCII file '%s' -- ignoring extra args",
450 orig_fname.c_str ());
454 || matches_patterns (argv, argv_idx, argc, name))
463 <<
"type rows cols name\n"
464 <<
"==== ==== ==== ====\n";
467 << std::setiosflags (std::ios::left)
468 << std::setw (16) << tc.
type_name ().c_str ()
469 << std::setiosflags (std::ios::right)
470 << std::setw (7) << tc.
rows ()
471 << std::setw (7) << tc.
columns ()
472 <<
" " << name <<
"\n";
475 symbol_names.push_back (name);
484 retstruct.
assign (name, tc);
487 install_loaded_variable (name, tc, global, doc);
498 if (list_only && count)
502 std::string msg = output_buf.str ();
523 else if (retstruct.
nfields () != 0)
532 bool& save_as_floats,
bool& use_zlib)
534#if ! defined (HAVE_ZLIB)
535 octave_unused_parameter (use_zlib);
539 int argc = argv.
numel ();
541 bool do_double =
false;
542 bool do_tabs =
false;
544 for (
int i = 0; i < argc; i++)
546 if (argv[i] ==
"-append")
550 else if (argv[i] ==
"-ascii" || argv[i] ==
"-a")
554 else if (argv[i] ==
"-double")
558 else if (argv[i] ==
"-tabs")
562 else if (argv[i] ==
"-text" || argv[i] ==
"-t")
566 else if (argv[i] ==
"-binary" || argv[i] ==
"-b")
570 else if (argv[i] ==
"-hdf5" || argv[i] ==
"-h")
572#if defined (HAVE_HDF5)
578 else if (argv[i] ==
"-v7.3" || argv[i] ==
"-V7.3" || argv[i] ==
"-7.3")
580 error (
"save: Matlab file format -v7.3 is not yet implemented");
582#if defined (HAVE_ZLIB)
583 else if (argv[i] ==
"-v7" || argv[i] ==
"-V7" || argv[i] ==
"-7"
584 || argv[i] ==
"-mat7-binary")
589 else if (argv[i] ==
"-mat" || argv[i] ==
"-m"
590 || argv[i] ==
"-v6" || argv[i] ==
"-V6" || argv[i] ==
"-6"
591 || argv[i] ==
"-mat-binary")
595 else if (argv[i] ==
"-v4" || argv[i] ==
"-V4" || argv[i] ==
"-4"
596 || argv[i] ==
"-mat4-binary")
600 else if (argv[i] ==
"-float-binary" || argv[i] ==
"-f")
603 save_as_floats =
true;
605 else if (argv[i] ==
"-float-hdf5")
607#if defined (HAVE_HDF5)
609 save_as_floats =
true;
614#if defined (HAVE_ZLIB)
615 else if (argv[i] ==
"-zip" || argv[i] ==
"-z")
620 else if (argv[i] ==
"-struct")
624 else if (argv[i][0] ==
'-' && argv[i] !=
"-")
626 error (
"save: Unrecognized option '%s'", argv[i].c_str ());
637 warning (R
"(save: "-double" option only has an effect with "-ascii")");
645 warning (R
"(save: "-tabs" option only has an effect with "-ascii")");
648 if (append && use_zlib
650 error (
"save: -append and -zip options can only be used together with a text format (-text or -ascii)");
658 bool& append,
bool& save_as_floats,
661 std::istringstream is (arg);
676 int argc, std::ostream& os,
679 bool write_header_info)
681 if (write_header_info)
682 write_header (os, fmt);
686 octave::unwind_action
687 clear_obj_cache ([
this] ()
693 if (argv_idx == argc)
695 save_vars (os,
"*", fmt, save_as_floats);
697 else if (argv[argv_idx] ==
"-struct")
699 if (++argv_idx >= argc)
700 error (
"save: missing struct name");
702 std::string struct_name = argv[argv_idx];
705 error (
"save: no such variable: '%s'", struct_name.c_str ());
710 error (
"save: '%s' is not a scalar structure", struct_name.c_str ());
718 for (
int i = argv_idx; i < argc; i++)
720 if (! save_fields (os, struct_var_map, argv[i], fmt,
723 warning (
"save: no such field '%s.%s'",
724 struct_name.c_str (), argv[i].c_str ());
729 save_fields (os, struct_var_map,
"*", fmt, save_as_floats);
733 for (
int i = argv_idx; i < argc; i++)
737 if (!
save_vars (os, argv[i], fmt, save_as_floats))
738 warning (
"save: no such variable '%s'", argv[i].c_str ());
746 if (m_crash_dumps_octave_core)
750 const char *fname = m_octave_core_file_name.c_str ();
752 message (
nullptr,
"attempting to save variables to '%s'...", fname);
756 bool save_as_floats =
false;
760 bool use_zlib =
false;
763 fmt, append, save_as_floats,
766 std::ios::openmode mode = std::ios::out;
773#
if defined (HAVE_HDF5)
779 mode |= std::ios::binary;
781 mode |= append ? std::ios::ate : std::ios::trunc;
783#if defined (HAVE_HDF5)
795 warning (
"dump_octave_core: unable to open '%s' for writing...",
803#if defined (HAVE_ZLIB)
815 warning (
"dump_octave_core: unable to open '%s' for writing...",
821 std::ofstream file = sys::ofstream (fname, mode);
830 warning (
"dump_octave_core: unable to open '%s' for writing...",
838load_save_system::write_header (std::ostream& os,
845 os << (mach_info::words_big_endian ()
846 ?
"Octave-1-B" :
"Octave-1-L");
848 mach_info::float_format flt_fmt = mach_info::native_float_format ();
859 char const *versionmagic;
860 char headertext[128];
864 const char *matlab_format =
"MATLAB 5.0 MAT-file, written by Octave "
866 std::string comment_string = now.strftime (matlab_format);
868 std::size_t
len = std::min (comment_string.length (),
869 static_cast<std::size_t
> (124));
870 memset (headertext,
'\0', 124);
871 memcpy (headertext, comment_string.data (),
len);
880 if (mach_info::words_big_endian ())
881 versionmagic =
"\x01\x00\x4d\x49";
883 versionmagic =
"\x00\x01\x49\x4d";
885 memcpy (headertext+124, versionmagic, 4);
886 os.write (headertext, 128);
891#if defined (HAVE_HDF5)
898 std::string comment_string = now.strftime (m_save_header_format_string);
900 if (! comment_string.empty ())
902#if defined (HAVE_HDF5)
906 H5Gset_comment (hs.
file_id,
"/", comment_string.c_str ());
910 os << comment_string <<
"\n";
925 const std::string& pattern,
933 std::size_t saved = 0;
935 for (
const auto& syminfo : syminfo_list)
937 do_save (os, syminfo, fmt, save_as_floats);
946load_save_system::do_save (std::ostream& os,
const octave_value& tc,
947 const std::string& name,
948 const std::string& help,
966 warning (
"save: unable to save %s in ASCII format", name.c_str ());
973#if defined (HAVE_HDF5)
996load_save_system::do_save (std::ostream& os,
1005 std::string name = syminfo.
name ();
1009 do_save (os, val, name, help, global, fmt, save_as_floats);
1017load_save_system::save_fields (std::ostream& os,
1019 const std::string& pattern,
1021 bool save_as_floats)
1025 std::size_t saved = 0;
1027 for (
auto it = m.
begin (); it != m.
end (); it++)
1029 std::string empty_str;
1031 if (pat.match (m.
key (it)))
1033 do_save (os, m.
contents (it), m.
key (it), empty_str,
1034 0, fmt, save_as_floats);
1047 bool save_as_floats)
1049 write_header (os, fmt);
1055 double save_mem_size = 0;
1057 for (
const auto& syminfo : syminfo_list)
1061 std::string name = syminfo.
name ();
1065 double val_size = val.
byte_size () / 1024;
1069 if (m_octave_core_file_limit < 0
1070 || save_mem_size + val_size < m_octave_core_file_limit)
1072 save_mem_size += val_size;
1074 do_save (os, val, name, help, global, fmt, save_as_floats);
1078 message (
nullptr,
"save to '%s' complete", fname);
1085load_save_system::install_loaded_variable (
const std::string& name,
1088 const std::string& )
1094load_save_system::init_save_header_format ()
1096 return "# Created by Octave " OCTAVE_VERSION ", %a %b %d %H:%M:%S %Y %Z";
1101 const std::string& filename)
1105 mach_info::float_format flt_fmt
1106 = mach_info::flt_fmt_unknown;
1110 if (read_binary_file_header (file, swap, flt_fmt,
true) == 0)
1115 file.seekg (0, std::ios::beg);
1117 int32_t mopt, nr, nc,
imag,
len;
1127 file.seekg (0, std::ios::beg);
1134 file.seekg (0, std::ios::beg);
1140 file.seekg (0, std::ios::beg);
1145 if (name_val.empty () !=
true && type_val.empty () !=
true)
1150 file.seekg (0, std::ios::beg);
1175 int argc = args.
length () + 1;
1180 std::string orig_fname =
"";
1183 if (argc > 1 && ! argv[1].empty () && argv[1].at (0) !=
'-')
1185 orig_fname = argv[1];
1195 bool list_only =
false;
1196 bool verbose =
false;
1200 octave::unwind_action
1201 clear_obj_cache ([
this] ()
1207 for (; i < argc; i++)
1209 if (argv[i] ==
"-text" || argv[i] ==
"-t")
1213 else if (argv[i] ==
"-binary" || argv[i] ==
"-b")
1217 else if (argv[i] ==
"-hdf5" || argv[i] ==
"-h")
1219#if defined (HAVE_HDF5)
1225 else if (argv[i] ==
"-ascii" || argv[i] ==
"-a")
1229 else if (argv[i] ==
"-v7.3" || argv[i] ==
"-V7.3" || argv[i] ==
"-7.3")
1231 error (
"load: Matlab file format -v7.3 is not yet implemented");
1233 else if (argv[i] ==
"-v7" || argv[i] ==
"-V7" || argv[i] ==
"-7"
1234 || argv[i] ==
"-mat7-binary")
1238 else if (argv[i] ==
"-mat" || argv[i] ==
"-m"
1239 || argv[i] ==
"-v6" || argv[i] ==
"-V6" || argv[i] ==
"-6"
1240 || argv[i] ==
"-mat-binary")
1244 else if (argv[i] ==
"-v4" || argv[i] ==
"-V4" || argv[i] ==
"-4"
1245 || argv[i] ==
"-mat4-binary")
1249 else if (argv[i] ==
"-list" || argv[i] ==
"-l")
1253 else if (argv[i] ==
"-verbose" || argv[i] ==
"-v")
1261 if (orig_fname ==
"")
1266 orig_fname = argv[i];
1271 mach_info::float_format flt_fmt = mach_info::flt_fmt_unknown;
1275 if (orig_fname ==
"-")
1279#if defined (HAVE_HDF5)
1281 error (
"load: cannot read HDF5 format from stdin");
1292 list_only, swap, verbose, argv, i,
1296 error (
"load: must specify file format if reading from stdin");
1300 std::string fname = sys::file_ops::tilde_expand (orig_fname);
1302 fname = find_file_to_load (fname, orig_fname);
1304 bool use_zlib =
false;
1309#if defined (HAVE_HDF5)
1317 err_file_open (
"load", orig_fname);
1320 list_only, swap, verbose, argv, i,
1335 std::ios::openmode mode = std::ios::in | std::ios::binary;
1337#if defined (HAVE_ZLIB)
1343 err_file_open (
"load", orig_fname);
1347 if (read_binary_file_header (file, swap, flt_fmt) < 0)
1349 if (file) file.
close ();
1359 if (file) file.
close ();
1365 list_only, swap, verbose, argv, i,
1373 std::ifstream file = sys::ifstream (fname.c_str (), mode);
1376 error (
"load: unable to open input file '%s'",
1377 orig_fname.c_str ());
1381 if (read_binary_file_header (file, swap, flt_fmt) < 0)
1383 if (file) file.close ();
1393 if (file) file.close ();
1399 list_only, swap, verbose, argv, i,
1406 error (
"load: unable to determine file format of '%s'",
1407 orig_fname.c_str ());
1420 bool save_as_floats =
false;
1421 bool append =
false;
1422 bool use_zlib =
false;
1427 save_as_floats, use_zlib);
1434 int argc = argv.
numel ();
1440 if (save_as_floats &&
format.type () ==
TEXT)
1441 error (
"save: cannot specify both -text and -float-binary");
1449#if defined (HAVE_HDF5)
1451 error (
"save: cannot write HDF5 format to stdout");
1458 warning (
"save: ignoring -append option for output to stdout");
1462 save_as_floats,
true);
1465 std::ostringstream output_buf;
1467 save_as_floats,
true);
1475 else if (i == argc - 1 && glob_pattern_p (argv[i]))
1487 std::string desiredname = sys::file_ops::tilde_expand (argv[i]);
1488 std::string fname = desiredname + (append ?
"" :
".saving_in_progress");
1501 warning (
"save: MATLAB compatible formats '-v4' and '-v6' are uncompressed");
1504 std::ios::openmode mode
1505 = (append ? (std::ios::app | std::ios::ate) : std::ios::out);
1508 mode |= std::ios::binary;
1510#if defined (HAVE_HDF5)
1515 error (
"save: appending to HDF5 files is not implemented");
1517# if defined (HAVE_HDF5_UTF8)
1518 bool write_header_info
1519 = ! (append && H5Fis_hdf5 (fname.c_str ()) > 0);
1521 std::string ascii_fname = sys::get_ASCII_filename (fname);
1523 bool write_header_info
1524 = ! (append && H5Fis_hdf5 (ascii_fname.c_str ()) > 0);
1530 err_file_open (
"save", fname);
1542#if defined (HAVE_ZLIB)
1548 err_file_open (
"save", fname);
1550 bool write_header_info = ! file.tellp ();
1560 std::ofstream file = sys::ofstream (fname.c_str (), mode);
1563 err_file_open (
"save", fname);
1565 bool write_header_info = ! file.tellp ();
1583 if (octave::sys::rename (fname, desiredname, msg) < 0)
1584 error (
"save: unable to save to %s %s",
1585 desiredname.c_str (), msg.c_str ());
1595 m_mcos_object_load_cache.clear ();
1596 m_mcos_object_save_cache.clear ();
1603 m_mcos_object_load_cache[object_id] = obj;
1609 return m_mcos_object_load_cache[object_id];
1617 return m_mcos_object_load_cache.find (object_id)
1618 != m_mcos_object_load_cache.end ();
1625 uint32_t
id = m_mcos_object_save_cache[obj];
1630 id = m_mcos_object_save_cache.size ();
1631 m_mcos_object_save_cache[obj] = id;
1643 m_subsystem_handler = std::make_unique<subsystem_handler> ();
1649 return m_subsystem_handler.get ();
1655 m_subsystem_handler.reset ();
1783 return load_save_sys.
load (args, nargout);
1948 return load_save_sys.
save (args, nargout);
2078DEFMETHOD (crash_dumps_octave_core, interp, args, nargout,
2099DEFMETHOD (save_default_options, interp, args, nargout,
2121DEFMETHOD (octave_core_file_limit, interp, args, nargout,
2150DEFMETHOD (octave_core_file_name, interp, args, nargout,
2172DEFMETHOD (octave_core_file_options, interp, args, nargout,
2195DEFMETHOD (save_header_format_string, interp, args, nargout,
2225OCTAVE_END_NAMESPACE(octave)
Gzipped file input stream class.
void close()
Close gzipped file.
Gzipped file output stream class.
void close()
Close gzipped file.
octave_value varval(const std::string &name) const
void install_variable(const std::string &name, const octave_value &value, bool global)
bool is_variable(const std::string &name) const
tree_evaluator & get_evaluator()
octave_value save_header_format_string(const octave_value_list &args, int nargout)
octave_value_list save(const octave_value_list &args=octave_value_list(), int nargout=0)
std::string save_header_format_string() const
subsystem_handler * get_subsystem_handler()
octave_value octave_core_file_name(const octave_value_list &args, int nargout)
void save_vars(const string_vector &argv, int argv_idx, int argc, std::ostream &os, const load_save_format &fmt, bool save_as_floats, bool write_header_info)
octave_value & get_mcos_object_cache_entry(uint32_t object_id)
void create_subsystem_handler()
octave_value octave_core_file_options(const octave_value_list &args, int nargout)
bool crash_dumps_octave_core() const
void clear_mcos_object_cache()
octave_value save_default_options(const octave_value_list &args, int nargout)
octave_value crash_dumps_octave_core(const octave_value_list &args, int nargout)
std::string octave_core_file_name() const
bool is_mcos_object_cache_entry(uint32_t object_id)
octave_value load_vars(std::istream &stream, const std::string &orig_fname, const load_save_format &fmt, mach_info::float_format flt_fmt, bool list_only, bool swap, bool verbose, const string_vector &argv, int argv_idx, int argc, int nargout)
std::string octave_core_file_options() const
double octave_core_file_limit() const
octave_value_list load(const octave_value_list &args=octave_value_list(), int nargout=0)
static load_save_format get_file_format(const std::string &fname, const std::string &orig_fname, bool &use_zlib, bool quiet=false)
void clear_subsystem_handler()
load_save_system(interpreter &interp)
std::string save_default_options() const
octave_value octave_core_file_limit(const octave_value_list &args, int nargout)
void set_mcos_object_cache_entry(uint32_t object_id, octave_value &obj)
uint32_t get_mcos_object_cache_id(const void *obj, bool &new_entry)
static string_vector parse_save_options(const string_vector &argv, load_save_format &fmt, bool &append, bool &save_as_floats, bool &use_zlib)
const octave_value & contents(const_iterator p) const
const_iterator end() const
const_iterator begin() const
void assign(const std::string &k, const octave_value &val)
octave_idx_type nfields() const
std::string key(const_iterator p) const
string_vector make_argv(const std::string &="") const
octave_idx_type length() const
octave_idx_type rows() const
octave_scalar_map scalar_map_value() const
octave_idx_type numel() const
std::string type_name() const
std::size_t byte_size() const
octave_idx_type columns() const
string_vector & append(const std::string &s)
std::ostream & list_in_columns(std::ostream &, int width=0, const std::string &prefix="") const
octave_idx_type numel() const
octave_value value() const
symbol_info_list top_scope_symbol_info() const
symbol_info_list glob_symbol_info(const std::string &pattern) const
ColumnVector imag(const ComplexColumnVector &a)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define DEFMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method.
void warning(const char *fmt,...)
void error(const char *fmt,...)
void message(const char *name, const char *fmt,...)
void err_unrecognized_data_fmt(const char *name)
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
bool save_hdf5_data(std::ostream &os, const octave_value &tc, const std::string &name, const std::string &doc, bool mark_global, bool save_as_floats)
std::string read_hdf5_data(std::istream &is, const std::string &, bool &global, octave_value &tc, std::string &doc, const string_vector &argv, int argv_idx, int argc)
bool save_mat_ascii_data(std::ostream &os, const octave_value &val, int precision, bool tabs)
std::string read_mat_ascii_data(std::istream &is, const std::string &filename, octave_value &tc)
bool looks_like_mat_ascii_file(std::istream &is, const std::string &filename)
octave::mach_info::float_format mopt_digit_to_float_format(int mach)
bool save_mat_binary_data(std::ostream &os, const octave_value &tc, const std::string &name)
int read_mat_file_header(std::istream &is, bool &swap, int32_t &mopt, int32_t &nr, int32_t &nc, int32_t &imag, int32_t &len, int quiet)
std::string read_mat_binary_data(std::istream &is, const std::string &filename, octave_value &tc)
int float_format_to_mopt_digit(octave::mach_info::float_format flt_fmt)
bool save_mat5_binary_element(std::ostream &os, const octave_value &tc_in, const std::string &name, bool mark_global, bool mat7_format, bool save_as_floats, bool compressing)
int read_mat5_binary_file_header(std::istream &is, bool &swap, bool quiet, const std::string &filename)
std::string read_mat5_binary_element(std::istream &is, const std::string &filename, bool swap, bool &global, octave_value &tc)
std::string read_binary_data(std::istream &is, bool swap, octave::mach_info::float_format fmt, const std::string &filename, bool &global, octave_value &tc, std::string &doc)
bool save_binary_data(std::ostream &os, const octave_value &tc_in, const std::string &name, const std::string &doc, bool mark_global, bool save_as_floats)
std::string read_text_data(std::istream &is, const std::string &filename, bool &global, octave_value &tc, octave_idx_type count, const bool do_name_validation)
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
bool save_text_data(std::ostream &os, const octave_value &val_arg, const std::string &name, bool mark_global, int precision)
bool strncmp(const T &str_a, const T &str_b, const typename T::size_type n)
True if the first N characters are the same.
std::string find_data_file_in_load_path(const std::string &fcn, const std::string &file, bool require_regular_file)
std::size_t format(std::ostream &os, const char *fmt,...)
octave_value set_internal_variable(bool &var, const octave_value_list &args, int nargout, const char *nm)