1 /* logjam - a GTK client for LiveJournal.
2 * Copyright (C) 2000-2003 Evan Martin <evan@livejournal.com>
4 #ifndef __LOGJAM_JOURNALSTORE_H__
5 #define __LOGJAM_JOURNALSTORE_H__
7 #include "liblj/livejournal.h"
11 #define MAX_MATCHES (1000)
14 typedef struct _JournalStore JournalStore
;
17 extern JournalStore
*journal_store_open (JamAccount
*acc
, gboolean create
, GError
**err
);
18 extern gboolean
journal_store_reindex (JamAccount
*acc
, GError
**err
);
20 extern JamAccount
*journal_store_get_account (JournalStore
*js
);
22 extern void journal_store_free (JournalStore
*js
);
24 extern gboolean
journal_store_put (JournalStore
*js
, LJEntry
*entry
, GError
**err
);
25 extern gboolean
journal_store_put_group (JournalStore
*js
, LJEntry
**entries
, int c
, GError
**err
);
27 extern time_t journal_store_lookup_entry_time (JournalStore
*js
, int itemid
);
28 extern guint32
journal_store_get_month_entries (JournalStore
*js
, int year
, int mon
);
29 extern LJEntry
*journal_store_get_entry (JournalStore
*js
, int get_itemid
);
30 extern int journal_store_get_latest_id (JournalStore
*js
);
31 extern int journal_store_get_count (JournalStore
*js
);
32 extern gboolean
journal_store_get_invalid (JournalStore
*js
);
34 extern char *journal_store_get_lastsync (JournalStore
*js
);
35 extern gboolean
journal_store_put_lastsync (JournalStore
*js
, const char *lastsync
, GError
**err
);
37 typedef void (*JournalStoreSummaryCallback
) (int itemid
, time_t etime
, const char *summary
, LJSecurity
*sec
, gpointer data
);
39 extern gboolean
journal_store_get_day_entries (JournalStore
*js
, int year
, int mon
, int day
, JournalStoreSummaryCallback cb_func
, gpointer cb_data
);
41 extern gboolean
journal_store_find_relative_by_time (JournalStore
*js
, time_t when
, int *ritemid
, int dir
, GError
*err
);
42 extern gboolean
journal_store_find_relative (JournalStore
*js
, gint itemid
, int *ritemid
, int dir
, GError
*err
);
44 typedef gboolean(*JournalStoreScanCallback
) (const char *str
, gpointer data
);
46 extern gboolean
journal_store_scan(JournalStore
*js
,
47 JournalStoreScanCallback scan_cb
,
48 const gpointer scan_data
, JournalStoreSummaryCallback cb_func
, const gpointer cb_data
);