TESTIFY_H

testify_Testify_.html

U_BUFFER_SIZE 2048

TESTIFY_DEBUG

Enum:

THandleType

T_HT_STREAMING_SERVER

T_HT_STREAMING_CONNECTION

T_HT_PACKET_PEER

T_HT_FILE_READ

T_HT_FILE_WRITE

T_HT_BUFFER

Struct:

UnravelAddress

uint32 ip

uint16 port

UnravelAddress

Description: ---------- TCP Networking --------

extern THandle *testify_network_stream_address_create(const char *host_name

uint16 port)

* Creates a TCP connection that can be both read or written to

connecting to the DNS address given as "host_name". By default the connection will attempt to connect to "port"

unless the host_name is frormated in the following way :

then the port number will be read from the host_name. If no host name is given

the function will open up the port

and wait for incomming connections.

extern int testify_network_stream_send_force(THandle *handle)

* Tells a TCP connectiuon to flush all out going data to the network.

extern THandle *testify_network_stream_wait_for_connection(THandle *listen

UnravelAddress *from)

*Polls a TCP handle "listen" for incomming connections. If a new connection is obtained a new handle for that connection will be returned. If the pointer from is given

the function will fill out the structure with the IP address and port of the incomming connection if one is obtained.

extern boolean testify_network_stream_connected(THandle *handle)

*Returns TRUE is the tcp connection is still active.

Description: ---------- UDP Networking --------

extern boolean testify_network_address_lookup(UnravelAddress *address

char *dns_name)

* look up a DNS address and turn it in to a IP and port. Returns TRUE if sucessfull.

extern THandle *testify_network_datagram_create(uint16 port)

* Opens a port for receving and sending UDP traffic on a specific port.

extern int testify_network_datagram_send(THandle *handle

UnravelAddress *to)

* Sends the data collected in handle to the IP and address specifyed in "to".

extern int testify_network_datagram_receive(THandle *handle

UnravelAddress *from)

*Querys for incoomming UDP packets. Returns 0 if no packets have arrived. If data has arrived the length of data will return and the "from" pointer will be filled out with the IP and port of the sender.

Description: ---------- File Management --------

extern THandle *testify_file_load(char *path)

* Opens a Testify handle from a file name for reading.

extern THandle *testify_file_save(char *path)

* Opens a Testify handle from a file name for writing.

extern uint64 testify_file_size(THandle *handle)

* Returns the size of the file.

extern void testify_file_position_set(THandle *handle

uint64 pos)

* Sets the current write position to "pos".

extern uint64 testify_file_position_get(THandle *handle)

* Returns the current write position.

Description: ---------- Memmory buffers --------

extern THandle *testify_buffer_create()

* Creates a handle to a Testify FIFO Memory buffer.

extern void *testify_buffer_get(THandle *handle

uint32 *size)

*Gives the user read direct memory access to the packed data. If the handle is set to debug mode it will contain debug header information.

extern void testify_buffer_set(THandle *handle

void *data

uint32 size)

*Lets the user give a pointer to "data" of "Size" number of bytes that will be added to the buffer.

Description: ---------- Handle Utillities --------

extern THandleType testify_type(THandle *handle)

* Returns the type of a Testify handle.

extern void testify_free(THandle *handle)

* frees a handle

extern uint testify_network_wait(THandle **handles

boolean *read

boolean *write

unsigned int handle_count

unsigned int microseconds)

* querys if network handles are ready to read and write. Can handle multiple handles as speccified by the array "handles" and handle count. The function will block for at most milliseconds and wait for any resource to become availbale. Once a resource gets available it will return.

Description: ---------- Debugging --------

extern void testify_debug_mode_set(THandle *handle

boolean debug

char *text_copy_name)