1 /* progress.c - status handler for progress status
2 Copyright (C) 2000 Werner Koch (dd9jn)
3 Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
5 This file is part of GPGME.
7 GPGME is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation; either version 2.1 of
10 the License, or (at your option) any later version.
12 GPGME is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34 _gpgme_progress_status_handler (void *priv, gpgme_status_code_t code,
37 gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
44 if (code != GPGME_STATUS_PROGRESS || !*args || !ctx->progress_cb)
47 args_cpy = strdup (args);
49 return gpg_error_from_errno (errno);
51 p = strchr (args_cpy, ' ');
57 type = *(unsigned char *)p;
58 p = strchr (p+1, ' ');
65 p = strchr (p+1, ' ');
77 ctx->progress_cb (ctx->progress_cb_value, args_cpy, type, current, total);