1 #ifndef _XDROUTPACKET_H 2 3 #define _XDROUTPACKET_H 4 5 #include <SupportDefs.h> 6 7 #define XDROUTPACKET_BUFFER_INCREMENT 512 8 9 struct XDROutPacket 10 { 11 uint8 *fBuffer; 12 size_t fSize; 13 size_t fLength; 14 }; 15 16 void XDROutPacketInit (struct XDROutPacket *packet); 17 void XDROutPacketDestroy (struct XDROutPacket *packet); 18 19 void XDROutPacketGrow (struct XDROutPacket *packet, size_t size); 20 void XDROutPacketAddInt32 (struct XDROutPacket *packet, int32 val); 21 status_t XDROutPacketAddDynamic (struct XDROutPacket *packet, const void *data, size_t size); 22 status_t XDROutPacketAddFixed (struct XDROutPacket *packet, const void *data, size_t size); 23 status_t XDROutPacketAddString (struct XDROutPacket *packet, const char *string); 24 void XDROutPacketAppend (struct XDROutPacket *me, const struct XDROutPacket *packet); 25 26 const uint8 *XDROutPacketBuffer (struct XDROutPacket *packet); 27 size_t XDROutPacketLength (struct XDROutPacket *packet); 28 void XDROutPacketClear (struct XDROutPacket *packet); 29 30 #endif 31