ext/readline/readline.c File Reference

#include "ruby/config.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <readline/readline.h>
#include <readline/history.h>
#include "ruby/ruby.h"
#include "ruby/io.h"

Go to the source code of this file.

Defines

#define EDIT_LINE_LIBRARY_VERSION   "EditLine wrapper"
#define USE_INSERT_IGNORE_ESCAPE   0
#define COMPLETION_PROC   "completion_proc"
#define COMPLETION_CASE_FOLD   "completion_case_fold"
#define OutputStringValue(str)

Functions

static char ** readline_attempted_completion_function (const char *text, int start, int end)
static int readline_getc (FILE *)
static VALUE readline_get (VALUE prompt)
static VALUE readline_readline (int argc, VALUE *argv, VALUE self)
static VALUE readline_s_set_input (VALUE self, VALUE input)
static VALUE readline_s_set_output (VALUE self, VALUE output)
static VALUE readline_s_set_completion_proc (VALUE self, VALUE proc)
static VALUE readline_s_get_completion_proc (VALUE self)
static VALUE readline_s_set_completion_case_fold (VALUE self, VALUE val)
static VALUE readline_s_get_completion_case_fold (VALUE self)
static VALUE readline_s_get_line_buffer (VALUE self)
static VALUE readline_s_get_point (VALUE self)
static VALUE readline_s_set_screen_size (VALUE self, VALUE rows, VALUE columns)
static VALUE readline_s_get_screen_size (VALUE self)
static VALUE readline_s_vi_editing_mode (VALUE self)
static VALUE readline_s_vi_editing_mode_p (VALUE self)
static VALUE readline_s_emacs_editing_mode (VALUE self)
static VALUE readline_s_emacs_editing_mode_p (VALUE self)
static VALUE readline_s_set_completion_append_character (VALUE self, VALUE str)
static VALUE readline_s_get_completion_append_character (VALUE self)
static VALUE readline_s_set_basic_word_break_characters (VALUE self, VALUE str)
static VALUE readline_s_get_basic_word_break_characters (VALUE self, VALUE str)
static VALUE readline_s_set_completer_word_break_characters (VALUE self, VALUE str)
static VALUE readline_s_get_completer_word_break_characters (VALUE self, VALUE str)
static VALUE readline_s_set_basic_quote_characters (VALUE self, VALUE str)
static VALUE readline_s_get_basic_quote_characters (VALUE self, VALUE str)
static VALUE readline_s_set_completer_quote_characters (VALUE self, VALUE str)
static VALUE readline_s_get_completer_quote_characters (VALUE self, VALUE str)
static VALUE readline_s_set_filename_quote_characters (VALUE self, VALUE str)
static VALUE readline_s_get_filename_quote_characters (VALUE self, VALUE str)
static VALUE readline_s_refresh_line (VALUE self)
static VALUE hist_to_s (VALUE self)
static int history_get_offset_history_base (int offset)
static int history_get_offset_0 (int offset)
static VALUE hist_get (VALUE self, VALUE index)
static VALUE hist_set (VALUE self, VALUE index, VALUE str)
static VALUE hist_push (VALUE self, VALUE str)
static VALUE hist_push_method (int argc, VALUE *argv, VALUE self)
static VALUE rb_remove_history (int index)
static VALUE hist_pop (VALUE self)
static VALUE hist_shift (VALUE self)
static VALUE hist_each (VALUE self)
static VALUE hist_length (VALUE self)
static VALUE hist_empty_p (VALUE self)
static VALUE hist_delete_at (VALUE self, VALUE index)
static VALUE hist_clear (VALUE self)
static VALUE filename_completion_proc_call (VALUE self, VALUE str)
static VALUE username_completion_proc_call (VALUE self, VALUE str)
void Init_readline ()

Variables

static VALUE mReadline
static ID completion_proc
static ID completion_case_fold
static int(* history_get_offset_func )(int)
static int(* history_replace_offset_func )(int)
static int readline_completion_append_character
static VALUE readline_instream
static ID id_getbyte

