doveadm-quota.c revision 18792f1110ecd1fca5306f3be96fcbe887f6dbcc
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainen/* Copyright (c) 2005-2010 Dovecot authors, see the included COPYING file */
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainenconst char *doveadm_quota_plugin_version = DOVECOT_VERSION;
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainenvoid doveadm_quota_plugin_init(struct module *module);
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainenstatic void cmd_quota_get_root(struct mail_user *user, struct quota_root *root)
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainen const char *const *res;
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainen printf("%s(%s): ", user->username, root->set->name);
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainen ret = quota_get_resource(root, "", *res, &value, &limit);
18792f1110ecd1fca5306f3be96fcbe887f6dbccTimo Sirainen (unsigned long long)value,
18792f1110ecd1fca5306f3be96fcbe887f6dbccTimo Sirainen (unsigned long long)limit);
18792f1110ecd1fca5306f3be96fcbe887f6dbccTimo Sirainen } else if (ret == 0)
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainenstatic void cmd_quota_get(struct mail_user *user, struct quota *quota)
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainenstatic void cmd_quota_recalc(struct quota *quota)
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainen (void)(*root)->backend.v.update(*root, &trans);
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainenstatic void cmd_quota(struct mail_user *user, const char *args[])
9563e6542b7a8a13b13a0ef62ec68b0383b99293Timo Sirainen struct quota_user *quser = QUOTA_USER_CONTEXT(user);