poolid.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2007, Novell Inc.
00003  *
00004  * This program is licensed under the BSD license, read LICENSE.BSD
00005  * for further information
00006  */
00007 
00008 /*
00009  * poolid.h
00010  * 
00011  */
00012 
00013 #ifndef SATSOLVER_POOLID_H
00014 #define SATSOLVER_POOLID_H
00015 
00016 #include "pooltypes.h"
00017 #include "hash.h"
00018 
00019 /*-----------------------------------------------
00020  * Ids with relation
00021  */
00022 
00023 typedef struct _Reldep {
00024   Id name;              // "package"
00025   Id evr;               // "0:42-3"
00026   int flags;            // operation/relation, see REL_x in pool.h
00027 } Reldep;
00028 
00029 extern Id pool_str2id(Pool *pool, const char *, int);
00030 extern Id pool_strn2id(Pool *pool, const char *, unsigned int, int);
00031 extern Id pool_rel2id(Pool *pool, Id, Id, int, int);
00032 extern const char *pool_id2str(const Pool *pool, Id);
00033 extern const char *pool_id2rel(const Pool *pool, Id);
00034 extern const char *pool_id2evr(const Pool *pool, Id);
00035 extern const char *pool_dep2str(Pool *pool, Id); /* might alloc tmpspace */
00036 
00037 extern void pool_shrink_strings(Pool *pool);
00038 extern void pool_shrink_rels(Pool *pool);
00039 extern void pool_freeidhashes(Pool *pool);
00040 
00041 
00042 /* deprecated names, do not use in new code */
00043 static inline Id str2id(Pool *pool, const char *str, int create)
00044 {
00045   return pool_str2id(pool, str, create);
00046 }
00047 static inline Id strn2id(Pool *pool, const char *str, unsigned int len, int create)
00048 {
00049   return pool_strn2id(pool, str, len, create);
00050 }
00051 static inline Id rel2id(Pool *pool, Id name, Id evr, int flags, int create)
00052 {
00053   return pool_rel2id(pool, name, evr, flags, create);
00054 }
00055 static inline const char *id2str(const Pool *pool, Id id)
00056 {
00057   return pool_id2str(pool, id);
00058 }
00059 static inline const char *id2rel(const Pool *pool, Id id)
00060 {
00061   return pool_id2rel(pool, id);
00062 }
00063 static inline const char *id2evr(const Pool *pool, Id id)
00064 {
00065   return pool_id2evr(pool, id);
00066 }
00067 static inline const char *dep2str(Pool *pool, Id id)
00068 {
00069   return pool_dep2str(pool, id);
00070 }
00071 
00072 #endif /* SATSOLVER_POOLID_H */

Generated on Mon Dec 15 17:56:24 2014 for satsolver by  doxygen 1.5.6