aboutsummaryrefslogtreecommitdiffstats
path: root/src/op-support.c
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-05-10 11:03:34 +0000
committerJustus Winter <[email protected]>2016-05-10 11:03:34 +0000
commitf531608539b45f0bbd036f430943b390ec21aa65 (patch)
tree56cf3f4db0c38e668645668ebb3dec418bed77a5 /src/op-support.c
parentMore GTK2 removal (diff)
parentAllow cc to detect missing cases in a switch. (diff)
downloadgpgme-f531608539b45f0bbd036f430943b390ec21aa65.tar.gz
gpgme-f531608539b45f0bbd036f430943b390ec21aa65.zip
Merge branch 'master' into justus/pyme3
Diffstat (limited to '')
-rw-r--r--src/op-support.c24
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);
+}