-int
-getstr (lineptr, n, stream, terminator, offset)
- char **lineptr;
- size_t *n;
- FILE *stream;
- char terminator;
- size_t offset;
+/* Always add at least this many bytes when extending the buffer. */
+#define MIN_CHUNK 64
+
+/* Read up to (and including) a delimiter DELIM1 from STREAM into *LINEPTR
+ + OFFSET (and NUL-terminate it). If DELIM2 is non-zero, then read up
+ and including the first occurrence of DELIM1 or DELIM2. *LINEPTR is
+ a pointer returned from malloc (or NULL), pointing to *N characters of
+ space. It is realloc'd as necessary. Return the number of characters
+ read (not including the NUL terminator), or -1 on error or EOF. */
+
+static int
+getdelim2 (char **lineptr, size_t *n, FILE *stream, int delim1, int delim2,
+ size_t offset)