// file: tools.h --------------------------------------------------------------- // ----------------------------------------------------------------------------- // header file for the tools library. -- // Please enter your own name on line 10. -- // ----------------------------------------------------------------------------- #ifndef TOOLS #define TOOLS #define NAME "Alice E. Fischer" #define CLASS "CS 647 / 547" #include #include // for malloc() and calloc()*/ #include #include // for time_t, time() and ctime()*/ #include #include // for isspace() and isdigit()-- #include // for INT_MAX-- #include // for DOUBLE_MAX, etc.-- #include // for functions with variable # of arguments-- #include #include #include #include #include #include #include #include #include #include #include #include #include typedef char* string; typedef FILE* stream; // ----------------------------------------------------------------------------- // Macros to make more convenient use of standard library functions. -- // ----------------------------------------------------------------------------- #define strequal(a,b) !strcmp(a,b) #define strnequal(a,b,n) !strncmp(a,b,n) // ----------------------------------------------------------------------------- // Routine screen and process management. -- // ----------------------------------------------------------------------------- void clearscreen( void ); void fbanner( stream sout ); void banner( void ); void say( string format, ... ); void delay( int ); void hold( void ); void bye( void ); // ----------------------------------------------------------------------------- // Error handling. ------------------------------------------------------------- // ----------------------------------------------------------------------------- int fatal( string format, ... ); int fatalp (string format, ...); void sayp (string format, ...); void cleanline( stream sin ); void clean_and_log( stream sin, stream sout ); // ----------------------------------------------------------------------------- // Time and date. -- // ----------------------------------------------------------------------------- void when( char date[], char hour[] ); string today( char date[] ); string oclock( char hour[] ); #endif