2.3.3 Information About the History List
These functions return information about the entire history list or
individual list entries.
-- Function: HIST_ENTRY ** history_list (void)
Return a NULL terminated array of HIST_ENTRY * which is the
current input history. Element 0 of this list is the beginning of
time. If there is no history, return NULL.
Set the current history offset to a_position, an absolute index
into the list.
Searching
These functions allow searching of the history list for entries
containing a specific string. Searching may be performed both forward
and backward from the current history position. The search may be
"anchored", meaning that the string must match at the beginning of the
history entry.
The history entry at an_offset removed from the history.
Note: the C library returns the removed element in order to free the
line, data, and containing structure. This may be useful for an
higher level interface to the library. Result will be different from
item(an_offset) because the library will mostly copy it elsewhere
before returning it.
Search the history for a_string, starting at the current history
offset.
If forward is true then the search is through previous
entries, otherwise through subsequent entries. If a_string
found, then the current history index is set to that history entry,
and Result is the offset in the line of the entry where STRING was
found. Otherwise, nothing is changed, and a -1 is returned.
Search the history for a_string, starting at the current history
offset.
The search is anchored: matching lines must begin with
a_string. If forward ir False then the search is through
previous entries, otherwise through subsequent entries. If
a_string is found, then the current history index is set to that
entry, and is_successful set to True. Otherwise, nothing
changed, and is_successful set to False.
Read a range of lines from a_file_name, adding them to the history
list.
Start reading at line a_lower end at an_upper. If
a_lower is zero, start at the beginning. If an_upper is less
than a_lower, then read until the end of the file. If
a_file_name is Void, then read from ~/.history. is_successful
and errno are updated..
It could be newly created or
retrieved from a cache, a dictionary, from the underlying
object, depending on the implementation.
See also wrapper_or_void: when a_pointer is the
default pointer (known as NULL in C) Result will be Void.
A wrapper for a_pointer or Void if a_pointer
default_pointer (NULL in C).
A commodity feature to
replace the following code snippet:
my_gobject: A_WRAPPER
local p: POINTER
do
p := get_foo(handle)
if p.is_not_null then
Result := factory.wrapper(p)
end
end
with
my_gobject: A_G_OBJECT_HEIR
do
Result := factory.wrapper_or_void(get_foo(handle))
end
ensure
null_pointer_returns_void: a_pointer.is_null implies Result = Void
correct: a_pointer.is_not_null implies Result /= Void and then Result.handle = a_pointer
This exception occurs when Void is passed as the expression
to inspect ("inspect on STRING only).
This exception also occurs when the inspected value selects no branch (when the keyword "else"
not used, one "when" branch _must_ be selected). Some value which is not one of the inspect
constants, if there is no Else_part
r