Define Documentation

#define COMPLETION_CASE_FOLD   "completion_case_fold"

Definition at line 59 of file readline.c.

Referenced by Init_readline().

#define COMPLETION_PROC   "completion_proc"

Definition at line 58 of file readline.c.

Referenced by Init_readline().

#define EDIT_LINE_LIBRARY_VERSION   "EditLine wrapper"

Definition at line 49 of file readline.c.

Referenced by Init_readline().

#define OutputStringValue ( str   ) 
#define USE_INSERT_IGNORE_ESCAPE   0

Definition at line 54 of file readline.c.


Function Documentation

static VALUE filename_completion_proc_call ( VALUE  self,
VALUE  str 
) [static]
static VALUE hist_clear ( VALUE  self  )  [static]

Definition at line 1456 of file readline.c.

References rb_secure().

Referenced by Init_readline().

static VALUE hist_delete_at ( VALUE  self,
VALUE  index 
) [static]

Definition at line 1440 of file readline.c.

References NUM2INT, rb_eIndexError, rb_raise(), rb_remove_history(), and rb_secure().

Referenced by Init_readline().

static VALUE hist_each ( VALUE  self  )  [static]
static VALUE hist_empty_p ( VALUE  self  )  [static]

Definition at line 1433 of file readline.c.

References Qfalse, Qtrue, and rb_secure().

Referenced by Init_readline().

static VALUE hist_get ( VALUE  self,
VALUE  index 
) [static]
static VALUE hist_length ( VALUE  self  )  [static]

Definition at line 1426 of file readline.c.

References INT2NUM(), and rb_secure().

Referenced by Init_readline().

static VALUE hist_pop ( VALUE  self  )  [static]

Definition at line 1386 of file readline.c.

References Qnil, rb_remove_history(), and rb_secure().

Referenced by Init_readline().

static VALUE hist_push ( VALUE  self,
VALUE  str 
) [static]

Definition at line 1341 of file readline.c.

References OutputStringValue, rb_secure(), and RSTRING_PTR.

Referenced by Init_readline().

static VALUE hist_push_method ( int  argc,
VALUE argv,
VALUE  self 
) [static]

Definition at line 1350 of file readline.c.

References OutputStringValue, rb_secure(), and RSTRING_PTR.

Referenced by Init_readline().

static VALUE hist_set ( VALUE  self,
VALUE  index,
VALUE  str 
) [static]
static VALUE hist_shift ( VALUE  self  )  [static]

Definition at line 1397 of file readline.c.

References Qnil, rb_remove_history(), and rb_secure().

Referenced by Init_readline().

static VALUE hist_to_s ( VALUE  self  )  [static]

Definition at line 1278 of file readline.c.

References rb_str_new_cstr().

Referenced by Init_readline().

static int history_get_offset_0 ( int  offset  )  [static]

Definition at line 1290 of file readline.c.

Referenced by Init_readline().

static int history_get_offset_history_base ( int  offset  )  [static]

Definition at line 1284 of file readline.c.

Referenced by Init_readline().

void Init_readline (  ) 

Definition at line 1517 of file readline.c.

