+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_package_hash(struct zpm *zpm, char *pkgid, char *hash);
+int zpm_package_sethash(struct zpm *zpm, char *pkgid, char *hash);
+
+sqlite3_stmt *zpm_dbqueryv(struct zpm *zpm, char *query, va_list args);
+sqlite3_stmt *zpm_dbquery(struct zpm *zpm, char *query, ...);
+char *zpm_db_string(struct zpm *zpm, char *query, ...);
+int zpm_db_int(struct zpm *zpm, char *query, ...);
+void zpm_db_run(struct zpm *zpm, char *query, ...);
+void zpm_seterror(struct zpm *zpm, char *msgfmt, ...);
+
+struct zpm *zpm_clearmem(struct zpm *zpm);
+
+struct zpm_note {
+ int64_t id;
+ time_t ts; /* or timespec */
+ char *note;
+ char *pkgid;
+ char *path;
+ char *file;
+ char *hash;
+ int ack;
+};