The "pio" Package

These routines are meant to provide a high level means of converting C data types to the "network" data format (ie. big endian, IEEE 754). These routines transfer data between host memory and files/ connections. These routines are NOT recommended as a means to transfer the recursive, heirarchical data structure supported in Karma, use the dsxfr routines instead.

Library: karma
Link With: -lkarma

Functions

pio_write64Write 64 bits of data to a channel object.
pio_read64Read 64 bits of data from a channel object.
pio_write32Write 32 bits of data to a channel object.
pio_read32Read 32 bits of data from a channel object.
pio_write16Write 16 bits of data to a channel object.
pio_read16Read 16 bits of data from a channel object.
pio_write_floatWrite a floating point number to a channel object.
pio_read_floatRead a floating point number from a channel object.
pio_read_float_nantrapRead floating point data from a channel object, trapping NaNs.
pio_write_doubleWrite double precision floating point data to a channel object.
pio_read_doubleRead double precision floating point data from a channel object.
pio_read_double_nantrapRead floating point data from a channel object, trapping NaNs.
pio_write32sWrite 32 bits of signed data to a channel object.
pio_read32sRead 32 bits of signed data from a channel object.
pio_write16sWrite 16 bits of signed data to a channel object.
pio_read16sRead 16 bits of signed data from a channel object.
pio_write_swapSwap and write bytes to a channel object.
pio_read_swapRead from a channel object and swap bytes.
pio_write_stringWrite a string to a channel object.
pio_read_stringRead a string from a channel object.


Functions


flag pio_write64 (Channel channel, unsigned long data)

Write 64 bits of data to a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_read64 (Channel channel, unsigned long *data)

Read 64 bits of data from a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_write32 (Channel channel, unsigned long data)

Write 32 bits of data to a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_read32 (Channel channel, unsigned long *data)

Read 32 bits of data from a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_write16 (Channel channel, unsigned long data)

Write 16 bits of data to a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_read16 (Channel channel, unsigned long *data)

Read 16 bits of data from a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_write_float (Channel channel, float data)

Write a floating point number to a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_read_float (Channel channel, float *data)

Read a floating point number from a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_read_float_nantrap (Channel channel, float *data, flag *was_nan)

This routine will read a floating point number from a channel object and will trap IEEE Not-A-Number (NaN) values.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_write_double (Channel channel, double data)

Write double precision floating point data to a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_read_double (Channel channel, double *data)

Read double precision floating point data from a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_read_double_nantrap (Channel channel, double *data, flag *was_nan)

This routine will read a double precision floating point number from a channel object and will trap IEEE Not-A-Number (NaN) values.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_write32s (Channel channel, long data)

Write 32 bits of signed data to a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_read32s (Channel channel, long *data)

Read 32 bits of signed data from a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_write16s (Channel channel, long data)

Write 16 bits of signed data to a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_read16s (Channel channel, long *data)

Read 16 bits of signed data from a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_write_swap (Channel channel, CONST char *data, unsigned int length)

Swap and write bytes to a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_read_swap (Channel channel, char *data, unsigned int length)

Read from a channel object and swap bytes.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


flag pio_write_string (Channel channel, CONST char *string)

Write a string to a channel object.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


char * pio_read_string (Channel channel, unsigned int *length)

Read a string from a channel object.

Parameters:

Returns: A pointer to a dynamically allocated string on success, else NULL. If a zero length string was read, the returned buffer is one character long and contains the '\0' character.
Multithreading Level: Unsafe


Contact: Richard Gooch
Web Development: Ariel Internet Services