Created
February 4, 2009 07:15
-
-
Save koichiro/57998 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef char *rl_compentry_func_t PARAMS((const char *, int)); | |
READLINE_DLL_IMPEXP rl_compentry_func_t *rl_completion_entry_function; | |
READLINE_DLL_IMPEXP char** | |
rl_completion_matches (text, entry_function) | |
const char *text; | |
rl_compentry_func_t *entry_function; | |
{ | |
....snip... | |
while (string = (*entry_function)(text, matches)) /* Need NULL return */ | |
{ | |
.... | |
} | |
....snip... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Readline | |
extend FFI::Library | |
ffi_lib 'readline' | |
callback :compentry_function, [:pointer, :int], :pointer | |
attach_function :completion_matches, :rl_completion_matches, [:string, :compentry_function], :pointer | |
end | |
Readline.completion_matches(text) do |str_p, stat| | |
# return NULL | |
# nil convert NULL pointer | |
nil | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment