4 * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
5 * Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
6 * Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
29 /* Database entries */
30 typedef enum _pmdbinfrq_t
{
35 INFRQ_SCRIPTLET
= 0x10,
36 /* ALL should be sum of all above */
43 char treename
[PATH_MAX
];
45 alpm_list_t
*pkgcache
;
46 alpm_list_t
*grpcache
;
50 /* db.c, database general calls */
51 pmdb_t
*_alpm_db_new(const char *root
, const char *dbpath
, const char *treename
);
52 void _alpm_db_free(pmdb_t
*db
);
53 int _alpm_db_cmp(const void *db1
, const void *db2
);
54 alpm_list_t
*_alpm_db_search(pmdb_t
*db
, alpm_list_t
*needles
);
55 pmdb_t
*_alpm_db_register(const char *treename
, alpm_cb_db_register callback
);
57 /* be.c, backend specific calls */
58 int _alpm_db_install(pmdb_t
*db
, const char *dbfile
);
59 int _alpm_db_open(pmdb_t
*db
);
60 void _alpm_db_close(pmdb_t
*db
);
61 void _alpm_db_rewind(pmdb_t
*db
);
62 pmpkg_t
*_alpm_db_scan(pmdb_t
*db
, const char *target
);
63 int _alpm_db_read(pmdb_t
*db
, pmpkg_t
*info
, pmdbinfrq_t inforeq
);
64 int _alpm_db_write(pmdb_t
*db
, pmpkg_t
*info
, pmdbinfrq_t inforeq
);
65 int _alpm_db_remove(pmdb_t
*db
, pmpkg_t
*info
);
66 int _alpm_db_getlastupdate(pmdb_t
*db
, char *ts
);
67 int _alpm_db_setlastupdate(pmdb_t
*db
, char *ts
);
69 #endif /* _ALPM_DB_H */
71 /* vim: set ts=2 sw=2 noet: */