From: Michael Schroeder Date: Fri, 17 Feb 2012 17:05:25 +0000 (+0100) Subject: - made parts of Pool private, removed inline from solv_chksum_len so that we can... X-Git-Tag: BASE-SuSE-Code-12_2-Branch~158 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee69e96eec833153d0bb75b03191d258a603e258;p=platform%2Fupstream%2Flibsolv.git - made parts of Pool private, removed inline from solv_chksum_len so that we can easily add new checksum types --- diff --git a/src/chksum.c b/src/chksum.c index c69a350..2c6fa3e 100644 --- a/src/chksum.c +++ b/src/chksum.c @@ -54,6 +54,22 @@ solv_chksum_create(Id type) return 0; } +int +solv_chksum_len(Id type) +{ + switch (type) + { + case REPOKEY_TYPE_MD5: + return 16; + case REPOKEY_TYPE_SHA1: + return 20; + case REPOKEY_TYPE_SHA256: + return 32; + default: + return 0; + } +} + void * solv_chksum_create_from_bin(Id type, const unsigned char *buf) { diff --git a/src/chksum.h b/src/chksum.h index 4265a92..0239844 100644 --- a/src/chksum.h +++ b/src/chksum.h @@ -19,20 +19,6 @@ const unsigned char *solv_chksum_get(void *handle, int *lenp); void *solv_chksum_free(void *handle, unsigned char *cp); const char *solv_chksum_type2str(Id type); Id solv_chksum_str2type(const char *str); - -static inline int solv_chksum_len(Id type) -{ - switch (type) - { - case REPOKEY_TYPE_MD5: - return 16; - case REPOKEY_TYPE_SHA1: - return 20; - case REPOKEY_TYPE_SHA256: - return 32; - default: - return 0; - } -} +int solv_chksum_len(Id type); #endif /* LIBSOLV_CHKSUM_H */ diff --git a/src/libsolv.ver b/src/libsolv.ver index 568b3ca..49d52d8 100644 --- a/src/libsolv.ver +++ b/src/libsolv.ver @@ -214,6 +214,7 @@ SOLV_1.0 { solv_chksum_get; solv_chksum_get_type; solv_chksum_isfinished; + solv_chksum_len; solv_chksum_str2type; solv_chksum_type2str; solv_dupappend; diff --git a/src/pool.h b/src/pool.h index 20de966..f67979f 100644 --- a/src/pool.h +++ b/src/pool.h @@ -65,8 +65,6 @@ struct _Pool { Reldep *rels; /* table of rels: Id -> Reldep */ int nrels; /* number of unique rels */ - Hashtable relhashtbl; /* hashtable: (name,evr,op)Hash -> Id */ - Hashmask relhashmask; struct _Repo **repos; int nrepos; /* repos allocated */ @@ -79,8 +77,6 @@ struct _Pool { const char **languages; int nlanguages; - Id *languagecache; - int languagecacheother; /* package manager type, deb/rpm */ int disttype; @@ -102,7 +98,7 @@ struct _Pool { /* providers data, as two-step indirect list * whatprovides[Id] -> Offset into whatprovidesdata for name - * whatprovidesdata[Offset] -> ID_NULL-terminated list of solvables providing Id + * whatprovidesdata[Offset] -> 0-terminated list of solvables providing Id */ Offset *whatprovides; /* Offset to providers of a specific name, Id -> Offset */ Offset *whatprovides_rel; /* Offset to providers of a specific relation, Id -> Offset */ @@ -119,9 +115,6 @@ struct _Pool { Id (*nscallback)(struct _Pool *, void *data, Id name, Id evr); void *nscallbackdata; - /* our tmp space string space */ - struct _Pool_tmpspace tmpspace; - /* debug mask and callback */ int debugmask; void (*debugcallback)(struct _Pool *, void *data, int type, const char *str); @@ -133,6 +126,19 @@ struct _Pool { /* search position */ Datapos pos; + +#ifdef LIBSOLV_INTERNAL + /* hash for rel unification */ + Hashtable relhashtbl; /* hashtable: (name,evr,op)Hash -> Id */ + Hashmask relhashmask; + + Id *languagecache; + int languagecacheother; + + /* our tmp space string space */ + struct _Pool_tmpspace tmpspace; +#endif + }; #define DISTTYPE_RPM 0