References COMPLETION_CASE_FOLD, completion_case_fold, COMPLETION_PROC, completion_proc, CONST_ID, EDIT_LINE_LIBRARY_VERSION, filename_completion_proc_call(), free, hist_clear(), hist_delete_at(), hist_each(), hist_empty_p(), hist_get(), hist_length(), hist_pop(), hist_push(), hist_push_method(), hist_set(), hist_shift(), hist_to_s(), history_get_offset_0(), history_get_offset_func, history_get_offset_history_base(), history_replace_offset_func, id_getbyte, mReadline, NULL, rb_cObject, rb_define_const(), rb_define_module(), rb_define_module_function(), rb_define_singleton_method(), rb_extend_object(), rb_intern, rb_intern_const, rb_mEnumerable, rb_obj_alloc(), rb_stdin, rb_str_new_cstr(), readline_attempted_completion_function(), readline_getc(), readline_readline(), readline_s_emacs_editing_mode(), readline_s_emacs_editing_mode_p(), readline_s_get_basic_quote_characters(), readline_s_get_basic_word_break_characters(), readline_s_get_completer_quote_characters(), readline_s_get_completer_word_break_characters(), readline_s_get_completion_append_character(), readline_s_get_completion_case_fold(), readline_s_get_completion_proc(), readline_s_get_filename_quote_characters(), readline_s_get_line_buffer(), readline_s_get_point(), readline_s_get_screen_size(), readline_s_refresh_line(), readline_s_set_basic_quote_characters(), readline_s_set_basic_word_break_characters(), readline_s_set_completer_quote_characters(), readline_s_set_completer_word_break_characters(), readline_s_set_completion_append_character(), readline_s_set_completion_case_fold(), readline_s_set_completion_proc(), readline_s_set_filename_quote_characters(), readline_s_set_input(), readline_s_set_output(), readline_s_set_screen_size(), readline_s_vi_editing_mode(), readline_s_vi_editing_mode_p(), strlen(), username_completion_proc_call(), and version().

static VALUE rb_remove_history ( int  index  )  [static]

Definition at line 1364 of file readline.c.

References free, Qnil, rb_locale_str_new_cstr(), rb_notimplement(), and rb_secure().

Referenced by hist_delete_at(), hist_pop(), and hist_shift().

static char ** readline_attempted_completion_function ( const char *  text,
int  start,
int  end 
) [static]
static VALUE readline_get ( VALUE  prompt  )  [static]

Definition at line 266 of file readline.c.

References readline_completion_append_character.

Referenced by readline_readline().

static int readline_getc ( FILE input  )  [static]
static VALUE readline_readline ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE readline_s_emacs_editing_mode ( VALUE  self  )  [static]

Definition at line 835 of file readline.c.

References Qnil, and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_emacs_editing_mode_p ( VALUE  self  )  [static]

Definition at line 857 of file readline.c.

References Qfalse, Qtrue, and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_basic_quote_characters ( VALUE  self,
VALUE  str 
) [static]

Definition at line 1124 of file readline.c.

