diff options
author | Werner Koch <[email protected]> | 2005-05-31 10:11:01 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2005-05-31 10:11:01 +0000 |
commit | a6a93ac54036c17de906e581de7aeeba5e463a31 (patch) | |
tree | aaee931cc8862f003d5f847ac0de364081199f3e /g10/cardglue.c | |
parent | Updated FSF street address and preparations for a release candidate. (diff) | |
download | gnupg-a6a93ac54036c17de906e581de7aeeba5e463a31.tar.gz gnupg-a6a93ac54036c17de906e581de7aeeba5e463a31.zip |
* keydb.h [!ENABLE_AGENT_SUPPORT]: Define dummy types.
* cardglue.c (assuan_strerror, assuan_transact): Dummy functions
if not build with agent support.
* zh_TW.po, zh_CN.po, es.po, ro.po: Updated.
* tr.po: Updated from TP. Note: this is an exception in general
translations from the Robot are not anymore accepted.
* regcomp.c (MB_CUR_MAX) [_WIN32]: Define it only if not defined.
Diffstat (limited to '')
-rw-r--r-- | g10/cardglue.c | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/g10/cardglue.c b/g10/cardglue.c index ae4d37ab0..6ab241dc2 100644 --- a/g10/cardglue.c +++ b/g10/cardglue.c @@ -44,11 +44,6 @@ #include "apdu.h" #include "app-common.h" -/* If we build w/o agent support, assuan.h won't be included and thus - we need to define a repalcement for the assuan error type. */ -#ifndef ENABLE_AGENT_SUPPORT -typedef int assuan_error_t; -#endif struct ctrl_ctx_s @@ -81,6 +76,48 @@ static app_t current_app; static assuan_error_t learn_status_cb (void *opaque, const char *line); +/* To avoid cluttering the code with bunches of ifdefs we use a few + dummy functions instead and defines. */ +#ifndef ENABLE_AGENT_SUPPORT + +#define ASSUAN_LINELENGTH 100 + +static assuan_context_t +agent_open (int try) +{ + return NULL; +} + +void +agent_close (assuan_context_t ctx) +{ +} + +const char * +assuan_strerror (assuan_error_t err) +{ + return "no Assuan support"; +} + +assuan_error_t +assuan_transact (assuan_context_t ctx, + const char *command, + assuan_error_t (*data_cb)(void *, const void *, size_t), + void *data_cb_arg, + assuan_error_t (*inquire_cb)(void*, const char *), + void *inquire_cb_arg, + assuan_error_t (*status_cb)(void*, const char *), + void *status_cb_arg) +{ + return 100; /* ASSUAN_NOT_IMPLEMENTED */ +} +assuan_error_t +assuan_send_data (assuan_context_t ctx, const void *buffer, size_t length) +{ + return 100; /* ASSUAN_NOT_IMPLEMENTED */ +} +#endif /*!ENABLE_AGENT_SUPPORT*/ + /* Create a serialno/fpr string from the serial number and the secret key. caller must free the returned string. There is no error @@ -253,9 +290,6 @@ app_get_serial_and_stamp (app_t app, char **serial, time_t *stamp) - - - /* Release the card info structure. */ void agent_release_card_info (struct agent_card_info_s *info) @@ -280,7 +314,7 @@ agent_release_card_info (struct agent_card_info_s *info) } -/* Print an error message for a failed assuan-Transact and return a +/* Print an error message for a failed assuan_transact and return a gpg error code. No error is printed if RC is 0. */ static gpg_error_t test_transact (int rc, const char *command) |