#include <cerrno>
#include <cstdio>
#include <iomanip>
#include <string>
#include "file-ops.h"
#include "file-stat.h"
#include "iconv-wrappers.h"
#include "lo-ieee.h"
#include "lo-sysdep.h"
#include "localcharset-wrapper.h"
#include "mkostemp-wrapper.h"
#include "oct-env.h"
#include "oct-locbuf.h"
#include "unistd-wrappers.h"
#include "builtin-defun-decls.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "interpreter-private.h"
#include "interpreter.h"
#include "load-path.h"
#include "oct-fstrm.h"
#include "oct-iostrm.h"
#include "oct-map.h"
#include "oct-prcstrm.h"
#include "oct-stream.h"
#include "oct-strstrm.h"
#include "ov.h"
#include "ovl.h"
#include "pager.h"
#include "sysdep.h"
#include "utils.h"
#include "variables.h"
Go to the source code of this file.
Functions | |
static octave_value | const_value (const char *, const octave_value_list &args, const octave_value &val) |
static octave_value | const_value (const char *, const octave_value_list &args, int val) |
static int | convert (int x, int ibase, int obase) |
static octave_value | do_fread (stream &os, const octave_value &size_arg, const octave_value &prec_arg, const octave_value &skip_arg, const octave_value &arch_arg, octave_idx_type &count) |
static int | do_fwrite (stream &os, const octave_value &data, const octave_value &prec_arg, const octave_value &skip_arg, const octave_value &arch_arg) |
static stream | do_stream_open (const octave_value &tc_name, const octave_value &tc_mode, const octave_value &tc_arch, const octave_value &tc_encoding, const char *fcn, int &fid) |
static stream | do_stream_open (const std::string &name, const std::string &mode_arg, const std::string &arch, std::string encoding, int &fid) |
OCTAVE_EXPORT octave_value_list | F__textscan__ (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffclear (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffclose (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffeof (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fferror (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffflush (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffgetl (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffgets (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffopen (octave::interpreter &interp, const octave_value_list &args, int nargout) |
OCTAVE_EXPORT octave_value_list | Ffprintf (octave::interpreter &interp, const octave_value_list &args, int nargout) |
OCTAVE_EXPORT octave_value_list | Ffputs (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffread (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffreport (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffrewind (octave::interpreter &interp, const octave_value_list &args, int nargout) |
OCTAVE_EXPORT octave_value_list | Ffscanf (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffseek (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffskipl (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fftell (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ffwrite (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fmkstemp (octave::interpreter &interp, const octave_value_list &args, int) |
static std::ios::openmode | fopen_mode_to_ios_mode (const std::string &mode) |
OCTAVE_EXPORT octave_value_list | FP_tmpdir (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fpclose (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fpopen (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fprintf (octave::interpreter &interp, const octave_value_list &args, int nargout) |
OCTAVE_EXPORT octave_value_list | Fputs (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fscanf (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | FSEEK_CUR (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | FSEEK_END (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | FSEEK_SET (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fsprintf (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fsscanf (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fstderr (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fstdin (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fstdout (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ftempdir (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ftempname (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ftextscan (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Ftmpfile (octave::interpreter &interp, const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fumask (const octave_value_list &args, int) |
static std::string | get_scan_string_data (const octave_value &val, const std::string &who) |
static void | normalize_fopen_mode (std::string &mode, bool &use_zlib) |
static octave_value_list | printf_internal (interpreter &interp, const std::string &who, const octave_value_list &args, int nargout) |
static octave_value_list | puts_internal (interpreter &interp, const std::string &who, const octave_value_list &args) |
static octave_value_list | scanf_internal (interpreter &interp, const std::string &who, const octave_value_list &args) |
static octave_value_list | textscan_internal (interpreter &interp, const std::string &who, const octave_value_list &args) |
|
static |
Definition at line 3281 of file file-io.cc.
References octave_value_list::length(), octave_value(), and print_usage().
|
static |
Definition at line 3217 of file file-io.cc.
References octave_value_list::length(), octave_value(), and print_usage().
Referenced by FSEEK_CUR(), FSEEK_END(), FSEEK_SET(), Fstderr(), Fstdin(), and Fstdout().
|
static |
|
static |
Definition at line 2404 of file file-io.cc.
References error(), octave_value::int_value(), stream::read(), oct_data_conv::string_to_data_type(), string_to_float_format(), octave_value::xstring_value(), and octave_value::xvector_value().
Referenced by Ffread().
|
static |
Definition at line 2646 of file file-io.cc.
References error(), octave_value::int_value(), oct_data_conv::string_to_data_type(), string_to_float_format(), stream::write(), and octave_value::xstring_value().
Referenced by Ffwrite().
|
static |
Definition at line 465 of file file-io.cc.
References do_stream_open(), and octave_value::xstring_value().
|
static |
Definition at line 389 of file file-io.cc.
References stdiostream::create(), zstdiostream::create(), stream::error(), error(), find_data_file_in_load_path(), fopen(), fopen_mode_to_ios_mode(), normalize_fopen_mode(), octave_iconv_close_wrapper(), octave_iconv_open_wrapper(), string_to_float_format(), tilde_expand(), and transform().
Referenced by do_stream_open(), and Ffopen().
OCTAVE_EXPORT octave_value_list F__textscan__ | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 1563 of file file-io.cc.
References print_usage(), and textscan_internal().
OCTAVE_EXPORT octave_value_list Ffclear | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 203 of file file-io.cc.
References stream::clearerr(), stream_list::get_file_number(), stream_list::lookup(), ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffclose | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 187 of file file-io.cc.
References ovl(), print_usage(), and stream_list::remove().
OCTAVE_EXPORT octave_value_list Ffeof | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 2749 of file file-io.cc.
References stream::eof(), stream_list::lookup(), ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Fferror | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 2780 of file file-io.cc.
References stream::error(), stream_list::lookup(), ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffflush | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 232 of file file-io.cc.
References stream::flush(), flush_stdout(), stream_list::get_file_number(), stream_list::lookup(), and print_usage().
Referenced by gnuplot_graphics_toolkit::send_quit().
OCTAVE_EXPORT octave_value_list Ffgetl | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 278 of file file-io.cc.
References stream::getl(), stream_list::lookup(), octave_value(), ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffgets | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 321 of file file-io.cc.
References stream::gets(), stream_list::lookup(), octave_value(), ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffopen | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | nargout | ||
) |
Definition at line 590 of file file-io.cc.
References do_stream_open(), stream::error(), stream_list::get_info(), stream_list::insert(), input_system::mfile_encoding(), octave_locale_charset_wrapper(), octave_value(), stream_list::open_file_numbers(), ovl(), print_usage(), and octave_value::string_value().
OCTAVE_EXPORT octave_value_list Ffprintf | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | nargout | ||
) |
Definition at line 842 of file file-io.cc.
References printf_internal().
OCTAVE_EXPORT octave_value_list Ffputs | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 904 of file file-io.cc.
References puts_internal().
Referenced by gnuplot_graphics_toolkit::send_quit().
OCTAVE_EXPORT octave_value_list Ffread | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 2603 of file file-io.cc.
References do_fread(), octave_value::is_string(), lo_ieee_inf_value(), stream_list::lookup(), ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffreport | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 685 of file file-io.cc.
References stream_list::list_open_files(), octave_stdout, ovl(), and warning().
OCTAVE_EXPORT octave_value_list Ffrewind | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | nargout | ||
) |
Definition at line 710 of file file-io.cc.
References stream_list::lookup(), ovl(), print_usage(), and stream::rewind().
OCTAVE_EXPORT octave_value_list Ffscanf | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 1109 of file file-io.cc.
References scanf_internal().
OCTAVE_EXPORT octave_value_list Ffseek | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 745 of file file-io.cc.
References stream_list::lookup(), octave_value(), ovl(), print_usage(), and stream::seek().
OCTAVE_EXPORT octave_value_list Ffskipl | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 363 of file file-io.cc.
References stream_list::lookup(), octave_value(), ovl(), print_usage(), and stream::skipl().
OCTAVE_EXPORT octave_value_list Fftell | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 767 of file file-io.cc.
References stream_list::lookup(), ovl(), print_usage(), and stream::tell().
OCTAVE_EXPORT octave_value_list Ffwrite | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 2703 of file file-io.cc.
References do_fwrite(), octave_value::is_string(), stream_list::lookup(), ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Fmkstemp | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 3096 of file file-io.cc.
References stdiostream::create(), error(), fopen_mode_to_ios_mode(), stream_list::insert(), is_true(), OCTAVE_LOCAL_BUFFER, octave_mkostemp_wrapper(), ovl(), and print_usage().
|
static |
Definition at line 140 of file file-io.cc.
References error(), and trunc().
Referenced by do_stream_open(), Fmkstemp(), and Ftmpfile().
OCTAVE_EXPORT octave_value_list FP_tmpdir | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 3236 of file file-io.cc.
References get_P_tmpdir(), ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Fpclose | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 2883 of file file-io.cc.
References ovl(), print_usage(), and stream_list::remove().
Referenced by gnuplot_graphics_toolkit::send_quit().
OCTAVE_EXPORT octave_value_list Fpopen | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 2843 of file file-io.cc.
References octave_iprocstream::create(), octave_oprocstream::create(), error(), stream_list::insert(), and print_usage().
OCTAVE_EXPORT octave_value_list Fprintf | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | nargout | ||
) |
Definition at line 868 of file file-io.cc.
References octave_value_list::prepend(), and printf_internal().
OCTAVE_EXPORT octave_value_list Fputs | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 950 of file file-io.cc.
References octave_value_list::prepend(), and puts_internal().
OCTAVE_EXPORT octave_value_list Fscanf | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 1206 of file file-io.cc.
References octave_value_list::prepend(), and scanf_internal().
OCTAVE_EXPORT octave_value_list FSEEK_CUR | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 3264 of file file-io.cc.
References const_value().
OCTAVE_EXPORT octave_value_list FSEEK_END | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 3275 of file file-io.cc.
References const_value().
OCTAVE_EXPORT octave_value_list FSEEK_SET | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 3253 of file file-io.cc.
References const_value().
OCTAVE_EXPORT octave_value_list Fsprintf | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 973 of file file-io.cc.
References stream::error(), error(), octave_value::is_sq_string(), octave_value::is_string(), stream::is_valid(), octave_value(), print_usage(), stream::printf(), octave_value_list::resize(), and ostrstream::str().
Referenced by Ferror(), and handle_message().
OCTAVE_EXPORT octave_value_list Fsscanf | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1142 of file file-io.cc.
References Array< double >, istrstream::create(), stream::eof(), stream::error(), error(), get_scan_string_data(), stream::is_valid(), lo_ieee_inf_value(), stream::oscanf(), ovl(), print_usage(), stream::scanf(), and stream::tell().
OCTAVE_EXPORT octave_value_list Fstderr | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 3327 of file file-io.cc.
References const_value(), and stream_list::stderr_file().
OCTAVE_EXPORT octave_value_list Fstdin | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 3298 of file file-io.cc.
References const_value(), and stream_list::stdin_file().
OCTAVE_EXPORT octave_value_list Fstdout | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 3312 of file file-io.cc.
References const_value(), and stream_list::stdout_file().
OCTAVE_EXPORT octave_value_list Ftempdir | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2904 of file file-io.cc.
References dir_sep_str(), get_temp_directory(), is_dir_sep(), ovl(), and print_usage().
OCTAVE_EXPORT octave_value_list Ftempname | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2954 of file file-io.cc.
References ovl(), print_usage(), and tempnam().
OCTAVE_EXPORT octave_value_list Ftextscan | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 1551 of file file-io.cc.
References textscan_internal().
OCTAVE_EXPORT octave_value_list Ftmpfile | ( | octave::interpreter & | interp, |
const octave_value_list & | args, | ||
int | |||
) |
Definition at line 3040 of file file-io.cc.
References stdiostream::create(), error(), fopen_mode_to_ios_mode(), fopen_tmp(), get_temp_directory(), stream_list::insert(), ovl(), print_usage(), and tempnam().
OCTAVE_EXPORT octave_value_list Fumask | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 3196 of file file-io.cc.
References convert(), error(), ovl(), print_usage(), and umask().
|
static |
Definition at line 1117 of file file-io.cc.
References error(), octave_value::is_string(), octave_value::numel(), octave_value::reshape(), and octave_value::string_value().
Referenced by Fsscanf(), and textscan_internal().
|
static |
Definition at line 88 of file file-io.cc.
References err_disabled_feature().
Referenced by do_stream_open().
|
static |
Definition at line 780 of file file-io.cc.
References error(), interpreter::get_stream_list(), octave_value_list::length(), stream_list::lookup(), ovl(), print_usage(), stream::printf(), and octave_value_list::resize().
Referenced by Ffprintf(), and Fprintf().
|
static |
Definition at line 879 of file file-io.cc.
References interpreter::get_stream_list(), octave_value_list::length(), stream_list::lookup(), ovl(), print_usage(), and stream::puts().
|
static |
Definition at line 1023 of file file-io.cc.
References Array< double >, stream::error(), error(), interpreter::get_stream_list(), octave_value_list::length(), lo_ieee_inf_value(), stream_list::lookup(), stream::oscanf(), ovl(), print_usage(), and stream::scanf().
|
static |
Definition at line 1216 of file file-io.cc.
References istrstream::create(), do_string_escapes(), stream::error(), error(), get_scan_string_data(), interpreter::get_stream_list(), stream::is_valid(), octave_value_list::length(), stream_list::lookup(), ovl(), print_usage(), octave_value_list::splice(), and stream::textscan().
Referenced by F__textscan__(), and Ftextscan().