2 * Copyright (c) 2007, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
13 #ifndef LIBSOLV_POOLID_H
14 #define LIBSOLV_POOLID_H
16 #include "pooltypes.h"
19 /*-----------------------------------------------
23 typedef struct _Reldep {
26 int flags; // operation/relation, see REL_x in pool.h
29 extern Id pool_str2id(Pool *pool, const char *, int);
30 extern Id pool_strn2id(Pool *pool, const char *, unsigned int, int);
31 extern Id pool_rel2id(Pool *pool, Id, Id, int, int);
32 extern const char *pool_id2str(const Pool *pool, Id);
33 extern const char *pool_id2rel(const Pool *pool, Id);
34 extern const char *pool_id2evr(const Pool *pool, Id);
35 extern const char *pool_dep2str(Pool *pool, Id); /* might alloc tmpspace */
37 extern void pool_shrink_strings(Pool *pool);
38 extern void pool_shrink_rels(Pool *pool);
39 extern void pool_freeidhashes(Pool *pool);
42 /* deprecated names, do not use in new code */
43 static inline Id str2id(Pool *pool, const char *str, int create)
45 return pool_str2id(pool, str, create);
47 static inline Id strn2id(Pool *pool, const char *str, unsigned int len, int create)
49 return pool_strn2id(pool, str, len, create);
51 static inline Id rel2id(Pool *pool, Id name, Id evr, int flags, int create)
53 return pool_rel2id(pool, name, evr, flags, create);
55 static inline const char *id2str(const Pool *pool, Id id)
57 return pool_id2str(pool, id);
59 static inline const char *id2rel(const Pool *pool, Id id)
61 return pool_id2rel(pool, id);
63 static inline const char *id2evr(const Pool *pool, Id id)
65 return pool_id2evr(pool, id);
67 static inline const char *dep2str(Pool *pool, Id id)
69 return pool_dep2str(pool, id);
72 #endif /* LIBSOLV_POOLID_H */