#ifndef LINES_H #define LINES_H /* /////////////////////////////////////////////////////////////// // // // lines.h - make a line of chars // // ver 1.1 // // manual page // // // // Language: Borland C, ver 3.0 // // Platform: Gateway 386/25, win95.400 // // Application: CSE784 demonstration // // Author: Jim Fawcett, 123 Link Hall, Syracuse Univ. // // (315) 443-2654, jfawcett@cat.syr.edu // // // /////////////////////////////////////////////////////////////// lines Operations: ================= The purpose of this module is to build a line of chars from a C string, a file, or an empty block. Users are expected to free line when done with it. char *line = makeLine("this is a line"); Copies literal into allocated heap memory. char *line = getLine(FILE *fptr); Reads line from file into allocated heap memory. File can be stdin. char *line = getBlock(size); Allocates block of size bytes. Fills block with null terminators. */ /* */ /* /////////////////////////////////////////////////////////////// // // // maintenance page // // // /////////////////////////////////////////////////////////////// // // // Build Process // // // // Files Required: // // lines.h, lines.c // // // // Integrated Environment: // // - close any open project // // - select Options\Compiler\Code generation\defines // // enter TEST_LINES // // - run // // // // Command Line Environment: // // tcc -w+ -DTEST_LINES lines.c // // // /////////////////////////////////////////////////////////////// Maintenance History: ver 1.1 : 31 Mar 97 - strip formfeeds ver 1.0 : 07 Sep 96 */ /* /////////////////////////////////////////////////////////////// // // // Declarations // // // /////////////////////////////////////////////////////////////// */ #include char *makeLine(char *s); /* returns pointer to line containing s */ char *getLine(FILE *fptr); /* returns pointer to next line from file */ char *getBlock(int size); /* returns pointer to block of size bytes */ /* filled with null terminators */ #endif