Mercurial > pidgin.yaz
diff src/core.c @ 2435:b4f2a53c0ee5
[gaim-migrate @ 2448]
more splits
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Fri, 05 Oct 2001 22:06:27 +0000 |
| parents | 0ba75351a01b |
| children | 5cbe86a444d9 |
line wrap: on
line diff
--- a/src/core.c Fri Oct 05 21:05:04 2001 +0000 +++ b/src/core.c Fri Oct 05 22:06:27 2001 +0000 @@ -44,6 +44,29 @@ }; GSList *uis = NULL; +gint UI_write(struct UI *ui, guchar *data, gint len) +{ + guchar *send = g_new0(guchar, len + 6); + gint sent; + send[0] = 'f'; + send[1] = 1; + memcpy(send + 2, &len, sizeof(len)); + memcpy(send + 6, data, len); + /* we'll let the write silently fail because the read will pick it up as dead */ + g_io_channel_write(ui->channel, send, len + 6, &sent); + return sent; +} + +void UI_broadcast(guchar *data, gint len) +{ + GSList *u = uis; + while (u) { + struct UI *ui = u->data; + UI_write(ui, data, len); + u = u->next; + } +} + static gint gaim_recv(GIOChannel *source, guchar *buf, gint len) { gint total = 0;
