Mercurial > pidgin
comparison src/core.c @ 2482:7e4757801725
[gaim-migrate @ 2495]
further updates to gaim-core. ui connects now and protocol basics seem to be working. this should facilitate cui dev.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 11 Oct 2001 07:19:20 +0000 |
parents | cf2f2450f7cc |
children | b4ac3b5f484b |
comparison
equal
deleted
inserted
replaced
2481:0d5257faa66e | 2482:7e4757801725 |
---|---|
71 pos += size; | 71 pos += size; |
72 | 72 |
73 size = va_arg(args2, int); | 73 size = va_arg(args2, int); |
74 } | 74 } |
75 | 75 |
76 pos -= sizeof(guchar) * 2 + 4; | |
77 | |
76 /* now we do size */ | 78 /* now we do size */ |
77 memcpy(buffer + sizeof(guchar) * 2, &pos, 4); | 79 memcpy(buffer + sizeof(guchar) * 2, &pos, 4); |
78 | 80 |
79 va_end(args2); | 81 va_end(args2); |
80 | 82 |
81 return buffer; | 83 return buffer; |
82 } | 84 } |
83 | 85 |
84 gint UI_write(struct UI *ui, guchar *data, gint len) | 86 gint UI_write(struct UI *ui, guchar *data, gint len) |
85 { | 87 { |
86 guchar *send = g_new0(guchar, len + 6); | |
87 gint sent; | 88 gint sent; |
88 send[0] = 'f'; | |
89 send[1] = 1; | |
90 memcpy(send + 2, &len, sizeof(len)); | |
91 memcpy(send + 6, data, len); | |
92 /* we'll let the write silently fail because the read will pick it up as dead */ | 89 /* we'll let the write silently fail because the read will pick it up as dead */ |
93 g_io_channel_write(ui->channel, send, len + 6, &sent); | 90 g_io_channel_write(ui->channel, data, len, &sent); |
94 return sent; | 91 return sent; |
95 } | 92 } |
96 | 93 |
97 void UI_build_write(struct UI *ui, guchar type, guchar subtype, ...) | 94 void UI_build_write(struct UI *ui, guchar type, guchar subtype, ...) |
98 { | 95 { |