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
Functions | Variables
oct-hist.cc File Reference
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <string>
#include "cmd-hist.h"
#include "file-ops.h"
#include "lo-mappers.h"
#include "octave-link.h"
#include "oct-env.h"
#include "oct-time.h"
#include "str-vec.h"
#include "unistd-wrappers.h"
#include <defaults.h>
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "input.h"
#include "oct-hist.h"
#include "ovl.h"
#include "pager.h"
#include "parse.h"
#include "sighandlers.h"
#include "sysdep.h"
#include "interpreter.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for oct-hist.cc:

Go to the source code of this file.

Functions

static std::string default_history_file (void)
 
static int default_history_size (void)
 
static std::string default_history_timestamp_format (void)
 
static void do_edit_history (const octave_value_list &args)
 
static string_vector do_history (const octave_value_list &args, int nargout)
 
static void do_run_history (const octave_value_list &args)
 
With two run the list of
commands between the command
xample roup run_history OR
run_history nd group nd
example oindent executes the
most recent command again The
command xample run_history nd
example oindent executes
commands through Specifying a
larger number for the first
command than the last command
reverses the list of commands
before executing them For
history nd deftypefn * 
do_run_history (args)
 
static void edit_history_add_hist (const std::string &line)
 
static char * edit_history_readline (std::fstream &stream)
 
OCTAVE_EXPORT octave_value_list Fedit_history (const octave_value_list &args, int) Octave executes the commands that remain in the file.It is often more convenient to use ode
 
OCTAVE_EXPORT octave_value_list Fhistory_control (const octave_value_list &args, int nargout) but may be overridden by the environment variable
 
static bool get_int_arg (const octave_value &arg, int &val)
 
void initialize_history (bool read_history_file)
 
static std::string mk_tmp_hist_file (const octave_value_list &args, bool insert_curr, const char *warn_for)
 
void octave_history_write_timestamp (void)
 
return ovl ()
 
static void unlink_cleanup (const char *file)
 

Variables

With one edit the specified command ar {cmd_number}
 
With one argument
 
to define functions rather
than attempting to enter them
directly on the command line
The block of commands is
executed as soon as you exit
the editor To avoid executing
any simply delete all the
lines from the buffer before
leaving the editor When
invoked with no 
arguments
 
to define functions rather
than attempting to enter them
directly on the command line
The block of commands is
executed as soon as you exit
the editor To avoid executing
any simply delete all the
lines from the buffer before
leaving the editor When
invoked with no edit the
previously executed 
command
 
to define functions rather
than attempting to enter them
directly on the command line
The block of commands is
executed as soon as you exit
the editor To avoid executing
any 
commands
 
With two edit the list of
commands between specifying a
larger number for the first
command than the last command
reverses the list of commands
before they are placed in the
buffer to be edited 
eealso
 
With two run the list of
commands between the command
xample roup run_history OR
run_history nd group nd
example oindent executes the
most recent command again The
command xample run_history nd
example oindent executes
commands through Specifying a
larger number for the first
command than the last command
reverses the list of commands
before executing them For 
example
 
bool input_from_tmp_history_file = false
 
The value of lines which begin
with a space character are not
saved in the history list A
value of all commands are
saved on the history 
list
 
The value of ode {history_control} is a colon-separated list of values controlling how commands are saved on the history list. If the list of values includes ode{ignorespace}
 
static std::string Vhistory_timestamp_format_string = default_history_timestamp_format ()
 

Function Documentation

static std::string default_history_file ( void  )
static
static int default_history_size ( void  )
static

Definition at line 90 of file oct-hist.cc.

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

Referenced by initialize_history().

static std::string default_history_timestamp_format ( void  )
static
static void do_edit_history ( const octave_value_list args)
static
static string_vector do_history ( const octave_value_list args,
int  nargout 
)
static
static void do_run_history ( const octave_value_list args)
static
With two run the list of commands between the command xample roup run_history OR run_history nd group nd example oindent executes the most recent command again The command xample run_history nd example oindent executes commands through Specifying a larger number for the first command than the last command reverses the list of commands before executing them For history nd deftypefn* do_run_history ( args  )
static void edit_history_add_hist ( const std::string line)
static

Definition at line 309 of file oct-hist.cc.

References octave::command_history::add(), octave_link::append_history(), string, and tmp.

Referenced by do_edit_history().

static char* edit_history_readline ( std::fstream &  stream)
static

Definition at line 259 of file oct-hist.cc.

