Merge from vendor branch OPENSSH:
[dragonfly.git] / contrib / gperf / src / read-line.h
1 /* This may look like C code, but it is really -*- C++ -*- */
2
3 /* Reads arbitrarily long string from input file, returning it as a
4    dynamically allocated buffer.
5
6    Copyright (C) 1989-1998 Free Software Foundation, Inc.
7    written by Douglas C. Schmidt (schmidt@ics.uci.edu)
8
9 This file is part of GNU GPERF.
10
11 GNU GPERF is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 1, or (at your option)
14 any later version.
15
16 GNU GPERF is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with GNU GPERF; see the file COPYING.  If not, write to the Free
23 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111, USA.  */
24
25 /* Returns a pointer to an arbitrary length string.  Returns NULL on error or EOF
26    The storage for the string is dynamically allocated by new. */
27
28 #ifndef read_line_h
29 #define read_line_h 1
30
31 #include <stdio.h>
32
33 class Read_Line
34 {
35 private:
36   char *readln_aux (int chunks);
37   FILE *fp;                       /* FILE pointer to the input stream. */
38
39 public:
40         Read_Line (FILE *stream = stdin) : fp (stream) {}
41   char *get_line (void);
42 };
43
44 #ifdef __OPTIMIZE__
45
46 #include "trace.h"
47 #define INLINE inline
48 #include "read-line.icc"
49 #undef INLINE
50
51 #endif
52
53 #endif