1 /* liblivejournal - a client library for LiveJournal.
2 * Copyright (C) 2003 Evan Martin <evan@livejournal.com>
4 * vim: tabstop=4 shiftwidth=4 noexpandtab :
8 #include "liblj/types.h"
9 #include "liblj/serveruser.h"
12 lj_user_new(LJServer
*server
) {
13 LJUser
*u
= g_new0(LJUser
, 1);
19 lj_user_compare(gconstpointer a
, gconstpointer b
) {
20 return g_ascii_strcasecmp(((LJUser
*)a
)->username
, ((LJUser
*)b
)->username
);
24 lj_server_new(const char *url
) {
25 LJServer
*s
= g_new0(LJServer
, 1);
26 s
->protocolversion
= 1; /* default to protocol version 1. */
28 s
->url
= g_strdup(url
);
33 lj_server_get_last_cached_moodid(LJServer
*server
) {
36 for (l
= server
->moods
; l
!= NULL
; l
= l
->next
) {
37 if (((LJMood
*)l
->data
)->id
> max
)
38 max
= ((LJMood
*)l
->data
)->id
;
44 webmenuitem_free(LJWebMenuItem
*wmi
) {
47 g_slist_foreach(wmi
->subitems
, (GFunc
)webmenuitem_free
, NULL
);
48 g_slist_free(wmi
->subitems
);
53 lj_webmenu_free(GSList
*l
) {
55 g_slist_foreach(l
, (GFunc
)webmenuitem_free
, NULL
);