Migrate input_function_get_names to wcstring_list_t

This commit is contained in:
ridiculousfish 2012-01-23 20:48:47 -08:00
parent 0d1c2a3b2a
commit 4dfe36feb1
3 changed files with 7 additions and 20 deletions

View file

@ -465,20 +465,13 @@ static void builtin_bind_key_names( int all )
*/ */
static void builtin_bind_function_names() static void builtin_bind_function_names()
{ {
array_list_t lst; wcstring_list_t names = input_function_get_names();
int i;
al_init( &lst ); for( size_t i=0; i<names.size(); i++ )
input_function_get_names( &lst );
for( i=0; i<al_get_count(&lst); i++ )
{ {
wchar_t *seq = (wchar_t *)al_get( &lst, i ); const wchar_t *seq = names.at(i).c_str();
sb_printf( sb_out, L"%ls\n", seq ); sb_printf( sb_out, L"%ls\n", seq );
} }
al_destroy( &lst );
} }
/** /**

View file

@ -835,16 +835,10 @@ void input_terminfo_get_names( array_list_t *lst, int skip_null )
} }
} }
void input_function_get_names( array_list_t *lst ) wcstring_list_t input_function_get_names( void )
{ {
size_t i; size_t count = sizeof name_arr / sizeof *name_arr;
return wcstring_list_t(name_arr, name_arr + count);
CHECK( lst, );
for( i=0; i<(sizeof(name_arr)/sizeof(wchar_t *)); i++ )
{
al_push( lst, name_arr[i] );
}
} }
wchar_t input_function_get_code( const wcstring &name ) wchar_t input_function_get_code( const wcstring &name )

View file

@ -138,7 +138,7 @@ wchar_t input_function_get_code( const wcstring &name );
/** /**
Returns a list of all existing input function names Returns a list of all existing input function names
*/ */
void input_function_get_names( array_list_t *lst ); wcstring_list_t input_function_get_names( void );
#endif #endif