X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fstrpool.h;h=f96c5c18a38f01f823161e784b1e6e3775af5a4c;hb=0e46e80434781d1acbc4f5716827bf8688450a30;hp=3845ced4cb0044978b28cd4cc5f42e22304df498;hpb=e1e59a9e7325923e98268b6dfce5ef2b1aa9def9;p=platform%2Fupstream%2Flibsolv.git diff --git a/src/strpool.h b/src/strpool.h index 3845ced..f96c5c1 100644 --- a/src/strpool.h +++ b/src/strpool.h @@ -4,24 +4,28 @@ * This program is licensed under the BSD license, read LICENSE.BSD * for further information */ -#ifndef SATSOLVER_STRINGPOOL_H -#define SATSOLVER_STRINGPOOL_H +#ifndef LIBSOLV_STRINGPOOL_H +#define LIBSOLV_STRINGPOOL_H #include "pooltypes.h" #include "hash.h" +#ifdef __cplusplus +extern "C" { +#endif + #define STRID_NULL 0 #define STRID_EMPTY 1 struct _Stringpool { - Offset *strings; // table of offsets into stringspace, indexed by Id: Id -> Offset - int nstrings; // number of unique strings in stringspace - char *stringspace; // space for all unique strings: stringspace + Offset = string - Offset sstrings; // next free pos in stringspace + Offset *strings; /* table of offsets into stringspace, indexed by Id: Id -> Offset */ + int nstrings; /* number of ids in strings table */ + char *stringspace; /* space for all unique strings: stringspace + Offset = string */ + Offset sstrings; /* size of used stringspace */ - Hashtable stringhashtbl; // hash table: (string ->) Hash -> Id - Hashmask stringhashmask; // modulo value for hash table (size of table - 1) + Hashtable stringhashtbl; /* hash table: (string ->) Hash -> Id */ + Hashval stringhashmask; /* modulo value for hash table (size of table - 1) */ }; void stringpool_init(Stringpool *ss, const char *strs[]); @@ -29,6 +33,7 @@ void stringpool_init_empty(Stringpool *ss); void stringpool_clone(Stringpool *ss, Stringpool *from); void stringpool_free(Stringpool *ss); void stringpool_freehash(Stringpool *ss); +void stringpool_resize_hash(Stringpool *ss, int numnew); Id stringpool_str2id(Stringpool *ss, const char *str, int create); Id stringpool_strn2id(Stringpool *ss, const char *str, unsigned int len, int create); @@ -42,4 +47,8 @@ stringpool_id2str(Stringpool *ss, Id id) return ss->stringspace + ss->strings[id]; } +#ifdef __cplusplus +} +#endif + #endif