diff options
| author | Justus Winter <[email protected]> | 2016-05-10 11:03:34 +0000 | 
|---|---|---|
| committer | Justus Winter <[email protected]> | 2016-05-10 11:03:34 +0000 | 
| commit | f531608539b45f0bbd036f430943b390ec21aa65 (patch) | |
| tree | 56cf3f4db0c38e668645668ebb3dec418bed77a5 /src/op-support.c | |
| parent | More GTK2 removal (diff) | |
| parent | Allow cc to detect missing cases in a switch. (diff) | |
| download | gpgme-f531608539b45f0bbd036f430943b390ec21aa65.tar.gz gpgme-f531608539b45f0bbd036f430943b390ec21aa65.zip | |
Merge branch 'master' into justus/pyme3
Diffstat (limited to '')
| -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); +} | 
