X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm.h;h=f8ce56bf598609efb4388da4379c1c8e722e8a3f;hb=43308b3c6fba1bcb7f4b10e67736cd981ed23540;hp=c7144649940bfd6bbf8008732a480d4f646a85ef;hpb=383712eefa950c5dc619f8cd5fb60be8e8041502;p=zpackage diff --git a/zpm.h b/zpm.h index c714464..f8ce56b 100644 --- a/zpm.h +++ b/zpm.h @@ -6,8 +6,10 @@ #include #include #include +#include #include +#include #define ZPM_HASH_STRLEN 64 @@ -52,7 +54,7 @@ struct zpm_tag { struct zpm_package { struct zpm *zpm; - struct jsw_hash *ht; + struct jsw_hash_t *ht; /* char pointers are just pointers into the hash table */ /* integers/times and such are passed through atoi */ @@ -75,7 +77,9 @@ struct zpm_package { }; int zpm_parse_package(char *pstr, char *name, char *ver, int *rel); -char *zpm_findpkg(struct zpm *zpm, char *pkgstr); +char *zpm_findpkg(struct zpm *zpm, char *pkgstr, char *where); +char *zpm_findlib(struct zpm *zpm, char *soname, char *where); +int zpm_libraries_needed(struct zpm *zpm, char *pkgid, jsw_atree_t *list); int zpm_quote(char *value, char *dest, size_t n); struct zpm_file { @@ -114,7 +118,7 @@ int zpm_tag(struct zpm *zp, char *path, char *tags); 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); @@ -156,10 +160,8 @@ int zpm_checkinstall(struct zpm *local); 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); @@ -175,9 +177,15 @@ int zpm_exec(struct zpm *z, const char *sql, int(*callback)(void *, int, char ** int zpm_foreach_path(struct zpm *zpm, char *pkgid, char *where, int (*callback)(void *f, int ncols, char **vals, char **cols), void *data, char **errmsg); - +int zpm_foreach_package(struct zpm *zpm, char *where, +int (*callback)(void *cbdata, 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_foreach_script(struct zpm *zpm, char *pkgstr, char *stage, void *cbd, + int (*cb)(void *ud, const char *pkg, const char *stage, const char *hash)); + int zpm_package_hash(struct zpm *zpm, char *pkgid, char *hash); int zpm_package_sethash(struct zpm *zpm, char *pkgid, char *hash);