GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
sysdep.cc File Reference
#include <cmath>
#include <cstddef>
#include <iostream>
#include <string>
#include "cmd-edit.h"
#include "file-ops.h"
#include "lo-mappers.h"
#include "lo-sysinfo.h"
#include "mach-info.h"
#include "oct-env.h"
#include "unistd-wrappers.h"
#include "unsetenv-wrapper.h"
#include "builtin-defun-decls.h"
#include "Cell.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "input.h"
#include "octave.h"
#include "ov.h"
#include "ovl.h"
#include "pager.h"
#include "parse.h"
#include "sighandlers.h"
#include "sysdep.h"
#include "interpreter.h"
#include "utils.h"
#include "file-stat.h"
Include dependency graph for sysdep.cc:

Go to the source code of this file.

Macros

#define STDIN_FILENO   1
 

Functions

 disp (ar{str})
 
endfor nd group nd example On non Windows platforms this function fails with an error nd deftypefn * error ("winqueryreg: function is only supported on Windows platforms")
 
OCTAVE_EXPORT octave_value_list F__open_with_system_app__ (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fclc (const octave_value_list &, int)
 
OCTAVE_EXPORT octave_value_list Fgetenv (const octave_value_list &args, int) xample getenv("PATH") nd example oindent returns a string containing the value of your path. eealso
 
OCTAVE_EXPORT octave_value_list Fkbhit (const octave_value_list &args, int) don 't wait for a keypress. For example
 
OCTAVE_EXPORT octave_value_list Fsetenv (const octave_value_list &args, int) getenv} nd deftypefn */)
 
OCTAVE_EXPORT octave_value_list Funsetenv (const octave_value_list &args, int) or did not exist
 
std::string get_P_tmpdir (void)
 
int octave_kbhit (bool wait)
 
int octave_pclose (FILE *f)
 
FILE * octave_popen (const char *command, const char *mode)
 
return ovl (octave::sys::env::getenv(name))
 
 pause (0.05)
 
 pause (5)
 
void raw_mode (bool on, bool wait)
 
bool same_file_internal (const std::string &file1, const std::string &file2)
 
void set_application_id (void)
 
void sysdep_cleanup (void)
 
void sysdep_init (void)
 

Variables

nd group nd example For each ar {valuenames}
 
 clc
 
OCTAVE_EXPORT octave_value_list and if an error occurred eealso
 
nd group nd example For each display the Environment
 
end example noindent is identical to the above example
 
end example noindent is identical to the above but doesn t wait for a keypress
 
nd deftypefn *std::string name = args(0).string_value ()
 
toc rint {} Elapsed time is 0.05039 seconds. nd group nd example The following example prints a message and then waits 5 seconds before clearing the screen. xample roup disp ("wait please...")
 
nd group nd example For each display the value
 
end example noindent will set var {x} to the next character typed at the keyboard as soon as it is typed. @example x = kbhit (1)
 
OCTAVE_EXPORT octave_value_list example x = kbhit ()
 

Macro Definition Documentation

◆ STDIN_FILENO

#define STDIN_FILENO   1

Function Documentation

◆ disp()

◆ error()

endfor nd group nd example On non Windows platforms this function fails with an error nd deftypefn* error ( "winqueryreg: function is only supported on Windows platforms"  )

Referenced by raw_mode().

◆ F__open_with_system_app__()

OCTAVE_EXPORT octave_value_list F__open_with_system_app__ ( const octave_value_list args,
int   
)

Definition at line 202 of file sysdep.cc.

References file, Fsystem(), ovl(), print_usage(), retval, string, and tmp.

◆ Fclc()

OCTAVE_EXPORT octave_value_list Fclc ( const octave_value_list ,
int   
)

Definition at line 617 of file sysdep.cc.

References octave::command_editor::clear_screen(), and ovl().

◆ Fgetenv()

OCTAVE_EXPORT octave_value_list Fgetenv ( const octave_value_list args,
int   
)