References NULL, Qnil, rb_locale_str_new_cstr(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_basic_word_break_characters ( VALUE  self,
VALUE  str 
) [static]

Definition at line 1004 of file readline.c.

References NULL, Qnil, rb_locale_str_new_cstr(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_completer_quote_characters ( VALUE  self,
VALUE  str 
) [static]

Definition at line 1186 of file readline.c.

References NULL, Qnil, rb_locale_str_new_cstr(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_completer_word_break_characters ( VALUE  self,
VALUE  str 
) [static]

Definition at line 1065 of file readline.c.

References NULL, Qnil, rb_locale_str_new_cstr(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_completion_append_character ( VALUE  self  )  [static]

Definition at line 939 of file readline.c.

References buf, Qnil, rb_locale_str_new(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_completion_case_fold ( VALUE  self  )  [static]

Definition at line 597 of file readline.c.

References completion_case_fold, mReadline, rb_attr_get(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_completion_proc ( VALUE  self  )  [static]

Definition at line 559 of file readline.c.

References completion_proc, mReadline, rb_attr_get(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_filename_quote_characters ( VALUE  self,
VALUE  str 
) [static]

Definition at line 1246 of file readline.c.

References NULL, Qnil, rb_locale_str_new_cstr(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_line_buffer ( VALUE  self  )  [static]

Definition at line 616 of file readline.c.

References NULL, Qnil, rb_locale_str_new_cstr(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_point ( VALUE  self  )  [static]

Definition at line 642 of file readline.c.

References INT2NUM(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_get_screen_size ( VALUE  self  )  [static]

Definition at line 762 of file readline.c.

References INT2NUM(), rb_ary_new(), rb_ary_push(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_refresh_line ( VALUE  self  )  [static]

Definition at line 1267 of file readline.c.

References Qnil, and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_set_basic_quote_characters ( VALUE  self,
VALUE  str 
) [static]

Definition at line 1088 of file readline.c.

References ALLOC_N, NULL, OutputStringValue, rb_secure(), REALLOC_N, RSTRING_LEN, and RSTRING_PTR.

Referenced by Init_readline().

static VALUE readline_s_set_basic_word_break_characters ( VALUE  self,
VALUE  str 
) [static]

Definition at line 968 of file readline.c.

References ALLOC_N, NULL, OutputStringValue, rb_secure(), REALLOC_N, RSTRING_LEN, and RSTRING_PTR.

Referenced by Init_readline().

static VALUE readline_s_set_completer_quote_characters ( VALUE  self,
VALUE  str 
) [static]

Definition at line 1150 of file readline.c.

References ALLOC_N, NULL, OutputStringValue, rb_secure(), REALLOC_N, RSTRING_LEN, and RSTRING_PTR.

Referenced by Init_readline().

static VALUE readline_s_set_completer_word_break_characters ( VALUE  self,
VALUE  str 
) [static]

Definition at line 1029 of file readline.c.

References ALLOC_N, NULL, OutputStringValue, rb_secure(), REALLOC_N, RSTRING_LEN, and RSTRING_PTR.

Referenced by Init_readline().

static VALUE readline_s_set_completion_append_character ( VALUE  self,
VALUE  str 
) [static]

Definition at line 906 of file readline.c.

References NIL_P, OutputStringValue, rb_secure(), RSTRING_LEN, and RSTRING_PTR.

Referenced by Init_readline().

static VALUE readline_s_set_completion_case_fold ( VALUE  self,
VALUE  val 
) [static]

Definition at line 574 of file readline.c.

References completion_case_fold, mReadline, rb_ivar_set(), and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_set_completion_proc ( VALUE  self,
VALUE  proc 
) [static]
static VALUE readline_s_set_filename_quote_characters ( VALUE  self,
VALUE  str 
) [static]

Definition at line 1210 of file readline.c.

References ALLOC_N, NULL, OutputStringValue, rb_secure(), REALLOC_N, RSTRING_LEN, and RSTRING_PTR.

Referenced by Init_readline().

static VALUE readline_s_set_input ( VALUE  self,
VALUE  input 
) [static]

Definition at line 436 of file readline.c.

References Check_Type, GetOpenFile, rb_io_stdio_file(), rb_secure(), readline_instream, and T_FILE.

Referenced by Init_readline().

static VALUE readline_s_set_output ( VALUE  self,
VALUE  output 
) [static]

Definition at line 460 of file readline.c.

References Check_Type, GetOpenFile, rb_io_stdio_file(), rb_secure(), and T_FILE.

Referenced by Init_readline().

static VALUE readline_s_set_screen_size ( VALUE  self,
VALUE  rows,
VALUE  columns 
) [static]

Definition at line 738 of file readline.c.

References NUM2INT, and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_vi_editing_mode ( VALUE  self  )  [static]

Definition at line 791 of file readline.c.

References Qnil, and rb_secure().

Referenced by Init_readline().

static VALUE readline_s_vi_editing_mode_p ( VALUE  self  )  [static]

Definition at line 813 of file readline.c.

References Qfalse, Qtrue, and rb_secure().

Referenced by Init_readline().

static VALUE username_completion_proc_call ( VALUE  self,
VALUE  str 
) [static]

Variable Documentation

ID completion_proc [static]
int(* history_get_offset_func)(int) [static]

Referenced by hist_each(), hist_get(), and Init_readline().

int(* history_replace_offset_func)(int) [static]

Referenced by hist_set(), and Init_readline().

ID id_getbyte [static]

Definition at line 127 of file readline.c.

Referenced by Init_readline(), and readline_getc().

VALUE mReadline [static]

Definition at line 78 of file readline.c.

Referenced by readline_attempted_completion_function(), and readline_get().

Definition at line 126 of file readline.c.

Referenced by readline_getc(), and readline_s_set_input().


Generated on 30 Nov 2012 for Ruby by  doxygen 1.6.1