Module: Readline

Defined in:
ext/rubysl/readline/readline.c

Constant Summary collapse

HISTORY =
history
VERSION =
rb_str_new2(rl_library_version)

Class Method Summary collapse

Class Method Details

.basic_word_break_charactersObject



234
235
236
# File 'ext/rubysl/readline/readline.c', line 234

static VALUE
readline_s_get_basic_word_break_characters(self, str)
VALUE self, str;

.basic_word_break_characters=Object



212
213
214
# File 'ext/rubysl/readline/readline.c', line 212

static VALUE
readline_s_set_basic_word_break_characters(self, str)
VALUE self, str;

.completer_quote_charactersObject



299
300
301
# File 'ext/rubysl/readline/readline.c', line 299

static VALUE
readline_s_get_completer_quote_characters(self, str)
VALUE self, str;

.completer_quote_characters=Object



276
277
278
# File 'ext/rubysl/readline/readline.c', line 276

static VALUE
readline_s_set_completer_quote_characters(self, str)
VALUE self, str;

.completer_word_break_charactersObject



266
267
268
# File 'ext/rubysl/readline/readline.c', line 266

static VALUE
readline_s_get_completer_word_break_characters(self, str)
VALUE self, str;

.completer_word_break_characters=Object



244
245
246
# File 'ext/rubysl/readline/readline.c', line 244

static VALUE
readline_s_set_completer_word_break_characters(self, str)
VALUE self, str;

.completion_append_characterObject



201
202
203
# File 'ext/rubysl/readline/readline.c', line 201

static VALUE
readline_s_get_completion_append_character(self)
VALUE self;

.completion_append_character=Object



182
183
184
# File 'ext/rubysl/readline/readline.c', line 182

static VALUE
readline_s_set_completion_append_character(self, str)
VALUE self, str;

.completion_case_foldObject



91
92
93
# File 'ext/rubysl/readline/readline.c', line 91

static VALUE
readline_s_get_completion_case_fold(self)
VALUE self;

.completion_case_fold=Object



82
83
84
# File 'ext/rubysl/readline/readline.c', line 82

static VALUE
readline_s_set_completion_case_fold(self, val)
VALUE self;

.completion_procObject



74
75
76
# File 'ext/rubysl/readline/readline.c', line 74

static VALUE
readline_s_get_completion_proc(self)
VALUE self;

.completion_proc=Object



63
64
65
# File 'ext/rubysl/readline/readline.c', line 63

static VALUE
readline_s_set_completion_proc(self, proc)
VALUE self;

.perform_readline(tmp, add_hist) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'ext/rubysl/readline/readline.c', line 34

static VALUE
readline_readline(VALUE self, VALUE tmp, VALUE add_hist)
{
    VALUE result;
    char *prompt = NULL;
    char *buff;

    rb_secure(4);
    SafeStringValue(tmp);
    prompt = RSTRING_PTR(tmp);

    if(!isatty(0) && errno == EBADF) rb_raise(rb_eIOError, "stdin closed");

    buff = (char*)rb_thread_blocking_region(readline_unlocked, prompt, 0, 0);

    if(RTEST(add_hist) && buff) {
      add_history(buff);
    }

    if(buff) {
      result = rb_tainted_str_new2(buff);
      free(buff);
    } else {
      result = Qnil;
    }

    return result;
}