The "chs" Package
These routines are meant to provide a simple method of reading (scanning)
channel objects for ASCII representations of floating point and integer
values.
Library: karma
Link With: -lkarma
Functions
Functions
unsigned int
chs_get_value (Channel channel, char *string, unsigned int length)
Scan a channel object for a whitespace separated value.
Parameters:
- channel :
The channel to read from.
- string :
The routine will write the value here.
- length :
The size of the buffer (in bytes).
Returns: The length of the string scanned on success, else 0.
Multithreading Level: Unsafe
double
chs_get_float (Channel channel)
This routine will scan a channel object for the ASCII
representation of a floating point number. Any leading whitespace will be
ignored.
Parameters:
- channel :
The channel to read from.
Returns: The value scanned. On error the process exits.
Multithreading Level: Unsafe
int
chs_get_int (Channel channel)
This routine will scan a channel object for the ASCII
representation of an integer number. Any leading whitespace will be
ignored.
Parameters:
- channel :
The channel object to read from.
Returns: The value scanned. On error the process exits.
Multithreading Level: Unsafe
flag
chs_get_line (Channel channel, char *buffer, unsigned int length)
This routine will read a line from a channel, stripping all
comments, leading and trailing whitespace. The comment character is '#'.
Parameters:
- channel :
The channel object to read from.
- buffer :
The buffer to write the line into.
- length :
The size of the buffer.
Returns: TRUE on success, else FALSE (indicating End-Of-File).
Multithreading Level: Unsafe
Contact: Richard Gooch
Web Development: Ariel Internet Services