1 /* logjam - a GTK client for LiveJournal.
2 * Copyright (C) 2000-2003 Evan Martin <evan@livejournal.com>
4 * vim: tabstop=4 shiftwidth=4 noexpandtab :
11 #include "journalstore.h"
14 journal_store_find_relative(JournalStore
*js
, gint itemid
,
15 int *ritemid
, int dir
, GError
*err
) {
16 time_t when
= journal_store_lookup_entry_time(js
, itemid
);
18 return journal_store_find_relative_by_time(js
, when
,
23 journal_store_get_lastsync(JournalStore
*js
) {
27 if (journal_store_get_invalid(js
)) {
28 /* the journalstore was invalid; we need to resync. */
32 filename
= conf_make_account_path(journal_store_get_account(js
),
34 if (g_file_get_contents(filename
, &sync
, NULL
, NULL
)) {
44 journal_store_put_lastsync(JournalStore
*js
, const char *lastsync
, GError
**err
) {
48 filename
= conf_make_account_path(journal_store_get_account(js
),
50 f
= fopen(filename
, "w");
52 g_set_error(err
, 0, 0, _("Can't open '%s': %s"), filename
,
57 fprintf(f
, "%s\n", lastsync
);