[dovecot-cvs] dovecot/src/lib istream.c,1.6,1.7 istream.h,1.6,1.7
cras at procontrol.fi
cras at procontrol.fi
Mon Mar 10 02:36:11 EET 2003
- Previous message: [dovecot-cvs] dovecot/src/lib-index/maildir maildir-index.c,1.25,1.26 maildir-index.h,1.14,1.15 maildir-open.c,1.14,1.15 maildir-sync.c,1.29,1.30
- Next message: [dovecot-cvs] dovecot/src/lib-settings settings.c,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv29409/lib
Modified Files:
istream.c istream.h
Log Message:
Added i_stream_read_next_line()
Index: istream.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/istream.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- istream.c 23 Jan 2003 19:08:53 -0000 1.6
+++ istream.c 10 Mar 2003 00:36:08 -0000 1.7
@@ -189,6 +189,19 @@
return ret_buf;
}
+char *i_stream_read_next_line(struct istream *stream)
+{
+ char *line;
+
+ line = i_stream_next_line(stream);
+ if (line != NULL)
+ return line;
+
+ if (i_stream_read(stream) > 0)
+ line = i_stream_next_line(stream);
+ return line;
+}
+
const unsigned char *i_stream_get_data(struct istream *stream, size_t *size)
{
struct _istream *_stream = stream->real_stream;
Index: istream.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/istream.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- istream.h 19 Feb 2003 19:50:22 -0000 1.6
+++ istream.h 10 Mar 2003 00:36:08 -0000 1.7
@@ -57,10 +57,13 @@
/* Seek to specified position from beginning of file. Never fails, the next
read tells if it was successful. This works only for files. */
void i_stream_seek(struct istream *stream, uoff_t v_offset);
-/* Reads the next line from stream and returns it, or NULL if more data is
+/* Gets the next line from stream and returns it, or NULL if more data is
needed to make a full line. NOTE: modifies the data in buffer for the \0,
so it works only with buffered streams (currently only file). */
char *i_stream_next_line(struct istream *stream);
+/* Like i_stream_next_line(), but reads for more data if needed. Returns NULL
+ if more data is needed or error occured. */
+char *i_stream_read_next_line(struct istream *stream);
/* Returns pointer to beginning of read data, or NULL if there's no data
buffered. */
const unsigned char *i_stream_get_data(struct istream *stream, size_t *size);
- Previous message: [dovecot-cvs] dovecot/src/lib-index/maildir maildir-index.c,1.25,1.26 maildir-index.h,1.14,1.15 maildir-open.c,1.14,1.15 maildir-sync.c,1.29,1.30
- Next message: [dovecot-cvs] dovecot/src/lib-settings settings.c,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list