7 char *path; /* path to package file */
11 time_t installed; /* install time, 0 for not installed */
21 struct zpm_file *next; /* so you can make a linked list */
25 int zpm_open(struct zpm *pkg, char *path);
26 int zpm_pkgname(char *base, char *version, int release); /* construct a package file name */
28 /* flags for preserving mode, owner, etc */
29 /* puts hash of import in hash */
30 /* path can be a hash, with an "INTERNAL" flag, i.e. internally import */
34 #define ZPM_INTERNAL 0x8
35 #define ZPM_NOBLOB 0x10
36 /* don't run scripts on install */
37 #define ZPM_NOSCRIPTS 0x10
38 /* don't import file to a particular package */
39 #define ZPM_NOPACKAGE 0x20
41 int zpm_import(struct zpm *zp, char *path, uint32_t flags, char *hash);
43 /* tag a file. relative to "current package" */
44 int zpm_tag(struct zpm *zp, char *path, char *tags);
45 /* should this be broken up into separage functions ? */
46 int zpm_md(struct zpm *zp, char *path, int mode, char *owner, char *group, time_t mtime);
48 /* export hash to dest */
49 int zpm_extract(struct zpm *pkg, char *hash, char *path, int mode);
51 /* export path to dest */
52 int zpm_export(struct zpm *zp, char *path, uint32_t flags, char *dest);
54 int zpm_close(struct zpm *zp);
56 /* attach a signature to a package */
57 int zpm_sign(struct zpm *z, size_t s, void *signature);
59 /* set the package info to the nth package, -1 to return count? */
60 /* further import/exports and such will be relative to this package */
61 int zpm_package(struct zpm *zp, int n);
63 /* get file information */
64 int zpm_stat(struct zpm *z, struct zpm_file *f, int n);
66 /* will also set the package context to the new package */
67 int zpm_newpkg(struct zpm *z, char *base, char *version, int release);
70 int zpm_begin(struct zpm *z);
71 int zpm_commit(struct zpm *z);
72 int zpm_rollback(struct zpm *z);
74 /* higher level operations */
76 /* install or uninstall the package */
77 /* flag for keeping the blobs in local */
78 /* what about tag filtering */
79 int zpm_install(struct zpm *z, struct zpm *local, uint32_t flags);
80 int zpm_uninstall(struct zpm *local);
82 /* slurp up the actual blobs */
83 /* what about versioning them if they change */
84 int zpm_preserve(struct zpm *local);
86 /* check file integrity */
87 int zpm_checkinstall(struct zpm *local);
89 int zpm_merge(struct zpm *z, struct zpm *src, uint32_t flags);
91 void uncompresslzma(void *buf, size_t bufsize, FILE *out);
92 void *compresslzma(void *buf, size_t bufsize, size_t *len);
93 #define SQLERROR(x) fprintf(stderr, "%s %d: %s\n", __func__, __LINE__, (x))