#ifndef OPEN_H #define OPEN_H /////////////////////////////////////////////////////////////// // open.h - gets a stream definition from user // // ver 1.1 // // // // Language: Visual C++, ver 6.0 // // Platform: Micron dual Pentium Pro 200, Win NT 4.0 // // Application: CSE784 demonstration // // Author: Jim Fawcett, CST 2-187, Syracuse Univ. // // (315) 443-3948, fawcett@ecs.syr.edu // /////////////////////////////////////////////////////////////// /* open Operations: ================ This module is part of a simple demonstration of how modules are constructed. Its purpose is to attach a file to an input or output stream. If a file name is provided it is used. Otherwise the program user is asked to supply one. FILE *fptr = getRStream("foo.bar"); - attempts to open file foo.bar for reading FILE *fptr = getRStream(0); - asks user to supply a filename for reading - returns pointer to stream FILE *fptr = getWStream("fee.bar"); - attempts to open file fee.bar for writing FILE *fptr = getWStream(0); - asks user to supply a filename for writing - returns pointer to stream */ /* */ /////////////////////////////////////////////////////////////// // maintenance page // /////////////////////////////////////////////////////////////// // // // Build Process // // // // Files Required: // // open.h, open.c, lines.h, lines.c // // // // Integrated Environment: // // - create a Win32 Console project and add c files cited // // - select Project\Settings\C/C++ // // enter ,TEST_OPEN in Preprocessor Definitions: edit box // // - compile, link, and run // // // // Command Line Environment: // // cl /GX /DTEST_OPEN open.c lines.c // // // /////////////////////////////////////////////////////////////// /* Maintenance History: ver 1.1 : 15 Jan 00 - cosmetic changes to these comments ver 1.0 : 07 Sep 96 - first release */ /////////////////////////////////////////////////////////////// // Declarations // /////////////////////////////////////////////////////////////// #include /* FILE */ FILE *getRStream(char *name); /* returns pointer to stream */ FILE *getWStream(char *name); /* returns pointer to stream */ #endif