aboutsummaryrefslogtreecommitdiffstats
path: root/src/status-table.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-09-15 08:45:04 +0000
committerWerner Koch <[email protected]>2016-09-15 09:39:43 +0000
commited1f2700a73060e2615697491ea9e49ded4293e6 (patch)
tree63501434bf047297fdf770df8c5dac537fdc6be7 /src/status-table.c
parentcore: Minor change of the gpgme_op_edit semantics. (diff)
downloadgpgme-ed1f2700a73060e2615697491ea9e49ded4293e6.tar.gz
gpgme-ed1f2700a73060e2615697491ea9e49ded4293e6.zip
core: New function gpgme_op_interact, deprecate gpgme_op_edit.
* src/gpgme.h.in (gpgme_interact_cb_t): New. (GPGME_INTERACT_CARD): New. (gpgme_op_interact_start, gpgme_op_interact): New. * src/libgpgme.vers, src/gpgme.def: Add new functions. * src/edit.c (op_data_t): Rename fnc to fnc_old and change users. Add fnc. (edit_status_handler): Call old or new callback. (command_handler): Ditto. (interact_start): New. (gpgme_op_interact_start, gpgme_op_interact_start): New. * src/status-table.c (_gpgme_status_to_string): New. * tests/gpg/t-edit.c (edit_fnc): Rename to interact_fnc and change type of STATUS. Use gpgme_io_writen. (main): s/gpgme_op_edit/gpgme_op_interact/. -- This change will eventually allow us to remove all those status codes from gpgme.h. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/status-table.c')
-rw-r--r--src/status-table.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/status-table.c b/src/status-table.c
index 1318c8ed..f44a08fb 100644
--- a/src/status-table.c
+++ b/src/status-table.c
@@ -169,3 +169,15 @@ _gpgme_parse_status (const char *name)
sizeof t, status_cmp);
return r ? r->code : -1;
}
+
+
+const char *
+_gpgme_status_to_string (gpgme_status_code_t code)
+{
+ int i;
+
+ for (i=0; i < DIM(status_table); i++)
+ if (status_table[i].code == code)
+ return status_table[i].name;
+ return "status_code_lost";
+}