support -X option in rpmmd2solv, make add_autopattern available in bindings
[platform/upstream/libsolv.git] / src / repodata.h
index 0e622a6..ad05525 100644 (file)
@@ -7,13 +7,13 @@
 
 /*
  * repodata.h
- * 
+ *
  */
 
 #ifndef LIBSOLV_REPODATA_H
 #define LIBSOLV_REPODATA_H
 
-#include <stdio.h> 
+#include <stdio.h>
 
 #include "pooltypes.h"
 #include "pool.h"
 #include "repopage.h"
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define SIZEOF_MD5     16
 #define SIZEOF_SHA1    20
+#define SIZEOF_SHA224  28
 #define SIZEOF_SHA256  32
+#define SIZEOF_SHA384  48
+#define SIZEOF_SHA512  64
 
 struct _Repo;
 struct _KeyValue;
@@ -96,6 +103,7 @@ typedef struct _Repodata {
   Id lastverticaloffset;       /* end of verticals */
 
   Repopagestore store;         /* our page store */
+  Id storestate;               /* incremented every time the store might change */
 
   unsigned char *vincore;      /* internal vertical data */
   unsigned int vincorelen;     /* data size */
@@ -190,9 +198,9 @@ repodata_has_keyname(Repodata *data, Id keyname)
  * Call <callback> for each match */
 void repodata_search(Repodata *data, Id solvid, Id keyname, int flags, int (*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, struct _KeyValue *kv), void *cbdata);
 
-/* Make sure the found KeyValue has the "str" field set. Return false
- * if not possible */
-int repodata_stringify(Pool *pool, Repodata *data, Repokey *key, struct _KeyValue *kv, int flags);
+/* Make sure the found KeyValue has the "str" field set. Return "str"
+ * if valid, NULL if not possible */
+const char *repodata_stringify(Pool *pool, Repodata *data, Repokey *key, struct _KeyValue *kv, int flags);
 
 int repodata_filelistfilter_matches(Repodata *data, const char *str);
 
@@ -201,10 +209,11 @@ int repodata_filelistfilter_matches(Repodata *data, const char *str);
 Id repodata_lookup_type(Repodata *data, Id solvid, Id keyname);
 Id repodata_lookup_id(Repodata *data, Id solvid, Id keyname);
 const char *repodata_lookup_str(Repodata *data, Id solvid, Id keyname);
-int repodata_lookup_num(Repodata *data, Id solvid, Id keyname, unsigned int *value);
+int repodata_lookup_num(Repodata *data, Id solvid, Id keyname, unsigned long long *value);
 int repodata_lookup_void(Repodata *data, Id solvid, Id keyname);
 const unsigned char *repodata_lookup_bin_checksum(Repodata *data, Id solvid, Id keyname, Id *typep);
 int repodata_lookup_idarray(Repodata *data, Id solvid, Id keyname, Queue *q);
+const void *repodata_lookup_binary(Repodata *data, Id solvid, Id keyname, int *lenp);
 
 
 /*-----
@@ -229,7 +238,7 @@ Id repodata_new_handle(Repodata *data);
 
 /* basic types: void, num, string, Id */
 void repodata_set_void(Repodata *data, Id solvid, Id keyname);
-void repodata_set_num(Repodata *data, Id solvid, Id keyname, unsigned int num);
+void repodata_set_num(Repodata *data, Id solvid, Id keyname, unsigned long long num);
 void repodata_set_id(Repodata *data, Id solvid, Id keyname, Id id);
 void repodata_set_str(Repodata *data, Id solvid, Id keyname, const char *str);
 void repodata_set_binary(Repodata *data, Id solvid, Id keyname, void *buf, int len);
@@ -262,10 +271,10 @@ void repodata_add_poolstr_array(Repodata *data, Id solvid, Id keyname, const cha
 void repodata_add_fixarray(Repodata *data, Id solvid, Id keyname, Id ghandle);
 void repodata_add_flexarray(Repodata *data, Id solvid, Id keyname, Id ghandle);
 
-void repodata_delete(Repodata *data, Id solvid, Id keyname);
-void repodata_delete_uninternalized(Repodata *data, Id solvid, Id keyname);
+void repodata_unset(Repodata *data, Id solvid, Id keyname);
+void repodata_unset_uninternalized(Repodata *data, Id solvid, Id keyname);
 
-/* 
+/*
  merge/swap attributes from one solvable to another
  works only if the data is not yet internalized
 */
@@ -273,8 +282,7 @@ void repodata_merge_attrs(Repodata *data, Id dest, Id src);
 void repodata_merge_some_attrs(Repodata *data, Id dest, Id src, Map *keyidmap, int overwrite);
 void repodata_swap_attrs(Repodata *data, Id dest, Id src);
 
-void repodata_create_stubs(Repodata *data);
-void repodata_join(Repodata *data, Id joinkey);
+Repodata *repodata_create_stubs(Repodata *data);
 
 /*
  * load all paged data, used to speed up copying in repo_rpmdb
@@ -284,13 +292,21 @@ void repodata_disable_paging(Repodata *data);
 /* helper functions */
 Id repodata_globalize_id(Repodata *data, Id id, int create);
 Id repodata_localize_id(Repodata *data, Id id, int create);
+Id repodata_translate_id(Repodata *data, Repodata *fromdata, Id id, int create);
+
 Id repodata_str2dir(Repodata *data, const char *dir, int create);
 const char *repodata_dir2str(Repodata *data, Id did, const char *suf);
 const char *repodata_chk2str(Repodata *data, Id type, const unsigned char *buf);
 void repodata_set_location(Repodata *data, Id solvid, int medianr, const char *dir, const char *file);
+void repodata_set_deltalocation(Repodata *data, Id handle, int medianr, const char *dir, const char *file);
+void repodata_set_sourcepkg(Repodata *data, Id solvid, const char *sourcepkg);
 Id repodata_lookup_id_uninternalized(Repodata *data, Id solvid, Id keyname, Id voidid);
 
 /* stats */
 unsigned int repodata_memused(Repodata *data);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* LIBSOLV_REPODATA_H */