istream-crlf.c revision 5fe5ea74285e2fc0fbf7568c53f251aa894650fb
/* 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;
return ret;
}
/* remove the unused bytes from beginning of buffer */
} else if (stream->max_buffer_size == 0 ||
/* buffer is full - grow it */
}
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;
}
}
}
static void ATTR_NORETURN
{
i_panic("crlf-istream: seeking unsupported currently");
}
static const struct stat *
{
}
static struct istream *
{
struct crlf_istream *cstream;
}
{
}
{
}