istream-file.c revision 411d6baa37f31d90730e90c4a28c43e1974bbe58
/* Copyright (c) 2002-2003 Timo Sirainen */
/* @UNSAFE: whole file */
#include "lib.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 {
}
if (ret == 0) {
/* EOF */
return -1;
}
if (ret < 0) {
ret = 0;
else {
return -1;
}
}
ret = 0;
} else {
}
}
return ret;
}
{
return;
}
}
}
{
else
return (uoff_t)-1;
}
{
struct file_istream *fstream;
/* get size of fd if it's a file */
}
}