#include <cstdio>
Go to the source code of this file.
Functions | |
void | Error (bool condition, char *message) |
If condition is true, print message and exit. | |
void | Error (bool condition, char *message, char *a1) |
void | Mesg (char *message) |
Print a message to stderr. | |
void | Mesg (char *message, char *a1) |
void | Mesg (char *message, int a1) |
void | PrintNumber (double d) |
Print a number, in a nice format. | |
FILE * | FileOpen (char *fileName, char *mode) |
Open a file, print an advisory message if the open fails. | |
char * | GetLine (FILE *fp) |
bool | HasDigits (char *s) |
Return true if this string has any digits. | |
void | Sort (void *array[], int size, int(*compare)(void *, void *)) |
In-place quicksort of an array of pointers. | |
void | StrLower (char *p) |
Force all chars in string to lower case. | |
bool | IsNormalChar (char c) |
True if char is alpha, numeric, or '-'. | |
Variables | |
const int | MAX_LINE = 40000 |
Maximum length of a line of input. |
|
|
|
If condition is true, print message and exit.
|
|
Open a file, print an advisory message if the open fails.
|
|
Read line from a file, return a pointer to the contents of the line. Notes: 1. Returns pointer to a static buffer that is overwritten when the function is called again, or when GetTreeLine is called. 2. Reads up to MAX_LINE chars. 3. Returns NULL pointer at end-of-file. |
|
Return true if this string has any digits.
|
|
True if char is alpha, numeric, or '-'.
|
|
|
|
|
|
Print a message to stderr.
|
|
Print a number, in a nice format.
|
|
In-place quicksort of an array of pointers. Sort() performs an in-place quicksort. compare must be a pointer to a function that takes 2 void * arguments, and returns 0 if they are equal, >0 if the first arg is greater, and <0 if first arg is less. |
|
Force all chars in string to lower case.
|
|
Maximum length of a line of input.
|