fs-metawrap.c revision a06af8e117e14e2ddc5835bcbe0d2f0370cbc0a1
/* Copyright (c) 2013 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "strescape.h"
#include "istream.h"
#include "istream-private.h"
#include "istream-metawrap.h"
#include "ostream.h"
#include "fs-api-private.h"
struct metawrap_fs {
bool wrap_metadata;
};
struct metawrap_fs_file {
struct metawrap_fs *fs;
enum fs_open_mode open_mode;
};
{
}
{
}
static struct fs *fs_metawrap_alloc(void)
{
struct metawrap_fs *fs;
}
static int
struct fs_settings *set)
{
if (*args == '\0') {
return -1;
}
if (parent_args == NULL) {
parent_name = args;
parent_args = "";
} else {
parent_args++;
}
return -1;
}
return 0;
}
{
}
{
enum fs_properties props;
if (fs->wrap_metadata) {
/* we don't have a quick stat() to see the file's size,
because of the metadata header */
props &= ~FS_PROPERTY_STAT;
}
return props;
}
static struct fs_file *
{
struct metawrap_fs_file *file;
/* avoid unnecessarily creating two seekable streams */
if (mode == FS_OPEN_MODE_READONLY)
}
{
}
{
}
static void
void *context)
{
}
{
return -1;
}
return 0;
}
static void
const char *value)
{
else
}
static int
{
char c;
return -1;
}
return 0;
}
return -1;
return 0;
}
{
}
{
return ret;
}
}
static void
{
T_BEGIN {
} T_END;
}
static struct istream *
{
return input2;
}
{
return -1;
}
return 0;
}
}
{
const struct fs_metadata *metadata;
/* FIXME: if fs_set_metadata() is called later the changes are
ignored. we'd need to write via temporary file then. */
}
if (ret < 0) {
} else {
}
} T_END;
}
{
int ret;
if (!success) {
return -1;
}
return -1;
}
return ret;
}
static int
{
return -1;
}
return 0;
}
{
i_unreached();
}
{
return -1;
}
return 0;
}
{
return -1;
}
return 0;
}
return -1;
}
if (ret == 0) {
return -1;
}
return -1;
}
return 0;
}
{
return -1;
}
return 0;
}
}
{
return -1;
}
return 0;
}
{
return -1;
}
return 0;
}
static struct fs_iter *
enum fs_iter_flags flags)
{
}
const struct fs fs_class_metawrap = {
.name = "metawrap",
.v = {
NULL,
}
};