The "p" Package

These routines are meant to provide a low level means of converting C data types to the "network" data format (ie. big endian, IEEE 754). These are memory to memory routines only. Although they are made public, their use is NOT recommended. When reading or writing raw data from and to files or connections, the pio routines are suggested.

Library: karma
Link With: -lkarma

Functions

p_write_buf_floatWrite a floating point number to a buffer.
p_write_buf_float_trapWrite a floating point number to a buffer, trapping blanks.
p_read_buf_floatRead a floating point number from a buffer.
p_read_buf_floatsRead floating point data from a buffer, trapping NaNs.
p_write_buf_doubleWrite a double precision floating point number to a buffer.
p_write_buf_double_trapWrite a dfloating point number to a buffer, trapping blanks.
p_read_buf_doubleRead a double precision floating point number from a buffer.
p_read_buf_doublesRead double floating point data from a buffer, trapping NaNs.
p_write_buf16sWrite 16 bits of signed data to a buffer,
p_read_buf16sRead 16 bits of signed data from a buffer.
p_write_buf32sWrite 32 bits of signed data to a buffer,
p_read_buf32sRead 32 bits of signed data from a buffer.
p_write_buf16Write 16 bits of unsigned data to a buffer,
p_read_buf16Read 16 bits of unsigned data from a buffer.
p_write_buf32Write 32 bits of unsigned data to a buffer,
p_read_buf32Read 32 bits of unsigned data from a buffer.
p_write_buf64Write 64 bits of data to a buffer.
p_read_buf64Read 64 bits of signed data from a buffer.


Functions


flag p_write_buf_float (char *buffer, float data)

Write a floating point number to a buffer.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag p_write_buf_float_trap (char *buffer, float data, flag blank_to_nan)

This routine will write a floating point number to a buffer 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 p_read_buf_float (CONST char *buffer, float *data)

Read a floating point number from a buffer.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag p_read_buf_floats (CONST char *buffer, uaddr num_values, float *data, uaddr *num_nan)

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

Parameters:

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


flag p_write_buf_double (char *buffer, double data)

Write a double precision floating point number to a buffer.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag p_write_buf_double_trap (char *buffer, double data, flag blank_to_nan)

This routine will write a double precision floating point number to a buffer 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 p_read_buf_double (CONST char *buffer, double *data)

Read a double precision floating point number from a buffer.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag p_read_buf_doubles (CONST char *buffer, uaddr num_values, double *data, uaddr *num_nan)

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

Parameters:

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


flag p_write_buf16s (char *buffer, long data)

Write 16 bits of signed data to a buffer,

Parameters:

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


flag p_read_buf16s (CONST char *buffer, long *data)

Read 16 bits of signed data from a buffer.

Parameters:

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


flag p_write_buf32s (char *buffer, long data)

Write 32 bits of signed data to a buffer,

Parameters:

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


flag p_read_buf32s (CONST char *buffer, long *data)

Read 32 bits of signed data from a buffer.

Parameters:

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


flag p_write_buf16 (char *buffer, unsigned long data)

Write 16 bits of unsigned data to a buffer,

Parameters:

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


flag p_read_buf16 (CONST char *buffer, unsigned long *data)

Read 16 bits of unsigned data from a buffer.

Parameters:

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


flag p_write_buf32 (char *buffer, unsigned long data)

Write 32 bits of unsigned data to a buffer,

Parameters:

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


flag p_read_buf32 (CONST char *buffer, unsigned long *data)

Read 32 bits of unsigned data from a buffer.

Parameters:

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


flag p_write_buf64 (char *buffer, unsigned long data)

Write 64 bits of data to a buffer.

Parameters:

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


flag p_read_buf64 (CONST char *buffer, unsigned long *data)

Read 64 bits of signed data from a buffer.

Parameters:

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


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