GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
input.cc File Reference
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include "cmd-edit.h"
#include "file-ops.h"
#include "quit.h"
#include "str-vec.h"
#include "call-stack.h"
#include "debug.h"
#include "defun.h"
#include "dirfns.h"
#include "error.h"
#include "errwarn.h"
#include "help.h"
#include "hook-fcn.h"
#include "input.h"
#include "interpreter.h"
#include "lex.h"
#include "load-path.h"
#include "octave.h"
#include "octave-link.h"
#include "oct-map.h"
#include "oct-hist.h"
#include "ovl.h"
#include "ov-fcn-handle.h"
#include "pager.h"
#include "parse.h"
#include "pt.h"
#include "pt-const.h"
#include "pt-eval.h"
#include "pt-stmt.h"
#include "sighandlers.h"
#include "symtab.h"
#include "sysdep.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for input.cc:

Go to the source code of this file.

Classes

struct  ode
 

Functions

static void execute_in_debugger_handler (const std::pair< std::string, int > &arg)
 
OCTAVE_EXPORT
octave_value_list any number
nd example oindent prints the
prompt xample Pick a any
number!nd example oindent and
waits for the user to enter a
value The string entered by
the user is evaluated as an so
it may be a literal a variable
or any other valid Octave code
The number of return their and
their class depend on the
expression entered If you are
only interested in getting a
literal string value you can
call ode 
fflush (stdout)}before calling ode
 
std::string find_indexed_expression (const std::string &text)
 
