satsolver  0.17.2
evr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7 
8 /*
9  * evr.h
10  *
11  */
12 
13 #ifndef SATSOLVER_EVR_H
14 #define SATSOLVER_EVR_H
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #include "pooltypes.h"
21 
22 #define EVRCMP_COMPARE 0
23 #define EVRCMP_MATCH_RELEASE 1
24 #define EVRCMP_MATCH 2
25 #define EVRCMP_COMPARE_EVONLY 3
26 
27 extern int sat_vercmp(const char *s1, const char *q1, const char *s2, const char *q2);
28 
29 extern int pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode);
30 extern int pool_evrcmp(const Pool *pool, Id evr1id, Id evr2id, int mode);
31 extern int pool_evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version, const char *release);
32 
33 /* obsolete, do not use in new code */
34 static inline int vercmp(const char *s1, const char *q1, const char *s2, const char *q2)
35 {
36  return sat_vercmp(s1, q1, s2, q2);
37 }
38 static inline int evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode)
39 {
40  return pool_evrcmp_str(pool, evr1, evr2, mode);
41 }
42 static inline int evrcmp(const Pool *pool, Id evr1id, Id evr2id, int mode)
43 {
44  return pool_evrcmp(pool, evr1id, evr2id, mode);
45 }
46 static inline int evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version, const char *release)
47 {
48  return pool_evrmatch(pool, evrid, epoch, version, release);
49 }
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 #endif /* SATSOLVER_EVR_H */