Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

intern.c File Reference

Library for pooling common strings. More...

#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <unistd.h>
#include "fallback.h"
#include "util.h"
#include "wutil.h"
#include "common.h"
#include "intern.h"

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.
static void clear_value (void *key, void *data)
 Free the specified key/value pair.
void intern_free_all ()
 Free all interned strings.

Variables

static hash_table_tintern_table = 0
 Table of interned strings.
static hash_table_tintern_static_table = 0
 Table of static interned strings.


Detailed Description

Library for pooling common strings.


Function Documentation

static void clear_value void *  key,
void *  data
[static]
 

Free the specified key/value pair.

Should only be called by intern_free_all at shutdown

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

void intern_free_all  ) 
 

Free all interned strings.

Only call this at shutdown.

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


Generated on Sun Jan 13 02:52:56 2008 for fish by  doxygen 1.4.4