Definition at line 642 of file sysdep.cc.

References print_usage().

◆ Fkbhit()

OCTAVE_EXPORT octave_value_list Fkbhit ( const octave_value_list args,
int   
)

◆ Fsetenv()

OCTAVE_EXPORT octave_value_list Fsetenv ( const octave_value_list args,
int   
)

Definition at line 666 of file sysdep.cc.

References ovl(), print_usage(), octave::sys::env::putenv(), string, val, and var.

◆ Funsetenv()

OCTAVE_EXPORT octave_value_list Funsetenv ( const octave_value_list args,
int   
)

◆ get_P_tmpdir()

std::string get_P_tmpdir ( void  )

Definition at line 574 of file sysdep.cc.

References octave::sys::env::getenv(), retval, and string.

◆ octave_kbhit()

int octave_kbhit ( bool  wait)

◆ octave_pclose()

int octave_pclose ( FILE *  f)

Definition at line 524 of file sysdep.cc.

References f.

Referenced by octave_procbuf::close().

◆ octave_popen()

FILE* octave_popen ( const char *  command,
const char *  mode 
)

Definition at line 506 of file sysdep.cc.

References command, and mode.

Referenced by octave::gl2ps_print(), and octave_procbuf::open().

◆ ovl()

◆ pause() [1/2]

pause ( 0.  05)

◆ pause() [2/2]

pause ( )

◆ raw_mode()

void raw_mode ( bool  on,
bool  wait 
)

Definition at line 358 of file sysdep.cc.

References error(), octave_isatty_wrapper(), on, s, STDIN_FILENO, and warn_disabled_feature().

Referenced by octave_kbhit().

◆ same_file_internal()

bool same_file_internal ( const std::string file1,
const std::string file2 
)

Definition at line 255 of file sysdep.cc.

References octave::sys::base_file_stat::dev(), octave::sys::base_file_stat::ino(), and retval.

Referenced by same_file().

◆ set_application_id()

void set_application_id ( void  )

Definition at line 175 of file sysdep.cc.

Referenced by octave::gui_application::execute().

◆ sysdep_cleanup()

void sysdep_cleanup ( void  )

Definition at line 337 of file sysdep.cc.

Referenced by octave::my_friendly_exit().

◆ sysdep_init()

void sysdep_init ( void  )

Definition at line 318 of file sysdep.cc.

Referenced by octave::gui_application::gui_application().

Variable Documentation

◆ ar

ar {valuenames}

Definition at line 866 of file sysdep.cc.

◆ clc

clc

Definition at line 1074 of file sysdep.cc.

◆ eealso

end example noindent is identical to the above but doesn t wait for a returning the empty string if no key is available eealso

Definition at line 702 of file sysdep.cc.

◆ Environment

nd group nd example For each display the Environment

Definition at line 866 of file sysdep.cc.

◆ example

end example noindent is identical to the above example

Definition at line 1027 of file sysdep.cc.

◆ keypress

end example noindent is identical to the above but doesn t wait for a keypress

Definition at line 1027 of file sysdep.cc.

◆ name

nd deftypefn* std::string name = args(0).string_value ()

Definition at line 647 of file sysdep.cc.

