#include <time.h>
#include <limits.h>
#include <stdarg.h>
+#include <sys/types.h>
#include <sqlite3.h>
int zpm_md(struct zpm *zp, char *path, int mode, char *owner, char *group, time_t mtime);
/* export hash to dest */
-int zpm_extract(struct zpm *pkg, char *hash, char *path, int mode);
+int zpm_extract(struct zpm *pkg, char *hash, char *path, mode_t mode);
/* export path to dest */
int zpm_export(struct zpm *zp, char *path, uint32_t flags, char *dest);
int zpm_merge(struct zpm *z, struct zpm *src, uint32_t flags);
-#if 1
-void uncompresslzma(void *buf, size_t bufsize, FILE *out);
+ssize_t uncompresslzma(void *buf, size_t bufsize, int outfd);
void *compresslzma(void *buf, size_t bufsize, size_t *len);
-#endif
#define SQLERROR(x) fprintf(stderr, "%s %d: %s\n", __func__, __LINE__, (x))
int zpm_hash(char *path, char *hash, uint32_t flags);
int (*callback)(void *f, int ncols, char **vals, char **cols),
void *data, char **errmsg);
-
int zpm_script_hash(struct zpm *zpm, char *pkgstr, char *phase, char *hash);
+int zpm_script_set(struct zpm *zpm, char *pkgstr, char *phase, char *hash);
+
int zpm_package_hash(struct zpm *zpm, char *pkgid, char *hash);
int zpm_package_sethash(struct zpm *zpm, char *pkgid, char *hash);