X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm.h;h=6cca0575c27c52d2a86e1df831806bfd326ad0f5;hb=62f6ff407bc4f2cf03d1fa7cf3dc9a3f4026624a;hp=106314e958356e40de4fbcea04f67bb42a35571b;hpb=c02e8d831122a804f675a2f106b2e23af235be58;p=zpackage diff --git a/zpm.h b/zpm.h index 106314e..6cca057 100644 --- a/zpm.h +++ b/zpm.h @@ -8,7 +8,8 @@ #include #include -#include +#include "sqlite3.h" +#include "lib/jsw/jsw_atree.h" #define ZPM_HASH_STRLEN 64 @@ -53,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 */ @@ -77,16 +78,36 @@ 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); +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_quote(char *value, char *dest, size_t n); struct zpm_file { - char path[ZPM_PATH_MAX]; - int mode; + char *package; + char *version; + int release; + + char *status; + char *path; + char *target; + + mode_t mode; + //struct zpm_tree *tags; - char owner[32]; - char group[32]; + + char *owner; + char *group; + gid_t gid; + uid_t uid; + + int configuration; time_t mtime; + char type; + dev_t device; char hash[ZPM_HASH_STRLEN+1]; + char confhash[ZPM_HASH_STRLEN+1]; + void *data; /* hook for applications to attach data */ struct zpm_file *next; /* so you can make a linked list */ }; @@ -174,6 +195,10 @@ 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_path_ds(struct zpm *zpm, char *pkgid, char *where, +int (*callback)(struct zpm *, struct zpm_file *, void *), void *cbd); + int zpm_foreach_package(struct zpm *zpm, char *where, int (*callback)(void *cbdata, int ncols, char **vals, char **cols), void *data, char **errmsg); @@ -197,7 +222,7 @@ struct zpm *zpm_clearmem(struct zpm *zpm); struct zpm_note { int64_t id; - time_t ts; /* or timespec */ + char *ts; /* applications can parse it if they need to */ char *note; char *pkgid; char *path;