Audacious
$Id:Doxyfile42802007-03-2104:39:00Znenolod$
|
#include <assert.h>
#include <glib.h>
#include <mowgli.h>
Go to the source code of this file.
Defines | |
#define | MAXLEN 100 |
Functions | |
gchar * | stringpool_get (gchar *str, gboolean take) |
Fetches or allocates a given string from the stringpool. | |
void | stringpool_unref (gchar *str) |
Unreference a pooled string. | |
Variables | |
static mowgli_patricia_t * | stringpool_tree = NULL |
static GStaticMutex | stringpool_mutex = G_STATIC_MUTEX_INIT |
#define MAXLEN 100 |
Definition at line 29 of file stringpool.c.
Referenced by stringpool_get(), and stringpool_unref().
gchar* stringpool_get | ( | gchar * | str, |
gboolean | take | ||
) |
Fetches or allocates a given string from the stringpool.
If string already exists in the pool, reference to it is returned. Otherwise, a new string is created in the pool with one reference.
[in] | str | String to be poolified. |
[in] | take | Nonzero if the caller no longer needs str; in this case, the pool will eventually call g_free(str). |
Definition at line 32 of file stringpool.c.
Referenced by describe_song(), set_string(), and tuple_copy_value().
void stringpool_unref | ( | gchar * | str | ) |
Unreference a pooled string.
When there are no references left, the string is unallocated and removed from the pool.
[in] | str | Pointer to a string in the pool. |
Definition at line 67 of file stringpool.c.
Referenced by entry_free(), entry_set_tuple_real(), tuple_associate_data(), and tuple_value_destroy().
GStaticMutex stringpool_mutex = G_STATIC_MUTEX_INIT [static] |
Definition at line 27 of file stringpool.c.
Referenced by stringpool_get(), and stringpool_unref().
mowgli_patricia_t* stringpool_tree = NULL [static] |
Definition at line 26 of file stringpool.c.
Referenced by stringpool_get(), and stringpool_unref().