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 a 64 bit integer to a channel object.
pio_read64Read a 64 bit integer from a channel object.
pio_le_read64Read a 64 bit little-endian integer from a channel object.
pio_write32Write a 32 bit integer to a channel object.
pio_read32Read a 32 bit integer from a channel object.
pio_le_read32Read a 32 bit little-endian integer from a channel object.
pio_write16Write a 16 bit integer to a channel object.
pio_read16Read a 16 bit integer from a channel object.
pio_le_read16Read a 16 bit little-endian integer from a channel object.
pio_write_floatWrite a floating point number to a channel object.
pio_write_float_trapWrite a floating point data to a channel object, trapping blanks.
pio_read_floatRead a floating point number from a channel object.
pio_le_read_floatRead a little-endian floating point number from a channel object.
pio_read_float_nantrapRead floating point data from a channel object, trapping NaNs.
pio_read_floatsRead floating point data from a channel object, trapping NaNs.
pio_le_read_floatsRead floating point data from a channel object, trapping NaNs.
pio_write_doubleWrite double precision floating point data to a channel object.
pio_write_double_trapWrite double precision floating point data to a channel object.
pio_read_doubleRead double precision floating point data from a channel object.
pio_le_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_read_doublesRead double float data from a channel object, trapping NaNs.
pio_le_read_doublesRead double float data from a channel object, trapping NaNs.
pio_write32sWrite a 32 bit signed integer to a channel object.
pio_read32sRead a 32 bit signed integer from a channel object.
pio_le_read32sRead a 32 bit little-endian signed integer from a channel object.
pio_write16sWrite a 16 bit signed integer to a channel object.
pio_read16sRead a 16 bit signed integer from a channel object.
pio_le_read16sRead a 16 bit little-endian signed integer 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 a 64 bit integer to a channel object.

Parameters:

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


flag pio_read64 (Channel channel, unsigned long *data)

Read a 64 bit integer from a channel object.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag pio_le_read64 (Channel channel, unsigned long *data)

Read a 64 bit little-endian integer from a channel object.

Parameters:

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


flag pio_write32 (Channel channel, unsigned long data)

Write a 32 bit integer to a channel object.

Parameters:

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


flag pio_read32 (Channel channel, unsigned long *data)

Read a 32 bit integer from a channel object.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag pio_le_read32 (Channel channel, unsigned long *data)

Read a 32 bit little-endian integer from a channel object.

Parameters:

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


flag pio_write16 (Channel channel, unsigned long data)

Write a 16 bit integer to a channel object.

Parameters:

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


flag pio_read16 (Channel channel, unsigned long *data)

Read a 16 bit integer from a channel object.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag pio_le_read16 (Channel channel, unsigned long *data)

Read a 16 bit little-endian integer 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


EXPERIMENTAL FUNCTION: subject to change without notice

flag pio_write_float_trap (Channel channel, float data, flag blanks_to_nans)

This routine will write a floating point number to a channel object and will optionally convert blank values (TOOBIGs) to IEEE Not-A-Number (NaN) values.

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag pio_le_read_float (Channel channel, float *data)

Read a little-endian 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


EXPERIMENTAL FUNCTION: subject to change without notice

uaddr pio_read_floats (Channel channel, uaddr num_values, float *data, uaddr *num_nan)

This routine will read many floating point numbers from a channel object and will optionally trap IEEE Not-A-Number (NaN) values. Trapped NaNs are converted to the TOOBIG value.

Parameters:

Returns: The number of values read and converted.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

uaddr pio_le_read_floats (Channel channel, uaddr num_values, float *data, uaddr *num_nan)

This routine will read many floating point numbers from a channel object and will optionally trap IEEE Not-A-Number (NaN) values. Trapped NaNs are converted to the TOOBIG value.

Parameters:

Returns: The number of values read and converted.
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


EXPERIMENTAL FUNCTION: subject to change without notice

flag pio_write_double_trap (Channel channel, double data, flag blanks_to_nans)

This routine will write a double precision floating point number to a channel object and will optionally convert blank values (TOOBIGs) to IEEE Not-A-Number (NaN) values.

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag pio_le_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


EXPERIMENTAL FUNCTION: subject to change without notice

uaddr pio_read_doubles (Channel channel, uaddr num_values, double *data, uaddr *num_nan)

This routine will read many double precision floating point numbers from a channel object and will optionally trap IEEE Not-A-Number (NaN) values. Trapped NaNs are converted to the TOOBIG value.

Parameters:

Returns: The number of values read and converted.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

uaddr pio_le_read_doubles (Channel channel, uaddr num_values, double *data, uaddr *num_nan)

This routine will read many double precision floating point numbers from a channel object and will optionally trap IEEE Not-A-Number (NaN) values. Trapped NaNs are converted to the TOOBIG value.

Parameters:

Returns: The number of values read and converted.
Multithreading Level: Unsafe


flag pio_write32s (Channel channel, long data)

Write a 32 bit signed integer to a channel object.

Parameters:

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


flag pio_read32s (Channel channel, long *data)

Read a 32 bit signed integer from a channel object.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag pio_le_read32s (Channel channel, long *data)

Read a 32 bit little-endian signed integer from a channel object.

Parameters:

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


flag pio_write16s (Channel channel, long data)

Write a 16 bit signed integer to a channel object.

Parameters:

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


flag pio_read16s (Channel channel, long *data)

Read a 16 bit signed integer from a channel object.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag pio_le_read16s (Channel channel, long *data)

Read a 16 bit little-endian signed integer 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


Back to Karma Home Page
Contact: Richard Gooch
Web Development: Ariel Internet Services