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_read_buf_floatRead a floating point number from a buffer.
p_write_buf_doubleWrite a double precision floating point number to a buffer.
p_read_buf_doubleRead a double precision floating point number from a buffer.
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


flag p_read_buf_float (char *buffer, float *data)

Read a floating point number from a buffer.

Parameters:

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


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


flag p_read_buf_double (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:


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 (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 (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 (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 (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 (char *buffer, unsigned long *data)

Read 64 bits of signed data from a buffer.

Parameters:

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


Contact: Richard Gooch
Web Development: Ariel Internet Services