home *** CD-ROM | disk | FTP | other *** search
- #define BOOL char
- #define FALSE 0
- #define TRUE 1
-
- #define FILENAME 256
- #define MESSLEN 256
- #define MAX_STRING 80
-
- #define MAX_LINE 2048
- static int buf_count = 0;
- static int eof = 0;
- char *get_line(desc)
- int desc;
- {
- static char buf[MAX_LINE];
- static char *buf_pt;
-
- static char line[MAX_LINE];
- register char *line_pt = line -1;
-
- line[0] = '\0';
- if (eof) return line;
- do{
- if (buf_count == 0){
- buf_count = read(desc, buf, MAX_LINE);
- if (buf_count == 0) eof = 1;
- buf_pt = buf;}
- if (!eof)
- *(++line_pt) = *(buf_pt++);
- buf_count--;
- } while ((*line_pt != '\n') && (line_pt != &line[MAX_LINE-1]) && !eof);
- *(++line_pt) = '\0';
- return line;
- };
-
-
-