1 /* logjam - a GTK client for LiveJournal.
2 * Copyright (C) 2000-2003 Evan Martin <evan@livejournal.com>
9 #include "journalstore.h"
12 gboolean
journal_store_find_relative (JournalStore
*js
, gint itemid
, int *ritemid
, int dir
, GError
*err
) {
13 time_t when
= journal_store_lookup_entry_time(js
, itemid
);
14 return journal_store_find_relative_by_time(js
, when
, ritemid
, dir
, err
);
18 char *journal_store_get_lastsync (JournalStore
*js
) {
21 if (journal_store_get_invalid(js
)) {
22 /* the journalstore was invalid; we need to resync. */
25 filename
= conf_make_account_path(journal_store_get_account(js
), "lastsync");
26 if (g_file_get_contents(filename
, &sync
, NULL
, NULL
)) {
36 gboolean
journal_store_put_lastsync (JournalStore
*js
, const char *lastsync
, GError
**err
) {
37 char *filename
= conf_make_account_path(journal_store_get_account(js
), "lastsync");
38 FILE *f
= fopen(filename
, "w");
40 g_set_error(err
, 0, 0, _("Can't open '%s': %s"), filename
, g_strerror(errno
));
44 fprintf(f
, "%s\n", lastsync
);