/** * aim_gettlv32 - Retrieve the Nth TLV in chain as a 32bit integer. * @list: Source TLV chain * @type: TLV type to search for * @nth: Index of TLV to return * * Same as aim_gettlv(), except that the return value is a * 32bit integer instead of an aim_tlv_t. * */ faim_internal fu32_t aim_gettlv32(aim_tlvlist_t *list, const fu16_t t, const int n) { aim_tlv_t *tlv; if (!(tlv = aim_gettlv(list, t, n))) return 0; /* erm */ return aimutil_get32(tlv->value); }
guint32 byte_stream_get32(ByteStream *bs) { if (byte_stream_empty(bs) < 4) return 0; /* XXX throw an exception */ bs->offset += 4; return aimutil_get32(bs->data + bs->offset - 4); }
faim_internal fu32_t aimbs_get32(aim_bstream_t *bs) { if (aim_bstream_empty(bs) < 4) return 0; /* XXX throw an exception */ bs->offset += 4; return aimutil_get32(bs->data + bs->offset - 4); }
guint32 aimbs_get32(aim_bstream_t *bs) { if (aim_bstream_empty(bs) < 4) { return 0; /* XXX throw an exception */ } bs->offset += 4; return aimutil_get32(bs->data + bs->offset - 4); }