quota.h revision 0df9428baed48afaff90b4d4f03792d2fd756a43
#ifndef QUOTA_H
#define QUOTA_H
struct mail;
struct mailbox;
struct mail_user;
/* Message storage size kilobytes. */
#define QUOTA_NAME_STORAGE_KILOBYTES "STORAGE"
/* Message storage size bytes. This is used only internally. */
#define QUOTA_NAME_STORAGE_BYTES "STORAGE_BYTES"
/* Number of messages. */
#define QUOTA_NAME_MESSAGES "MESSAGE"
struct quota;
struct quota_root;
struct quota_root_iter;
struct quota_transaction_context;
/* Set up a new quota root. */
struct quota_root_settings *
const char *root_def);
/* Add a new rule too the quota root. Returns 0 if ok, -1 if rule is invalid. */
/* Add a new warning rule for the quota root. Returns 0 if ok, -1 if rule is
invalid. */
/* Initialize quota for the given user. */
/* List all quota roots. Returned quota roots are freed by quota_deinit(). */
/* Return quota root or NULL. */
/* Returns name of the quota root. */
/* Return a list of all resources set for the quota root. */
/* Returns 1 if quota value was found, 0 if not, -1 if error. */
/* Returns 0 if OK, -1 if error (eg. permission denied, invalid name). */
/* Start a new quota transaction. */
/* Commit quota transaction. Returns 0 if ok, -1 if failed. */
/* Rollback quota transaction changes. */
/* Allocate from quota if there's space. Returns 1 if updated, 0 if not,
-1 if error. If mail size is larger than even maximum allowed quota,
too_large_r is set to TRUE. */
/* Like quota_try_alloc(), but don't actually allocate anything. */
/* Update quota by allocating/freeing space used by mail. */
/* Mark the quota to be recalculated */
#endif