/**** Start of file io.c ****/ #include "defines.h" void update_lhs( void ); /** extern variable declarations **/ extern char buffer[ MaxExp + 2 ]; extern int lhs; void prompt( void ) { printf( "\n%d ", lhs ); } void input( void ) { char *nl; fgets( buffer, MaxExp, stdin ); /* eliminate newline */ if ( ( nl = strrchr( buffer, '\n' ) ) != NULL ) *nl = '\0'; } void output( void ) { printf( "%d %s == ", lhs, buffer ); update_lhs(); printf( "%d\n", lhs ); } /**** End of file io.c ****/