X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm.h;h=98971c126bb64adc45deb0cea274c2949addbb00;hb=be765ec4d3dc14dd27826326e29da8a62d5603f7;hp=5fc450fd9f322b35b6d9fa400b03a637d9590fbd;hpb=86d735d52280359df4896d5c542ddfbe33d8df7b;p=zpackage diff --git a/zpm.h b/zpm.h index 5fc450f..98971c1 100644 --- a/zpm.h +++ b/zpm.h @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include "sqlite3.h" #include "lib/jsw/jsw_atree.h" @@ -41,6 +43,14 @@ struct zpm { struct zpm_package *current_package; }; +struct zpm_stat { + struct stat st; + int configuration; + char hash[65]; /* length + room for a nul byte */ + char diskhash[65]; /* hash of actual file on disk */ + char *target; /* malloced link target */ +}; + struct zpm_dependency { char minpkg[ZPM_PACKAGE_ID_MAX+1]; char maxpkg[ZPM_PACKAGE_ID_MAX+1]; @@ -78,9 +88,11 @@ struct zpm_package { int zpm_parse_package(char *pstr, char *name, char *ver, int *rel); char *zpm_findpkg(struct zpm *zpm, char *pkgstr, char *where); +char *zpm_findpkg_range(struct zpm *zpm, char *minpkg, char *maxpkg, char *where, int wantleast); int zpm_findhash(struct zpm *zpm, char *find, char *dest); 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_packages_needed(struct zpm *zpm, char *pkgid, jsw_atree_t *list); int zpm_quote(char *value, char *dest, size_t n); struct zpm_file { @@ -186,6 +198,15 @@ void *compresslzma(void *buf, size_t bufsize, size_t *len); int zpm_hash(char *path, char *hash, uint32_t flags); int zpm_readopts(struct zpm *pkg, int ac, char **av); +struct zpm_version_info { + const char *verstr; + const char *name; int namelen; + const char *version; int verlen; + const char *relstr; int rellen; + int release; +}; + +int zpm_parse_version(const char *pstr, struct zpm_version_info *info); int zpm_vercmp(const char *a, const char *b); /* add vercmp collation to db */