#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <ctime>
#include "util.h"
#include "gabbie.h"
Defines | |
#define | MAX_LINE_SIZE 256 |
#define | EXCHANGE(a, b) |
Functions | |
void | PrintNumber (double d) |
Print a number, in a nice format. | |
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) |
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 '-'. |
|
Value: { temp_p = array[a]; array[a] = array[b]; \ array[b] = temp_p; } |
|
|
|
|
|
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.
|