RL

 view release on metacpan or  search on metacpan

RL.xs  view on Meta::CPAN

OUTPUT:
    RETVAL

int
set_prompt (prompt)
    const char *prompt;
CODE:
    RETVAL = rl_set_prompt(prompt);
OUTPUT:
    RETVAL

# Modifying Text

int
insert_text (text)
    const char *text;
CODE:
    RETVAL = rl_insert_text(text);
OUTPUT:
    RETVAL

# Character Input

int
read_key ()
CODE:
    RETVAL = rl_read_key();
OUTPUT:
    RETVAL

void
stuff_char (c)
    int c;
CODE:
    rl_stuff_char(c);

# Utility Functions

int
initialize ()
CODE:
    RETVAL = rl_initialize();
OUTPUT:
    RETVAL

# Completion Functions

int
complete (count, key)
    int count;
    int key;
CODE:
    RETVAL = rl_complete(count, key);
OUTPUT:
    RETVAL

void
completion_matches (text, func_sv)
    const char *text;
    SV *func_sv;
PPCODE:
    if (completion_matches_function_sv) {
        SvSetSV(completion_matches_function_sv, func_sv);
    }
    else {
        completion_matches_function_sv = newSVsv(func_sv);
    }
    char **matches = rl_completion_matches(text, completion_matches_function_wrapper);
    if (!matches) {
        XSRETURN_EMPTY;
    }
    int i;
    for (i = 0; matches[i]; i++)
        ;
    int n = i;
    EXTEND(SP, n);
    for (i = 0; i < n; i++) {
        PUSHs(sv_2mortal(newSVpv(matches[i], 0)));
        free(matches[i]);
    }
    free(matches);

char *
filename_completion_function (text, state)
    const char *text;
    int state;
CODE:
    RETVAL = rl_filename_completion_function(text, state);
OUTPUT:
    RETVAL

char *
username_completion_function (text, state)
    const char *text;
    int state;
CODE:
    RETVAL = username_completion_function(text, state);
OUTPUT:
    RETVAL

# Completion Variables

void
completion_entry_function (func_sv)
    SV *func_sv;
CODE:
    if (completion_entry_function_sv) {
        SvSetSV(completion_entry_function_sv, func_sv);
    }
    else {
        completion_entry_function_sv = newSVsv(func_sv);
    }
    if (SvOK(func_sv)) {
        rl_completion_entry_function = (void *) completion_entry_function_wrapper;
    }
    else {
        rl_completion_entry_function = NULL;
    }

void
attempted_completion_function (func_sv)



( run in 0.867 second using v1.01-cache-2.11-cpan-5511b514fd6 )