diff options
author | Michael Schroeder <mls@suse.de> | 2011-07-12 14:08:07 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2011-07-12 14:08:07 +0200 |
commit | 09f29f706df0cf171ba7e7e8a3272388039630e4 (patch) | |
tree | 8751165a972da652b43bc1219ccc64cfdd3901e1 /src/strpool.c | |
parent | e29f9ccb48086b27462c751d1905ed3c5e703dfd (diff) | |
download | libsolv-09f29f706df0cf171ba7e7e8a3272388039630e4.tar.gz libsolv-09f29f706df0cf171ba7e7e8a3272388039630e4.tar.bz2 libsolv-09f29f706df0cf171ba7e7e8a3272388039630e4.zip |
- rename all sat_ to solv_
Diffstat (limited to 'src/strpool.c')
-rw-r--r-- | src/strpool.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/strpool.c b/src/strpool.c index d2c7a8a..0b47367 100644 --- a/src/strpool.c +++ b/src/strpool.c @@ -24,8 +24,8 @@ stringpool_init(Stringpool *ss, const char *strs[]) totalsize += strlen(strs[count]) + 1; // alloc appropriate space - ss->stringspace = sat_extend_resize(0, totalsize, 1, STRINGSPACE_BLOCK); - ss->strings = sat_extend_resize(0, count, sizeof(Offset), STRING_BLOCK); + ss->stringspace = solv_extend_resize(0, totalsize, 1, STRINGSPACE_BLOCK); + ss->strings = solv_extend_resize(0, count, sizeof(Offset), STRING_BLOCK); // now copy predefined strings into allocated space ss->sstrings = 0; @@ -41,15 +41,15 @@ stringpool_init(Stringpool *ss, const char *strs[]) void stringpool_free(Stringpool *ss) { - sat_free(ss->strings); - sat_free(ss->stringspace); - sat_free(ss->stringhashtbl); + solv_free(ss->strings); + solv_free(ss->stringspace); + solv_free(ss->stringhashtbl); } void stringpool_freehash(Stringpool *ss) { - ss->stringhashtbl = sat_free(ss->stringhashtbl); + ss->stringhashtbl = solv_free(ss->stringhashtbl); ss->stringhashmask = 0; } @@ -68,9 +68,9 @@ void stringpool_clone(Stringpool *ss, Stringpool *from) { memset(ss, 0, sizeof(*ss)); - ss->strings = sat_extend_resize(0, from->nstrings, sizeof(Offset), STRING_BLOCK); + ss->strings = solv_extend_resize(0, from->nstrings, sizeof(Offset), STRING_BLOCK); memcpy(ss->strings, from->strings, from->nstrings * sizeof(Offset)); - ss->stringspace = sat_extend_resize(0, from->sstrings, 1, STRINGSPACE_BLOCK); + ss->stringspace = solv_extend_resize(0, from->sstrings, 1, STRINGSPACE_BLOCK); memcpy(ss->stringspace, from->stringspace, from->sstrings); ss->nstrings = from->nstrings; ss->sstrings = from->sstrings; @@ -98,11 +98,11 @@ stringpool_strn2id(Stringpool *ss, const char *str, unsigned int len, int create // expand hashtable if needed if (ss->nstrings * 2 > hashmask) { - sat_free(hashtbl); + solv_free(hashtbl); // realloc hash table ss->stringhashmask = hashmask = mkmask(ss->nstrings + STRING_BLOCK); - ss->stringhashtbl = hashtbl = (Hashtable)sat_calloc(hashmask + 1, sizeof(Id)); + ss->stringhashtbl = hashtbl = (Hashtable)solv_calloc(hashmask + 1, sizeof(Id)); // rehash all strings into new hashtable for (i = 1; i < ss->nstrings; i++) @@ -133,11 +133,11 @@ stringpool_strn2id(Stringpool *ss, const char *str, unsigned int len, int create id = ss->nstrings++; hashtbl[h] = id; - ss->strings = sat_extend(ss->strings, id, 1, sizeof(Offset), STRING_BLOCK); + ss->strings = solv_extend(ss->strings, id, 1, sizeof(Offset), STRING_BLOCK); ss->strings[id] = ss->sstrings; /* we will append to the end */ // append string to stringspace - ss->stringspace = sat_extend(ss->stringspace, ss->sstrings, len + 1, 1, STRINGSPACE_BLOCK); + ss->stringspace = solv_extend(ss->stringspace, ss->sstrings, len + 1, 1, STRINGSPACE_BLOCK); memcpy(ss->stringspace + ss->sstrings, str, len); ss->stringspace[ss->sstrings + len] = 0; ss->sstrings += len + 1; @@ -157,6 +157,6 @@ stringpool_str2id(Stringpool *ss, const char *str, int create) void stringpool_shrink(Stringpool *ss) { - ss->stringspace = sat_extend_resize(ss->stringspace, ss->sstrings, 1, STRINGSPACE_BLOCK); - ss->strings = sat_extend_resize(ss->strings, ss->nstrings, sizeof(Offset), STRING_BLOCK); + ss->stringspace = solv_extend_resize(ss->stringspace, ss->sstrings, 1, STRINGSPACE_BLOCK); + ss->strings = solv_extend_resize(ss->strings, ss->nstrings, sizeof(Offset), STRING_BLOCK); } |