示例#1
0
文件: tlv.c 项目: Doap/transports
/**
 * aim_puttlv_32 - Write a four-byte TLV.
 * @buf: Destination buffer
 * @t: TLV type
 * @v: Value
 *
 * Writes a TLV with a four-byte integer value portion.
 *
 */
faim_export int aim_puttlv_32(fu8_t *buf, const fu16_t t, const fu32_t v)
{
	fu8_t v32[4];

	aimutil_put32(v32, v);

	return aim_puttlv_raw(buf, t, 4, v32);
}
示例#2
0
文件: tlv.c 项目: Doap/transports
/**
 * aim_addtlvtochain32 - Add a 32bit integer to a TLV chain
 * @list: Destination chain
 * @type: TLV type to add
 * @val: Value to add
 *
 * Adds a four-byte unsigned integer to a TLV chain.
 *
 */
faim_internal int aim_addtlvtochain32(aim_tlvlist_t **list, const fu16_t t, const fu32_t v)
{
	fu8_t v32[4];

	aimutil_put32(v32, v);

	return aim_addtlvtochain_raw(list, t, 4, v32);
}
示例#3
0
文件: bstream.c 项目: VoxOx/VoxOx
int byte_stream_put32(ByteStream *bs, guint32 v)
{

	if (byte_stream_empty(bs) < 4)
		return 0; /* XXX throw an exception */

	bs->offset += aimutil_put32(bs->data + bs->offset, v);

	return 1;
}
示例#4
0
faim_internal int aimbs_put32(aim_bstream_t *bs, fu32_t v)
{

    if (aim_bstream_empty(bs) < 4)
        return 0; /* XXX throw an exception */

    bs->offset += aimutil_put32(bs->data + bs->offset, v);

    return 1;
}
示例#5
0
int aimbs_put32(aim_bstream_t *bs, guint32 v)
{

	if (aim_bstream_empty(bs) < 4) {
		return 0; /* XXX throw an exception */

	}
	bs->offset += aimutil_put32(bs->data + bs->offset, v);

	return 1;
}