Referenced by absolute_search(), octave::dynamic_library::add(), octave::jit_typeinfo::add_builtin(), octave::dynamic_library::dynlib_rep::add_fcn_name(), add_hdf5_data(), octave::file_editor::add_menu(), octave::jit_typeinfo::add_print(), octave::symbol_table::alias_built_in_function(), alias_builtin(), octave::symbol_table::assign(), octave::call_stack::backtrace(), binmap(), bsxfun_builtin_lookup(), octave::symbol_table::builtin_find(), octave::sys::canonicalize_file_name(), class_fromName(), octave::stream_list::clear(), octave::symbol_table::clear_dld_function(), octave::symbol_table::clear_function(), octave::symbol_table::clear_global(), octave::symbol_table::clear_symbol(), octave::symbol_table::clear_user_function(), QConsolePrivate::closeStandardIO(), octave_scalar_map::contains(), octave_map::contains(), property::create(), graphics_event::create_callback_event(), octave::jit_typeinfo::create_external(), octave::jit_module::create_global_variable(), octave::jit_typeinfo::create_identity(), octave::jit_typeinfo::create_internal(), octave::jit_module::create_llvm_function(), graphics_event::create_set_event(), decode_subscripts(), KeyboardTranslatorManager::deleteTranslator(), octave::sys::dir_entry::dir_entry(), dir_search(), octave::jit_convert::do_assign(), do_edit_history(), octave::ft_manager::do_get_font(), octave::sys::env::do_getenv(), octave::tree_jit::do_getPointerToNamedFunction(), octave::tree_jit::do_getSymbolAddress(), do_load(), octave_errno::do_lookup(), octave::sys::env::do_polite_directory_format(), gh_manager::do_post_callback(), gh_manager::do_post_set(), octave::jit_typeinfo::do_register_new_type(), do_run_history(), do_save(), do_trilu(), octave::opengl_selector::draw(), dump_octave_core(), octave::main_window::edit_mfile(), octave::variable_editor::edit_variable(), octave_link::edit_variable(), err_square_matrix_required(), err_unrecognized_data_fmt(), err_user_returned_invalid(), err_user_supplied_eval(), err_wrong_type_arg(), error_1(), named_hook_function::eval(), octave::jit_info::execute(), F__octave_link_list_dialog__(), octave::symbol_table::fcn_table_find(), octave::base_stream::file_number(), QtHandles::Figure::fileName(), octave::symbol_table::find(), octave::fcn_info::fcn_info_rep::find_autoload(), octave::symbol_table::find_autoload(), octave::symbol_table::find_built_in_function(), octave::jit_typeinfo::find_builtin(), octave::symbol_table::find_cmdline_function(), find_file_to_load(), find_first_of(), octave::symbol_table::find_function(), octave::symbol_table::find_global_symbol(), octave::symbol_table::find_method(), find_octave_class(), octave::symbol_table::find_submethod(), octave::symbol_table::find_symbol(), octave::gtk_manager::find_toolkit(), octave::fcn_info::fcn_info_rep::find_user_function(), octave::symbol_table::find_user_function(), KeyboardTranslatorManager::findTranslator(), KeyboardTranslatorManager::findTranslatorPath(), KeyboardTranslatorManager::findTranslators(), Fopenvar(), octave::curl_transfer::form_query_string(), G__eigs__(), Gaudiodevinfo(), generate_completion(), get_class_context(), figure::get_default(), get_dim_vector(), octave::ft_text_renderer::ft_font::get_face(), base_graphics_object::get_factory_default(), octave::symbol_table::get_fcn_info(), octave::ft_manager::get_font(), text_element_fontname::get_fontname(), octave::text_renderer::font::get_name(), octave::load_path::get_package(), octave_classdef::get_property(), octave::get_user_code(), get_variable(), octave::sys::env::getenv(), octave::jit_module::getFunctionAddress(), octave::tree_jit::getPointerToNamedFunction(), octave::jit_memory_manager::getPointerToNamedFunction(), octave::tree_jit::getSymbolAddress(), octave::jit_memory_manager::getSymbolAddress(), octave::symbol_table::global_assign(), octave::symbol_table::global_varval(), gripe_empty_arg(), gripe_invalid_value_specified(), gripe_square_matrix_required(), gripe_user_returned_invalid(), gripe_user_supplied_eval(), gripe_wrong_type_arg(), octave::main_window::handle_create_listview(), octave::main_window::handle_edit_mfile_request(), hdf5_fstreambase::hdf5_fstreambase(), hdf5_h5g_iterate(), hdf5_read_next_data(), hdf5_read_next_data_internal(), hook_function::hook_function(), named_hook_function::id(), base_properties::insert_property(), octave::fcn_info::fcn_info_rep::install_built_in_dispatch(), octave::symbol_table::install_built_in_dispatch(), octave::symbol_table::install_built_in_function(), install_builtin_dispatch(), install_builtin_function(), octave::symbol_table::install_cmdline_function(), install_dld_function(), install_loaded_variable(), octave::symbol_table::install_local_function(), install_mex_function(), octave::symbol_table::install_user_function(), octave::symbol_table::is_built_in_function_name(), octave::load_path::dir_info::is_package(), octave::load_path::is_package(), named_hook_function::is_valid(), is_valid_bsxfun(), is_valid_inplace_bsxfun(), octave_scalar_map::isfield(), octave_map::isfield(), octave::jit_convert::jit_convert(), kpse_all_path_search(), kpse_path_search(), kpse_readable_file(), kpse_tilde_expand(), kpse_truncate_filename(), octave::variable_editor_stack::levelUp(), octave_link::list_dialog(), octave_fcn_handle::load_ascii(), octave_fcn_handle::load_binary(), octave::fcn_info::fcn_info_rep::load_class_constructor(), octave::fcn_info::fcn_info_rep::load_class_method(), octave_fcn_inline::load_hdf5(), octave_sparse_bool_matrix::load_hdf5(), octave_fcn_handle::load_hdf5(), octave_struct::load_hdf5(), octave_sparse_complex_matrix::load_hdf5(), octave_sparse_matrix::load_hdf5(), octave_float_complex_matrix::load_hdf5(), octave_cell::load_hdf5(), octave_char_matrix_str::load_hdf5(), octave_complex_matrix::load_hdf5(), octave_float_complex::load_hdf5(), octave_complex::load_hdf5(), octave_float_matrix::load_hdf5(), octave_bool_matrix::load_hdf5(), octave_matrix::load_hdf5(), octave_bool::load_hdf5(), octave_float_scalar::load_hdf5(), octave_scalar::load_hdf5(), octave_scalar_struct::load_hdf5(), octave_range::load_hdf5(), OCTAVE_VALUE_INT_MATRIX_T::load_hdf5(), OCTAVE_VALUE_INT_SCALAR_T::load_hdf5(), octave_value::load_hdf5(), load_hdf5_empty(), octave_base_int_matrix< intNDArray< OCTAVE_INT_T > >::load_hdf5_internal(), octave_base_int_scalar< OCTAVE_INT_T >::load_hdf5_internal(), KeyboardTranslatorManager::loadTranslator(), octave_errno::lookup(), property_list::lookup(), lookup_class(), lookup_object_name(), octave::main_window::m_add_menu(), cdef_manager::make_attribute(), cdef_manager::make_class(), cdef_manager::make_meta_class(), cdef_manager::make_method(), cdef_manager::make_property(), make_stack_frame_list(), matches_patterns(), maybe_optimized_builtin(), message(), message_with_id(), mexGetVariable(), mexGetVariablePtr(), mexPutVariable(), mk_tmp_hist_file(), octave::sys::mkdir(), octave::sys::mkfifo(), mxIsClass(), mxSetClassName(), octave::dynamic_loader::name_mangler(), octave::dynamic_loader::name_uscore_mangler(), octave::main_window::notice_settings(), octave_areadlink_wrapper(), octave_canonicalize_file_name_wrapper(), octave_errno::octave_errno(), octave_fnmatch_wrapper(), octave_getenv(), octave::octave_jit_print_any(), octave::octave_jit_print_scalar(), octave_mkdir_wrapper(), octave_mkfifo_wrapper(), octave_putenv(), octave_unsetenv_wrapper(), procstreambase::open(), hdf5_fstreambase::open(), hdf5_ifstream::open(), hdf5_ofstream::open(), iprocstream::open(), gzfilebuf::open(), oprocstream::open(), procstream::open(), gzifstream::open(), gzofstream::open(), octave::sys::dir_entry::operator=(), octave::text_renderer::font::operator=(), path_find_first_of(), path_search(), octave::sys::env::polite_directory_format(), octave::jit_extract_argument::print(), octave_struct::print_name_tag(), octave_base_scalar< bool >::print_name_tag(), octave_cell::print_name_tag(), octave_scalar_struct::print_name_tag(), octave_range::print_name_tag(), octave_base_value::print_name_tag(), octave_value::print_name_tag(), print_usage(), octave_base_value::print_with_name(), octave_value::print_with_name(), octave::files_dock_widget::process_new_dir(), octave::files_dock_widget::process_new_file(), octave_function::profiler_name(), octave::sys::env::putenv(), read_binary_data(), read_mat5_binary_element(), read_mat_binary_data(), read_text_data(), octave::sys::recursive_rmdir(), octave::jit_typeinfo::register_generic(), octave::jit_typeinfo::register_intrinsic(), octave::jit_typeinfo::register_new_type(), octave::gtk_manager::register_toolkit(), octave::documentation_dock_widget::registerDoc(), octave::dynamic_library::remove(), octave::sys::rmdir(), octave::variable_editor_stack::save(), save_binary_data(), octave_fcn_inline::save_hdf5(), octave_sparse_bool_matrix::save_hdf5(), octave_fcn_handle::save_hdf5(), octave_sparse_complex_matrix::save_hdf5(), octave_struct::save_hdf5(), octave_sparse_matrix::save_hdf5(), octave_float_complex_matrix::save_hdf5(), octave_cell::save_hdf5(), octave_complex_matrix::save_hdf5(), octave_char_matrix_str::save_hdf5(), octave_float_complex::save_hdf5(), octave_complex::save_hdf5(), octave_float_matrix::save_hdf5(), octave_bool_matrix::save_hdf5(), octave_matrix::save_hdf5(), octave_bool::save_hdf5(), octave_float_scalar::save_hdf5(), octave_scalar::save_hdf5(), octave_scalar_struct::save_hdf5(), octave_range::save_hdf5(), OCTAVE_VALUE_INT_MATRIX_T::save_hdf5(), OCTAVE_VALUE_INT_SCALAR_T::save_hdf5(), octave_value::save_hdf5(), save_hdf5_data(), save_hdf5_empty(), octave_base_int_matrix< intNDArray< OCTAVE_INT_T > >::save_hdf5_internal(), octave_base_int_scalar< OCTAVE_INT_T >::save_hdf5_internal(), save_mat5_binary_element(), save_mat5_element_length(), save_mat_binary_data(), octave::octave_dock_widget::save_settings(), save_text_data(), save_text_data_for_plotting(), search(), octave::opengl_selector::select(), property_list::set(), octave::text_renderer::set_font(), octave::ft_text_renderer::set_font(), annotation_dialog::set_gui_props(), property::set_name(), octave_classdef::set_property(), octave::main_window::set_window_layout(), QtHandles::Figure::setFileName(), Emulation::setKeyBindings(), QConsolePrivate::setupStandardIO(), octave::documentation_dock_widget::showDoc(), octave::QUIWidgetCreator::signal_listview(), octave::split_name_with_package(), octave::sys::file_ops::tilde_expand(), octave::symbol_table::top_level_assign(), octave::symbol_table::top_level_varval(), try_cellfun_internal_ops(), octave::sys::unlink(), octave::gtk_manager::unload_all_toolkits(), octave::gtk_manager::unload_toolkit(), octave::gtk_manager::unregister_toolkit(), octave::documentation_dock_widget::unregisterDoc(), octave::variable_editor::update_colors(), octave::variable_editor::variable_focused(), octave::symbol_table::varval(), verror(), octave::tree_evaluator::visit_decl_elt(), octave::jit_convert::visit_statement(), vmessage(), vmessage_with_id(), vwarning(), warn_dim_too_large(), warn_empty_arg(), warn_invalid_value_specified(), warn_wrong_type_arg(), octave::fcn_info::fcn_info_rep::x_builtin_find(), and octave::fcn_info::fcn_info_rep::xfind().

