rpm  5.4.15
set.h
Go to the documentation of this file.
1 #ifndef SET_H
2 #define SET_H
3 
4 extern int _rpmset_debug;
5 
6 typedef /*@refcounted@*/ struct set * rpmset;
7 
8 #if defined(_RPMSET_INTERNAL)
9 /* Internally, "struct set" is just a bag of strings and their hash values. */
10 struct set {
11  struct rpmioItem_s _item;
12  int c;
13  struct sv {
14  const char *s;
15  unsigned v;
16  } *sv;
17 #if defined(__LCLINT__)
18 /*@refs@*/
19  int nrefs;
20 #endif
21 };
22 #endif
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
33 /*@unused@*/ /*@null@*/
34 rpmset rpmsetUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmset set)
35  /*@modifies set @*/;
36 #define rpmsetUnlink(_set) \
37  ((rpmset)rpmioUnlinkPoolItem((rpmioItem)(_set), __FUNCTION__, __FILE__, __LINE__))
38 
44 /*@unused@*/ /*@newref@*/ /*@null@*/
45 rpmset rpmsetLink (/*@null@*/ rpmset set)
46  /*@modifies set @*/;
47 #define rpmsetLink(_set) \
48  ((rpmset)rpmioLinkPoolItem((rpmioItem)(_set), __FUNCTION__, __FILE__, __LINE__))
49 
55 /*@null@*/
56 rpmset rpmsetFree(/*@killref@*/ /*@null@*/rpmset set)
57  /*@globals fileSystem @*/
58  /*@modifies set, fileSystem @*/;
59 #define rpmsetFree(_set) \
60  ((rpmset)rpmioFreePoolItem((rpmioItem)(_set), __FUNCTION__, __FILE__, __LINE__))
61 
68 /*@newref@*/ /*@null@*/
69 rpmset rpmsetNew(const char * fn, int flags)
70  /*@globals fileSystem, internalState @*/
71  /*@modifies fileSystem, internalState @*/;
72 
76 void rpmsetAdd(rpmset set, const char * sym)
77  /*@*/;
78 
82 const char * rpmsetFinish(rpmset set, int bpp)
83  /*@*/;
84 
85 /* Compare two set-versions.
86  * Return value:
87  * 1: set1 > set2
88  * 0: set1 == set2
89  * -1: set1 < set2 (aka set1 \subset set2)
90  * -2: set1 != set2
91  * -3: set1 decoder error
92  * -4: set2 decoder error
93  * For performance reasons, set1 should come on behalf of Provides.
94  */
95 int rpmsetCmp(const char * set1, const char * set2)
96  /*@*/;
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif
int _rpmset_debug
Definition: set.c:24
void rpmsetAdd(rpmset set, const char *sym)
Add new symbol to set.
Definition: set.c:1334
struct set * rpmset
Definition: set.h:6
#define rpmsetFree(_set)
Definition: set.h:59
const char const bson_bool_t v
Definition: bson.h:919
#define rpmsetUnlink(_set)
Definition: set.h:36
const char const bson int mongo_write_concern int flags
Definition: mongo.h:485
#define rpmsetLink(_set)
Definition: set.h:47
static void set(char *t, NODE *ip)
Definition: rpmmtree.c:1408
const char * rpmsetFinish(rpmset set, int bpp)
Make set-version.
Definition: set.c:1387
rpmset rpmsetNew(const char *fn, int flags)
Create and load a set wrapper.
Definition: set.c:1327
int rpmsetCmp(const char *set1, const char *set2)
Definition: set.c:1113