istream-crlf.c revision 42dbeeb3462895b03e7633dbc59e8e191199734b
/* Copyright (c) 2007 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream-internal.h"
#include "istream-crlf.h"
struct crlf_istream {
struct istream_private istream;
char last_char;
unsigned int crlf:1;
};
{
}
static void
{
}
{
const unsigned char *data;
if (size == 0) {
return ret;
}
}
return -2;
/* @UNSAFE */
if (data[0] == '\n')
i = 0;
else {
/* CR without LF */
return 1;
}
}
if (data[0] != '\r')
i = 1;
}
if (data[i] <= '\r') {
if (data[i] == '\n') {
break;
}
continue;
}
continue;
}
/* CR without LF */
break;
}
if (data[i] == '\r')
continue;
}
}
if (ret == 0) {
return i_stream_crlf_read(stream);
}
return ret;
}
static void ATTR_NORETURN
{
i_panic("crlf-istream: seeking unsupported currently");
}
static const struct stat *
{
}
static struct istream *
{
struct crlf_istream *cstream;
}
{
}
{
}