◆ rint

toc rint {} Elapsed time is 0.05039 seconds. nd group nd example The following example prints a message and then waits 5 seconds before clearing the screen. xample roup disp ("wait please...")

Definition at line 1074 of file sysdep.cc.

◆ value

nd group nd example For each display the value

Definition at line 866 of file sysdep.cc.

Referenced by octave::jit_phi::add_incoming(), OCTAVE_VALUE_INT_MATRIX_T::as_mxArray(), octave::symbol_record::symbol_record_rep::assign(), octave::symbol_table::assign(), octave::symbol_scope_rep::assign(), octave::symbol_record::assign(), octave::symbol_scope::assign(), octave_int< T >::bool_value(), QtHandles::ButtonControl::ButtonControl(), octave_int< T >::char_value(), convert_index(), octave_int_base< T >::convert_real(), octave::jit_typeinfo::do_end(), octave::sys::env::do_getenv(), gh_manager::do_post_set(), octave_int< T >::double_value(), octave::jit_typeinfo::end(), expand(), extract_keyword(), octave_int< T >::float_value(), octave::symbol_scope_rep::force_assign(), octave::symbol_scope::force_assign(), octave::jit_paren_subsasgn::generate_matrix(), get_region_range(), octave::symbol_table::global_assign(), QWinTerminalImpl::horizontalScrollValueChanged(), initialize_jvm(), octave::isa(), octave::jit_typeinfo::jit_typeinfo(), QtHandles::ListBoxControl::ListBoxControl(), octave_sort< T >::lookup(), Array< octave_value >::lookup(), octave_lazy_index::make_value(), octave::jit_info::match(), octave_errno::octave_errno(), octave_getenv(), octave::octave_jit_cast_any_scalar(), octave::octave_jit_paren_scalar_subsasgn(), octave::octave_jit_paren_subsasgn_impl(), octave::octave_jit_paren_subsasgn_matrix_range(), octave::octave_jit_print_scalar(), octave_print_internal_template(), octave_putenv(), octave::octave_scan_1(), oneOrZero(), base_det< T >::operator T(), octave_int< T >::operator T(), octave::operator<<(), octave::sys::env::putenv(), octave::jit_infer::release_temp(), octave::jit_value::replace_with(), octave::jit_block::replace_with(), octave::textscan::scan_complex(), QtHandles::ListBoxControl::sendSelectionChange(), octave::profiler::set_active(), octave::workspace_model::setData(), QConsolePrivate::setHorizontalScrollValue(), QUnixTerminalImpl::setScrollBufferSize(), QWinTerminalImpl::setScrollBufferSize(), QConsolePrivate::setScrollBufferSize(), QConsolePrivate::setVerticalScrollValue(), QtHandles::SliderControl::SliderControl(), octave::symbol_table::top_level_assign(), octave::jit_factory::track_value(), octave_int_base< T >::truncate_int(), QtHandles::ButtonControl::update(), QtHandles::PopupMenuControl::update(), QtHandles::SliderControl::update(), axes::properties::update_aspectratios(), axes::update_axis_limits(), QtHandles::updateSelection(), QtHandles::SliderControl::valueChanged(), QWinTerminalImpl::verticalScrollValueChanged(), and octave::jit_convert::visit_switch_command().

◆ var

end example noindent will set var {x} to the next character typed at the keyboard as soon as it is typed. @example x = kbhit (1)

Definition at line 1027 of file sysdep.cc.

Referenced by Fsetenv().

◆ x

OCTAVE_EXPORT octave_value_list example x = kbhit ()

Definition at line 1027 of file sysdep.cc.