dcrud  0.0.0
Distributed data and services
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
ByteBuffer.h
Go to the documentation of this file.
1 #pragma once
2 #ifdef __cplusplus
3 extern "C" {
4 #endif
5 
6 #include <util/types.h>
7 #include <io/socket.h>
8 #include <io/Status.h>
9 
10 #include <stdio.h>
11 
12 typedef enum ioByteOrder_e {
13 
16 
17 } ioByteOrder;
18 
19 UTIL_ADT( ioByteBuffer );
20 
21 ioByteBuffer ioByteBuffer_wrap ( unsigned int capacity, byte * array );
22 ioByteBuffer ioByteBuffer_new ( unsigned int capacity );
23 void ioByteBuffer_delete ( ioByteBuffer * This );
24 ioByteBuffer ioByteBuffer_copy ( ioByteBuffer This, unsigned int length );
25 byte * ioByteBuffer_array ( ioByteBuffer This );
26 void ioByteBuffer_clear ( ioByteBuffer This );
27 void ioByteBuffer_mark ( ioByteBuffer This );
28 ioStatus ioByteBuffer_reset ( ioByteBuffer This );
29 void ioByteBuffer_flip ( ioByteBuffer This );
30 unsigned int ioByteBuffer_getPosition( ioByteBuffer This );
31 ioStatus ioByteBuffer_setPosition( ioByteBuffer This, unsigned int position );
32 unsigned int ioByteBuffer_getLimit ( ioByteBuffer This );
33 unsigned int ioByteBuffer_remaining ( ioByteBuffer This );
34 ioStatus ioByteBuffer_put ( ioByteBuffer This, const byte * src, unsigned int from, unsigned int to );
35 ioStatus ioByteBuffer_get ( ioByteBuffer This, byte * target, unsigned int from, unsigned int to );
36 ioStatus ioByteBuffer_putByte ( ioByteBuffer This, byte value );
37 ioStatus ioByteBuffer_getByte ( ioByteBuffer This, byte * target );
38 ioStatus ioByteBuffer_putShort ( ioByteBuffer This, unsigned short value );
39 ioStatus ioByteBuffer_getShort ( ioByteBuffer This, unsigned short * target );
40 ioStatus ioByteBuffer_putInt ( ioByteBuffer This, unsigned int value );
41 ioStatus ioByteBuffer_putIntAt ( ioByteBuffer This, unsigned int value, unsigned int index );
42 ioStatus ioByteBuffer_getInt ( ioByteBuffer This, unsigned int * target );
43 ioStatus ioByteBuffer_putLong ( ioByteBuffer This, uint64_t value );
44 ioStatus ioByteBuffer_getLong ( ioByteBuffer This, uint64_t * target );
45 ioStatus ioByteBuffer_putFloat ( ioByteBuffer This, float value );
46 ioStatus ioByteBuffer_getFloat ( ioByteBuffer This, float * target );
47 ioStatus ioByteBuffer_putDouble ( ioByteBuffer This, double value );
48 ioStatus ioByteBuffer_getDouble ( ioByteBuffer This, double * target );
49 ioStatus ioByteBuffer_putString ( ioByteBuffer This, const char * src );
50 ioStatus ioByteBuffer_getString ( ioByteBuffer This, char * target, unsigned int sizeOfTarget );
51 ioStatus ioByteBuffer_putBuffer ( ioByteBuffer This, ioByteBuffer source );
52 ioStatus ioByteBuffer_send ( ioByteBuffer This, SOCKET sckt, struct sockaddr_in * target );
53 ioStatus ioByteBuffer_receive ( ioByteBuffer This, SOCKET sckt );
54 ioStatus ioByteBuffer_dump ( ioByteBuffer This, FILE * target );
55 
56 #ifdef __cplusplus
57 }
58 #endif
ioStatus ioByteBuffer_getDouble(ioByteBuffer This, double *target)
ioStatus ioByteBuffer_send(ioByteBuffer This, SOCKET sckt, struct sockaddr_in *target)
ioStatus ioByteBuffer_getByte(ioByteBuffer This, byte *target)
unsigned char byte
Definition: types.h:16
ioStatus ioByteBuffer_getFloat(ioByteBuffer This, float *target)
ioStatus ioByteBuffer_getLong(ioByteBuffer This, uint64_t *target)
ioStatus ioByteBuffer_setPosition(ioByteBuffer This, unsigned int position)
ioStatus ioByteBuffer_putString(ioByteBuffer This, const char *src)
void ioByteBuffer_mark(ioByteBuffer This)
byte * ioByteBuffer_array(ioByteBuffer This)
ioByteBuffer ioByteBuffer_copy(ioByteBuffer This, unsigned int length)
ioByteOrder_e
Definition: ByteBuffer.h:12
ioStatus ioByteBuffer_putInt(ioByteBuffer This, unsigned int value)
ioStatus ioByteBuffer_putDouble(ioByteBuffer This, double value)
void ioByteBuffer_clear(ioByteBuffer This)
ioByteBuffer ioByteBuffer_wrap(unsigned int capacity, byte *array)
unsigned int ioByteBuffer_remaining(ioByteBuffer This)
ioStatus ioByteBuffer_putLong(ioByteBuffer This, uint64_t value)
ioStatus ioByteBuffer_putBuffer(ioByteBuffer This, ioByteBuffer source)
ioStatus ioByteBuffer_getShort(ioByteBuffer This, unsigned short *target)
ioStatus ioByteBuffer_reset(ioByteBuffer This)
unsigned int ioByteBuffer_getPosition(ioByteBuffer This)
ioStatus ioByteBuffer_putIntAt(ioByteBuffer This, unsigned int value, unsigned int index)
UTIL_ADT(ioByteBuffer)
ioStatus ioByteBuffer_putShort(ioByteBuffer This, unsigned short value)
ioStatus ioByteBuffer_get(ioByteBuffer This, byte *target, unsigned int from, unsigned int to)
void ioByteBuffer_flip(ioByteBuffer This)
ioStatus ioByteBuffer_put(ioByteBuffer This, const byte *src, unsigned int from, unsigned int to)
ioStatus ioByteBuffer_dump(ioByteBuffer This, FILE *target)
ioStatus ioByteBuffer_putByte(ioByteBuffer This, byte value)
void ioByteBuffer_delete(ioByteBuffer *This)
unsigned int ioByteBuffer_getLimit(ioByteBuffer This)
enum ioStatus_e ioStatus
ioStatus ioByteBuffer_receive(ioByteBuffer This, SOCKET sckt)
enum ioByteOrder_e ioByteOrder
ioStatus ioByteBuffer_getInt(ioByteBuffer This, unsigned int *target)
ioStatus ioByteBuffer_putFloat(ioByteBuffer This, float value)
ioStatus ioByteBuffer_getString(ioByteBuffer This, char *target, unsigned int sizeOfTarget)
ioByteBuffer ioByteBuffer_new(unsigned int capacity)