2005-09-20 13:26:39 +00:00
|
|
|
/** \file intern.h
|
|
|
|
|
|
|
|
Library for pooling common strings
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2005-10-04 15:11:39 +00:00
|
|
|
#ifndef FISH_INTERN_H
|
|
|
|
#define FISH_INTERN_H
|
|
|
|
|
|
|
|
#include <wchar.h>
|
|
|
|
|
2005-09-20 13:26:39 +00:00
|
|
|
/**
|
|
|
|
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.
|
|
|
|
|
2005-10-24 15:26:25 +00:00
|
|
|
\param in the string to return an interned copy of
|
2005-09-20 13:26:39 +00:00
|
|
|
*/
|
|
|
|
const wchar_t *intern( 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.
|
2005-10-24 15:26:25 +00:00
|
|
|
|
|
|
|
\param in the string to add to the interned pool
|
2005-09-20 13:26:39 +00:00
|
|
|
*/
|
|
|
|
const wchar_t *intern_static( const wchar_t *in );
|
|
|
|
|
|
|
|
/**
|
2005-10-24 15:26:25 +00:00
|
|
|
Free all interned strings. Only call this at shutdown.
|
2005-09-20 13:26:39 +00:00
|
|
|
*/
|
|
|
|
void intern_free_all();
|
2005-10-04 15:11:39 +00:00
|
|
|
|
|
|
|
#endif
|