Mercurial > pidgin.yaz
view plugins/timestamp.c @ 4200:c8fb43808a4b
[gaim-migrate @ 4431]
I try to look at it like this:
At least now I know a little more about va_args.
So when you pass stuff through "...", gcc promotes the argument to an
integer. So passing fu16_t because 4 bytes instead of 2. Then when
using va_args, you have to use a type that is 4 bytes instead of 2.
I guess va_args is different in gcc 2, in that, if you give it a 2 byte
type, it will get 4 bytes anyway. Either that, or gcc2 doesn't promote
stuff to 4 bytes when passed through ....
Anyway, sorry to all gcc3.x users. This patch just fixes a little bit
of whitespace stuff, again, for no real reason.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 04 Jan 2003 19:41:07 +0000 |
parents | ebfb80bbe1ed |
children | 511c2b63caa4 |
line wrap: on
line source
/* iChat-like timestamps by Sean Egan. * <INSERT GPL HERE> */ #define GAIM_PLUGINS #include <time.h> #include "gaim.h" #include "gtkimhtml.h" #define TIMESTAMP_DELAY (5 * 60 * 1000) GModule *handle; GSList *timestamp_timeouts; gboolean do_timestamp (struct conversation *c) { char *buf; char mdate[6]; time_t tim = time(NULL); if (!g_list_find(conversations, c)) return FALSE; strftime(mdate, sizeof(mdate), "%H:%M", localtime(&tim)); buf = g_strdup_printf(" %s", mdate); write_to_conv(c, buf, WFLAG_NOLOG, NULL, tim, -1); g_free(buf); return TRUE; } void timestamp_new_convo(char *name) { struct conversation *c = find_conversation(name); do_timestamp(c); timestamp_timeouts = g_slist_append(timestamp_timeouts, GINT_TO_POINTER(g_timeout_add(TIMESTAMP_DELAY, do_timestamp, c))); } char *gaim_plugin_init(GModule *h) { GList *cnvs = conversations; struct conversation *c; handle = h; while (cnvs) { c = cnvs->data; timestamp_new_convo(c->name); cnvs = cnvs->next; } gaim_signal_connect(handle, event_new_conversation, timestamp_new_convo, NULL); return NULL; } void gaim_plugin_remove() { GSList *to; to = timestamp_timeouts; while (to) { g_source_remove(GPOINTER_TO_INT(to->data)); to = to->next; } g_slist_free(timestamp_timeouts); } struct gaim_plugin_description desc; struct gaim_plugin_description *gaim_plugin_desc() { desc.api_version = PLUGIN_API_VERSION; desc.name = g_strdup(_("Timestamp")); desc.version = g_strdup(VERSION); desc.description = g_strdup(_("Adds iChat-style timestamps to conversations every 5 minutes.")); desc.authors = g_strdup("Sean Egan <bj91704@binghamton.edu>"); desc.url = g_strdup(WEBSITE); return &desc; }