+void pkg_deinit(pkg_t * pkg);
+int pkg_init_from_file(pkg_t * pkg, const char *filename);
+
+void *pkg_set_raw(pkg_t *pkg, int id, const void *val, size_t len);
+void *pkg_get_raw(const pkg_t *pkg, int id);
+
+static inline int pkg_set_int(pkg_t *pkg, int id, int val)
+{
+ return (intptr_t) pkg_set_raw(pkg, id, &val, sizeof(val));
+}
+
+static inline int pkg_get_int(const pkg_t *pkg, int id)
+{
+ return (intptr_t) pkg_get_raw(pkg, id);
+}
+
+char *pkg_set_string(pkg_t *pkg, int id, const char *s);
+
+static inline char *pkg_get_string(const pkg_t *pkg, int id)
+{
+ return (char *) pkg_get_raw(pkg, id);
+}
+
+static inline void * pkg_set_ptr(pkg_t *pkg, int id, void *ptr)
+{
+ void **res = pkg_set_raw(pkg, id, &ptr, sizeof(ptr));
+ return res ? *res : NULL;
+}
+
+static inline void * pkg_get_ptr(const pkg_t *pkg, int id)
+{
+ void **ptr = pkg_get_raw(pkg, id);
+ return ptr ? *ptr : NULL;
+}
+
+char *pkg_set_architecture(pkg_t *pkg, const char *architecture, ssize_t len);
+char *pkg_get_architecture(const pkg_t *pkg);
+int pkg_get_arch_priority(const pkg_t *pkg);
+
+char *pkg_get_md5(const pkg_t *pkg);
+char *pkg_set_md5(pkg_t *pkg, const char *cksum);
+
+char *pkg_get_sha256(const pkg_t *pkg);
+char *pkg_set_sha256(pkg_t *pkg, const char *cksum);
+