+static int zpm_sqlite_vercmp(void *not_used, int unknown, const void *a,
+ int unk2, const void *b) {
+ /* not sure what the ints are, possibly string lengths */
+ not_used = 0; /* suppress warning */
+ unknown = 0; /* suppress warning */
+ unk2 = 0;
+ return zpm_vercmp(a, b);
+}
+
+int zpm_addvercmp(struct zpm *pkg) {
+ return sqlite3_create_collation(
+ pkg->db, "vercmp", SQLITE_UTF8, NULL,
+ zpm_sqlite_vercmp
+ );
+}
+