X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/f0feb22e80bfe438c16d212a7cc8be6d2282b6ac..02ba7921a8b083f421a747b89c65a87d0afd5841:/lib/trackdb-int.h diff --git a/lib/trackdb-int.h b/lib/trackdb-int.h index 1d31cfe..6d5234e 100644 --- a/lib/trackdb-int.h +++ b/lib/trackdb-int.h @@ -2,25 +2,30 @@ * This file is part of DisOrder * Copyright (C) 2005, 2007 Richard Kettlewell * - * This program is free software; you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * along with this program. If not, see . */ - +/** @file lib/trackdb-int.h + * @brief Track database internals */ #ifndef TRACKDB_INT_H #define TRACKDB_INT_H +#include + +#include "kvp.h" + +struct vector; /* forward declaration */ + extern DB_ENV *trackdb_env; extern DB *trackdb_tracksdb; @@ -30,6 +35,7 @@ extern DB *trackdb_tagsdb; extern DB *trackdb_noticeddb; extern DB *trackdb_globaldb; extern DB *trackdb_usersdb; +extern DB *trackdb_scheduledb; DBC *trackdb_opencursor(DB *db, DB_TXN *tid); /* open a transaction */ @@ -100,6 +106,7 @@ int trackdb_delkeydata(DB *db, int trackdb_scan(const char *root, int (*callback)(const char *track, struct kvp *data, + struct kvp *prefs, void *u, DB_TXN *tid), void *u, @@ -108,8 +115,9 @@ int trackdb_scan(const char *root, * 0). Return 0 or DB_LOCK_DEADLOCK. CALLBACK should return 0 on success or * EINTR to cancel the scan. */ -/* fill KEY in with S, returns KEY */ +int trackdb_listkeys(DB *db, struct vector *v, DB_TXN *tid); +/* fill KEY in with S, returns KEY */ static inline DBT *make_key(DBT *key, const char *s) { memset(key, 0, sizeof *key); key->data = (void *)s; @@ -141,6 +149,9 @@ int trackdb_get_global_tid(const char *name, DB_TXN *tid, const char **rp); +char **parsetags(const char *s); +int tag_intersection(char **a, char **b); + #endif /* TRACKDB_INT_H */ /*