diff options
Diffstat (limited to 'src/op-support.c')
| -rw-r--r-- | src/op-support.c | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/src/op-support.c b/src/op-support.c index 2bcb3a35..02940efd 100644 --- a/src/op-support.c +++ b/src/op-support.c @@ -337,3 +337,27 @@ _gpgme_parse_plaintext (char *args, char **filenamep)      }    return 0;  } + + +/* Parse a FAILURE status line and return the error code.  ARGS is +   modified to contain the location part.  */ +gpgme_error_t +_gpgme_parse_failure (char *args) +{ +  char *where, *which; + +  where = strchr (args, ' '); +  if (!where) +    return trace_gpg_error (GPG_ERR_INV_ENGINE); + +  *where = '\0'; +  which = where + 1; + +  where = strchr (which, ' '); +  if (where) +    *where = '\0'; + +  where = args; + +  return atoi (which); +} | 
