/* Copyright (c) 2005-2018 Dovecot authors, see the included COPYING file */
/* Quota reporting based on simply summing sizes of all files in mailbox
together. */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "quota-private.h"
#include <unistd.h>
#include <dirent.h>
struct quota_count_path {
const char *path;
bool is_file;
};
extern struct quota_backend quota_backend_dirsize;
{
}
const char **error_r)
{
}
{
}
static const char *const *
{
return resources;
}
const char **error_r)
{
struct dirent *d;
unsigned int path_pos;
int ret;
return 0;
return -1;
}
ret = 0;
if (d->d_name[0] == '.' &&
/* skip . and .. */
continue;
}
continue;
ret = -1;
break;
ret = -1;
break;
}
} else {
}
}
return ret;
}
const char **error_r)
{
if (is_file) {
return 0;
return -1;
}
} else {
return -1;
}
return 0;
}
{
unsigned int i, count;
for (i = 0; i < count; ) {
/* this path has already been counted */
return;
}
/* the new path contains the existing path.
drop it and see if there are more to drop. */
} else {
i++;
}
}
}
static int
const char **error_r)
{
unsigned int i, count;
const char *path;
bool is_file;
for (i = 0; i < count; i++) {
continue;
/* INBOX may be in different path. */
MAILBOX_LIST_PATH_TYPE_MAILBOX, &path) > 0)
}
/* now sum up the found paths */
*value_r = 0;
for (i = 0; i < count; i++) {
return -1;
}
return 0;
}
static enum quota_get_result
{
int ret;
}
}
static int
const char **error_r ATTR_UNUSED)
{
return 0;
}
.name = "dirsize",
.v = {
}
};