quota-private.h revision bd7b1a9000b12349e2a99bb43b3ce8b96a18e92b
#ifndef __QUOTA_PRIVATE_H
#define __QUOTA_PRIVATE_H
#include "mail-storage-private.h"
#include "quota.h"
/* Modules should use do "my_id = quota_module_id++" and
use quota_module_contexts[id] for their own purposes. */
extern unsigned int quota_module_id;
struct quota {
unsigned int debug:1;
unsigned int counting:1;
};
struct quota_backend_vfuncs {
struct quota_root *(*alloc)(void);
/* called once for each backend */
struct mail_storage *storage);
/* the limit is set by default, so it shouldn't normally need to
be changed. */
struct quota_transaction_context *ctx);
};
struct quota_backend {
/* quota backends equal if backend1.name == backend2.name */
const char *name;
struct quota_backend_vfuncs v;
};
struct quota_rule {
char *mailbox_name;
};
struct quota_root {
/* Unique quota root name. */
const char *name;
/* pointer to the quota that owns this root */
struct quota_backend backend;
struct quota_rule default_rule;
/* Module-specific contexts. See quota_module_id. */
ARRAY_DEFINE(quota_module_contexts, void);
};
struct quota_transaction_context {
unsigned int failed:1;
unsigned int recalculate:1;
};
/* Register storage to all user's quota roots. */
struct mail_storage *storage);
#endif