10 char *path; /* path to package file */
14 int error; /* internal error number */
15 time_t installed; /* install time, 0 for not installed */
25 struct zpm_file *next; /* so you can make a linked list */
29 int zpm_open(struct zpm *pkg, char *path);
30 int zpm_pkgname(char *base, char *version, int release); /* construct a package file name */
32 /* flags for preserving mode, owner, etc */
33 /* puts hash of import in hash */
34 /* path can be a hash, with an "INTERNAL" flag, i.e. internally import */
38 #define ZPM_INTERNAL 0x8
39 #define ZPM_NOBLOB 0x10
40 /* don't run scripts on install */
41 #define ZPM_NOSCRIPTS 0x10
42 /* don't import file to a particular package */
43 #define ZPM_NOPACKAGE 0x20
45 int zpm_import(struct zpm *zp, char *path, uint32_t flags, char *hash);
47 /* tag a file. relative to "current package" */
48 int zpm_tag(struct zpm *zp, char *path, char *tags);
49 /* should this be broken up into separage functions ? */
50 int zpm_md(struct zpm *zp, char *path, int mode, char *owner, char *group, time_t mtime);
52 /* export hash to dest */
53 int zpm_extract(struct zpm *pkg, char *hash, char *path, int mode);
55 /* export path to dest */
56 int zpm_export(struct zpm *zp, char *path, uint32_t flags, char *dest);
58 int zpm_close(struct zpm *zp);
60 /* attach a signature to a package */
61 int zpm_sign(struct zpm *z, size_t s, void *signature);
63 /* set the package info to the nth package, -1 to return count? */
64 /* further import/exports and such will be relative to this package */
65 int zpm_package(struct zpm *zp, int n);
67 /* get file information */
68 int zpm_stat(struct zpm *z, struct zpm_file *f, int n);
70 /* will also set the package context to the new package */
71 int zpm_newpkg(struct zpm *z, char *base, char *version, int release);
74 int zpm_begin(struct zpm *z);
75 int zpm_commit(struct zpm *z);
76 int zpm_rollback(struct zpm *z);
78 /* higher level operations */
80 /* install or uninstall the package */
81 /* flag for keeping the blobs in local */
82 /* what about tag filtering */
83 int zpm_install(struct zpm *z, struct zpm *local, uint32_t flags);
84 int zpm_uninstall(struct zpm *local);
86 /* slurp up the actual blobs */
87 /* what about versioning them if they change */
88 int zpm_preserve(struct zpm *local);
90 /* check file integrity */
91 int zpm_checkinstall(struct zpm *local);
93 int zpm_merge(struct zpm *z, struct zpm *src, uint32_t flags);
95 void uncompresslzma(void *buf, size_t bufsize, FILE *out);
96 void *compresslzma(void *buf, size_t bufsize, size_t *len);
97 #define SQLERROR(x) fprintf(stderr, "%s %d: %s\n", __func__, __LINE__, (x))
98 int zpm_hash(char *path, char *hash, uint32_t flags);
99 int zpm_readopts(struct zpm *pkg, int ac, char **av);
101 int zpm_vercmp(const char *a, const char *b);
103 /* add vercmp collation to db */
104 int zpm_addvercmp(struct zpm *pkg);
106 int zpm_exec(struct zpm *z, const char *sql, int(*callback)(void *, int, char **, char**), void *arg, char **errmsg);