#include <string.h>
#include "util.h"
#include "strpool.h"
Go to the source code of this file.
Defines | |
#define | STRING_BLOCK 2047 |
#define | STRINGSPACE_BLOCK 65535 |
Functions | |
void | stringpool_init (Stringpool *ss, const char *strs[]) |
void | stringpool_free (Stringpool *ss) |
void | stringpool_freehash (Stringpool *ss) |
void | stringpool_init_empty (Stringpool *ss) |
void | stringpool_clone (Stringpool *ss, Stringpool *from) |
Id | stringpool_strn2id (Stringpool *ss, const char *str, unsigned int len, int create) |
Id | stringpool_str2id (Stringpool *ss, const char *str, int create) |
void | stringpool_shrink (Stringpool *ss) |
#define STRING_BLOCK 2047 |
Definition at line 12 of file strpool.c.
Referenced by stringpool_clone(), stringpool_init(), stringpool_shrink(), and stringpool_strn2id().
#define STRINGSPACE_BLOCK 65535 |
Definition at line 13 of file strpool.c.
Referenced by stringpool_clone(), stringpool_init(), stringpool_shrink(), and stringpool_strn2id().
void stringpool_init | ( | Stringpool * | ss, | |
const char * | strs[] | |||
) |
Definition at line 16 of file strpool.c.
References _Stringpool::nstrings, sat_extend_resize(), _Stringpool::sstrings, STRING_BLOCK, _Stringpool::strings, _Stringpool::stringspace, and STRINGSPACE_BLOCK.
Referenced by pool_create(), and stringpool_init_empty().
void stringpool_free | ( | Stringpool * | ss | ) |
Definition at line 42 of file strpool.c.
References sat_free(), _Stringpool::stringhashtbl, _Stringpool::strings, and _Stringpool::stringspace.
Referenced by pool_free(), and repodata_freedata().
void stringpool_freehash | ( | Stringpool * | ss | ) |
Definition at line 50 of file strpool.c.
References sat_free(), _Stringpool::stringhashmask, and _Stringpool::stringhashtbl.
Referenced by pool_freeidhashes().
void stringpool_init_empty | ( | Stringpool * | ss | ) |
Definition at line 57 of file strpool.c.
References stringpool_init().
Referenced by repodata_initdata().
void stringpool_clone | ( | Stringpool * | ss, | |
Stringpool * | from | |||
) |
Definition at line 68 of file strpool.c.
References _Stringpool::nstrings, sat_extend_resize(), _Stringpool::sstrings, STRING_BLOCK, _Stringpool::strings, _Stringpool::stringspace, and STRINGSPACE_BLOCK.
Id stringpool_strn2id | ( | Stringpool * | ss, | |
const char * | str, | |||
unsigned int | len, | |||
int | create | |||
) |
Definition at line 80 of file strpool.c.
References HASHCHAIN_NEXT, HASHCHAIN_START, mkmask(), _Stringpool::nstrings, sat_calloc(), sat_extend(), sat_free(), _Stringpool::sstrings, strhash(), STRID_EMPTY, STRID_NULL, STRING_BLOCK, _Stringpool::stringhashmask, _Stringpool::stringhashtbl, _Stringpool::strings, _Stringpool::stringspace, STRINGSPACE_BLOCK, and strnhash().
Referenced by repodata_str2dir(), stringpool_str2id(), and strn2id().
Id stringpool_str2id | ( | Stringpool * | ss, | |
const char * | str, | |||
int | create | |||
) |
Definition at line 148 of file strpool.c.
References STRID_EMPTY, STRID_NULL, and stringpool_strn2id().
Referenced by repodata_add_poolstr_array(), repodata_set_poolstr(), and str2id().
void stringpool_shrink | ( | Stringpool * | ss | ) |
Definition at line 158 of file strpool.c.
References _Stringpool::nstrings, sat_extend_resize(), _Stringpool::sstrings, STRING_BLOCK, _Stringpool::strings, _Stringpool::stringspace, and STRINGSPACE_BLOCK.
Referenced by pool_shrink_strings().