istream-file.c revision cd1eef2109b4476842b7757f1d69b104196d5941
/* Copyright (c) 2002-2003 Timo Sirainen */
/* @UNSAFE: whole file */
#include "lib.h"
#include "ioloop.h"
#include "istream-internal.h"
#include "network.h"
#include <time.h>
#include <unistd.h>
#define I_STREAM_MIN_SIZE 4096
struct file_istream {
unsigned int file:1;
unsigned int autoclose_fd:1;
};
{
i_error("file_istream.close() failed: %m");
}
}
{
}
{
}
{
else {
}
if (fstream->max_buffer_size > 0 &&
}
{
}
{
return -1;
/* remove the unused bytes from beginning of buffer */
} else if (fstream->max_buffer_size == 0 ||
/* buffer is full - grow it */
}
return -2; /* buffer full */
}
ret = -1;
do {
} else {
size);
}
if (ret == 0) {
/* EOF */
return -1;
}
if (ret < 0) {
ret = 0;
} else {
return -1;
}
}
ret = 0;
} else {
}
}
return ret;
}
bool mark __attr_unused__)
{
return;
}
}
}
{
/* can't do anything or data would be lost */
return;
}
}
static const struct stat *
{
i_error("file_istream.fstat() failed: %m");
return NULL;
}
}
}
{
struct file_istream *fstream;
/* if it's a file, set the flags properly */
}
}