/*
 * Faculty of Applied Science and Engineering, University of Toronto
 * CSC181: Introduction to Computer Programming, Fall 2000
 *
 * Assignment: 3
 * File: utility.h
 * Author: Ray Ortigas (rayo@dgp.toronto.edu)
 * Contains: Utility typedefs and function prototypes.
 */

/*
 * Represents a character string.
 */
struct string {

	/* The contents of this string, stored in a (null-terminated) 
	   character array. */
	char* contents;
};
typedef struct string String;
typedef String* StringPtr;

/* Returns a string whose contents are in the C string s. */
StringPtr stringInit(const char* s);

/* Compares two strings s1 and s2 lexicographically, returning 0 if s1
   and s2 are equal, < 0 if s1 < s2 or > 0 if s1 > s2. */
int stringCompare(void* s1, void* s2);

/* Returns a C string with contents equivalent to s. */
char* stringToCString(const StringPtr s);
