1 /* asshelp.h - Helper functions for Assuan
2 * Copyright (C) 2004, 2007 Free Software Foundation, Inc.
4 * This file is part of GnuPG.
6 * This file is free software; you can redistribute it and/or modify
7 * it under the terms of either
9 * - the GNU Lesser General Public License as published by the Free
10 * Software Foundation; either version 3 of the License, or (at
11 * your option) any later version.
15 * - the GNU General Public License as published by the Free
16 * Software Foundation; either version 2 of the License, or (at
17 * your option) any later version.
19 * or both in parallel, as here.
21 * This file is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, see <https://www.gnu.org/licenses/>.
30 #ifndef GNUPG_COMMON_ASSHELP_H
31 #define GNUPG_COMMON_ASSHELP_H
34 #include <gpg-error.h>
36 #include "session-env.h"
41 void setup_libassuan_logging (unsigned int *debug_var_address,
42 int (*log_monitor)(assuan_context_t ctx,
45 void set_libassuan_log_cats (unsigned int newcats);
49 send_pinentry_environment (assuan_context_t ctx,
50 gpg_err_source_t errsource,
51 const char *opt_lc_ctype,
52 const char *opt_lc_messages,
53 session_env_t session_env);
55 /* This function is used by the call-agent.c modules to fire up a new
58 start_new_gpg_agent (assuan_context_t *r_ctx,
59 gpg_err_source_t errsource,
60 const char *agent_program,
61 const char *opt_lc_ctype,
62 const char *opt_lc_messages,
63 session_env_t session_env,
64 int autostart, int verbose, int debug,
65 gpg_error_t (*status_cb)(ctrl_t, int, ...),
66 ctrl_t status_cb_arg);
68 /* This function is used to connect to the dirmngr. On some platforms
69 the function is able starts a dirmngr process if needed. */
71 start_new_dirmngr (assuan_context_t *r_ctx,
72 gpg_err_source_t errsource,
73 const char *dirmngr_program,
74 int autostart, int verbose, int debug,
75 gpg_error_t (*status_cb)(ctrl_t, int, ...),
76 ctrl_t status_cb_arg);
78 /* Return the version of a server using "GETINFO version". */
79 gpg_error_t get_assuan_server_version (assuan_context_t ctx,
80 int mode, char **r_version);
85 /* Helper function to print an assuan status line using a printf
87 gpg_error_t print_assuan_status (assuan_context_t ctx,
90 ...) GPGRT_ATTR_PRINTF(3,4);
91 gpg_error_t vprint_assuan_status (assuan_context_t ctx,
94 va_list arg_ptr) GPGRT_ATTR_PRINTF(3,0);
97 #endif /*GNUPG_COMMON_ASSHELP_H*/