Mercurial > pidgin
diff src/protocols/oscar/bstream.c @ 13234:f2431a7e33aa
[gaim-migrate @ 15600]
Massive oscar shuffling. No change in functionality.
I renamed each of the files that contains stuff for a SNAC family.
I started splitting the file transfer/direct connect stuff into
peer.c and peer.h. I stopped using fu8_t, fu16_t and fu32_t and
switched to guint8, guint16 and guint32 instead. I changed the
SNAC family and subtype defines so they are more meaningful.
Added LGPL copyright header to each file. Added myself to the
AUTHORS file.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 11 Feb 2006 21:45:18 +0000 |
parents | b6ca6d3c5332 |
children | f260d319bbbc |
line wrap: on
line diff
--- a/src/protocols/oscar/bstream.c Sat Feb 11 19:16:38 2006 +0000 +++ b/src/protocols/oscar/bstream.c Sat Feb 11 21:45:18 2006 +0000 @@ -1,13 +1,30 @@ /* - * bstream.c + * Gaim's oscar protocol plugin + * This file is the legal property of its developers. + * Please see the AUTHORS file distributed alongside this file. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* * This file contains all functions needed to use bstreams. */ -#define FAIM_INTERNAL -#include <aim.h> +#include "oscar.h" -faim_internal int aim_bstream_init(aim_bstream_t *bs, fu8_t *data, int len) +faim_internal int aim_bstream_init(aim_bstream_t *bs, guint8 *data, int len) { if (!bs) @@ -65,7 +82,7 @@ return n; } -faim_internal fu8_t aimbs_get8(aim_bstream_t *bs) +faim_internal guint8 aimbs_get8(aim_bstream_t *bs) { if (aim_bstream_empty(bs) < 1) @@ -76,7 +93,7 @@ return aimutil_get8(bs->data + bs->offset - 1); } -faim_internal fu16_t aimbs_get16(aim_bstream_t *bs) +faim_internal guint16 aimbs_get16(aim_bstream_t *bs) { if (aim_bstream_empty(bs) < 2) @@ -87,7 +104,7 @@ return aimutil_get16(bs->data + bs->offset - 2); } -faim_internal fu32_t aimbs_get32(aim_bstream_t *bs) +faim_internal guint32 aimbs_get32(aim_bstream_t *bs) { if (aim_bstream_empty(bs) < 4) @@ -98,7 +115,7 @@ return aimutil_get32(bs->data + bs->offset - 4); } -faim_internal fu8_t aimbs_getle8(aim_bstream_t *bs) +faim_internal guint8 aimbs_getle8(aim_bstream_t *bs) { if (aim_bstream_empty(bs) < 1) @@ -109,7 +126,7 @@ return aimutil_getle8(bs->data + bs->offset - 1); } -faim_internal fu16_t aimbs_getle16(aim_bstream_t *bs) +faim_internal guint16 aimbs_getle16(aim_bstream_t *bs) { if (aim_bstream_empty(bs) < 2) @@ -120,7 +137,7 @@ return aimutil_getle16(bs->data + bs->offset - 2); } -faim_internal fu32_t aimbs_getle32(aim_bstream_t *bs) +faim_internal guint32 aimbs_getle32(aim_bstream_t *bs) { if (aim_bstream_empty(bs) < 4) @@ -131,7 +148,7 @@ return aimutil_getle32(bs->data + bs->offset - 4); } -faim_internal int aimbs_getrawbuf(aim_bstream_t *bs, fu8_t *buf, int len) +faim_internal int aimbs_getrawbuf(aim_bstream_t *bs, guint8 *buf, int len) { if (aim_bstream_empty(bs) < len) @@ -143,9 +160,9 @@ return len; } -faim_internal fu8_t *aimbs_getraw(aim_bstream_t *bs, int len) +faim_internal guint8 *aimbs_getraw(aim_bstream_t *bs, int len) { - fu8_t *ob; + guint8 *ob; if (!(ob = malloc(len))) return NULL; @@ -165,7 +182,7 @@ if (!(ob = malloc(len + 1))) return NULL; - if (aimbs_getrawbuf(bs, (fu8_t *)ob, len) < len) { + if (aimbs_getrawbuf(bs, (guint8 *)ob, len) < len) { free(ob); return NULL; } @@ -175,7 +192,7 @@ return ob; } -faim_internal int aimbs_put8(aim_bstream_t *bs, fu8_t v) +faim_internal int aimbs_put8(aim_bstream_t *bs, guint8 v) { if (aim_bstream_empty(bs) < 1) @@ -186,7 +203,7 @@ return 1; } -faim_internal int aimbs_put16(aim_bstream_t *bs, fu16_t v) +faim_internal int aimbs_put16(aim_bstream_t *bs, guint16 v) { if (aim_bstream_empty(bs) < 2) @@ -197,7 +214,7 @@ return 2; } -faim_internal int aimbs_put32(aim_bstream_t *bs, fu32_t v) +faim_internal int aimbs_put32(aim_bstream_t *bs, guint32 v) { if (aim_bstream_empty(bs) < 4) @@ -208,7 +225,7 @@ return 1; } -faim_internal int aimbs_putle8(aim_bstream_t *bs, fu8_t v) +faim_internal int aimbs_putle8(aim_bstream_t *bs, guint8 v) { if (aim_bstream_empty(bs) < 1) @@ -219,7 +236,7 @@ return 1; } -faim_internal int aimbs_putle16(aim_bstream_t *bs, fu16_t v) +faim_internal int aimbs_putle16(aim_bstream_t *bs, guint16 v) { if (aim_bstream_empty(bs) < 2) @@ -230,7 +247,7 @@ return 2; } -faim_internal int aimbs_putle32(aim_bstream_t *bs, fu32_t v) +faim_internal int aimbs_putle32(aim_bstream_t *bs, guint32 v) { if (aim_bstream_empty(bs) < 4) @@ -242,7 +259,7 @@ } -faim_internal int aimbs_putraw(aim_bstream_t *bs, const fu8_t *v, int len) +faim_internal int aimbs_putraw(aim_bstream_t *bs, const guint8 *v, int len) { if (aim_bstream_empty(bs) < len) @@ -256,7 +273,7 @@ faim_internal int aimbs_putstr(aim_bstream_t *bs, const char *str) { - return aimbs_putraw(bs, (fu8_t *)str, strlen(str)); + return aimbs_putraw(bs, (guint8 *)str, strlen(str)); } faim_internal int aimbs_putbs(aim_bstream_t *bs, aim_bstream_t *srcbs, int len)