diff options
Diffstat (limited to 'src/intern.h')
-rw-r--r-- | src/intern.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/intern.h b/src/intern.h new file mode 100644 index 00000000..1403e66c --- /dev/null +++ b/src/intern.h @@ -0,0 +1,28 @@ +/** \file intern.h + + Library for pooling common strings + +*/ + +#ifndef FISH_INTERN_H +#define FISH_INTERN_H + +#include <wchar.h> + +/** + 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. + + \param in the string to return an interned copy of +*/ +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. + + \param in the string to add to the interned pool +*/ +const wchar_t *intern_static(const wchar_t *in); + +#endif |