NAME ^

pirutil.c - various utility functions

FUNCTIONS ^

clone_string()

clone a string. Copy the characters of src into dest and return dest. Memory allocation is done by this function, keeping this function's client code simple. Please free() the memory after usage!

open_file(char *filename, char *mode)

Open the file filename in mode mode. If this fails, an error message is printed, and the program is terminated.

verbose()

Prints the specified message if the verbose flag was set

debug()

Prints the specified message if the debug flag was set.

is_op()

Return 1 if the specified id is a Parrot op, 0 otherwise.


parrot