mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 01:36:39 +08:00
Minor edits, mostly tweaks of the API documentation
darcs-hash:20060123233347-ac50b-44ebb96ba202c062739ba3d183519e28a95511b2.gz
This commit is contained in:
parent
ba177b48d5
commit
8df21a1cb1
37
builtin.c
37
builtin.c
|
@ -657,15 +657,15 @@ static void functions_def( wchar_t *name )
|
||||||
|
|
||||||
array_list_t ev;
|
array_list_t ev;
|
||||||
event_t search;
|
event_t search;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
search.function_name = name;
|
search.function_name = name;
|
||||||
search.type = EVENT_ANY;
|
search.type = EVENT_ANY;
|
||||||
|
|
||||||
al_init( &ev );
|
al_init( &ev );
|
||||||
event_get( &search, &ev );
|
event_get( &search, &ev );
|
||||||
|
|
||||||
sb_append2( sb_out,
|
sb_append2( sb_out,
|
||||||
L"function ",
|
L"function ",
|
||||||
name,
|
name,
|
||||||
|
@ -674,11 +674,11 @@ static void functions_def( wchar_t *name )
|
||||||
if( desc && wcslen(desc) )
|
if( desc && wcslen(desc) )
|
||||||
{
|
{
|
||||||
wchar_t *esc_desc = escape( desc, 1 );
|
wchar_t *esc_desc = escape( desc, 1 );
|
||||||
|
|
||||||
sb_append2( sb_out, L" --description ", esc_desc, (void *)0 );
|
sb_append2( sb_out, L" --description ", esc_desc, (void *)0 );
|
||||||
free( esc_desc );
|
free( esc_desc );
|
||||||
}
|
}
|
||||||
|
|
||||||
for( i=0; i<al_get_count( &ev); i++ )
|
for( i=0; i<al_get_count( &ev); i++ )
|
||||||
{
|
{
|
||||||
event_t *next = (event_t *)al_get( &ev, i );
|
event_t *next = (event_t *)al_get( &ev, i );
|
||||||
|
@ -689,7 +689,7 @@ static void functions_def( wchar_t *name )
|
||||||
sb_printf( sb_out, L" --on-signal %ls", sig2wcs( next->param1.signal ) );
|
sb_printf( sb_out, L" --on-signal %ls", sig2wcs( next->param1.signal ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_VARIABLE:
|
case EVENT_VARIABLE:
|
||||||
{
|
{
|
||||||
sb_printf( sb_out, L" --on-variable %ls", next->param1.variable );
|
sb_printf( sb_out, L" --on-variable %ls", next->param1.variable );
|
||||||
|
@ -714,17 +714,17 @@ static void functions_def( wchar_t *name )
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
al_destroy( &ev );
|
al_destroy( &ev );
|
||||||
|
|
||||||
sb_append2( sb_out,
|
sb_append2( sb_out,
|
||||||
L"\n\t",
|
L"\n\t",
|
||||||
def,
|
def,
|
||||||
L"\nend\n\n",
|
L"\nend\n\n",
|
||||||
(void *)0);
|
(void *)0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -744,7 +744,7 @@ static int builtin_functions( wchar_t **argv )
|
||||||
int list=0;
|
int list=0;
|
||||||
int show_hidden=0;
|
int show_hidden=0;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
woptind=0;
|
woptind=0;
|
||||||
|
|
||||||
const static struct woption
|
const static struct woption
|
||||||
|
@ -775,7 +775,7 @@ static int builtin_functions( wchar_t **argv )
|
||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
int opt_index = 0;
|
int opt_index = 0;
|
||||||
|
|
||||||
int opt = wgetopt_long( argc,
|
int opt = wgetopt_long( argc,
|
||||||
argv,
|
argv,
|
||||||
L"ed:na",
|
L"ed:na",
|
||||||
|
@ -783,7 +783,7 @@ static int builtin_functions( wchar_t **argv )
|
||||||
&opt_index );
|
&opt_index );
|
||||||
if( opt == -1 )
|
if( opt == -1 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch( opt )
|
switch( opt )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -820,10 +820,8 @@ static int builtin_functions( wchar_t **argv )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Erase, desc and list are mutually exclusive
|
Erase, desc and list are mutually exclusive
|
||||||
|
@ -833,13 +831,12 @@ static int builtin_functions( wchar_t **argv )
|
||||||
sb_printf( sb_err,
|
sb_printf( sb_err,
|
||||||
_( L"%ls: Invalid combination of options\n" ),
|
_( L"%ls: Invalid combination of options\n" ),
|
||||||
argv[0] );
|
argv[0] );
|
||||||
|
|
||||||
|
|
||||||
builtin_print_help( argv[0], sb_err );
|
builtin_print_help( argv[0], sb_err );
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( erase )
|
if( erase )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1234,7 +1234,7 @@ static const wchar_t *complete_function_desc( const wchar_t *fn )
|
||||||
|
|
||||||
\param cmd the command string to find completions for
|
\param cmd the command string to find completions for
|
||||||
|
|
||||||
B\param comp the list to add all completions to
|
\param comp the list to add all completions to
|
||||||
*/
|
*/
|
||||||
static void complete_cmd( const wchar_t *cmd,
|
static void complete_cmd( const wchar_t *cmd,
|
||||||
array_list_t *comp )
|
array_list_t *comp )
|
||||||
|
|
49
util.h
49
util.h
|
@ -165,19 +165,29 @@ float minf( float a, float b );
|
||||||
*/
|
*/
|
||||||
void q_init( dyn_queue_t *q );
|
void q_init( dyn_queue_t *q );
|
||||||
|
|
||||||
/** Destroy the queue */
|
/**
|
||||||
|
Destroy the queue
|
||||||
|
*/
|
||||||
void q_destroy( dyn_queue_t *q );
|
void q_destroy( dyn_queue_t *q );
|
||||||
|
|
||||||
/** Insert element into queue */
|
/**
|
||||||
|
Insert element into queue
|
||||||
|
*/
|
||||||
int q_put( dyn_queue_t *q, void *e );
|
int q_put( dyn_queue_t *q, void *e );
|
||||||
|
|
||||||
/** Remove and return next element from queue */
|
/**
|
||||||
|
Remove and return next element from queue
|
||||||
|
*/
|
||||||
void *q_get( dyn_queue_t *q);
|
void *q_get( dyn_queue_t *q);
|
||||||
|
|
||||||
/** Return next element from queue without removing it */
|
/**
|
||||||
|
Return next element from queue without removing it
|
||||||
|
*/
|
||||||
void *q_peek( dyn_queue_t *q);
|
void *q_peek( dyn_queue_t *q);
|
||||||
|
|
||||||
/** Returns 1 if the queue is empty, 0 otherwise */
|
/**
|
||||||
|
Returns 1 if the queue is empty, 0 otherwise
|
||||||
|
*/
|
||||||
int q_empty( dyn_queue_t *q );
|
int q_empty( dyn_queue_t *q );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -251,15 +261,15 @@ void hash_get_keys( hash_table_t *h,
|
||||||
void hash_get_data( hash_table_t *h,
|
void hash_get_data( hash_table_t *h,
|
||||||
array_list_t *arr );
|
array_list_t *arr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Call the function func for each key/data pair in the table
|
Call the function func for each key/data pair in the table
|
||||||
*/
|
*/
|
||||||
void hash_foreach( hash_table_t *h,
|
void hash_foreach( hash_table_t *h,
|
||||||
void (*func)( const void *, const void * ) );
|
void (*func)( const void *, const void * ) );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Same as hash_foreach, but the function func takes an additional
|
Same as hash_foreach, but the function func takes an additional
|
||||||
argument, which is provided by the caller in the variable aux
|
argument, which is provided by the caller in the variable aux
|
||||||
*/
|
*/
|
||||||
void hash_foreach2( hash_table_t *h, void (*func)( const void *,
|
void hash_foreach2( hash_table_t *h, void (*func)( const void *,
|
||||||
const void *,
|
const void *,
|
||||||
|
@ -273,7 +283,8 @@ int hash_str_func( const void *data );
|
||||||
/**
|
/**
|
||||||
Hash comparison function suitable for character strings
|
Hash comparison function suitable for character strings
|
||||||
*/
|
*/
|
||||||
int hash_str_cmp( const void *a, const void *b );
|
int hash_str_cmp( const void *a,
|
||||||
|
const void *b );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Hash function suitable for wide character strings.
|
Hash function suitable for wide character strings.
|
||||||
|
@ -283,7 +294,8 @@ int hash_wcs_func( const void *data );
|
||||||
/**
|
/**
|
||||||
Hash comparison function suitable for wide character strings
|
Hash comparison function suitable for wide character strings
|
||||||
*/
|
*/
|
||||||
int hash_wcs_cmp( const void *a, const void *b );
|
int hash_wcs_cmp( const void *a,
|
||||||
|
const void *b );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize the priority queue
|
Initialize the priority queue
|
||||||
|
@ -296,12 +308,12 @@ void pq_init( priority_queue_t *q,
|
||||||
/**
|
/**
|
||||||
Add element to the queue
|
Add element to the queue
|
||||||
|
|
||||||
\param q the queue
|
\param q the queue
|
||||||
\param e the new element
|
\param e the new element
|
||||||
|
|
||||||
*/
|
*/
|
||||||
int pq_put( priority_queue_t *q,
|
int pq_put( priority_queue_t *q,
|
||||||
void *e );
|
void *e );
|
||||||
/**
|
/**
|
||||||
Removes and returns the last entry in the priority queue
|
Removes and returns the last entry in the priority queue
|
||||||
*/
|
*/
|
||||||
|
@ -445,6 +457,10 @@ void al_foreach2( array_list_t *l, void (*func)(const void *, void *), void *aux
|
||||||
int wcsfilecmp( const wchar_t *a, const wchar_t *b );
|
int wcsfilecmp( const wchar_t *a, const wchar_t *b );
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
String buffer functions
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize the specified string_buffer
|
Initialize the specified string_buffer
|
||||||
*/
|
*/
|
||||||
|
@ -503,6 +519,9 @@ void sb_destroy( string_buffer_t * );
|
||||||
*/
|
*/
|
||||||
void sb_clear( string_buffer_t * );
|
void sb_clear( string_buffer_t * );
|
||||||
|
|
||||||
|
/*
|
||||||
|
Buffer functions
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize the specified buffer_t
|
Initialize the specified buffer_t
|
||||||
|
|
Loading…
Reference in New Issue
Block a user