~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/doveadm/doveadm-mail-mailbox-status.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2010-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2010-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "str.h"
5
5
#include "mail-namespace.h"
6
6
#include "mail-storage.h"
 
7
#include "mail-search.h"
7
8
#include "doveadm-print.h"
8
9
#include "doveadm-mail.h"
9
10
#include "doveadm-mailbox-list-iter.h"
79
80
        }
80
81
}
81
82
 
82
 
static void status_output(struct status_cmd_context *ctx, struct mailbox *box,
83
 
                          const struct mailbox_status *status,
84
 
                          const struct mailbox_metadata *metadata)
 
83
static void ATTR_NULL(2)
 
84
status_output(struct status_cmd_context *ctx, struct mailbox *box,
 
85
              const struct mailbox_status *status,
 
86
              const struct mailbox_metadata *metadata)
85
87
{
86
88
        if (box != NULL)
87
89
                doveadm_print(mailbox_get_vname(box));
124
126
        struct mailbox_status status;
125
127
        struct mailbox_metadata metadata;
126
128
 
127
 
        box = doveadm_mailbox_find(ctx->ctx.cur_mail_user, info->name);
 
129
        box = doveadm_mailbox_find(ctx->ctx.cur_mail_user, info->vname);
128
130
        if (mailbox_get_status(box, ctx->status_items, &status) < 0 ||
129
131
            mailbox_get_metadata(box, ctx->metadata_items, &metadata) < 0) {
130
132
                doveadm_mail_failed_mailbox(&ctx->ctx, box);
145
147
{
146
148
        struct status_cmd_context *ctx = (struct status_cmd_context *)_ctx;
147
149
        enum mailbox_list_iter_flags iter_flags =
148
 
                MAILBOX_LIST_ITER_RAW_LIST |
149
150
                MAILBOX_LIST_ITER_NO_AUTO_BOXES |
150
151
                MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
151
152
        struct doveadm_mailbox_list_iter *iter;
207
208
                doveadm_print_header_simple("guid");
208
209
}
209
210
 
 
211
static void cmd_mailbox_status_deinit(struct doveadm_mail_cmd_context *_ctx)
 
212
{
 
213
        struct status_cmd_context *ctx = (struct status_cmd_context *)_ctx;
 
214
 
 
215
        mail_search_args_unref(&ctx->search_args);
 
216
}
 
217
 
210
218
static bool
211
219
cmd_mailbox_status_parse_arg(struct doveadm_mail_cmd_context *_ctx, int c)
212
220
{
230
238
        ctx->ctx.getopt_args = "t";
231
239
        ctx->ctx.v.parse_arg = cmd_mailbox_status_parse_arg;
232
240
        ctx->ctx.v.init = cmd_mailbox_status_init;
 
241
        ctx->ctx.v.deinit = cmd_mailbox_status_deinit;
233
242
        ctx->ctx.v.run = cmd_mailbox_status_run;
234
243
        doveadm_print_init(DOVEADM_PRINT_TYPE_FLOW);
235
244
        return &ctx->ctx;