The "arln" Package

These routines are meant to provide a simple to use asynchronous line reading facility. When reading from pipes, connections and terminals, the routines continue polling for events (using the chm_poll and cm_poll routines). They are not usable in a module which also uses an alternative event management scheme (such as Xt Intrinsics or the XView notifier).

Library: karma
Link With: -lkarma

Functions

arln_read_floatRead a floating point value from the user.
arln_read_intRead an integer value from the user.
arln_read_flagRead a boolean value from the user.
arln_read_lineRead a string from the user.
arln_read_from_stdinRead a line from the user.


Functions


float arln_read_float (CONST char *prompt, float default_value)

This routine will prompt the user for a single floating point number. If no input is given, the routine returns a default value.

Parameters:

Returns: The point value.
Multithreading Level: Unsafe


int arln_read_int (CONST char *prompt, int default_value)

This routine will prompt the user for a single integer number. If no input is given, the routine returns a default value.

Parameters:

Returns: The value.
Multithreading Level: Unsafe


flag arln_read_flag (CONST char *prompt, flag default_value)

This routine will prompt the user for a single boolean value. If no input is given, the routine returns a default value.

Parameters:

Returns: TRUE if "yes" was typed in, else FALSE.
Multithreading Level: Unsafe


flag arln_read_line (char *buffer, unsigned int length, CONST char *prompt)

This routine will read a line from a the standard input, stripping all comments, leading and trailing whitespace. The comment character is '#'.

Parameters:

Returns: TRUE on successful reading, else FALSE (indicating End-Of-File).
Multithreading Level: Unsafe


flag arln_read_from_stdin (char *buffer, unsigned int length, CONST char *prompt)

This routine will read a line from the standard input without preventing event processing. The standard input channel is internally allocated.

Parameters:

Returns: TRUE on successful reading, else FALSE.
Multithreading Level: Unsafe


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