1
/* gpgconf.c - GnuPG Made Easy.
2
Copyright (C) 2007 g10 Code GmbH
4
This file is part of GPGME.
6
GPGME is free software; you can redistribute it and/or modify it
7
under the terms of the GNU Lesser General Public License as
8
published by the Free Software Foundation; either version 2.1 of
9
the License, or (at your option) any later version.
11
GPGME is distributed in the hope that it will be useful, but
12
WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
16
You should have received a copy of the GNU Lesser General Public
17
License along with this program; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
31
/* engine-gpgconf.c. */
32
gpgme_error_t _gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p,
33
gpgme_conf_type_t type, void *value);
34
void _gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type);
35
gpgme_error_t _gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset,
36
gpgme_conf_arg_t arg);
37
void _gpgme_conf_release (gpgme_conf_comp_t conf);
38
gpgme_error_t _gpgme_conf_load (void *engine, gpgme_conf_comp_t *conf_p);
39
gpgme_error_t gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp);
44
/* Allocate a new gpgme_conf_arg_t. */
46
gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p,
47
gpgme_conf_type_t type, void *value)
50
return _gpgme_conf_arg_new (arg_p, type, value);
52
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
57
/* This also releases all chained argument structures! */
59
gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type)
62
return _gpgme_conf_arg_release (arg, type);
67
/* Register a change for the value of OPT to ARG. */
69
gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset, gpgme_conf_arg_t arg)
72
return _gpgme_conf_opt_change (opt, reset, arg);
74
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
80
/* Public function to release a gpgme_conf_comp list. */
82
gpgme_conf_release (gpgme_conf_comp_t conf)
85
_gpgme_conf_release (conf);
90
/* Public function to release load a configuration list. No
91
asynchronous interface for now. */
93
gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p)
97
gpgme_protocol_t proto = ctx->protocol;
99
ctx->protocol = GPGME_PROTOCOL_GPGCONF;
100
err = _gpgme_op_reset (ctx, 1);
104
err = _gpgme_engine_op_conf_load (ctx->engine, conf_p);
105
ctx->protocol = proto;
108
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
113
/* This function does not follow chained components! */
115
gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp)
117
#ifdef ENABLE_GPGCONF
119
gpgme_protocol_t proto = ctx->protocol;
121
ctx->protocol = GPGME_PROTOCOL_GPGCONF;
122
err = _gpgme_op_reset (ctx, 1);
126
err = _gpgme_engine_op_conf_save (ctx->engine, comp);
127
ctx->protocol = proto;
130
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);