intern.h File Reference

Library for pooling common strings. More...

#include <wchar.h>

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const wchar_t * intern (const wchar_t *in)
 Return an identical copy of the specified string from a pool of unique strings.
const wchar_t * intern_static (const wchar_t *in)
 Insert the specified string literal into the pool of unique strings.
void intern_free_all ()
 Free all interned strings.


Detailed Description

Library for pooling common strings.


Function Documentation

const wchar_t* intern ( const wchar_t *  in  ) 

Return an identical copy of the specified string from a pool of unique strings.

If the string was not in the pool, add a copy.

Parameters:
in the string to return an interned copy of

References DIE_MEM, hash_get(), hash_init(), hash_put(), hash_wcs_cmp(), and hash_wcs_func().

Referenced by autoload_names(), builtin_source(), complete_get_exact_entry(), function_add(), history_create_mode(), input_mapping_add(), main(), parse_util_load_internal(), and parser_push_block().

void intern_free_all (  ) 

Free all interned strings.

Only call this at shutdown.

References clear_value(), hash_destroy(), and hash_foreach().

Referenced by main().

const wchar_t* intern_static ( const wchar_t *  in  ) 

Insert the specified string literal into the pool of unique strings.

The string will not first be copied, and it will not be free'd on exit.

Parameters:
in the string to add to the interned pool

References DIE_MEM, hash_get(), hash_init(), hash_put(), hash_wcs_cmp(), and hash_wcs_func().

Referenced by builtin_init(), and builtin_source().


Generated on Sun Mar 8 15:46:55 2009 for fish by  doxygen 1.5.6