diff options
author | 2006-06-17 23:07:08 +1000 | |
---|---|---|
committer | 2006-06-17 23:07:08 +1000 | |
commit | 07ff8a6c03e9c232a285e8b4ebc22f11ae5963d7 (patch) | |
tree | dee6963874a0c36ec40401211b6ea67784be2c7d /builtin_help.hdr | |
parent | 9f10dd377ee08f9142fb52db1506392610606250 (diff) |
Documentation updates. Fixes a few formating bugs, adds various minor missing api documentation, fixes a few typos. Also fixes a few tiny code issues, mostly missing consts, etc
darcs-hash:20060617130708-ac50b-cc2ec5aa3e4bfb8e28d7b86441bfb4661f1dd7e7.gz
Diffstat (limited to 'builtin_help.hdr')
-rw-r--r-- | builtin_help.hdr | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/builtin_help.hdr b/builtin_help.hdr index c2671a5f..092bb5ee 100644 --- a/builtin_help.hdr +++ b/builtin_help.hdr @@ -16,8 +16,6 @@ #include "common.h" #include "halloc_util.h" -static int is_help_init=0; - /** Hashtable storing the help text */ @@ -25,17 +23,22 @@ static hash_table_t tbl; static void builtin_help_init(); -char *builtin_help_get( wchar_t *cmd ) +char *builtin_help_get( const wchar_t *cmd ) { - if( !is_help_init ) - { - builtin_help_init(); - } + builtin_help_init(); + return (char *)hash_get( &tbl, (void *)cmd ); } +/** + Initialize help hash table. Don't invoke it manually, + it is called by builtin_help_get automatically. +*/ static void builtin_help_init() { - is_help_init = 1; + static int is_help_init = 0; + if( is_help_init ) + return; + is_help_init=1; halloc_register_function( global_context, (void (*)(void *))&hash_destroy, &tbl ); hash_init( &tbl, &hash_wcs_func, &hash_wcs_cmp ); |