OCTAVE_EXPORT octave_value_list Finput (const octave_value_list &args, int nargout) xample input("Pick a number
 
static std::string generate_completion (const std::string &text, int state)
 
static string_vector generate_possible_completions (const std::string &text, std::string &prefix, std::string &hint, bool &deemed_struct)
 
static void get_debug_input (const std::string &prompt)
 
FILE * get_input_from_stdin (void)
 
static octave_value_list get_user_input (const octave_value_list &args, int nargout)
 
static std::string gnu_readline (const std::string &s, bool &eof)
 
void initialize_command_input (void)
 
static std::string interactive_input (const std::string &s, bool &eof)
 
static bool is_completing_dirfns (void)
 
static std::string quoting_filename (const std::string &text, int, char quote)
 
void remove_input_event_hook_functions (void)
 
void set_default_prompts (void)
 

Variables

OCTAVE_EXPORT
octave_value_list any number
nd example oindent prints the
prompt xample Pick a any
number!nd example oindent and
waits for the user to enter a
value The string entered by
the user is evaluated as an so
it may be a literal a variable
or any other valid Octave code
The number of return 
arguments
 
OCTAVE_EXPORT
octave_value_list any number
nd example oindent prints the
prompt xample Pick a any
number!nd example oindent and
waits for the user to enter a
value The string entered by
the user is evaluated as an so
it may be a literal 
constant
 
OCTAVE_EXPORT
octave_value_list any number
nd example oindent prints the
prompt xample Pick a any
number!nd example oindent and
waits for the user to enter a
value The string entered by
the user is evaluated as an so
it may be a literal a variable
or any other valid Octave code
The number of return their and
their class depend on the
expression entered If you are
only interested in getting a
literal string value you can
call ode 
directly
 
This will ensure that all
pending output is written to
the screen before your prompt 
eealso
 
OCTAVE_EXPORT
octave_value_list any number
nd example oindent prints the
prompt xample Pick a any
number!nd example oindent and
waits for the user to enter a
value The string entered by
the user is evaluated as an 
expression
 
static hook_function_list input_event_hook_functions
 
static std::string last_debugging_command = "\n"
 
OCTAVE_EXPORT
octave_value_list any number
nd example oindent prints the
prompt xample Pick a any
number!nd example oindent and
waits for the user to enter a
value The string entered by
the user is evaluated as an so
it may be a literal a variable 
name
 
OCTAVE_EXPORT
octave_value_list any number
nd example oindent prints the
prompt xample Pick a 
number
 
bool octave_completion_matches_called = false
 
OCTAVE_EXPORT
octave_value_list any number
nd example oindent prints the
prompt xample Pick a any
number!nd example oindent and
waits for the user to enter a
value The string entered by
the user is evaluated as an so
it may be a literal a variable
or any other valid Octave code
The number of return their and
their class depend on the
expression entered If you are
only interested in getting a
literal string value you can
call ode 
pager
 
OCTAVE_EXPORT
octave_value_list any number
nd example oindent prints the
prompt xample Pick a any
number!nd example oindent and
waits for the user to enter a
value The string entered by
the user is evaluated as an so
it may be a literal a variable
or any other valid Octave code
The number of return their 
size
 
static char Vcompletion_append_char = ' '
 
bool Vdebugging = false
 
bool Vdrawnow_requested = false
 
int Vecho_executing_commands = ECHO_OFF
 
char Vfilemarker = '>'
 
static bool Vgud_mode = false
 
octave::sys::time Vlast_prompt_time = 0.0
 
static std::string VPS1
 
static std::string VPS2
 
std::string VPS4 = "+ "
 
bool Vtrack_line_num = true
 

Function Documentation

static void execute_in_debugger_handler ( const std::pair< std::string, int > &  arg)
static

Definition at line 579 of file input.cc.

References octave_link::execute_in_debugger_event().

Referenced by get_debug_input().

OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number ! nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable or any other valid Octave code The number of return their and their class depend on the expression entered If you are only interested in getting a literal string value you can call ode fflush ( stdout  )

Definition at line 871 of file input.cc.

std::string find_indexed_expression ( const std::string text)

Definition at line 509 of file input.cc.

References octave::command_editor::get_line_buffer(), and string.

Referenced by generate_struct_completions().

OCTAVE_EXPORT octave_value_list Finput ( const octave_value_list args,
int  nargout 
)

Referenced by install_input_fcns().

static std::string generate_completion ( const std::string text,
int  state 
)
static
static string_vector generate_possible_completions ( const std::string text,
std::string prefix,
std::string hint,
bool deemed_struct 
)
static
static void get_debug_input ( const std::string prompt)
static
FILE* get_input_from_stdin ( void  )
static octave_value_list get_user_input ( const octave_value_list args,
int  nargout 
)
static
static std::string gnu_readline ( const std::string s,
bool eof 
)
static
void initialize_command_input ( void  )
static std::string interactive_input ( const std::string s,
bool eof 
)
inlinestatic
static bool is_completing_dirfns ( void  )
static

Definition at line 373 of file input.cc.

References octave::command_editor::get_line_buffer(), retval, and string.

Referenced by generate_completion().

static std::string quoting_filename ( const std::string text,
int  ,
char  quote 
)
static

Definition at line 496 of file input.cc.

References string, and text.

Referenced by initialize_command_input().

void remove_input_event_hook_functions ( void  )

Definition at line 130 of file input.cc.

References hook_function_list::clear().

void set_default_prompts ( void  )

Definition at line 136 of file input.cc.

References octave_link::set_default_prompts(), VPS1, VPS2, and VPS4.

Variable Documentation

OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number ! nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable or any other valid Octave code The number of return arguments

Definition at line 871 of file input.cc.

OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number ! nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal constant

Definition at line 871 of file input.cc.

OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number ! nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable or any other valid Octave code The number of return their and their class depend on the expression entered If you are only interested in getting a literal string value you can call ode directly
This will ensure that all pending output is written to the screen before your prompt eealso

Definition at line 871 of file input.cc.

OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number ! nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an expression

Definition at line 871 of file input.cc.

hook_function_list input_event_hook_functions
static

Definition at line 126 of file input.cc.

std::string last_debugging_command = "\n"
static

Definition at line 118 of file input.cc.

Referenced by octave_base_reader::octave_gets().

OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number ! nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable name

Definition at line 871 of file input.cc.

Referenced by jit_typeinfo::add_builtin(), symbol_table::add_dispatch(), jit_typeinfo::add_print(), binmap(), class_fromName(), symbol_table::symbol_record::symbol_record_rep::clear(), jit_typeinfo::create_identity(), octave::sys::dir_entry::dir_entry(), dir_search(), jit_convert::do_assign(), octave_call_stack::do_backtrace(), symbol_table::do_cache_name(), octave_stream_list::do_clear(), do_edit_history(), symbol_table::do_insert(), do_load(), octave::sys::env::do_polite_directory_format(), gtk_manager::do_register_toolkit(), do_run_history(), do_save(), gtk_manager::do_unload_all_toolkits(), octave::opengl_selector::draw(), symbol_table::symbol_record::symbol_record_rep::dump(), dump_octave_core(), symbol_table::symbol_record::symbol_record_rep::dup(), symbol_table::symbol_record::symbol_record_rep::erase_persistent(), named_hook_function::eval(), jit_info::execute(), F__get_cmdline_fcn_txt__(), F__octave_link_list_dialog__(), symbol_table::fcn_info::fcn_info_rep::fcn_info_rep(), octave_base_stream::file_number(), QtHandles::Figure::fileName(), symbol_table::symbol_record::find(), symbol_table::fcn_info::fcn_info_rep::find_autoload(), find_first_of(), symbol_table::find_submethod(), symbol_table::fcn_info::fcn_info_rep::find_user_function(), KeyboardTranslatorManager::findTranslator(), KeyboardTranslatorManager::findTranslators(), octave::curl_transfer::form_query_string(), symbol_table::fcn_info::fcn_info_rep::full_name(), G__eigs__(), Gaudiodevinfo(), generate_completion(), graphics_object::get(), root_figure::get(), octave::ft_text_renderer::ft_font::get_face(), text_element_fontname::get_fontname(), octave::text_renderer::font::get_name(), figure::properties::get_property(), get_user_code(), file_editor::handle_edit_mfile_request(), tree_identifier::has_magic_end(), hdf5_read_next_data_internal(), hook_function::hook_function(), named_hook_function::id(), symbol_table::symbol_record::symbol_record_rep::init_persistent(), base_properties::insert_property(), symbol_table::install_built_in_function(), symbol_table::install_cmdline_function(), symbol_table::install_subfunction(), symbol_table::install_user_function(), named_hook_function::is_valid(), jit_convert::jit_convert(), kpse_readable_file(), kpse_tilde_expand(), kpse_truncate_filename(), octave_fcn_handle::load_ascii(), octave_fcn_handle::load_binary(), symbol_table::fcn_info::fcn_info_rep::load_class_constructor(), symbol_table::fcn_info::fcn_info_rep::load_class_method(), symbol_table::fcn_info::fcn_info_rep::load_private_function(), main_window::m_add_menu(), file_editor::m_add_menu(), make_filter_list(), make_stack_frame_list(), symbol_table::symbol_record::symbol_record_rep::mark_global(), symbol_table::symbol_record::symbol_record_rep::mark_persistent(), mk_tmp_hist_file(), octave_dynamic_loader::name_mangler(), octave_dynamic_loader::name_uscore_mangler(), main_window::notice_settings(), octave_errno::octave_errno(), octave_push_parse(), octave::sys::dir_entry::operator=(), path_find_first_of(), jit_extract_argument::print(), symbol_table::fcn_info::fcn_info_rep::print_dispatch(), octave_classdef::print_with_name(), files_dock_widget::process_new_dir(), files_dock_widget::process_new_file(), octave_function::profiler_name(), raw_help_from_docstrings_file(), read_binary_data(), read_mat5_binary_element(), read_mat_binary_data(), read_text_data(), jit_typeinfo::register_generic(), jit_typeinfo::register_intrinsic(), octave::dynamic_library::remove(), save_binary_data(), octave_dock_widget::save_settings(), search(), octave::opengl_selector::select(), annotation_dialog::set_gui_props(), main_window::set_window_layout(), split_name_with_package(), tree_identifier::static_workspace_error(), symbol_table::fcn_info::fcn_info_rep::subfunction_defined_in_scope(), try_cellfun_internal_ops(), tree_parameter_list::validate(), symbol_table::symbol_record::symbol_record_rep::varref(), symbol_table::symbol_record::symbol_record_rep::varval(), jit_convert::visit_statement(), and symbol_table::fcn_info::fcn_info_rep::xfind().

OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a number
bool octave_completion_matches_called = false

Definition at line 102 of file input.cc.

OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number ! nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable or any other valid Octave code The number of return their and their class depend on the expression entered If you are only interested in getting a literal string value you can call ode pager
OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number ! nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable or any other valid Octave code The number of return their size
char Vcompletion_append_char = ' '
static

Definition at line 99 of file input.cc.

Referenced by generate_completion().

bool Vdebugging = false
bool Vdrawnow_requested = false
int Vecho_executing_commands = ECHO_OFF
char Vfilemarker = '>'
bool Vgud_mode = false
static

Definition at line 121 of file input.cc.

octave::sys::time Vlast_prompt_time = 0.0

Definition at line 96 of file input.cc.

Referenced by out_of_date_check(), and rehash_internal().

std::string VPS1
static
std::string VPS2
static
std::string VPS4 = "+ "
bool Vtrack_line_num = true