mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
0361423469
darcs-hash:20060613134328-ac50b-05ae75eb5cc081b680f38e8866fac00a679cc266.gz
41 lines
859 B
Text
41 lines
859 B
Text
/** \file builtin_help.c
|
|
|
|
Functions for printing usage information of builtin commands. This
|
|
file is automatically generated from the file builtin_help.hdr and
|
|
various help files in the doc_src directory.
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <strings.h>
|
|
#include <wchar.h>
|
|
#include <sys/types.h>
|
|
|
|
#include "config.h"
|
|
#include "util.h"
|
|
#include "common.h"
|
|
#include "halloc_util.h"
|
|
|
|
static int is_help_init=0;
|
|
|
|
/**
|
|
Hashtable storing the help text
|
|
*/
|
|
static hash_table_t tbl;
|
|
|
|
static void builtin_help_init();
|
|
|
|
char *builtin_help_get( wchar_t *cmd )
|
|
{
|
|
if( !is_help_init )
|
|
{
|
|
builtin_help_init();
|
|
}
|
|
return (char *)hash_get( &tbl, (void *)cmd );
|
|
}
|
|
|
|
static void builtin_help_init()
|
|
{
|
|
is_help_init = 1;
|
|
halloc_register_function( global_context, (void (*)(void *))&hash_destroy, &tbl );
|
|
hash_init( &tbl, &hash_wcs_func, &hash_wcs_cmp );
|