References c.

Referenced by do_edit_history().

OCTAVE_EXPORT octave_value_list Fedit_history ( const octave_value_list args,
int   
)

Definition at line 587 of file oct-hist.cc.

References do_edit_history(), ovl(), and print_usage().

Referenced by install_oct_hist_fcns().

OCTAVE_EXPORT octave_value_list Fhistory_control ( const octave_value_list args,
int  nargout 
)

Definition at line 728 of file oct-hist.cc.

Referenced by install_oct_hist_fcns().

static bool get_int_arg ( const octave_value arg,
int val 
)
static
void initialize_history ( bool  read_history_file)
static std::string mk_tmp_hist_file ( const octave_value_list args,
bool  insert_curr,
const char *  warn_for 
)
static
void octave_history_write_timestamp ( void  )
return ovl ( )

Referenced by Fedit_history().

static void unlink_cleanup ( const char *  file)
static

Definition at line 437 of file oct-hist.cc.

References octave_unlink_wrapper().

Referenced by do_edit_history(), and do_run_history().

Variable Documentation

With two run the list of commands between ar {cmd_number}

Definition at line 587 of file oct-hist.cc.

With one argument

Definition at line 587 of file oct-hist.cc.

With two arguments

Definition at line 587 of file oct-hist.cc.

to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any simply delete all the lines from the buffer before leaving the editor When invoked with no edit the previously executed command
to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any commands

Definition at line 587 of file oct-hist.cc.

Referenced by octave_qscintilla::contextmenu_run().

With two edit the list of commands between specifying a larger number for the first command than the last command reverses the list of commands before they are placed in the buffer to be edited eealso

Definition at line 587 of file oct-hist.cc.

With two run the list of commands between the command xample roup run_history OR run_history nd group nd example oindent executes the most recent command again The command xample run_history nd example oindent executes commands through Specifying a larger number for the first command than the last command reverses the list of commands before executing them For example

Definition at line 696 of file oct-hist.cc.

bool input_from_tmp_history_file = false

Definition at line 70 of file oct-hist.cc.

Referenced by octave::base_parser::frob_function().

The value of lines which begin with a space character are not saved in the history list A value of all commands are saved on the history list

Definition at line 728 of file oct-hist.cc.

Referenced by UrlFilter::HotSpot::actions(), octave::base_parser::append_statement_list(), tree_while_command::body(), tree_simple_for_command::body(), tree_complex_for_command::body(), tree_switch_command::case_list(), tree_if_command::cmd_list(), tree_if_clause::commands(), tree_switch_case::commands(), main_window::dock_widget_list(), F__octave_link_list_dialog__(), KeyboardTranslatorManager::findTranslators(), octave::base_parser::finish_if_command(), octave::base_parser::finish_switch_command(), FilterChain::hotSpots(), QtHandles::ListBoxControl::itemSelectionChanged(), make_name_list(), print_DASPK_options(), print_DASRT_options(), print_DASSL_options(), print_LSODE_options(), print_Quad_options(), set_DASPK_options(), set_DASRT_options(), set_DASSL_options(), set_LSODE_options(), set_Quad_options(), octave::base_parser::set_stmt_print_flag(), show_DASPK_options(), show_DASRT_options(), show_DASSL_options(), show_LSODE_options(), show_Quad_options(), KeyboardTranslatorReader::tokenize(), QtHandles::ListBoxControl::update(), tree_checker::visit_complex_for_command(), tree_print_code::visit_complex_for_command(), tree_checker::visit_do_until_command(), tree_print_code::visit_do_until_command(), tree_checker::visit_if_clause(), tree_print_code::visit_if_clause(), tree_checker::visit_if_command(), tree_print_code::visit_if_command(), tree_checker::visit_simple_for_command(), tree_print_code::visit_simple_for_command(), tree_checker::visit_switch_case(), tree_print_code::visit_switch_case(), tree_checker::visit_switch_command(), tree_print_code::visit_switch_command(), tree_checker::visit_while_command(), and tree_print_code::visit_while_command().

The value of lines which begin with a space character are not saved in the history list A value of ode {history_control} is a colon-separated list of values controlling how commands are saved on the history list. If the list of values includes ode{ignorespace}

Definition at line 728 of file oct-hist.cc.

std::string Vhistory_timestamp_format_string = default_history_timestamp_format ()
static

Definition at line 121 of file oct-hist.cc.

Referenced by octave_history_write_timestamp().