Remove support for libgpgme-pth.
[gpgme.git] / src / ChangeLog
1 2011-10-25  Marcus Brinkmann  <marcus@g10code.com>
2
3         * Makefile.am: Remove build rules for libgpgme-pth.
4         * gpgme.m4: Remove support for libgpgme-pth.
5
6 2011-05-26  Marcus Brinkmann  <marcus@g10code.com>
7
8         * decrypt.c (gpgme_op_decrypt_start, gpgme_op_decrypt): Check CTX.
9         * decrypt-verify.c (gpgme_op_decrypt_verify_start)
10         (gpgme_op_decrypt_verify): Likewise.
11         * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise.
12         * edit.c (gpgme_op_edit_start, gpgme_op_edit)
13         (gpgme_op_card_edit_start, gpgme_op_card_edit): Likewise.
14         * encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt): Likewise.
15         * encrypt-sign.c (gpgme_op_encrypt_sign_start)
16         (gpgme_op_encrypt_sign): Likewise.
17         * export.c (gpgme_op_export_start, gpgme_op_export)
18         (gpgme_op_export_ext_start, gpgme_op_export_ext)
19         (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
20         * genkey.c (gpgme_op_genkey_start, gpgme_op_genkey): Likewise.
21         * getauditlog.c (gpgme_op_getauditlog_start)
22         (gpgme_op_getauditlog): Likewise.
23         * gpgconf.c (gpgme_op_conf_load, gpgme_op_conf_save): Likewise.
24         * import.c (gpgme_op_import_start, gpgme_op_import_keys_start)
25         (gpgme_op_import_keys, gpgme_op_import): Likewise.
26         * keylist.c (gpgme_op_keylist_start, gpgme_op_keylist_ext_start): Likewise.
27         * opassuan.c (gpgme_op_assuan_transact_start)
28         (gpgme_op_assuan_transact_ext): Likewise.
29         * passwd.c (gpgme_op_passwd_start, gpgme_op_passwd): Likewise.
30         * sign.c (gpgme_op_sign_start, gpgme_op_sign): Likewise.
31         * trustlist.c (gpgme_op_trustlist_start)
32         (gpgme_op_trustlist_next): Likewise.
33         * verify.c (gpgme_op_verify_start, gpgme_get_sig_key): Likewise.
34         * op-support.c (_gpgme_op_data_lookup): Likewise.
35         * vfs-create.c (gpgme_op_vfs_transact, gpgme_op_vfs_create): Likewise.
36         * vfs-mount.c (gpgme_op_vfs_mount, gpgme_op_vfs_transact): Likewise.
37         * gpgme.c (gpgme_set_protocol)
38         (gpgme_set_sub_protocol)
39         (gpgme_set_armor, gpgme_set_include_certs)
40         (gpgme_set_keylist_mode, gpgme_set_passphrase_cb)
41         (gpgme_set_progress_cb, gpgme_set_io_cbs, gpgme_set_locale)
42         (gpgme_ctx_set_engine_info, gpgme_sig_notation_clear): Likewise.
43         * gpgme.c (gpgme_new): Check for valid R_CTX.
44         (gpgme_cancel, gpgme_cancel_async, gpgme_release): Likewise.
45
46 2011-04-06  Werner Koch  <wk@g10code.com>
47
48         * gpgme-config.in: Add option --host.  Change options --cflags and
49         --libs to collapse duplicate include and lib dirs.  Try to put
50         extra libs at the end.
51
52         * gpgme.h.in: Use INSERT__TYPEDEFS_FOR_GPGME_H to include platform
53         specific typedefs.
54
55 2011-02-03  Werner Koch  <wk@g10code.com>
56
57         * extra-stati.h: New.
58         * mkstatus: Extend to also process extra-stati.h
59         * Makefile.am (main_sources): Add extra-stati.h
60         (status-table.h): Depend on extra-stati.h and adjust rule.
61
62 2011-02-03  Marcus Brinkmann  <marcus@g10code.com>
63
64         * w32-io.c (_gpgme_io_socket): Return fd, not res.
65
66 2011-02-02  Marcus Brinkmann  <mb@g10code.com>
67
68         * assuan-support.c (my_socket, my_connect): New functions.
69         (_gpgme_assuan_system_hooks): Add my_Socket, my_connect.
70         * priv-io.h (_gpgme_io_socket): New prototype.
71         * w32-io.c (pid_to_handle, handle_to_oid, fd_to_handle): Remove macros.
72         (is_socket): Remove function.
73         (_gpgme_io_spawn) [HAVE_W32CE_SYSTEM]: Remove some dead code.
74         (_gpgme_io_spawn): Translate handles before DuplicateHandle them.
75
76 2011-02-02  Marcus Brinkmann  <mb@g10code.com>
77
78         * w32-util.c (mkstemp): Don't use CreateFile instead of open (the
79         function is not used on Windows CE, and the callers were not
80         adjusted).
81
82 2011-01-21  Marcus Brinkmann  <mb@g10code.com>
83
84         * engine-gpgconf.c (_gpgme_conf_opt_change): Fix the case that is
85         not self-assignment.
86
87 2010-12-08  Werner Koch  <wk@g10code.com>
88
89         * gpgme-tool.c (strcpy_escaped_plus): New.
90         (DIM, xtoi_1, xtoi_2): New.
91         (cmd_keylist): Allow for multiple patterns.
92
93 2010-11-23  Marcus Brinkmann  <mb@g10code.com>
94
95         * w32-io.c (create_reader, create_writer): Use small stack size on
96         Windows CE.
97
98 2010-11-23  Marcus Brinkmann  <mb@g10code.com>
99
100         * gpgme.h.in (gpgme_conf_arg_new): Make VALUE arg const void *.
101         * gpgconf.c (_gpgme_conf_arg_new): Likewise.
102         (gpgme_conf_arg_new): Likewise.
103         * engine-gpgconf.c (_gpgme_conf_arg_new): Likewise.
104         (gpgconf_write): Remove debug hack.
105
106 2010-11-19  Marcus Brinkmann  <mb@g10code.com>
107
108         * engine-gpgconf.c (_gpgme_conf_opt_change): Support
109         self-assignment.  Requested by Marc Mutz.
110
111 2010-11-17  Marcus Brinkmann  <mb@g10code.com>
112
113         * vasprintf.c (int_vasprintf) [HAVE_W32CE_SYSTEM]: Just use a
114         fixed size buffer, as va_copy is not easy to fake.
115
116 2010-11-15  Marcus Brinkmann  <mb@g10code.com>
117
118         * w32-ce.h (strcasecmp, strdup) [_MSC_VER]: Define.
119         * genkey.c, passphrase.c: Include util.h.
120
121         * w32-util.c (_gpgme_w32ce_get_debug_envvar): Fix return value.
122
123 2010-11-15  Werner Koch  <wk@g10code.com>
124
125         * data-compat.c (gpgme_data_new_from_filepart)
126         (gpgme_data_new_from_file) [W32CE && _MSC_VER]: Return not
127         GPG_ERR_NOT_IMPLEMENTED.
128
129         * w32-ce.h (HKEY_PERFORMANCE_DATA, HKEY_CURRENT_CONFIG, _IOLBF)
130         (abort) [_MSC_VER]: Provide these macros.
131
132         * ath.h [W32CE && _MSC_VER]: Include winsock2.h.
133
134         * ath.c (ath_read, ath_write) [W32CE && _MSC_VER]: Do not call
135         non-available functions.
136
137 2010-11-04  Werner Koch  <wk@g10code.com>
138
139         * w32-ce.h [_MSC_VER && W32CE]: Undef leave.
140         * export.c: Include util.h so that we get the above undef.
141
142         * memrchr.c: Remove.  Used to be a replacement function required
143         by the formerly included assuan code.
144
145 2010-11-03  Werner Koch  <wk@g10code.com>
146
147         * debug.c (_gpgme_debug) [W32CE]: Replace locatime by GetLocalTime.
148
149         * signers.c (gpgme_signers_clear): Remove useless return.
150         Reported by Patrick Spendrin.
151
152         * w32-util.c: s/__inline__/GPG_ERR_INLINE/
153
154         * setenv.c: Include string.h due to our strerror replacement.
155
156         * w32-ce.h (access, bsearch): New macros.
157         * w32-ce.c (_gpgme_wince_access): New.
158         (RegQueryValueExA): Change DATA to a void*.
159         (_gpgme_wince_bsearch): New.  Taken from glibc 2.6.
160
161         Guard include of sys/stat.h and sys/types.h.
162
163 2010-11-02  Werner Koch  <wk@g10code.com>
164
165         * data-fd.c (read, write, lseek) [W32CE && ! __MINGW32CE__]: New.
166         Taken from Pedro Alves Public Domain code.
167
168         * w32-ce.h (SHGetSpecialFolderPath): Remove our defines and
169         prototypes.  We use the system provided prototypes now.
170         * w32-ce.c: Include shlobj.h
171         (_WIN32_IE): Define to 0x0400
172         (CreateFileA): New.
173         * w32-util.c: Explicitly include windows headers before util.h.
174         (_gpgme_w32ce_get_debug_envvar): Do not use wchar_t strings for
175         read_w32_registry_string.
176         (mkstemp): Use CreateFile instead of open.
177
178         * w32-io.c (handle_to_fd, fd_tohandle): Add.  We need them for W32.
179         * w32-util.c (_WIN32_IE): Define to 0x0400.
180
181         * util.h [W32]: Include windows.h.
182         * w32-sema.c: Do not include windows.h directly.
183         * ath.c (ssize_t, pid_t)[_MSC_VER]: Add new types.
184         * gpgme.c (gpgme_result_ref, gpgme_result_unref): Do not use a
185         void pointer in pointer arithmetic.
186         * w32-util.c: Include util.h prior to ath.h.  Don't include
187         windows.h directly.
188         (F_OK): Define if not defined.
189         * w32-ce.c: Include string.h.
190         (RegQueryValueExA): Use WINAPI modifier to match the declaration.
191         * vfs-create.c: Include string.h because under W32CE with MSC we
192         get a warning related to our strerror replacement.
193         * encrypt-sign.c: Include stdlib.h, string.h and errno.h.
194         * priv-io.h [W32CE]: Include w32-ce.h
195         * w32-ce.h: Include winsock2.h and ws2tcpip.h.
196         (_MSV_VER): Remove useless macro.
197         (pid_t): Add typedef.
198
199         Guard all includes of unistd.h and sys/time.h.
200
201 2010-10-28  Marcus Brinkmann  <marcus@g10code.com>
202
203         * opassuan.c (gpgme_op_assuan_transact_ext): Fix uninitialized
204         value use.  Reported by Marc Mutz.
205
206 2010-10-07  Werner Koch  <wk@g10code.com>
207
208         * gpgme-tool.c (ARGP_ERR_UNKNOWN): Use EDEADLK if available.
209
210         * w32-util.c (_gpgme_w32ce_get_debug_envvar) [W32CE]: New.
211         * debug.c (debug_init) [W32CE]: Use new function.
212
213 2010-09-16  Werner Koch  <wk@g10code.com>
214
215         * import.c: Include "util.h".
216         (parse_import): Return GPG_ERR_MISSING_ISSUER_CERT.
217
218         * util.h: Add fallback define for GPG_ERR_MISSING_ISSUER_CERT.
219         * op-support.c: Include "util.h".
220         (_gpgme_parse_inv_recp): Handle new code 12.
221
222 2010-09-02  Marcus Brinkmann  <marcus@g10code.de>
223
224         * error.c (gpgme_err_code_to_errno): Fix cut and paste bug (thanks
225         to Marc Mutz).
226
227 2010-09-01  Marcus Brinkmann  <marcus@g10code.de>
228
229         * w32-io.c: Revert change from 2009-06-18, as it created a race
230         condition.
231
232 2010-08-18  Marcus Brinkmann  <marcus@g10code.de>
233
234         * gpgme.def: Add gpgme_err_code_from_syserror and gpgme_err_set_errno.
235         * libgpgme.vers: Likewise.
236         * gpgme.h.in (gpgme_error_from_errno): Fix return type to
237         gpgme_error_t.
238         (gpgme_err_code_from_syserror, gpgme_err_set_errno): New prototype.
239         (gpgme_error_from_syserror): New inline function (why are
240         gpgme_err_make_from_errno and gpgme_error_from_errno not inline
241         functions?).
242         * error.c (gpgme_error_from_errno): Fix return type to gpgme_error_t.
243         (gpgme_err_set_errno, gpgme_err_code_from_syserror): New functions.
244
245 2010-08-03  Marcus Brinkmann  <marcus@g10code.de>
246
247         * gpgme-tool.c (result_encrypt_to_xml, result_sign_to_xml)
248         (result_verify_to_xml, result_import_to_xml)
249         (result_genkey_to_xml): Check vigorously for null pointers.
250
251         * w32-io.c (GPGCEDEV_IOCTL_ASSIGN_RVID): New macro.
252         (_gpgme_io_spawn): Use ASSIGN_RVID.
253
254 2010-06-11  Marcus Brinkmann  <marcus@g10code.de>
255
256         * w32-io.c (_gpgme_io_spawn): Remove debug printf.
257
258 2010-06-10  Marcus Brinkmann  <marcus@g10code.de>
259
260         * gpgme-tool.c (gpgme_server): Use special hack for Windows CE to
261         get at stdin and stdout.
262
263         * engine-gpgsm.c (gpgsm_new): Translate returned achild_fds back
264         to child_fds.
265
266         * debug.h (TRACE_SUC6): New macro.
267         * w32-io.c (MAX_SLAFD): New macro.
268         (fd_table): New static variable.
269         (new_fd, release_fd): New functions.
270         (fd_to_handle, handle_to_fd, handle_to_socket): Remove macros.
271         (MAX_READERS, MAX_WRITERS): Increase to 64.
272         (notify_table): Increase to MAX_SLAFD.
273         (struct reader_context_s, struct writer_context_s): Add member
274         file_sock.
275         (reader, writer): Use file_hd vs file_sock to decide if socket
276         operations to use.  Remove auto-detect mode.
277         (create_reader, create_writer): Set file_sock.  Unblock pending
278         thread only if this is a pipe fd.
279         (_gpgme_io_pipe): Allocate fds from table and return slot indices
280         instead of windows handles.  This allows to properly handle RVIDs.
281         (_gpgme_io_close): Handle dup'ed file descriptors.
282         (build_commandline) [HAVE_W32_SYSTEM]: Use RVID from fd table now.
283         (_gpgme_io_spawn): Use fd table now.
284         (_gpgme_io_fd2str): Use RVID from fd table now.
285         (_gpgme_io_dup): Implement using fd table.
286         (_gpgme_io_socket): Allocate fds from table.
287         (_gpgme_io_connect): Use fd from table.
288
289         * w32-glib-io.c (find_channel): Check that the slot is used.
290
291 2010-06-09  Marcus Brinkmann  <marcus@g10code.de>
292
293         * w32-io.c [HAVE_W32CE_SYSTEM]: Include assuan.h and winioctl.h.
294         (GPGCEDEV_IOCTL_UNBLOCK) [HAVE_W32CE_SYSTEM]: Define.
295         (set_synchronize) [HAVE_W32CE_SYSTEM]: Stub it out.
296         (is_socket): Allow to return -1 for auto-detect (old behaviour).
297         (is_socket) [HAVE_W32CE_SYSTEM]: Return -1.
298         (reader): Handle auto-detect case.  Handle ctx->stop_me before
299         checking for EOF.
300         (destroy_reader) [HAVE_W32CE_SYSTEM]: Unblock a pending reader.
301         (writer): Handle auto-detect case.  Handle ctx->stop_me with
302         ERROR_BUSY.
303         (destroy_writer) [HAVE_W32CE_SYSTEM]: Unblock a pending writer.
304         (_gpgme_io_pipe) [HAVE_W32CE_SYSTEM]: Implement in terms of a
305         half-pipe.
306         (build_commandline) [HAVE_W32CE_SYSTEM]: New function.
307         (_gpgme_io_spawn) [HAVE_W32CE_SYSTEM]: Implement it differently
308         for this platform.
309         (_gpgme_io_fd2str) [HAVE_W32CE_SYSTEM]: Implement it for RVIDs.
310         (_gpgme_io_dup) [HAVE_W32CE_SYSTEM]: Stub it out.
311
312         * gpgme-tool.c (result_add_timestamp): Add missing NULL argument.
313         (result_sign_to_xml): Protect against NULL fingerprint.
314         (struct server): New members input_fd, input_filename,
315         input_stream output_fd, output_filename, output_stream,
316         message_filename, message_stream.
317         (server_reset_fds): Deallocate those.
318         (server_parse_fd): New function.
319         (server_data_obj): Take optional filename argument and direction
320         argument.  Also take new argument to return a filestream that
321         needs to be closed after destroying the data object.
322         Change all callers, too.
323         (input_notify, output_notify): Removed.
324         (cmd_input, cmd_output): New functions.
325         (gpgme_server): Do not register input and output notifier.
326         (register_commands): Use cmd_input and cmd_output.
327         (cmd_message): Rewritten to use server_parse_fd.
328         (cmd_delete, cmd_keylist): Fix inverted option check.
329         (main) [HAVE_W32CE_SYSTEM]: Sleep a bit to work around bug in ssh.
330
331         * genkey.c (gpgme_op_genkey): Return err with TRACE_ERR.
332
333 2010-05-12  Marcus Brinkmann  <marcus@g10code.de>
334
335         * conversion.c (_gpgme_timegm) [HAVE_W32_SYSTEM]: New static
336         function.
337         (_gpgme_parse_timestamp) [HAVE_W32_SYSTEM]: Use it.
338
339         * gpgme-tool.c (main): Protect call to setlocale with
340         HAVE_SETLOCALE.
341
342         * Makefile.am (system_components): Remove custom cppflags from
343         RCCOMPILE (because gpg-error adds -idirafter that makes RC bail.
344         [HAVE_W32CE_SYSTEM]: Add w32-ce.h and w32-ce.c, clear
345         libexec_PROGRAMS.
346         * w32-ce.h, w32-ce.c: New files.
347
348         * priv-io.h: Include <sys/types.h>
349         * util.h: Likewise.
350
351 2010-05-11  Marcus Brinkmann  <marcus@g10code.de>
352
353         * w32-util.c: Include ath.h
354         (HAVE_ALLOW_SET_FOREGROUND_WINDOW) [!HAVE_W32CE_SYSTEM]: Define
355         it.
356         (RTLD_LAZY, dlopen, dlsym,
357         dlclose) [!HAVE_ALLOW_SET_FORGROUND_WINDOW]: Don't define anymore.
358         (_gpgme_allow_set_foreground_window) [!HAVE_ALLOW_SET_FOREGROUND_WINDOW]:
359         Make it a stub.
360         (read_w32_registry_string): Use FooA variants of Windows functions
361         instead of Foo (which dispatches depending on UNICODE).
362         [!HAVE_W32CE_SYSTEM]: Don't check environment.
363         (w32_shgetfolderpath): Remove.
364         (find_program_at_standard_place): Call
365         SHGetSpecialFolderPath (which is available on all Windows systems
366         and also Windows CE).
367         (mkstemp): Use ath_self instead of getpid.
368         (_gpgme_mkstemp): Use GetTempPathA instead of GetTempPath.
369
370         * gpgme.h.in: Use _WIN32 instead of _MSC_VER.  Include time.h for
371         time_t.
372
373 2010-05-07  Marcus Brinkmann  <marcus@g10code.de>
374
375         * engine-g13.c, gpgme.c, engine-gpgsm.c, engine-gpg.c,
376         op-support.c, engine-assuan.c, gpgme-tool.c: Include <locale.h>
377         only if available with HAVE_LOCALE_H and conditionalize use of
378         LC_CTYPE on its definition.
379         * engine-gpgconf.c: Do not include <locale.h>.
380
381         * engine-gpgsm.c (gpgsm_new, start): Cast between int and
382         assuan_fd_t.
383         * assuan-support.c (my_pipe, my_close, my_read, my_write): Likewise.
384         * gpgme-tool.c (server_data_obj, server_reset_fds, gpgme_server),
385         (my_recvmsg, my_sendmsg, my_spawn): Likewise.
386         * engine-assuan.c (start): Likewise.
387         * engine-g13.c (start): Likewise.
388
389 2010-05-06  Marcus Brinkmann  <marcus@g10code.de>
390
391         * w32-glib-io.c, w32-io.c, w32-qt-io.cpp, w32-sema.c, w32-util.c:
392         Do not include <signal.h>.
393
394         * sign.c, data-user.c, conversion.c, debug.c, verify.c, data.c,
395         decrypt.c, delete.c, assuan-support.c, import.c, engine-gpgsm.c,
396         data-mem.c, op-support.c, w32-io.c, w32-util.c, data-compat.c: Use
397         gpg_error_from_syserror instead gpg_error_from_errno, and use
398         gpg_err_set_errno to set error number.
399         * setenv.c: Include <gpg-error.h> and define __set_errno to use
400         gpg_err_set_errno.
401         * gpgme-tool.c (ARGP_ERR_UNKNOWN): Define to EDEADLOCK (which is
402         mapped in Windows CE) instead of E2BIG (which is not).
403         (gt_import_keys): Initialize err.
404
405 2010-04-19  Marcus Brinkmann  <marcus@g10code.de>
406
407         * assuan-support.c (my_spawn): Cast to avoid warning.
408         * engine-g13.c (g13_new): Make ARGV array of pointer to const
409         char.
410         (g13_assuan_simple_command) [!USE_DESCRIPTOR_FUNCTION]: Don't define.
411         * ops.h (_gpgme_key_append_name): Same in prototype.
412         * key.c (_gpgme_key_append_name): Make SRC argument pointer to
413         const char.
414         * posix-util.c (_gpgme_get_uiserver_socket_path): Make HOMEDIR
415         const.
416         * vfs-mount.c (gpgme_op_vfs_transact_start): Never define this
417         potentially useful but currently unused function.
418         * vfs-create.c (gpgme_op_vfs_transact_start): Likewise.
419
420 2010-04-16  Werner Koch  <wk@g10code.com>
421
422         * w32-io.c (is_socket): New.
423         (reader, writer): Use it to figure out the API to use.
424
425 2010-03-15  Werner Koch  <wk@g10code.com>
426
427         * gpgme.h.in: Add autoconf template to set generated file to
428         read-only in an emacs buffer.
429
430 2010-03-12  Werner Koch  <wk@g10code.com>
431
432         * gpgme.h.in (GPGME_STATUS_SUCCESS): Use the right file for the
433         change; see below.
434
435         * passwd.c (op_data_t): New.
436         (passwd_start): Setup OPD.
437         (passwd_status_handler): Return GPG_ERR_NOT_SUPPORTED if needed.
438         * context.h (OPDATA_PASSWD): New.
439         * gpgme.h (GPGME_STATUS_SUCCESS): New.
440
441 2010-03-09  Werner Koch  <wk@g10code.com>
442
443         * engine-gpgsm.c (gpgsm_keylist): Try to start the agent.
444
445 2010-02-17  Werner Koch  <wk@g10code.com>
446
447         * posix-io.c (notify_table): Change implementation.
448         (notify_table_item_t, notify_table_size, notify_table_lock): New.
449         (_gpgme_io_close, _gpgme_io_set_close_notify): Adjust for new
450         implementation.
451
452 2010-02-16  Werner Koch  <wk@g10code.com>
453
454         * gpgme-tool.c (spacep, has_option, skip_options): New.
455         (cmd_export): Implement option --minimal.
456
457         * gpgme.h.in (GPGME_EXPORT_MODE_MINIMAL): New.
458         * export.c (export_start, export_ext_start): Implement it.
459         * engine-gpg.c (export_common): Ditto.
460
461 2010-01-25  Werner Koch  <wk@g10code.com>
462
463         * w32-io.c (_gpgme_io_connect): Fix return code check to make it work.
464
465         * version.c (do_subsystem_inits): Remove superfluous second
466         WSAStartup.
467
468 2010-01-22  Werner Koch  <wk@g10code.com>
469
470         * w32-io.c (writer): Try to use send first.
471         (reader): Try to use recv first.
472
473 2010-01-08  Werner Koch  <wk@g10code.com>
474
475         * engine-gpg.c (gpg_passwd): New.
476         (_gpgme_engine_ops_gpg): Register.
477         * passwd.c (parse_error): New.
478         (passwd_status_handler): Use it.
479
480 2010-01-07  Marcus Brinkmann  <marcus@g10code.de>
481
482         * gpgme-tool.c (result_xml_write_cb_t, struct result_xml_state):
483         New types.
484         (MAX_TAGS): New macro.
485         (result_init, result_xml_indent, result_xml_tag_start)
486         (result_xml_tag_data, result_xml_tag_end, result_add_error)
487         (result_add_pubkey_algo, result_add_hash_algo, result_add_keyid)
488         (result_add_fpr, result_add_timestamp, result_add_sig_mode)
489         (result_add_value, result_add_string, result_encrypt_to_xml)
490         (result_decrypt_to_xml, result_sign_to_xml)
491         (result_verify_to_xml, result_import_to_xml)
492         (result_genkey_to_xml, result_keylist_to_xml)
493         (result_vfs_mount_to_xml): New functions.
494         (gt_result): Rewritten.
495
496 2010-01-05  Werner Koch  <wk@g10code.com>
497
498         * gpgme-tool.c (gt_passwd, cmd_passwd): New.
499         (register_commands): Register.
500
501         * gpgme.h.in (gpgme_op_passwd_start, gpgme_op_passwd): New.
502         * libgpgme.vers, gpgme.def: Add new functions.
503         * passwd.c: New.
504         * Makefile.am (main_sources): Add passwd.c
505         * engine.c, engine.h (_gpgme_engine_op_passwd): New.
506         * engine-backend.h (struct engine_ops): Add PASSWD.
507         * engine-gpgsm.c (gpgsm_passwd): New.
508         (_gpgme_engine_ops_gpgsm): Register.
509         (gpgsm_reset): Reset only if we have a conenction.
510
511         * gpgme.h.in (GPGME_PK_ECDSA, GPGME_PK_ECDH): New.
512         * gpgme.c (gpgme_pubkey_algo_name): Add them.
513
514 2009-12-22  Marcus Brinkmann  <marcus@g10code.de>
515
516         * debug.c: Test for TLS, not __GNUC__
517
518 2009-12-15  Marcus Brinkmann  <marcus@g10code.de>
519
520         * assuan-support.c (my_spawn): Calloc, not malloc, the fd_items.
521
522 2009-12-10  Werner Koch  <wk@g10code.com>
523
524         * debug.c (debug_init): Test on sgid process.
525
526 2009-12-08  Marcus Brinkmann  <marcus@g10code.de>
527
528         * Makefile.am (LTRCCOMPILE): Refactor with ...
529         (RCCOMPILE): ... this new macro.
530         (SUFFIXES): Add .lo.
531         (gpgme_res_ldflag): Removed.
532         (gpgme_res): Use libtool object file name here.
533         (libgpgme_la_LDFLAGS): Remove gpgme_res_ldflag usage.
534         (libgpgme_la_LIBADD): Add gpgme_res.
535
536         * ath.c (ath_self) [HAVE_W32_SYSTEM]: Fix typo.
537
538 2009-12-02  Werner Koch  <wk@g10code.com>
539
540         * gpgconf.c (gpgme_conf_arg_release): No return in a function
541         returning void.  Reported by Wyllys Ingersoll.
542
543 2009-12-01  Werner Koch  <wk@g10code.com>
544
545         * gpgme-tool.c (cmd_getauditlog): Add flag --html.
546         (hlp_getauditlog): New.
547
548         * gpgme-tool.c (GT_GCC_A_SENTINEL, GT_GCC_A_PRINTF): New.
549         (gt_write_status): Use sentinel.
550         (argp_error, log_error): Use printf attribute.
551         (argp_parse): Remove extra argument to argp_error.
552         (_gt_progress_cb, gt_get_engine_info, gt_get_keylist_mode)
553         (gt_result): Add NULL arg.
554
555 2009-11-26  Marcus Brinkmann  <marcus@g10code.de>
556
557         * opassuan.c (opassuan_start): Allocate result structure before
558         beginning operation.
559
560 2009-11-25  Marcus Brinkmann  <marcus@g10code.de>
561
562         * gpgme-tool.c (gpgme_server): Use assuan_fd_t and assuan_fdopen
563         on fds.
564
565 2009-11-13    <wk@g10code.com>
566
567         * sign.c (_gpgme_sign_status_handler): Handle SIG_CREATED_SEEN.
568         * engine-uiserver.c (uiserver_sign): Make sending SENDER optional.
569
570 2009-11-10  Marcus Brinkmann  <marcus@g10code.de>
571
572         * op-support.c (_gpgme_op_reset): Instead of last change, only set
573         sub protocol if it is not the default.
574
575 2009-11-10  Werner Koch  <wk@g10code.com>
576
577         * op-support.c (_gpgme_op_reset): Ignore GPG_ERR_NOT_IMPLEMENTED
578         while setting the sub protocol.
579
580         * engine-uiserver.c (uiserver_new): Pass fdpassing flag to
581         assuan_socket_connect.
582         (set_recipients): Replace fingerprint by user id.
583
584         * engine-gpgsm.c (set_recipients): Fix non-terminating loop in
585         case of a missing key.
586
587 2009-11-10  Marcus Brinkmann  <marcus@g10code.de>
588
589         * gpgme.c (gpgme_new): Set default sub protocol.
590         * gpgme-tool.c: Implement get sub protocol.
591
592         * gpgme.h.in (gpgme_get_sub_protocol): Add prototype.
593         * gpgme.def, libgpgme.vers: Add gpgme_get_sub_protocol.
594         * context.h (struct gpgme_context): New member sub_protocol.
595         * gpgme.c (gpgme_set_sub_protocol): Set CTX->sub_protocol.
596         (gpgme_get_sub_protocol): New function.
597         * op-support.c (_gpgme_op_reset): Set sub protocol.
598
599         * Makefile.am (uiserver_components): New variable.
600         (main_sources): Add it.
601         * ops.h, key.c (_gpgme_key_append_name): Take CONVERT argument,
602         implement it.  Adjust callers.
603         (gpgme_key_from_uid): New function.
604         * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_DEFAULT.
605         (gpgme_encrypt_flags_t): Add GPGME_ENCRYPT_PREPARE,
606         GPGME_ENCRYPT_EXPECT_SIGN.
607         (gpgme_set_sub_protocol, gpgme_key_from_uid): New functions.
608         * libgpgme.vers, gpgme.def: Add new functions.
609         * gpgme.c (gpgme_set_protocol): Add UIServer protocol.
610         (gpgme_set_sub_protocol): New function.
611         (gpgme_get_protocol_name): Add UIServer and default protocol.
612         * assuan-support.c: Return correct error values, implement
613         socketpair for POSIX.
614         * priv-io.h, posix-io.c, w32-io.c, w32-glib-io.c,
615         w32-qt-io.cpp (_gpgme_io_spawn): Add ATFORK and ATFORKVALUE
616         arguments.  Implement it for POSIX.  Adjust all callers.
617         * engine.h, engine-backend.h (_gpgme_engine_set_protocol)
618         (_gpgme_engine_op_decrypt_verify): New prototypes.  Adjust all
619         users.
620         * engine.c (engine_ops, gpgme_get_engine_info): Add UIServer
621         engine.
622         (_gpgme_engine_set_protocol, _gpgme_engine_op_decrypt_verify): New
623         function.
624         * decrypt-verify.c (decrypt_verify_start): Call
625         _gpgme_engine_op_decrypt_verify.
626         * util.h, posix-util.c,
627         w32-util.c (_gpgme_get_uiserver_socket_path): New function.
628         * engine-gpgsm.c (gpgsm_set_fd): Fix _gpgme_io_pipe invocation.
629         * gpgme-tool.c: Some support for UIServer protocol.
630         * engine-uiserver.c: New file.
631
632 2009-11-09  Marcus Brinkmann  <marcus@g10code.de>
633
634         * engine-gpgsm.c (gpgsm_new): Close server side FDs.
635
636 2009-11-06  Marcus Brinkmann  <marcus@g10code.de>
637
638         * gpgme-tool.c (struct gpgme_tool): New members write_data and
639         write_data_hook.
640         (gt_write_data): New function.
641         (gt_result): Output vfs_mount result.
642         (server_write_data): New function.
643         (gpgme_server): Initialize write_data members.
644
645 2009-11-05  Marcus Brinkmann  <marcus@g10code.de>
646
647         * engine-g13.c (struct engine_g13): Remove members RESULT_CB and
648         RESULT_CB_VALUE.
649         (g13_assuan_simple_command, status_handler): Don't use those anymore.
650         (g13_transact): Remove them from argument list, too.
651         * vfs-mount.c (_gpgme_vfs_mount_status_handler): New function.
652         (_gpgme_op_vfs_mount): Pass it to transact.
653
654         * engine-assuan.c (llass_new): Update use of assuan_socket_connect.
655         * engine-gpgsm.c (gpgsm_new): Update use of assuan_pipe_connect.
656         * engine-g13.c (g13_new): Likewise.
657
658         * priv-io.h (IOSPAWN_FLAG_NOCLOSE): New flag.
659         * w32-io.c (_gpgme_io_spawn): Implement this flag.
660         * posix-io.c (_gpgme_io_spawn): Likewise.
661         * w32-glib-io.c (_gpgme_io_spawn): Likewise.
662         * assuan-support.c (my_spawn): Set this flag.
663
664         * decrypt.c (gpgme_op_decrypt_start): Fix use of debug macro.
665         * decrypt-verify.c (gpgme_op_decrypt_verify_start): Likewise.
666         * delete.c (gpgme_op_delete_start): Likewise.
667         * edit.c (gpgme_op_edit_start, gpgme_op_card_edit_start):
668         Likewise.
669         * encrypt.c (gpgme_op_encrypt_start): Likewise.
670         * encrypt-sign.c (gpgme_op_encrypt_sign_start): Likewise.
671         * export.c (gpgme_op_export_start, gpgme_op_export_ext_start)
672         (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
673         * genkey.c (gpgme_op_genkey_start): Likewise.
674         * getauditlog.c (gpgme_op_getauditlog_start): Likewise.
675         * import.c (gpgme_op_import_start, gpgme_op_import_keys_start):
676         Likewise.
677         * opassuan.c (gpgme_op_assuan_transact_start): Likewise.
678         * sign.c (gpgme_op_sign_start): Likewise.
679         * verify.c (gpgme_op_verify_start): Likewise.
680         * vfs-create.c (gpgme_op_vfs_create): Likewise.
681         * vfs-mount.c (gpgme_op_vfs_mount): Likewise.
682
683 2009-11-04  Marcus Brinkmann  <marcus@g10code.de>
684
685         * ath.h (ath_self): New prototype.  Include <stdint.h>
686         * ath.c, ath-pth.c, ath-pthread.c (ath_self): New function.
687         * debug.h: Rewrite most macros to beautify debug output.
688         (_gpgme_debug_buffer): Remove tagname and tag argument.
689         (_gpgme_debug_frame_begin, _gpgme_debug_frame_end): New prototypes.
690         * debug.c: Include <time.h>.  Don't include assuan.h.
691         (frame_nr, FRAME_NR): New thread-specific variable and macro.
692         (debug_init): Do not initialize assuan.  Call _gpgme_debug after
693         initialization instead using printf directly.
694         (_gpgme_debug): Do not call debug_init (we now ensure proper
695         initialization by user).  Add timestamp and thread/process ID.
696         (_gpgme_debug_buffer): Do not take tagname and tag argument.
697         (_gpgme_debug_frame_begin, _gpgme_debug_frame_end): New functions.
698         * version.c (gpgme_check_version_internal, gpgme_check_version):
699         Fix debug string.  Do not initialize assuan.
700         * posix-io.c (get_max_fds): Use 0 not NULL (nicer debug output).
701
702 2009-11-04  Werner Koch  <wk@g10code.com>
703
704         * gpgme-tool.c (register_commands): Add HELP feature.
705
706 2009-11-03  Werner Koch  <wk@g10code.com>
707
708         * gpgme.h.in (GPGME_PROTOCOL_UISERVER): New.
709
710 2009-11-03  Marcus Brinkmann  <marcus@g10code.de>
711
712         * Makefile.am (main_sources): Change g13.c to vfs-mount.c.  Add
713         vfs-create.c
714         * vfs-create.c: New file.
715         * g13.c: Renamed to ...
716         * vfs-mount.c: ... this new file.
717         * gpgme.h.in (gpgme_op_vfs_create): New prototype.
718         * gpgme.def, libgpgme.vers: Add gpgme_op_vfs_create.
719         * gpgme-tool.c (gt_vfs_create, cmd_vfs_create): New functions.
720         (register_commands): Add VFS_CREATE and CREAET.
721
722 2009-11-02  Marcus Brinkmann  <marcus@g10code.de>
723
724         * debug.h (_gpgme_debug_buffer): Make TAG argument const const.
725         * debug.c (_gpgme_debug_buffer): Likewise.
726         * gpgme-tool.c (input_notify, output_notify): Adjust type to new
727         assuan interface.
728         * decrypt.c (gpgme_op_decrypt_result): Remove unused variable.
729         * opassuan.c (gpgme_op_assuan_transact): Fix return value.
730
731 2009-10-30  Marcus Brinkmann  <marcus@g10code.de>
732
733         * Makefile.am (noinst_PROGRAMS): New target gpgme-tool.
734         (gpgme_tool_LDADD): New variable.
735         * gpgme-tool.c: New file.
736         * ops.h (_gpgme_sig_notation_clearm _gpgme_signers_clear): New
737         prototypes.
738         * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_GPGCONF (when
739         had that gone missing?).
740         (_gpgme_sig_notation_clear): New function without debug output.
741         (gpgme_release): Call it and _gpgme_signers_clear.
742         * signers.c (_gpgme_signers_clear): New function without debug output.
743         * g13.c (gpgme_op_vfs_mount): Add debug output.
744         * assuan-support.c (my_spawn): Allow fd_child_list to be NULL.
745         * conversion.c (_gpgme_encode_percent_string): Fix infinite loop.
746         * debug.h: Put tag in front of debug lines, should make for nicer
747         output.
748         * engine-assuan.c (llass_new): Use our new system hooks for libassuan.
749         * engine-g13.c (g13_new): Remove redundant assuan context allocation.
750         * version.c (gpgme_check_version_internal): Delay debug output
751         until after gpgme_check_version was called.
752
753 2009-10-28  Marcus Brinkmann  <marcus@g10code.de>
754
755         * signers.c, encrypt-sign.c, encrypt.c, delete.c, keylist.c,
756         edit.c, import.c, export.c: Fix last change in debug output.
757
758 2009-10-27  Marcus Brinkmann  <marcus@g10code.de>
759
760         * edit.c (gpgme_op_edit_start, gpgme_op_edit)
761         (gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
762         * encrypt-sign.c (gpgme_op_encrypt_sign_start)
763         (gpgme_op_encrypt_sign): Likewise.
764         * encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
765         (gpgme_op_encrypt_result): Likewise.
766         * export.c (gpgme_op_export_start, gpgme_op_export)
767         (gpgme_op_export_ext_start, gpgme_op_export_ext)
768         (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
769         * genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
770         (gpgme_op_genkey_result): Likewise.
771         * getauditlog.c (gpgme_op_getauditlog_start)
772         (gpgme_op_getauditlog): Likewise.
773         * import.c (gpgme_op_import_result, gpgme_op_import_start)
774         (gpgme_op_import): Likewise.
775         * keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
776         (gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
777         (gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
778         * opassuan.c (gpgme_op_assuan_transact_start)
779         (gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
780         (gpgme_op_assuan_transact): Likewise.
781         * signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
782         * trustlist.c (gpgme_op_trustlist_start)
783         (gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
784         * verify.c (gpgme_op_verify_start, gpgme_op_verify)
785         (gpgme_op_verify_result): Likewise.
786
787 2009-10-26  Marcus Brinkmann  <marcus@g10code.de>
788
789         * gpgme.h.in (struct gpgme_io_event_done_data)
790         (gpgme_io_event_done_data_t): New types.
791         (struct _gpgme_op_assuan_result): Deprecate the err member.
792         (gpgme_op_assuan_result): Deprecate (for now).
793         (gpgme_op_assuan_transact_ext): New prototype.
794         (gpgme_op_assuan_transact): Deprecate.
795         (struct _gpgme_op_g13_result): Replace with ...
796         (struct _gpgme_op_vfs_mount_result): ... this.
797         (gpgme_op_g13_mount): Replace with ...
798         (gpgme_op_vfs_mount): ... this.
799         * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext)
800         (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New.
801         (gpgme_op_g13_mount): Remove.
802         * libgpgme.vers: Likewise.
803         * engine-backend.h (struct engine_ops): Remove RESULT_CB and
804         RESULT_CB_VALUE args in opassuan_transact member.  Add CANCEL_OP
805         member.
806         * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add
807         OP_ERR argument.
808         (_gpgme_wait_one_ext): New prototype.
809         * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT.
810         * engine-g13.c (g13_cancel_op): New function.
811         (parse_status): Remove declaration.
812         (g13_assuan_simple_command): Do nothing with status lines for now.
813         (status_handler): Update opaque value access.
814         (_gpgme_engine_ops_g13): Add new cancel_op member.
815         * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR.
816         Handle operational errors.
817         (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output.
818         * data.c (_gpgme_data_inbound_handler)
819         (_gpgme_data_outbound_handler): Adjust opaque value access.
820         * engine-gpg.c (command_handler, status_handler)
821         (colon_line_handler): Likewise.
822         * engine-gpgsm.c (status_handler): Likewise.
823         * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member.
824         * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
825         * g13.c: Rewritten (and will be rewritten again).
826         * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb
827         and result_cb_value parameters from prototype.
828         (_gpgme_engine_cancel_op): New prototype.
829         * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma.
830         (_gpgme_engine_op_assuan_transact): Remove result_cb and
831         result_cb_value parameter.
832         (_gpgme_engine_cancel_op): New function.
833         * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR.
834         (struct io_cb_data): New struct to pass opaque data and get a
835         op_err return value.  Needed because we can't modify I/O callback
836         handler signature because it is exposed to the user.
837         * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter.  Handle
838         operational errors.
839         * wait-user.c (_gpgme_user_io_cb_handler): Handle operational
840         errors.
841         * wait-private.c (_gpgme_wait_on_condition): New argument to
842         retrieve the operational result.  Handle operational errors in
843         session based protocols.
844         (_gpgme_wait_one_ext): New function.
845         (_gpgme_wait_one): Pass argument in invocation of
846         _gpgme_wait_on_condition.
847         * wait-global.c (struct ctx_list_item): Add member OP_ERR.
848         (ctx_done): New argument OP_ERR.
849         (ctx_wait): New argument OP_ERR.
850         (gpgme_wait_ext): New function based on gpgme_wait but handling
851         operational errors.
852         (gpgme_wait): Implement in term of gpgme_wait_ext.
853         * keylist.c (gpgme_op_keylist_next): Pass argument in invocation
854         of _gpgme_wait_on_condition.
855         * trustlist.c (gpgme_op_trustlist_next): Pass argument in
856         invocation of _gpgme_wait_on_condition.
857         * engine-assuan.c (struct engine_llass): Replace members RESULT_CB
858         and RESULT_CB_VALUE by LAST_OP_ERR.
859         (_gpgme_engine_assuan_last_op_err): Add this hack function.
860         (llass_cancel_op): New function.
861         (_gpgme_engine_llass_ops): Add cancel_op member.
862         (llass_status_handler): Update opaque value access.
863         (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments.
864         * opassuan.c: Move compat hacks to the end of file.
865         (opassuan_start): Do not set OPD->result.err.
866         Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact.
867         (gpgme_op_assuan_transact_ext): New function.
868
869         * debug.h (DEBUG_GLOBAL): New debug level.
870         * conversion.c (gnupg_errors, _gpgme_map_gnupg_error): Removed.
871         * data-user.c (gpgme_data_new_from_cbs): Add debug output.
872         * data-fd.c (gpgme_data_new_from_fd): Likewise.
873         * data-stream.c (gpgme_data_new_from_stream): Likewise.
874         * decrypt.c (gpgme_op_decrypt_result, gpgme_op_decrypt_start)
875         (gpgme_op_decrypt): Likewise.
876         * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise.
877         * decrypt-verify.c (gpgme_op_decrypt_verify_start)
878         (gpgme_op_decrypt_verify): Likewise.
879         * sign.c (gpgme_op_sign_result): Fix debug message.
880         * data-mem.c (gpgme_data_new): Improve debug output.
881         * verify.c (parse_trust): Use atoi instead of
882         _gpgme_map_gnupg_error.
883         * decrypt.c (_gpgme_decrypt_status_handler): Likewise.
884
885 2009-10-22  Marcus Brinkmann  <marcus@g10code.de>
886
887         * Makefile.am: Remove @NETLIBS@ from LIBADDs.
888         (g13_components): New variable.
889         (main_sources): Add $(g13_components).
890         * g13.c, engine-g13.c: New files.
891         * engine.c (engine_ops): Check for assuan for assuan engine, add
892         g13 engine.
893         * util.h (_gpgme_get_g13_path, _gpgme_encode_percent_string): New
894         prototypes.
895         * conversion.c (_gpgme_encode_percent_string): New function.
896         * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_G13.
897         (struct _gpgme_op_g13_result, gpgme_g13_result_t): New types.
898         (gpgme_op_g13_mount): New function.
899         * gpgme.def, libgpgme.vers: Add gpgme_op_g13_mount.
900         * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_G13.
901         (gpgme_get_protocol_name): Add GPGME_PROTOCOL_G13.
902         * posix-util.c (_gpgme_get_g13_path): New function.
903         * w32-util.c (_gpgme_get_g13_path): New function.
904         * engine-backend.h (_gpgme_engine_ops_g13): New declaration.
905
906 2009-10-20  Marcus Brinkmann  <marcus@g10code.de>
907
908         * gpgme-config.in (netlibs): Remove.
909         (assuan_cflags, assuan_libs): Add.
910
911         * Makefile.am (assuan_cppflags, assuan_libobjs): Removed.
912         (gpgsm_components): Move engine-assuan.c to ...
913         (assuan_components): ... this new variable.
914         (main_sources): Add this new variable.
915         (AM_CPPFLAGS): Remove $(assuan_cppflags).
916         (AM_CFLAGS): Add @LIBASSUAN_CFLAGS@.
917         (libgpgme_la_DEPENDENCIES, libgpgme_pth_la_DEPENDENCIES)
918         (libgpgme_glib_la_DEPENDENCIES, libgpgme_qt_la_DEPENDENCIES)
919         (libgpgme_pthread_la_DEPENDENCIES): Remove $(assuan_libobjs).
920         (libgpgme_la_LIBADD, libgpgme_pth_la_LIBADD)
921         (libgpgme_glib_la_LIBADD, libgpgme_qt_la_LIBADD))
922         (libgpgme_pthread_la_LIBADD): Replace $(assuan_libobjs) by
923         @LIBASSUAN_LIBS@.
924         * priv-io.h [!HAVE_W32_SYSTEM]: Declare _gpgme_io_recvmsg,
925         _gpgme_io_sendmsg, _gpgme_io_waitpid.
926         * engine-backend.h: Define with [ENABLE_ASSUAN] instead
927         of [ENABLE_GPGSM].
928         * posix-io.c (_gpgme_io_waitpid): Make non-static.
929         * util.h (ENABLE_ASSUAN): Declar _gpgme_assuan_system_hooks,
930         _gpgme_assuan_malloc_hooks, _gpgme_assuan_log_cb.
931         * engine-gpgsm.c: Don't map assuan error codes.  Use
932         assuan_release instead of assuan_disconnect.
933         (map_assuan_error): Remove function.
934         (gpgsm_new): Use new assuan context interface.
935         * engine-assuan.c: Use assuan_release instead of
936         assuan_disconnect.
937         (llass_new): Use new assuan context interface.
938
939 2009-10-07    <wk@g10code.com>
940
941         * priv-io.h [W32]: Include windows.h instead of sys/socket.h.
942
943 2009-08-06  Werner Koch  <wk@g10code.com>
944
945         * op-support.c (_gpgme_parse_inv_recp): Allow for no fingerprint.
946
947         * engine-gpgsm.c (gpgsm_sign): Hook up the status func for the
948         SIGNER command.
949         * gpgme.h.in (GPGME_STATUS_INV_SGNR, GPGME_STATUS_NO_SGNR): New.
950         * sign.c (op_data_t): Add fields IGNORE_INV_RECP and INV_SGNR_SEEN.
951         (_gpgme_op_sign_init_result): Factor code out to ...
952         (sign_init_result): .. new.  Init new fields.
953         (sign_start): Use sign_init_result.
954         (_gpgme_sign_status_handler): Take care of the new INV_SGNR.
955         Return an error if no signature has been created.
956
957 2009-07-07  Werner Koch  <wk@g10code.com>
958
959         * engine-gpgsm.c (struct engine_gpgsm): Add fields
960         input_helper_data and input_helper_memory.
961         (close_notify_handler): Release these new fields.
962         (gpgsm_import): Implement the keyarray feature.
963
964         * engine-gpg.c (gpg_import): Actually return GPG_ERR_INV_VALUE.
965
966         * engine-gpgsm.c (gpgsm_import): Return an error for unknown data
967         encodings.
968
969 2009-06-22  Marcus Brinkmann  <marcus@g10code.de>
970
971         * debug.h: Everywhere, use %p instead of 0x%x to print pointer.
972         [HAVE_STDINT_H]: Include <stdint.h>.
973         (_TRACE, TRACE, TRACE0, TRACE1, TRACE2, TRACE3, TRACE6): Cast tag
974         to (uintptr_t) before casting it to (void*) to silence GCC
975         warning.
976
977         * gpgme.h.in (_GPGME_DEPRECATED_OUTSIDE_GPGME): New macro.
978         * sign.c (_GPGME_IN_GPGME): Define it.
979         * keylist.c (_GPGME_IN_GPGME): Define it.
980
981         * debug.c (_gpgme_debug_begin, _gpgme_debug_add): Handle error in
982         vasprintf and asprintf.
983
984         * priv-io.h: Include <sys/socket.h>.  Declare _gpgme_io_connect.
985
986 2009-06-18  Marcus Brinkmann  <marcus@g10code.de>
987
988         * gpgme.h.in (GPGME_CONF_PATHNAME): Revert last change, it's
989         back! (GPA still uses it...).
990
991         * gpgme.def: Fix stupid typo.
992         * w32-io.c (_gpgme_io_pipe): Add missing declaration.
993
994         * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro.
995
996         * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right
997         away.
998         (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select)
999         (_gpgme_io_dup): Never allocate threads here.
1000         (find_writer, find_reader): Check return value of thread creation
1001         function.
1002
1003         * context.h (CTX_OP_DATA_MAGIC): New macro.
1004         (struct ctx_op_data): New member MAGIC.
1005         * op-support.c (_gpgme_op_data_lookup): Initialize magic.
1006         * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic.
1007
1008 2009-06-16  Marcus Brinkmann  <marcus@g10code.de>
1009
1010         * gpgme.c (gpgme_result_unref): Hot fix to release a lock.
1011
1012         * gpgme.c (result_ref_lock): New global variable.
1013         (gpgme_result_ref, gpgme_result_unref): use it.
1014
1015 2009-06-16  Werner Koch  <wk@g10code.com>
1016
1017         * version.c: Include stdlib.h.
1018
1019         * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL,
1020         GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0.
1021         * data.c (gpgme_data_set_encoding): Adjust for new values.
1022         * engine-gpg.c (string_from_data): New.
1023         (gpg_import): Implement --fetch-key feature.
1024
1025         * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
1026         * gpgme.def, libgpgme.vers: Add them.
1027         * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
1028         (export_keys_start): New.
1029
1030         * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New.
1031         (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start)
1032         (gpgme_op_export_ext): Change arg RESERVED to MODE of new
1033         compatible type.
1034         * export.c (gpgme_export_ext_start, gpgme_op_export)
1035         (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto.
1036         (export_start): Ditto.
1037         * engine.c (_gpgme_engine_op_export): Ditto.
1038         * engine-backend.h (struct engine_ops): Ditto.
1039         * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.
1040         * engine-gpg.c (gpg_export, gpg_export_ext): Ditto.  Implement
1041         mode EXTERN.
1042         (gpg_export, gpg_export_ext): Factor common code out to ..
1043         (export_common): .. this.
1044
1045         * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
1046         * gpgme.def, libgpgme.vers: Add them.
1047         * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
1048         (_gpgme_op_import_keys_start): New.
1049         * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY.
1050         * engine-backend.h (struct engine_ops): Ditto.
1051         * engine-gpgsm.c (gpgsm_import): Ditto.  Not functional.
1052         * engine-gpg.c (gpg_import): Ditto.  Implement it.
1053
1054 2009-06-15  Marcus Brinkmann  <marcus@g10code.de>
1055
1056         * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add
1057         prototypes.
1058         * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref):
1059         Add these.
1060         * context.h (struct ctx_op_data): Add member "references".
1061         * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions.
1062         (_gpgme_release_result): Use gpgme_result_unref.
1063         * op-support.c (_gpgme_op_data_lookup): Initialize references.
1064
1065 2009-06-12  Werner Koch  <wk@g10code.com>
1066
1067         * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn
1068         flags.  Add new arg R_FLAGS.  Fix segv on file w/o LF.
1069         (translate_handles): Add new arg R_FLAGS.  Avoid possible segv.
1070         (main): Pass flags for my_spawn.
1071         (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow.
1072
1073         * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New.
1074         * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it.
1075         * w32-glib-io.c (_gpgme_io_spawn): Ditto.
1076         * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
1077         * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS.
1078         * engine-gpg.c (start): Call spawn with new flag.
1079
1080         * w32-util.c (_gpgme_allow_set_foregound_window): Rename to
1081         _gpgme_allow_set_foreground_window.  Change all callers.
1082         * posix-util.c (_gpgme_allow_set_foreground_window): Ditto.
1083
1084 2009-06-10  Werner Koch  <wk@g10code.com>
1085
1086         * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support.
1087
1088 2009-06-09  Werner Koch  <wk@g10code.com>
1089
1090         * engine-gpg.c (gpg_io_event): Test for cmd.fd.
1091
1092         * version.c (gpgme_check_version_internal): Make result const.
1093
1094         * gpgme.c: Include priv-io.h.
1095         (gpgme_io_read, gpgme_io_write): New.
1096         * libgpgme.vers (GPGME_1.1): Add them.
1097         * gpgme.def: Ditto.
1098
1099         * Makefile.am (main_sources): Remove gpgme.h.
1100         (include_HEADERS): Rename to nodist_include_HEADERS so that a
1101         VPATH build won't use the distributed one.
1102
1103         * util.h (GPG_ERR_NOT_OPERATIONAL): Define.
1104
1105 2009-05-28  Marcus Brinkmann  <marcus@g10code.de>
1106
1107         * gpgme.h.in (gpgme_check_version_internal): New prototype.
1108         (gpgme_check_version): New macro, overriding function of the same
1109         name.
1110         * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
1111         * context.h (_gpgme_selftest): New variable declaration.
1112         * version.c: Include "context.h".
1113         (gpgme_check_version): Set _gpgme_selftest on success.
1114         (gpgme_check_version_internal): New function.
1115         * gpgme.c (_gpgme_selftest): Define it.
1116         (gpgme_new): Check the selftest result.
1117
1118 2009-05-18  Marcus Brinkmann  <marcus@g10code.de>
1119
1120         * gpgme.h.in (gpgme_encrypt_flags_t): Add
1121         GPGME_ENCRYPT_NO_ENCRYPT_TO.
1122         * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if
1123         GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set.
1124
1125 2009-05-14  Werner Koch  <wk@g10code.com>
1126
1127         * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for
1128         better maintainability and to help debugging.
1129
1130 2009-05-05  Marcus Brinkmann  <marcus@g10code.de>
1131
1132         * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS.
1133
1134 2009-04-15  Marcus Brinkmann  <marcus@g10code.de>
1135
1136         * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
1137         * w32-io.c (_gpgme_io_connect): Fix stupid error.
1138
1139 2009-04-08  Marcus Brinkmann  <marcus@g10code.de>
1140
1141         * w32-glib-io.c (giochannel_table): New members used, fd, socket.
1142         (find_channel): Drop CREATE argument.
1143         (new_dummy_channel_from_fd, new_channel_from_fd)
1144         (new_channel_from_socket): New functions.
1145         (_gpgm_io_fd2str): Implement for sockets.
1146         (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors
1147         correctly.
1148         (_gpgme_io_pipe): Fix for new channel bookkeeping.
1149         (_gpgme_io_close, _gpgme_io_dup): Likewise.
1150         (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
1151         * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40.
1152         (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
1153         * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs.
1154         * version.c [HAVE_W32_SYSTEM]: Include "windows.h.
1155         (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup.
1156         * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors.
1157
1158 2009-03-18  Werner Koch  <wk@g10code.com>
1159
1160         * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New.
1161         * engine-gpgsm.c (gpgsm_keylist): Send new option.
1162
1163 2009-03-13  Werner Koch  <wk@g10code.com>
1164
1165         * gpgme-config.in: Make sure locale is set to C.
1166
1167 2009-02-24  Werner Koch  <wk@g10code.com>
1168
1169         * gpgme.h.in (struct _gpgme_op_assuan_result): New.
1170         (gpgme_assuan_result_t): New.
1171         (gpgme_op_assuan_result): Change return type.
1172         (struct _gpgme_assuan_sendfnc_ctx)
1173         (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove.
1174         (gpgme_assuan_inquire_cb_t): Changed.
1175         * opassuan.c (op_data_t): Make use of a result structure.
1176         (gpgme_op_assuan_result): Change return type.
1177         (opassuan_start): Use result structure.
1178         (result_cb): Ditto.
1179         * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove.
1180         (inquire_cb_sendfnc): Remove.
1181         (inquire_cb): Change for new callback scheme.  Not yet finished.
1182         (llass_status_handler): Allow sending a CANCEL from the inquire CB.
1183
1184 2009-02-04  Werner Koch  <wk@g10code.com>
1185
1186         * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to
1187         match prototype.
1188         * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
1189
1190 2009-02-03  Werner Koch  <wk@g10code.com>
1191
1192         * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and
1193         CARD_NUMBER..
1194         * key.c (gpgme_key_unref): Release field CARD_NUMBER.
1195         * keylist.c (keylist_colon_handler): Factor common code out to ...
1196         (parse_sec_field15): New.  Set card number.
1197
1198 2009-01-26  Werner Koch  <wk@g10code.com>
1199
1200         * opassuan.c, dirinfo.c, engine-assuan.c: New.
1201         * Makefile.am:  Add them.
1202         * engine-backend.h: Add _gpgme_engine_ops_assuan.
1203         (struct engine_ops): Add field OPASSUAN_TRANSACT.  Update all
1204         engine intializers.
1205         * Makefile.am (gpgsm_components): Add engine-assuan.c.
1206         * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN.
1207         (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t)
1208         (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New.
1209         (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New.
1210         * gpgme.c (gpgme_get_protocol_name): Ditto.
1211         (gpgme_set_protocol): Support it.
1212         * engine.c (gpgme_get_engine_info): Ditto.
1213         (engine_ops): Register it.
1214         (_gpgme_engine_op_assuan_transact): New.
1215         * libgpgme.vers (gpgme_op_assuan_transact_start)
1216         (gpgme_op_assuan_transact): New.
1217         * gpgme.def (gpgme_op_assuan_transact_start)
1218         (gpgme_op_assuan_transact): New.
1219         * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and
1220         initialize to NULL for all engines.
1221         * engine.c (engine_get_home_dir): New.
1222         (gpgme_get_engine_info): Use it.
1223         (_gpgme_set_engine_info): Use it.
1224         * engine.h (engine_assuan_result_cb_t): New.
1225         * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN.
1226
1227         * util.h (GPG_ERR_UNFINISHED): Define if not yet defined.
1228
1229         * version.c (gpgme_check_version): Protect trace arg against NULL.
1230
1231 2009-01-19  Werner Koch  <wk@g10code.com>
1232
1233         * rungpg.c: Rename to engine-gpg.c
1234         * Makefile.am (main_sources): Ditto.
1235
1236 2008-12-03  Marcus Brinkmann  <marcus@g10code.de>
1237
1238         * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h.
1239
1240 2008-11-18  Werner Koch  <wk@g10code.com>
1241
1242         * version.c (do_subsystem_inits): Always initialize I/O
1243         subsystem.  Fixes regression from 2007-08-02.
1244
1245         * decrypt.c (_gpgme_decrypt_status_handler): Use
1246         _gpgme_map_gnupg_error to parse the error code for decrypt.algorithm.
1247
1248 2008-10-30  Marcus Brinkmann  <marcus@g10code.de>
1249
1250         * wait-private.c (_gpgme_wait_on_condition): Remove unused
1251         variable IDX.
1252         * wait-global.c: Include ops.h to silence gcc warning.
1253         (_gpgme_wait_global_event_cb): Pass error value directly.
1254         * wait-user.c: Include ops.h to silence gcc warning.
1255
1256         * posix-io.c (_gpgme_io_spawn): Make ARGV argument const to
1257         silence gcc warning.  Cast argument to execv to silence warning.
1258         * w32-io.c (_gpgme_io_spawn): Likewise.
1259         * priv-io.h (_gpgme_io_spawn): Likewise for prototype.
1260
1261 2008-10-24  Werner Koch  <wk@g10code.com>
1262
1263         * rungpg.c (gpg_keylist_preprocess): Escape backslashes too.
1264
1265 2008-10-23  Marcus Brinkmann  <marcus@g10code.de>
1266
1267         * rungpg.c (gpg_keylist_preprocess): Convert percent escaped
1268         string to C coded string.
1269
1270 2008-10-20  Werner Koch  <wk@g10code.com>
1271
1272         * Makefile.am (EXTRA_DIST): Add gpgme.h.in.
1273
1274         * gpgme.h: Rename to gpgme.h.in.
1275         * gpgme.h.in (GPGME_VERSION): Use autoconf substitution.
1276
1277         * posix-io.c: Include sys/uio.h.  Fixes bug #818.
1278
1279 2008-10-18  Marcus Brinkmann  <marcus@g10code.com>
1280
1281         * w32-util.c (find_program_in_registry): Don't define.
1282         (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path)
1283         (_gpgme_get_gpgconf_path): Do not check for fooProgram in the
1284         registry anymore.  It is now no longer possible to overwrite the
1285         default location in that way.
1286
1287 2008-10-17  Werner Koch  <wk@g10code.com>
1288
1289         * w32-glib-io.c (_gpgme_io_fd2str): Use "%d" and not "%ld" to work
1290         around a bug in mingw32.
1291
1292 2008-09-23  Marcus Brinkmann  <marcus@g10code.com>
1293
1294         * gpgme.c (gpgme_sig_notation_clear): Clear CTX->sig_notations.
1295         Submitted by "Daniel Mueller" <daniel@danm.de>
1296
1297 2008-09-16  Marcus Brinkmann  <marcus@g10code.com>
1298
1299         * rungpg.c (gpg_new): Don't use errno with ttyname_r.
1300
1301 2008-08-11  Marcus Brinkmann  <marcus@g10code.com>
1302
1303         * rungpg.c (gpg_cancel): Remove cmd fd before status fd.
1304         * gpgme.c (_gpgme_cancel_with_err): New function.
1305         (gpgme_cancel): Reimplement in terms of _gpgme_cancel_with_err.
1306         * wait-private.c (_gpgme_wait_on_condition): Use
1307         _gpgme_cancel_with_err.
1308         * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1309         * wait-global.c (_gpgme_wait_global_event_cb, gpgme_wait): Likewise.
1310
1311 2008-08-08  Marcus Brinkmann  <marcus@g10code.com>
1312
1313         * rungpg.c (command_handler): Remove I/O callback on error, too.
1314
1315 2008-06-29  Marcus Brinkmann  <marcus@g10code.com>
1316
1317         * gpgme.c (gpgme_cancel_async): Remove unused variable.
1318
1319 2008-06-27  Marcus Brinkmann  <marcus@g10code.de>
1320
1321         * libgpgme.vers: Add gpgme_cancel_async.
1322         * gpgme.def: Likewise.
1323
1324         * context.h: Include "sema.h".
1325         (struct gpgme_context): New members lock and canceled.
1326         * gpgme.c (gpgme_new): Initialize lock.
1327         (gpgme_release): Destroy lock.
1328         (gpgme_cancel_async): New function.
1329         * op-support.c (_gpgme_op_reset): Reset the canceled flag.
1330         * wait-global.c (gpgme_wait): Check cancel flag before processing
1331         any I/O callbacks.
1332         * wait-private.c (_gpgme_wait_on_condition): Likewise.
1333         * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
1334
1335 2008-06-26  Werner Koch  <wk@g10code.com>
1336
1337         * w32-util.c (_gpgme_mkstemp): Replace sprint by stpcpy.
1338         (mkstemp): Need to use GetSystemTimeAsFileTime for better
1339         compatibility.
1340
1341 2008-06-25  Marcus Brinkmann  <marcus@g10code.de>
1342
1343         * gpgme-w32spawn.c: New file.
1344         * Makefile.am (libexec_PROGRAMS) [HAVE_W32_SYSTEM]: New variable
1345         with gpgme-w32spawn.
1346         * engine-gpgsm.c (gpgsm_new): Use server translated handles.
1347         (gpgsm_set_locale): Return early if locale value is NULL.
1348         * util.h (_gpgme_mkstemp)
1349         (_gpgme_get_w32spawn_path) [HAVE_W32_SYSTEM]: New function
1350         prototypes.
1351         * w32-util.c: Include <stdint.h>, <sys/stat.h> and <unistd.h>.
1352         (letters, mkstemp, _gpgme_mkstemp, _gpgme_get_w32spawn_path): New
1353         functions.
1354         * rungpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign)
1355         (gpg_genkey, gpg_import, gpg_verify, gpg_sign): Pass data over
1356         special filename FD rather than stdin.
1357         (struct arg_and_data_s): Add member ARG_LOCP.
1358         (struct fd_data_map_s): Add member ARG_LOC.
1359         (struct engine_gpg): Add member ARG_LOC to status and colon.
1360         (_add_arg, add_arg_with_locp): New function.
1361         (add_arg_ext): Reimplement in terms of _add_arg.
1362         (gpg_new): Remember argument location for status FD.
1363         (build_argv): Set argument location if requested.  Also set
1364         argument location of fd_data_map for data items.
1365         (start): Adjust caller of _gpgme_io_spawn.
1366         * priv-io.h (struct spawn_fd_item_s): Add members peer_name and
1367         arg_loc.
1368         (_gpgme_io_spawn): Remove parent fd list argument.
1369         * posix-io.c (get_max_fds): New function.
1370         (_gpgme_io_dup): Add tracing.
1371         (_gpgme_io_spawn): Remove parent fd list.  Change meaning of child
1372         fd list to contain all child fds that should be inherited.  Close
1373         all other file descriptors after fork.
1374         * w32-io.c, w32-glib-io.c, w32-qt-io.c(_gpgme_io_spawn): Remove
1375         parent fd list.  Change meaning of child fd list to contain all
1376         child fds that should be inherited.  Do not inherit any file
1377         descriptors, but DuplicateHandle them.  Spawn process through
1378         wrapper process.  Provide wrapper process with a temporary file
1379         containing handle translation data.  Return translated handle
1380         names.
1381         * w32-io.c (reader): Add more tracing output.
1382         (_gpgme_io_read): Likewise.
1383         * engine-gpgconf.c (gpgconf_read): Adjust caller of
1384         _gpgme_io_spawn.
1385         * version.c (_gpgme_get_program_version): Likewise.
1386
1387 2008-06-20  Werner Koch  <wk@g10code.com>
1388
1389         * engine-gpgconf.c (gpgconf_read): Change ARGV initialization for
1390         compatibility with old compilers.  Fix amount of memmove.  Fix
1391         CR removal.
1392
1393 2008-06-19  Werner Koch  <wk@g10code.com>
1394
1395         * gpgme.h (GPGME_CONF_PATHNAME): Replace by GPGME_CONF_FILENAME,
1396         change all callers and provide compatibilty macro.
1397         (gpgme_conf_type_t): Add complex types 34..37.
1398         * engine-gpgconf.c (gpgconf_parse_option, arg_to_data)
1399         (_gpgme_conf_arg_new, _gpgme_conf_arg_release): Add new types.
1400
1401 2008-06-19  Marcus Brinkmann  <marcus@g10code.de>
1402
1403         * engine-gpgconf.c (gpgconf_parse_option): Fix comma detection.
1404
1405 2008-05-09  Werner Koch  <wk@g10code.com>
1406
1407         * engine-gpgconf.c (gpgconf_read): Do not pass empty lines to the
1408         callback.
1409
1410 2008-05-07  Werner Koch  <wk@g10code.com>
1411
1412         * engine-gpgconf.c (gpgconf_write): Change argv[0] to a
1413         self-explaining string.  Needs a proper fix, though.
1414
1415         * rungpg.c (gpg_keylist, gpg_keylist_ext): Factor common code out
1416         to ..
1417         (gpg_build_keylist_options): .. new. Allow combination of extern
1418         and intern mode.
1419         (gpg_new): DFT_TTYNAME is an array, thus check the first character.
1420
1421 2008-05-06  Werner Koch  <wk@g10code.com>
1422
1423         * version.c (extract_version_string): New.
1424         (_gpgme_get_program_version): Use it to allow for suffixes in the
1425         version line.
1426
1427 2008-04-28  Werner Koch  <wk@g10code.com>
1428
1429         * engine-gpgconf.c (gpgconf_read): Fixed segv.  Avoid memmove for
1430         each line.
1431
1432 2008-04-22  Marcus Brinkmann  <marcus@g10code.de>
1433
1434         * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
1435         Osterfeld, implement blocking select.
1436
1437 2008-03-11  Marcus Brinkmann  <marcus@g10code.de>
1438
1439         * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
1440
1441 2008-03-06  Marcus Brinkmann  <marcus@g10code.de>
1442
1443         * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL.
1444         Reported by Marc Mutz.
1445
1446 2008-03-05  Marcus Brinkmann  <marcus@g10code.de>
1447
1448         * decrypt.c (release_op_data): Release OPD->result.recipients.
1449         * encrypt.c (release_op_data): Release invalid_recipient.
1450
1451 2008-02-15  Marcus Brinkmann  <marcus@g10code.de>
1452
1453         * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
1454
1455 2008-02-14  Werner Koch  <wk@g10code.com>
1456
1457         * w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
1458         * posix-io.c (_gpgme_io_spawn): Ditto.
1459         * w32-glib-io.c (_gpgme_io_spawn): Ditto.
1460         * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
1461         * priv-io.h (_gpgme_io_spawn): Adjust prototyp and change all callers.
1462         * rungpg.c (start): Call _gpgme_allow_set_foregound_window.
1463
1464         * w32-util.c (_gpgme_allow_set_foregound_window): New.
1465         * posix-util.c (_gpgme_allow_set_foregound_window): New.
1466         * engine-gpgsm.c (default_inq_cb): New.
1467         (gpgsm_new) [W32]: Enable pinentry notifications.
1468         (status_handler): Handle inquiries.
1469
1470 2008-01-30  Marcus Brinkmann  <marcus@g10code.de>
1471
1472         * kdpipeiodevice.cpp: New version by Frank Osterfeld, fixes race
1473         condition.
1474
1475 2008-01-28  Marcus Brinkmann  <marcus@g10code.de>
1476
1477         * engine-gpgsm.c (map_input_enc): Rename to ...
1478         (map_data_enc): ... this.  Also change all callers.
1479         (gpgsm_encrypt, gpgsm_export, gpgsm_export_ext, gpgsm_genkey)
1480         (gpgsm_sign): Set encoding for output.
1481
1482 2008-01-28  Werner Koch  <wk@g10code.com>
1483
1484         * keylist.c (gpgme_get_key): Skip duplicated keys.  Fixes bug 876.
1485
1486 2008-01-14  Marcus Brinkmann  <marcus@g10code.de>
1487
1488         * engine-gpgconf.c (gpgconf_config_load_cb): Fix program_name
1489         field.
1490
1491 2008-01-10  Marcus Brinkmann  <marcus@g10code.de>
1492
1493         * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1494
1495         * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
1496         NO_ARG_DESC.
1497
1498 2008-01-04  Marcus Brinkmann  <marcus@g10code.de>
1499
1500         * Makefile.am (gpgconf_components): New variable.
1501         (main_sources): Add gpgconf.c.
1502         * gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
1503         (gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
1504         (gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
1505         (gpgme_conf_arg_release, gpgme_conf_opt_change)
1506         (gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
1507         types.
1508         * gpgconf.c, engine-gpgconf.c: New files.
1509         * engine.h: (_gpgme_engine_op_conf_load,
1510         (_gpgme_engine_op_conf_save): New prototypes.
1511         * op-support.c (_gpgme_op_reset): Ignore not implemented locale
1512         function.
1513         * posix-util.c (_gpgme_get_gpgconf_path): New function.
1514         * w32-util.c (_gpgme_get_gpgconf_path): New function.
1515         * engine-gpgsm.c:
1516         (_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
1517         * rungpg.c:
1518         (_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
1519         * gpgme.def: Add new gpgconf related interfaces.
1520         * libgpgme.vers: Likewise.
1521         * util.h (_gpgme_get_gpgconf_path): New prototype.
1522         * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
1523         * engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
1524         (struct engine_ops): Add members for conf_load and conf_save.
1525         * engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
1526         (_gpgme_engine_op_conf_load,
1527         (_gpgme_engine_op_conf_save): New functions.
1528         (gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.
1529
1530 2007-11-28  Marcus Brinkmann  <marcus@g10code.de>
1531
1532         * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search
1533         for installation directory.  Remove old fallback default.
1534         (find_program_in_inst_dir): New function.
1535
1536 2007-11-26  Werner Koch  <wk@g10code.com>
1537
1538         * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and
1539         always reset it before calling start.
1540         (gpgsm_new): Clear it.
1541         (status_handler): Implement it.
1542         (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA.
1543
1544 2007-11-23  Werner Koch  <wk@g10code.com>
1545
1546         * op-support.c (_gpgme_op_reset): Implement a no-reset flag.
1547         * getauditlog.c (getauditlog_start): Use that flag.
1548
1549 2007-11-20  Werner Koch  <wk@g10code.com>
1550
1551         * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
1552
1553 2007-11-22  Werner Koch  <wk@g10code.com>
1554
1555         * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New.
1556         * libgpgme.vers: Ditto.
1557         * gpgme.def: Ditto.
1558         * getauditlog.c: New.
1559         * engine-backend.h (struct engine_ops): Add member GETAUDITLOG.
1560         * engine-gpgsm.c (gpgsm_getauditlog): New.
1561         (_gpgme_engine_ops_gpgsm): Insert new function.
1562         (gpgsm_new): Try to enable audit log support.
1563         * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry.
1564
1565 2007-11-12  Marcus Brinkmann  <marcus@g10code.de>
1566
1567         * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1568
1569 2007-10-11  Marcus Brinkmann  <marcus@g10code.de>
1570
1571         * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1572
1573 2007-10-09  Marcus Brinkmann  <marcus@g10code.de>
1574
1575         * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
1576         Mutz.
1577
1578 2007-10-05  Marcus Brinkmann  <marcus@g10code.de>
1579
1580         * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
1581         Osterfeld.
1582
1583 2007-10-04  Marcus Brinkmann  <marcus@g10code.de>
1584
1585         * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
1586         w32-qt-io.cpp: New versions from Frank Osterfeld.
1587
1588 2007-10-02  Marcus Brinkmann  <marcus@g10code.de>
1589
1590         * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
1591         * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
1592         (_gpgme_io_dup): Only acquire a reference, do not actually dup.
1593         Submitted by Frank Osterfeld.
1594
1595         * priv-io.h, engine-gpgsm.c: Add comments.
1596         * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
1597         * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
1598         even if not primary.
1599         (_gpgme_io_dup): Acquire a reference.  Replace unused
1600         implementation by assertion.
1601
1602 2007-09-28  Werner Koch  <wk@g10code.com>
1603
1604         * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
1605         (gpgsm_new): Set it.
1606         (gpgsm_set_fd): Use it.
1607
1608         * w32-glib-io.c (find_channel): Add a new primary flag.
1609         (_gpgme_io_close): Close channel only if primary.
1610         (_gpgme_io_dup): Put newfd into the table as shallow copy.
1611
1612         * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
1613         * w32-io.c (_gpgme_io_select): Ditto.
1614         * w32-glib-io.c (_gpgme_io_select): Ditto.
1615
1616         * posix-io.c (_gpgme_io_select): Ditto.
1617         * rungpg.c (read_status): Ditto.
1618         * wait.c (fd_table_put): Ditto.
1619
1620         * rungpg.c (gpg_io_event): Add tracing.
1621         (start): Use gpg_io_event for sending the start event.
1622         * engine-gpgsm.c (gpgsm_io_event): Add tracing.
1623         (start): Use gpgsm_io_event for sending the start event.
1624         * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
1625
1626 2007-09-28  Marcus Brinkmann  <marcus@g10code.de>
1627
1628         * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
1629         versions from Frank Osterfeld.
1630
1631 2007-09-27  Marcus Brinkmann  <marcus@g10code.de>
1632
1633         * w32-glib-io.c (_gpgme_io_spawn),
1634         w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
1635         the process handle, return 0.
1636
1637         * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
1638         * gpgme.c (gpgme_get_protocol_name): Implement support for
1639         GPGME_PROTOCOL_UNKNOWN.
1640
1641         * kdpipeiodevice.h: Fix last change.
1642
1643         * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
1644         w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
1645         output.
1646
1647 2007-09-25  Marcus Brinkmann  <marcus@g10code.de>
1648
1649         * conversion.c, keylist.c: Include <sys/types.h>.
1650
1651         * kdpipeiodevice.h: Use namespace _gpgme_.
1652         * kdpipeiodevice.cpp: Use namespace _gpgme_.
1653         [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
1654         * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
1655         _gpgme_::KDPipeIODevice.
1656
1657 2007-09-17  Werner Koch  <wk@g10code.com>
1658
1659         * rungpg.c (gpg_new): Make robust against undefined ttyname or
1660         ttytype.
1661
1662 2007-09-14  Werner Koch  <wk@g10code.com>
1663
1664         * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
1665
1666 2007-09-14  Marcus Brinkmann  <marcus@g10code.de>
1667
1668         * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
1669
1670 2007-09-13  Marcus Brinkmann  <marcus@g10code.de>
1671
1672         * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
1673         small memory leak).
1674
1675 2007-09-07  Marcus Brinkmann  <marcus@g10code.de>
1676
1677         * Makefile.am (libgpgme_qt_la_SOURCES): Move
1678         moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
1679         another file (it's more like a header file than a cpp file, but
1680         automake doesn't know that).
1681
1682         * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
1683         * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
1684         (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
1685
1686         * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
1687         kdpipeiodevice.moc, w32-qt-io.c: New files.
1688         * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
1689         (ltlib_gpgme_qt): New variable.
1690         (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
1691         (libgpgme_qt_la_SOURCES): New variable.
1692         (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
1693         (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
1694         (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
1695         (libgpgme_qt_la_LIBADD): New variables.
1696
1697         * sema.h (struct critsect_s): Rename "private" to "priv" to make
1698         C++ users happy.  Change users.
1699         * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
1700         (_gpgme_sema_cs_destroy): Likewise.
1701         * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
1702         (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
1703         * w32-glib-io.c (gpgme_get_giochannel): Change return type to
1704         void*.
1705         (gpgme_get_fdptr): New function.
1706         * w32-io.c (gpgme_get_fdptr): New function
1707         * gpgme.def: Add gpgme_get_fdptr.
1708
1709 2007-08-22  Marcus Brinkmann  <marcus@g10code.de>
1710
1711         * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
1712         (writer): Remove superfluous check.
1713
1714 2007-08-20  Marcus Brinkmann  <marcus@g10code.de>
1715
1716         * gpgme.h: Move include of gpg-error.h out of extern "C".
1717
1718 2007-08-07  Werner Koch  <wk@g10code.com>
1719
1720         * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
1721         * verify.c (parse_trust): Set Chain_MODEL.
1722
1723 2007-08-02  Werner Koch  <wk@g10code.com>
1724
1725         * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
1726         * w32-io.c (_gpgme_io_spawn): Ditto.
1727         (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
1728         * debug.c (_gpgme_debug): Enable assuan logging.
1729         (_gpgme_debug_subsystem_init): New.
1730         * version.c (do_subsystem_inits): Disable assuan logging and
1731         initialize the debug system.
1732         (gpgme_check_version): Do not trace before the subsystems are
1733         initialized.
1734
1735 2007-07-17  Marcus Brinkmann  <marcus@g10code.de>
1736
1737         * debug.c: Include <errno.h> and "debug.h".
1738         (_gpgme_debug): Save and restore ERRNO.
1739         (TOHEX): New macro.
1740         (_gpgme_debug_buffer): New function.
1741         * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
1742         gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
1743         w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants.  In
1744         most of these files, add many more tracepoints.
1745
1746 2007-07-16  Marcus Brinkmann  <marcus@g10code.de>
1747
1748         * engine-gpgsm.c (status_handler): Do not send BYE here.
1749
1750         * w32-io.c (struct reader_context_s, struct writer_context_s): New
1751         members REFCOUNT.
1752         (create_reader, create_writer): Initialize C->refcount to 1.
1753         (destroy_reader, destroy_writer): Only destroy if C->refcount
1754         drops to 0.
1755         (find_reader, find_writer, kill_reader, kill_writer): Beautify.
1756         * priv-io.h (_gpgme_io_dup): New prototype.
1757         * posix-io.c (_gpgme_io_dup): New function.
1758         * w32-io.c (_gpgme_io_dup): Likewise.
1759         * w32-glib-io.c (_gpgme_io_dup): Likewise.
1760         * engine-gpgsm.c (start): Reverting to version 2007-07-10.
1761
1762 2007-07-13  Marcus Brinkmann  <marcus@g10code.de>
1763
1764         * data-user.c (user_read, user_write, user_seek): Set errno and
1765         return -1 instead returning the error code directly.
1766         * data-compat.c (old_user_seek): Likewise.
1767         * gpgme.c (gpgme_sig_notation_add): Return error properly.
1768
1769         * Revert the "close_notify_handler" returns int stuff.  Always
1770         close in the _gpgme_io_close implementations.
1771         * engine-gpgsm.c (status_handler): Try to terminate the connection
1772         in case of error.
1773         * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
1774         (_gpgme_io_write): Likewise.
1775
1776         * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
1777         to _gpgme_close_notify_handler.
1778         (_gpgme_close_notify_handler): New type.
1779         (_gpgme_io_dup): Remove prototype.
1780         * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
1781         type of HANDLER to _gpgme_close_notify_handler_t.
1782         (_gpgme_io_close): Do not close the FD if handler returns 0.
1783         (_gpgme_io_dup): Remove function.
1784         * w32-io.c (notify_table, _gpgme_io_set_close_notify,
1785         _gpgme_io_close): Change type of HANDLER to
1786         _gpgme_close_notify_handler_t.
1787         (_gpgme_io_close): Do not close the FD if handler returns 0.
1788         (_gpgme_io_dup): Remove function.
1789         * w32-glib-io.c (_gpgme_io_dup): Remove function.
1790         (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
1791         to _gpgme_close_notify_handler_t.
1792         (_gpgme_io_close): Do not close the FD if handler returns 0.
1793         * rungpg.c (close_notify_handler): Change return type to int,
1794         return 1.
1795         * engine-gpgsm.c (close_notify_handler): Change return type to
1796         int, return 0 for status FD and 1 for all other FDs.
1797         (start): Do not duplicate the status FD.
1798
1799 2007-07-12  Marcus Brinkmann  <marcus@g10code.de>
1800
1801         * Makefile.am: Replace implicite rule by suffix rule.  Add
1802         SUFFIXES for that.
1803
1804 2007-07-12  Werner Koch  <wk@g10code.com>
1805
1806         * version.c (do_subsystem_inits) [W32]: Make sure that the socket
1807         system has been started.
1808
1809 2007-07-10  Marcus Brinkmann  <marcus@g10code.de>
1810
1811         * priv-io.h (_gpgme_io_dup): New prototype.
1812         * posix-io.c (_gpgme_io_dup): New function.
1813         * w32-io.c (_gpgme_io_dup): Likewise.
1814         * w32-glib-io.c (_gpgme_io_dup): Likewise.
1815         * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
1816
1817 2007-07-08  Marcus Brinkmann  <marcus@g10code.de>
1818
1819         * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
1820         * funopen.c (funopen): Rename to _gpgme_funopen.
1821
1822 2007-04-30  Marcus Brinkmann  <marcus@g10code.de>
1823
1824         * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
1825         * rungpg.c (gpg_new): Likewise.
1826         Submitted by Stephen Tether.
1827
1828 2007-02-26  Werner Koch  <wk@g10code.com>
1829
1830         * verify.c (op_data_t): New element PLAINTEXT_SEEN.
1831         (_gpgme_verify_status_handler): Return an error if more than one
1832         plaintext has been seen.
1833         (parse_error): New arg SET_STATUS. Also detect it based on an
1834         ERROR status (gpg > 1.4.6).
1835
1836 2007-01-26  Werner Koch  <wk@g10code.com>
1837
1838         * w32-io.c (build_commandline): Fixed stupid quoting bug.
1839         * w32-glib-io.c (build_commandline): Ditto.
1840
1841         * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
1842
1843         * gpgme-config.in: New options --get-gpg and --get-gpgsm.
1844
1845 2007-01-18  Marcus Brinkmann  <marcus@g10code.de>
1846
1847         * data.h (_gpgme_data_get_fd): Add prototype.
1848         (gpgme_data_get_fd_cb): New type.
1849         (struct _gpgme_data_cbs): New member get_fd.
1850         * data.c (_gpgme_data_get_fd): New function.
1851         * data-fd.c (fd_get_fd): New function.
1852         (fd_cbs): Add fd_get_fd.
1853         * data-stream.c (stream_get_fd): New function.
1854         (stream_cbs): Add stream_get_fd.
1855         * data-mem.c (mem_cbs): Add NULL for get_fd callback.
1856         * data-user.c (user_cbs): Likewise.
1857         * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
1858         short-cut by passing the data descriptor directly.
1859
1860 2007-01-17  Marcus Brinkmann  <marcus@g10code.de>
1861
1862         * w32-io.c (build_commandline): Quote all command line arguments.
1863         * w32-glib-io.c (build_commandline): Likewise.
1864
1865 2007-01-10  Werner Koch  <wk@g10code.com>
1866
1867         * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
1868
1869 2007-01-08  Werner Koch  <wk@g10code.com>
1870
1871         * version.c (do_subsystem_inits): Do assuan init only if building
1872         with Assuan.
1873         * setenv.c: Include assuan-def.h only if building with Assuan
1874         support.
1875
1876         * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
1877         if defined.
1878         * engine-gpgsm.c (gpgsm_set_locale): Ditto.
1879         * rungpg.c (gpg_set_locale): Ditto.
1880
1881 2006-12-17  Marcus Brinkmann  <marcus@g10code.de>
1882
1883         * gpgme.c (gpgme_set_protocol): Shut down the engine when
1884         switching protocols.
1885         (gpgme_ctx_set_engine_info): Likewise for engine info.
1886         * engine.h (_gpgme_engine_reset): New function prototype.
1887         * engine.c (_gpgme_engine_reset): New function.
1888         * engine-backend.h (struct engine_ops): New member RESET.
1889         * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
1890         * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
1891         [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
1892         (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
1893         reset function.
1894         (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
1895         * op-support.c (_gpgme_op_reset): Try to use the engine's reset
1896         function if available.
1897         * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
1898         (start): ... here.
1899         * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
1900
1901         * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
1902         lc_messages from prototype.
1903         (_gpgme_engine_set_locale): New prototype.
1904         * engine.c (_gpgme_engine_set_locale): New function.
1905         * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
1906         * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
1907         Remove arguments lc_messages and lc_ctype from member NEW.
1908         * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
1909         and lc_messages_set.
1910         (gpgsm_new): Remove lc_messages and lc_ctype
1911         arguments.
1912         (gpgsm_set_locale): New function.
1913         (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
1914         * rungpg.c (struct engine_gpg): Add new members lc_messages and
1915         lc_ctype.
1916         (gpg_release): Release lc_messages and lc_ctype if set.
1917         (gpg_new): Remove lc_messages and lc_ctype arguments.
1918         (gpg_set_locale): New function.
1919         (_gpgme_engine_ops_gpg): Add gpg_set_locale.
1920         (add_arg): Implement in terms of:
1921         (add_arg_ext): New function.
1922         (start): Set lc-messages and lc-ctype arguments here.
1923
1924 2006-12-03  Marcus Brinkmann  <marcus@g10code.de>
1925
1926         * engine-gpgsm.c (struct engine_gpgsm): Move members
1927         input_fd_server, output_fd_server, message_fd_server to ...
1928         (iocb_data): ... here (as server_fd).
1929         (close_notify_handler): Reset tags as well.
1930         (gpgsm_new): Implement support for descriptor
1931         passing.
1932         (fd_type_t): New type.
1933         (gpgsm_clear_fd): New function.  Use it instead of _gpgsm_io_close
1934         for unused communication channels.
1935         (gpgsm_set_fd): Rewritten to support descriptor passing.  All
1936         relevant callers adjusted as well (previously of _gpgme_io_close).
1937
1938 2006-12-02  Marcus Brinkmann  <marcus@g10code.de>
1939
1940         * version.c: Include "assuan.h".
1941         (do_subsystem_inits): Call assuan_set_assuan_err_source.
1942
1943 2006-12-01  Marcus Brinkmann  <marcus@g10code.de>
1944
1945         * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
1946         (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1947         libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
1948         $(main_sources).
1949         (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
1950         libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
1951         libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
1952         libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
1953         libgpgme-real.la.
1954         (noinst_LTLIBRARIES): Removed.
1955         (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
1956         (AM_CFLAGS): New variable.
1957
1958 2006-11-30  Marcus Brinkmann  <marcus@g10code.de>
1959
1960         * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
1961         ASSUAN_CONTEXT with assuan_context_t.
1962
1963 2006-11-29  Marcus Brinkmann  <marcus@g10code.de>
1964
1965         * engine-gpgsm.c (gpgsm_new): Check return value of
1966         assuan_pipe_connect.
1967
1968         * rungpg.c: Include <unistd.h>.
1969         (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
1970         --lc-messages.  Fixes issue 734.
1971
1972 2006-10-24  Marcus Brinkmann  <marcus@g10code.de>
1973
1974         * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
1975         NULL.
1976
1977 2006-10-23  Marcus Brinkmann  <marcus@g10code.de>
1978
1979         * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
1980         _gpgme_engine_io_event().
1981
1982         * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
1983
1984 2006-09-25  Marcus Brinkmann  <marcus@g10code.de>
1985
1986         * data-mem.c (gpgme_data_release_and_get_mem): Release the data
1987         object properly.
1988
1989 2006-09-22  Marcus Brinkmann  <marcus@g10code.de>
1990
1991         * keylist.c (keylist_colon_handler): Move debug output after
1992         initialising KEY.
1993
1994 2006-07-29  Marcus Brinkmann  <marcus@g10code.de>
1995
1996         * gpgme-config.in (Options): Add NETLIBS.
1997         * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
1998         libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
1999
2000         * rungpg.c (read_status): Fix comparison disguising as an
2001         assignment.
2002
2003 2005-03-24  Marcus Brinkmann  <marcus@g10code.de>
2004
2005         * gpgme.c (gpgme_set_locale): Remove conditional on
2006         HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
2007
2008 2006-07-16  Marcus Brinkmann  <marcus@g10code.de>
2009
2010         * rungpg.c (read_status): Strip potential carriage return.
2011         * genkey.c (get_key_parameter): Skip potential carriage return.
2012         * version.c (_gpgme_get_program_version): Strip potential carriage
2013         return.
2014
2015         * data.c (gpgme_data_set_file_name): Allow to clear the file name
2016         by passing NULL.
2017
2018 2006-06-22  Marcus Brinkmann  <marcus@g10code.de>
2019
2020         * keylist.c (gpgme_get_key): Also clone the engine info.
2021
2022 2006-03-06  Marcus Brinkmann  <marcus@g10code.de>
2023
2024         * gpgme-config.in (cflags_pth): Revert accidential removal of
2025         pthread support with last change.
2026
2027 2006-02-28  Marcus Brinkmann  <marcus@g10code.de>
2028
2029         * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
2030         (_gpgme_io_pipe): Open pipes in binary mode.
2031
2032 2006-02-22  Marcus Brinkmann  <marcus@g10code.de>
2033
2034         * engine.c (gpgme_engine_check_version): Reimplemented to allow
2035         checking the version correctly even after changing the engine
2036         information.  Bug reported by Stéphane Corthésy.
2037
2038         * rungpg.c (read_colon_line): Invoke colon preprocess handler if
2039         it is set.
2040         (colon_preprocessor_t): New type.
2041         (struct engine_gpg): New member colon.preprocess_fnc.
2042         (gpg_keylist_preprocess): New function.
2043         * keylist.c (keylist_colon_handler): Allow short key IDs.
2044
2045 2006-02-15  Marcus Brinkmann  <marcus@g10code.de>
2046
2047         * w32-io.c (create_writer): Make C->have_data a manually resetted
2048         event.
2049         (writer): Move code from end of if block to beginning, so it
2050         is also run the first time.
2051         (_gpgme_io_write): Move assert check after error check.  Reset
2052         the is_empty event, and also do it eagerly.
2053         (_gpgme_io_select): Unconditionally wait for the is_empty event.
2054
2055 2006-01-26  Werner Koch  <wk@g10code.com>
2056
2057         * w32-util.c (_gpgme_get_conf_int): New.
2058         * posix-util.c (_gpgme_get_conf_int): New.
2059         * w32-io.c (get_desired_thread_priority): New.
2060         (create_reader, create_writer): Use it here.
2061
2062 2006-01-04  Werner Koch  <wk@g10code.com>
2063
2064         * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
2065
2066         * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
2067         statements. Disable error return for failed nonblocking call.
2068
2069 2006-01-03  Marcus Brinkmann  <marcus@g10code.de>
2070
2071         * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
2072         channel for it.
2073
2074 2005-12-31  Marcus Brinkmann  <marcus@g10code.de>
2075
2076         * w32-glib-io.c (find_channel): Set channel to unbuffered.
2077         (_gpgme_io_select): Fix debug output.
2078
2079 2005-12-23  Werner Koch  <wk@g10code.com>
2080
2081         * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
2082         * verify.c (release_op_data, _gpgme_verify_status_handler): Set
2083         this field.
2084
2085 2005-12-20  Werner Koch  <wk@g10code.com>
2086
2087         * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
2088         and GPGME_STATUS_PKA_TRUST_GOOD.
2089         (struct _gpgme_signature): New field pka_trust.
2090         * verify.c (_gpgme_verify_status_handler): Set pka_trust.
2091
2092 2005-12-06  Werner Koch  <wk@g10code.com>
2093
2094         * keylist.c (keylist_colon_handler): Store fingerprints of the
2095         subkeys.  Reset the secret flag of subkeys for stub secret keys.
2096         (NR_FIELDS): Bumped up to 16
2097
2098 2005-11-27  Marcus Brinkmann  <marcus@g10code.de>
2099
2100         * engine.c (_gpgme_set_engine_info): Use new_file_name in
2101         engine_get_version invocation.  Reported by Stéphane Corthésy.
2102
2103 2005-11-24  Marcus Brinkmann  <marcus@g10code.de>
2104
2105         * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
2106
2107 2005-11-18  Werner Koch  <wk@g10code.com>
2108
2109         * w32-glib-io.c: Include glib.h before windows to avoid a symbol
2110         shadowing warning.
2111         (find_channel): Better use g_io_channel_win32_new_fd instead of
2112         the autodetection function g_io_channel_unix_new.
2113         (_gpgme_io_select): Rewritten.  It is now a fully working select
2114         implementation.
2115
2116 2005-11-18  Marcus Brinkmann  <marcus@g10code.de>
2117
2118         * priv-io.h (_gpgme_io_fd2str): New prototype.
2119         * posix-io.c (_gpgme_io_fd2str): New function.
2120         * w32-io.c (_gpgme_io_fd2str): New function.
2121         * rungpg.c: Use this new function.
2122         * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
2123         again.  Two's company, three's the musketeers.
2124
2125         * w32-glib-io.c: Rewrote the file handle code.  We don't create
2126         system fds for every handle (doesn't work for inherited handles),
2127         but we create pseudo fds in a private namespace that designate a
2128         handle and potentially a giochannel.
2129
2130 2005-11-18  Werner Koch  <wk@g10code.com>
2131
2132         * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
2133
2134 2005-11-17  Marcus Brinkmann  <marcus@g10code.de>
2135
2136         * w32-glib-io.c: New file.
2137         * gpgme.def (gpgme_get_giochannel): Add symbol.
2138         * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
2139         w32-io.c.
2140         (ltlib_gpgme_extra): New variable.
2141         (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
2142         (system_components_not_extra): New variable.
2143         (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
2144         (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
2145         (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
2146         (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
2147         [BUILD_W32_GLIB]: New variables.
2148         * gpgme-config.in (glib): New option.
2149         * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
2150
2151 2005-11-17  Marcus Brinkmann  <marcus@g10code.de>
2152
2153         * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
2154         * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
2155         * posix-io.c (_gpgme_io_kill): Removed.
2156         (_gpgme_io_waitpid): Declare static.
2157
2158 2005-10-24  Marcus Brinkmann  <marcus@g10code.de>
2159
2160         * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
2161
2162 2005-10-21  Werner Koch  <wk@g10code.com>
2163
2164         * Makefile.am: Fixed cut+paste problem
2165
2166 2005-10-20  Marcus Brinkmann  <marcus@g10code.de>
2167
2168         * Makefile.am: Build versioninfo.lo, not versioninfo.o.  Also, fix
2169         the whole mess.
2170
2171 2005-10-16  Marcus Brinkmann  <marcus@g10code.de>
2172
2173         * rungpg.c (gpg_edit): Don't add a key argument if in card edit
2174         mode.
2175
2176 2005-10-06  Marcus Brinkmann  <marcus@g10code.de>
2177
2178         * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
2179         gpgme.def.
2180
2181         * gpgme.h (gpgme_free): New prototype.
2182         * data-mem.c (gpgme_free): New function.
2183         * libgpgme.vers (GPGME_1.1): Add gpgme_free.
2184         * gpgme.def: Add gpgme_free.
2185
2186 2005-10-02  Marcus Brinkmann  <marcus@g10code.de>
2187
2188         * util.h (_gpgme_decode_percent_string): Add new argument BINARY
2189         to prototype.
2190         * verify.c (parse_notation): Likewise for invocation.
2191         * conversion.c (_gpgme_decode_percent_string): Likewise to
2192         declaration.  If set, do not replace '\0' characters with a
2193         printable string.
2194         * gpgme.h (struct _gpgme_key_sig): New field notations.
2195         * ops.h (_gpgme_parse_notation): New prototype.
2196         * sig-notation.c (_gpgme_parse_notation): New function.
2197         * key.c (gpgme_key_unref): Free all signature notations.
2198         * keylist.c (op_data_t): New member tmp_keysig.
2199         (finish_key): Clear OPD->tmp_keysig.
2200         * gpgme.c (gpgme_set_keylist_mode): Remove check.
2201         * rungpg.c (gpg_keylist): Support listing signature notations.
2202         (gpg_keylist_ext): Likewise.
2203
2204 2005-10-01  Marcus Brinkmann  <marcus@g10code.de>
2205
2206         * engine.h (_gpgme_set_engine_info): Add prototype.
2207         * engine-backend.h (struct engine_ops): Change return type of
2208         get_file_name() to const char * to silence gcc warning.
2209         * engine.c (engine_get_file_name): Change return type to const
2210         char * to silence gcc warning.
2211         (gpgme_get_engine_info): Use transitional variable to go from
2212         const char * to char * to silence gcc warning.
2213         (_gpgme_set_engine_info): Likewise.
2214         * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
2215         char * to silence gcc warning.
2216         (gpgsm_new): Make ARGV a pointer to const char.
2217         (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
2218         to char * to silence gcc warning.
2219
2220         * gpgme.def: Add gpgme_data_set_file_name,
2221         gpgme_data_get_file_name, gpgme_sig_notation_clear,
2222         gpgme_sig_notation_add and gpgme_sig_notation_get.
2223         * libgpgme.vers: Add gpgme_sig_notation_clear,
2224         gpgme_sig_notation_add and gpgme_sig_notation_get.
2225         * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
2226         * context.h (struct gpgme_context): New field sig_notations.
2227         * gpgme.h (struct _gpgme_sig_notation): New member value_len and
2228         critical.
2229         (GPGME_SIG_NOTATION_CRITICAL): New symbol.
2230         (gpgme_sig_notation_flags_t): New type.
2231         (gpgme_sig_notation_add, gpgme_sig_notation_clear,
2232         gpgme_sig_notation_get): New prototypes.
2233         * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
2234         New prototypes.
2235         * sig-notation.c (_gpgme_sig_notation_free): New file.
2236         * verify.c (parse_notation): Use support functions.
2237         (release_op_data): Likewise.
2238         * rungpg.c (append_args_from_sig_notations): New function.
2239         (gpg_encrypt_sign, gpg_sign): Call it.
2240
2241 2005-09-30  Marcus Brinkmann  <marcus@g10code.de>
2242
2243         * data.h (struct gpgme_data): New member file_name.
2244         * data.c (gpgme_data_set_filename): New function.
2245         (_gpgme_data_release): Free DH->filename if necessary.
2246         (gpgme_data_get_filename): New function.
2247         * rungpg.c (gpg_encrypt): Set filename option.
2248         (gpg_encrypt_sign): Likewise.
2249         (gpg_sign): Likewise.
2250         * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
2251         gpgme_data_get_file_name.
2252
2253         * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
2254         file_name.
2255
2256 2005-09-29  Marcus Brinkmann  <marcus@g10code.de>
2257
2258         * gpgme.h (struct _gpgme_key): Add field is_qualified.
2259         (struct _gpgme_subkey): Likewise.
2260         * keylist.c (set_subkey_capability, set_mainkey_capability): Set
2261         field is_qualified.
2262
2263 2005-09-23  Werner Koch  <wk@g10code.com>
2264
2265         * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
2266         again.
2267         (create_reader, create_writer): Set thread priority higher.
2268
2269 2005-09-19  Werner Koch  <wk@g10code.com>
2270
2271         * w32-io.c (_gpgme_io_pipe): New environment variable to change
2272         the size of the pipe buffer.
2273
2274 2005-09-13  Werner Koch  <wk@g10code.com>
2275
2276         * ath.c: Changes to make it work under W32.
2277
2278 2005-09-12  Marcus Brinkmann  <marcus@g10code.de>
2279
2280         * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
2281         (ath_pth_src, ath_pthread_src): Removed.
2282         (w32_o_files): Replace ath-compat.o with ath.o.
2283         (libgpgme_pth_la_CFLAGS): New variable.
2284         * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
2285         * ath.h (ath_pthread_available, ath_pth_available): Removed.
2286         (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
2287         (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
2288         (_ATH_COMPAT): Macro removed.
2289         * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
2290         _gpgme_ath_init.
2291
2292 2005-09-12  Marcus Brinkmann  <marcus@g10code.de>
2293
2294         * keylist.c (release_op_data): Do not free opd->tmp_uid.
2295
2296 2005-09-07  Werner Koch  <wk@g10code.com>
2297
2298         * w32-io.c (build_commandline): Quote argv[0].
2299
2300 2005-08-26  Marcus Brinkmann  <marcus@g10code.de>
2301
2302         * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
2303
2304         * edit.c (command_handler): Do not depend on PROCESSED being
2305         available.
2306
2307         * engine.h (engine_command_handler_t): Add new argument processed.
2308         * ops.h (_gpgme_passphrase_command_handler_internal): Rename
2309         prototype to ...
2310         (_gpgme_passphrase_command_handler): ... this one.
2311         * passphrase.c (_gpgme_passphrase_command_handler_internal):
2312         Rename to ...
2313         (_gpgme_passphrase_command_handler): ... this one.
2314         * edit.c (command_handler): Add new argument processed.  Remove
2315         local variable with the same name.  Always return processed as
2316         true.
2317         * rungpg.c (command_handler): Send a newline character if the
2318         handler did not.
2319
2320 2005-08-26  Werner Koch  <wk@g10code.com>
2321
2322         * w32-util.c (read_w32_registry_string): Updated from code used by
2323         GnuPG.  This allows for expanding strings and features the
2324         implicit fallback key.
2325         (w32_shgetfolderpath, find_program_at_standard_place): New.
2326         (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
2327         entry, locate the programs at the standard place.
2328         (dlopen, dlsym, dlclose): New, so that we can keep on using what
2329         we are accustomed to.
2330
2331         * debug.c (debug_init): Use PATHSEP_C so that under W32 a
2332         semicolon is used which allows us to create files with drive
2333         letters.
2334
2335         * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
2336         debug mode too.
2337
2338 2005-07-27  Marcus Brinkmann  <marcus@g10code.de>
2339
2340         * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
2341         (struct _gpgme_op_decrypt_result): New member plaintext_filename.
2342         (struct _gpgme_op_verify_result): Likewise.
2343         * ops.h (_gpgme_parse_plaintext): Add prototype.
2344         * op-support.c (_gpgme_parse_plaintext): New function.
2345         * decrypt.c (release_op_data): Release
2346         OPD->result.plaintext_filename.
2347         (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
2348         * verify.c (release_op_data): Release
2349         OPD->result.plaintext_filename.
2350         (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
2351
2352 2005-08-08  Werner Koch  <wk@g10code.com>
2353
2354         * util.h (stpcpy): Renamed to ..
2355         (_gpgme_stpcpy): .. this and made inline.  This avoids duplicate
2356         definitions when linking statically.
2357         * stpcpy.c: Removed.
2358
2359 2005-08-19  Werner Koch  <wk@g10code.com>
2360
2361         * gpgme.def: New.
2362         * versioninfo.rc.in: New.
2363         * Makefile.am: Addes support for building a W32 DLL.
2364
2365         * ttyname_r.c (ttyname_r) [W32]: Return error.
2366         * ath-compat.c [W32]: select and co are not yet supported; return
2367         error.
2368         * data-stream.c (stream_seek): Use ftell if ftello is not available.
2369
2370 2005-07-26  Marcus Brinkmann  <marcus@g10code.de>
2371
2372         * keylist.c (gpgme_get_key): Allow key IDs.
2373
2374 2005-06-20  Marcus Brinkmann  <marcus@g10code.de>
2375
2376         * gpgme.m4: Only call GPGME_CONFIG if found.
2377
2378 2005-06-03  Marcus Brinkmann  <marcus@g10code.de>
2379
2380         * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
2381         hash_algo.
2382         * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
2383         (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
2384
2385         (_gpgme_decrypt_status_handler): Fix last change.
2386
2387         * gpgme.h (struct _gpgme_recipient): New structure.
2388         (gpgme_recipient_t): New type.
2389         (struct _gpgme_op_decrypt_result): Add member recipients.
2390         * decrypt.c (op_data_t): New member last_recipient_p.
2391         (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
2392         (parse_enc_to): New function.
2393         (_gpgme_decrypt_status_handler): Handle status ENC_TO and
2394         NO_SECKEY.
2395
2396         * wait-global.c (gpgme_wait): Break out of the fd processing loop
2397         after an error.
2398         Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2399
2400 2005-06-02  Marcus Brinkmann  <marcus@g10code.de>
2401
2402         * wait.h (_gpgme_run_io_cb): New prototype.
2403         * wait.c (_gpgme_run_io_cb): New function.
2404         * wait-global.c (gpgme_wait): Call it.
2405         * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
2406         * wait-private.c (_gpgme_wait_on_condition): Likewise.
2407
2408 2005-06-02  Werner Koch  <wk@g10code.com>
2409
2410         * passphrase.c (_gpgme_passphrase_status_handler): Take care of
2411         GPGME_STATUS_NEED_PASSPHRASE_PIN.
2412         (_gpgme_passphrase_command_handler_internal): Also act on the key
2413         "passphrase.pin.ask".
2414
2415         * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
2416         GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
2417         GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
2418         GPGME_STATUS_BACKUP_KEY_CREATED.
2419
2420 2005-05-28  Marcus Brinkmann  <marcus@g10code.de>
2421
2422         * data-user.c: Include <errno.h>.
2423
2424 2005-05-17  Marcus Brinkmann  <marcus@g10code.de>
2425
2426         * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
2427         default.
2428
2429 2005-05-11  Marcus Brinkmann  <marcus@g10code.de>
2430
2431         * w32-io.c (_gpgme_io_select): Fix loop increment.
2432
2433 2005-05-05  Marcus Brinkmann  <marcus@g10code.de>
2434
2435         * data-user.c (user_release): Only call user hook if provided.
2436         (user_seek): Return EBADF if no user hook is provided.
2437         (user_read): Likewise.
2438         (user_write): Likewise.
2439
2440 2005-04-28  Marcus Brinkmann  <marcus@g10code.de>
2441
2442         * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
2443         * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
2444         the reset, just for cleanliness, and do not sent it at all if the
2445         default is requested.
2446         * gpgme.c (gpgme_set_include_certs): Allow to use
2447         GPGME_INCLUDE_CERTS_DEFAULT.
2448
2449 2005-04-21  Werner Koch  <wk@g10code.com>
2450
2451         * verify.c (calc_sig_summary): Set the key revoked bit.
2452
2453 2005-04-14  Marcus Brinkmann  <marcus@g10code.de>
2454
2455         * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
2456         in the list, not the user-provided CTX.
2457         Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2458
2459         * wait-global.c (gpgme_wait): If no context is found, and we
2460         should not hang, set *status to 0 and return NULL.
2461         Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2462
2463 2005-03-24  Marcus Brinkmann  <marcus@g10code.de>
2464
2465         * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
2466         * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
2467         (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
2468         ENOSYS instead EOPNOTSUPP.
2469         * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
2470         (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
2471         to ENOSYS.
2472
2473 2005-03-24  Marcus Brinkmann  <marcus@g10code.de>
2474
2475         * io.h: Rename to ...
2476         * priv-io.h: ... this.
2477         * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
2478         * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
2479         w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
2480         Change all includes of "io.h" to "priv-io.h"
2481
2482 2005-03-09  Werner Koch  <wk@g10code.com>
2483
2484         * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
2485         cast away type checks.
2486
2487         * io.h [W32]: Do not include stdio.h.  If it is needed do it at
2488         the right place.
2489
2490         * data.h [W32]: Removed kludge for EOPNOTSUP.
2491         * data.c, data-compat.c [W32]: Explicitly test for it here.
2492
2493         Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
2494         files.
2495
2496 2005-03-07  Timo Schulz  <twoaday@g10code.de>
2497
2498         * gpgme.h: [_WIN32] Removed ssize_t typedef.
2499         * ath.h: [_WIN32] Added some (dummy) types.
2500         * io.h: [_WIN32] include stdio.h.
2501         * data.h: [_WIN32] Define EOPNOTSUPP.
2502         * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
2503         * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
2504
2505 2004-12-12  Marcus Brinkmann  <marcus@g10code.de>
2506
2507         * engine.c (_gpgme_set_engine_info): Fix assertion.
2508
2509 2004-12-11  Marcus Brinkmann  <marcus@g10code.de>
2510
2511         * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
2512         prototype.
2513         * ttyname_r.c: New file.
2514
2515 2004-12-07  Marcus Brinkmann  <marcus@g10code.de>
2516
2517         * putc_unlocked.c, funopen.c: I just claim copyright on these
2518         files and change their license to LGPL, because they are totally
2519         trivial wrapper functions.
2520         * isascii.c: Change copyright notice to the one from ctype/ctype.h
2521         in the GNU C Library (CVS Head 2004-10-10), where isascii is
2522         defined as a macro doing exactly the same as the function in this
2523         file.
2524         * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
2525         * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
2526         * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
2527         ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
2528         data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
2529         data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
2530         decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
2531         engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
2532         export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
2533         key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
2534         passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
2535         rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
2536         util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
2537         wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
2538         license to LGPL.
2539
2540 2004-12-07  Marcus Brinkmann  <marcus@g10code.de>
2541
2542         * libgpgme.vers (GPGME_1.1): New version.
2543         * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
2544         member get_version().  Add arguments FILE_NAME and HOME_DIR to
2545         member new().  Change return type of get_file_name and get_version
2546         to char *.
2547         * engine-gpgsm.c (gpgsm_get_version): Change return type to char
2548         pointer.  Do not cache result.
2549         (gpgsm_new): Add file_name and home_dir argument, and use them
2550         instead of the defaults, if set.
2551         * rungpg.c (struct engine_gpg): New member file_name.
2552         (gpg_get_version): Change return type to char pointer, and do not
2553         cache result.
2554         (gpg_release): Free gpg->file_name.
2555         (gpg_new): Take new arguments file_name and home_dir.  Set the
2556         --homedir argument if HOME_DIR is not NULL.  Set gpg->file_name.
2557         (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
2558         * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
2559         New prototypes.
2560         (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
2561         info.
2562         * engine.c: Include <assert.h>.
2563         (gpgme_get_engine_info): Set *INFO within the lock.  Move
2564         ENGINE_INFO and ENGINE_INFO_LOCK to ....
2565         (engine_info, engine_info_lock): ... here.  New static variables.
2566         (engine_get_version): Add file_name argument to
2567         get_version invocation.  Change return type to char pointer.
2568         (gpgme_engine_check_version): Rewritten to free() the return value
2569         of engine_get_version after using it.
2570         (_gpgme_engine_info_release): New function.
2571         (gpgme_get_engine_info): Rewritten.
2572         (_gpgme_engine_info_copy): New function.
2573         (_gpgme_set_engine_info): New function.
2574         (gpgme_set_engine_info): New function.
2575         (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
2576         info, and use that.
2577         * gpgme.h (struct _gpgme_engine_info): Change type of file_name
2578         and version to char * (remove the const).  New member home_dir.
2579         (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
2580         gpgme_ctx_set_engine_info): New prototypes.
2581         * context.h (struct gpgme_context): New member engine_info.
2582         * gpgme.c (gpgme_new): Allocate CTX->engine_info.
2583         (gpgme_release): Deallocate CTX->engine_info.
2584         (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
2585         functions.
2586         * op-support.c (_gpgme_op_reset): Look for correct engine info and
2587         pass it to _gpgme_engine_new.
2588         * version.c (gpgme_check_version): Adjust to
2589         _gpgme_compare_versions returning an int.
2590         (_gpgme_compare_versions): Return an int value, not a const char
2591         pointer.
2592         * ops.h (_gpgme_compare_versions): Same for prototype.
2593
2594 2004-10-03  Marcus Brinkmann  <marcus@g10code.de>
2595
2596         * verify.c (parse_trust): If no reason is provided, set
2597         SIG->validity_reason to 0.
2598         (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
2599
2600 2004-10-22  Marcus Brinkmann  <marcus@g10code.de>
2601
2602         * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
2603         (start): Call map_assuan_error on return value of
2604         assuan_write_line.
2605
2606 2004-10-05  Marcus Brinkmann  <marcus@g10code.de>
2607
2608         * op-support.c (_gpgme_op_data_lookup): Use char pointer for
2609         pointer arithmetic.
2610
2611 2004-09-30  Marcus Brinkmann  <marcus@g10code.de>
2612
2613         * gpgme.m4: Implement the --api-version check.
2614
2615         * rungpg.c (read_status): Move the polling of the output data pipe
2616         to just before removing the command fd, from just before adding
2617         it.  This avoids buffering problems.
2618
2619         * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
2620         read, to improve debug output.
2621
2622 2004-09-29  Marcus Brinkmann  <marcus@g10code.de>
2623
2624         * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
2625         GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
2626         (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
2627         GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
2628         enum to macros.
2629         (gpgme_keylist_mode_t): Define as unsigned int.
2630         (gpgme_key_t): Change type of keylist_mode to
2631         gpgme_keylist_mode_t.
2632
2633 2004-09-23  Marcus Brinkmann  <marcus@g10code.de>
2634
2635         * data.c (_gpgme_data_outbound_handler): Close the file descriptor
2636         if we get an EPIPE.
2637
2638         * data-stream.c (stream_seek): Call ftello and return the current
2639         offset.
2640         * data.h (struct gpgme_data): Change type of data.mem.offset to
2641         off_t.
2642         * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
2643         callback.  If SEEK_CUR, adjust the offset by the pending buffer
2644         size.  Clear pending buffer on success.
2645
2646
2647 2004-09-14  Marcus Brinkmann  <marcus@g10code.de>
2648
2649         * gpgme.m4: Add copyright notice.
2650
2651 2004-08-18  Marcus Brinkmann  <marcus@g10code.de>
2652
2653         * passphrase.c (_gpgme_passphrase_status_handler): Always run the
2654         status handler.
2655
2656 2004-08-17  Marcus Brinkmann  <marcus@g10code.de>
2657
2658         * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
2659
2660 2004-06-23  Marcus Brinkmann  <marcus@g10code.de>
2661
2662         * key.c (_gpgme_key_append_name): Make sure tail points to the
2663         byte following the uid.
2664         (_gpgme_key_add_sig): Likewise.  Don't use calloc, but malloc and
2665         memset.
2666
2667 2004-06-02  Marcus Brinkmann  <marcus@g10code.de>
2668
2669         * libgpgme.vers: Remove C-style comment, which is not supported by
2670         older binutils.
2671
2672 2004-05-21  Marcus Brinkmann  <marcus@g10code.de>
2673
2674         * gpgme-config.in (Options): Support --api-version.
2675
2676         * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
2677
2678         * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
2679         * verify.c (parse_error): Likewise.
2680
2681         * verify.c (parse_error): Do not skip location of where token.
2682
2683         * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
2684         * verify.c (_gpgme_verify_status_handler): Add handling of
2685         GPGME_STATUS_REVKEYSIG.
2686         (parse_trust): Likewise.
2687
2688 2004-05-21  Marcus Brinkmann  <marcus@g10code.de>
2689
2690         * gpgme.h (struct _gpgme_decrypt_result): New fields
2691         wrong_key_usage and _unused.
2692         * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
2693         character after a matched string, as in a protocol error this
2694         could skip over the trailing binary zero.
2695         Handle decrypt.keyusage error notifications.
2696
2697         * gpgme.h (struct _gpgme_key): New member keylist_mode.
2698         * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
2699
2700 2004-04-29  Marcus Brinkmann  <marcus@g10code.de>
2701
2702         * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
2703         to unsigned int.  Same for member _unused.
2704
2705         * keylist.c (set_mainkey_trust_info): Rewritten.
2706         (set_subkey_capability): Handle 'd' (disabled).
2707         (set_mainkey_capability): Rewritten.
2708
2709 2004-04-22  Marcus Brinkmann  <marcus@g10code.de>
2710
2711         * gpgme.m4: Quote first argument to AC_DEFUN.
2712
2713 2004-04-21  Werner Koch  <wk@gnupg.org>
2714
2715         * key.c (gpgme_key_unref): Allow passing NULL like free does.
2716         The rule of least surprise.
2717
2718 2004-04-15  Werner Koch  <wk@gnupg.org>
2719
2720         * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
2721         unused result.signatures items.
2722
2723         * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
2724
2725 2004-04-08  Werner Koch  <wk@gnupg.org>
2726
2727         * verify.c (_gpgme_verify_status_handler): Ignore the error status
2728         if we can't process it.
2729         * decrypt-verify.c (decrypt_verify_status_handler): Backed out
2730         yesterday's hack.  It is not any longer required.
2731
2732 2004-04-07  Werner Koch  <wk@gnupg.org>
2733
2734         * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
2735         with meaningless error codes from the verify status function.
2736
2737 2004-04-05  Werner Koch  <wk@gnupg.org>
2738
2739         * gpgme.h: Add GPGME_STATUS_NEWSIG.
2740
2741         * verify.c (parse_error): Compare only the last part of the where
2742         token.
2743         (prepare_new_sig): New.
2744         (parse_new_sig): Use prepare_new_sig when required.
2745         (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
2746
2747         * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
2748         option.  Fixed pattern construction.
2749         (status_handler): Add debugging output.
2750
2751 2004-03-23  Marcus Brinkmann  <marcus@g10code.de>
2752
2753         * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
2754         isatty().  Submitted by Bernhard Herzog.
2755
2756 2004-03-11  Marcus Brinkmann  <marcus@g10code.de>
2757
2758         * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
2759         isatty().
2760
2761         * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
2762         releasing it.
2763         * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
2764         GPGSM->assuan_ctx is not NULL.  Set it to NULL afterwards.
2765
2766 2004-03-07  Marcus Brinkmann  <marcus@g10code.de>
2767
2768         * gpgme-config.in: Do not emit include and lib directory for
2769         prefix "/usr" or "".
2770
2771 2004-03-03  Werner Koch  <wk@gnupg.org>
2772
2773         * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
2774         beween patterns.
2775
2776 2004-02-18  Werner Koch  <wk@gnupg.org>
2777
2778         * gpgme-config.in: Ignore setting of --prefix.
2779
2780 2004-02-25  Marcus Brinkmann  <marcus@g10code.de>
2781
2782         * rungpg.c (gpg_cancel): New function.
2783         (gpg_release): Call it here.
2784         (_gpgme_engine_ops_gpg): Add it here.
2785         * engine-gpgsm.c (gpgsm_cancel): Fix last change.
2786
2787 2004-02-24  Marcus Brinkmann  <marcus@g10code.de>
2788
2789         * gpgme.c (gpgme_cancel): New function.
2790         * engine-backend.h (struct engine_ops): New member cancel.
2791         * engine.h (_gpgme_engine_cancel): New prototype.
2792         * engine.c (_gpgme_engine_cancel): New function.
2793         * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
2794         (gpgsm_cancel): New function.
2795         (gpgsm_release): Use it.
2796         * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
2797
2798 2004-02-17  Werner Koch  <wk@gnupg.org>
2799
2800         * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE.
2801         * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
2802
2803 2004-02-15  Werner Koch  <wk@gnupg.org>
2804
2805         * memrchr.c (memrchr): Fixed implementation.  Problem pointed out
2806         by Adriaan de Groot.
2807
2808 2004-02-01  Marcus Brinkmann  <marcus@g10code.de>
2809
2810         * rungpg.c (build_argv): Use --no-comment, not --comment "".
2811
2812         * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
2813         available.
2814         * data-stream.c (stream_seek): Likewise.
2815
2816 2004-01-16  Werner Koch  <wk@gnupg.org>
2817
2818         * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
2819         used by GnuPG 1.9.x
2820
2821 2004-01-13  Marcus Brinkmann  <marcus@g10code.de>
2822
2823         * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
2824
2825 2004-01-12  Werner Koch  <wk@gnupg.org>
2826
2827         * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
2828
2829 2003-12-25  Marcus Brinkmann  <marcus@g10code.de>
2830
2831         * gpgme.h (_GPGME_D_CLASS): Revert this change.
2832         (struct _gpgme_key_sig): For C++ compilers, rename class
2833         member to _obsolete_class.  Add new member sig_class.
2834         (struct _gpgme_new_signature): Same here.
2835         * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
2836         not CERTSIG->class.
2837         * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
2838         setting KEYSIG->class, too.  Rename variable CLASS to SIG_CLASS.
2839         * sign.c (parse_sig_created): Set SIG->sig_class.
2840
2841 2003-12-22  Werner Koch  <wk@gnupg.org>
2842
2843         * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
2844         changing the C API.
2845
2846 2003-11-19  Werner Koch  <wk@gnupg.org>
2847
2848         * conversion.c (_gpgme_parse_timestamp): New.
2849         (atoi_1, atoi_2, atoi_4): New.
2850         * keylist.c (parse_timestamp): Removed. Changed all callers to use
2851         the new function.
2852         * verify.c (parse_valid_sig): Ditto.  Repalced the errno check.
2853         * sign.c (parse_sig_created): Ditto.
2854
2855 2003-10-31  Werner Koch  <wk@gnupg.org>
2856
2857         * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
2858         to convert them.
2859
2860 2003-10-10  Marcus Brinkmann  <marcus@g10code.de>
2861
2862         * genkey.c (get_key_parameter): Make a copy of the key parameters.
2863         Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
2864
2865 2003-10-06  Marcus Brinkmann  <marcus@g10code.de>
2866
2867         * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
2868         broken systems.
2869
2870         * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
2871         error.
2872
2873         * io.h (_gpgme_io_subsystem_init): New prototype.
2874         * posix-io.c (_gpgme_io_subsystem_init): Add function.
2875         (_gpgme_io_spawn): Do not fixup signal handler here.
2876         * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
2877
2878         * debug.c (debug_init): Drop const qualifier from E.
2879
2880         * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
2881         const.
2882         (ath_connect): Make ADDR argument const.
2883         * ath-pthread.c (ath_connect): Likewise.
2884         * ath-pth.c (ath_connect): Likewise.
2885         * ath-compat.c (ath_connect): Likewise.
2886         * ath.c (ath_connect): Likewise.
2887
2888         * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
2889         [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
2890
2891         * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
2892         SRC argument.
2893         * util.h (_gpgme_hextobyte): Likewise for prototype.
2894
2895         * gpgme.h: Remove trailing comma in enum.
2896
2897         * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
2898         <signal.h>, <fcntl.h>, or "unistd.h".
2899
2900 2003-10-02  Marcus Brinkmann  <marcus@g10code.de>
2901
2902         * engine-backend.h (struct engine_ops): Add argument TYPE.
2903         * engine.c (_gpgme_engine_op_edit): Likewise.
2904         * engine.h: Likewise.
2905         * rungpg.c (gpg_edit): Likewise.  Use it.
2906         * edit.c (edit_start): Likewise.  Pass it on.
2907         (gpgme_op_edit_start, gpgme_op_edit): Likewise.
2908         (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
2909
2910 2003-09-30  Marcus Brinkmann  <marcus@g10code.de>
2911
2912         * gpgme.h (gpg_strerror_r): Change prototype to match
2913         gpg_strerror_r change.
2914         * error.c (gpg_strerror_r): Likewise, also update implementation.
2915
2916         * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
2917         RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
2918         CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
2919
2920 2003-09-14  Marcus Brinkmann  <marcus@g10code.de>
2921
2922         * gpgme.h: Add prototype for gpgme_set_locale.
2923
2924         * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
2925         characteristics and use that instead __inline__.
2926
2927         * context.h (struct gpgme_context): New members lc_ctype and
2928         lc_messages.
2929         * gpgme.c: Include <locale.h>.
2930         (def_lc_lock, def_lc_ctype, def_lc_messages): New static
2931         variables.
2932         (gpgme_set_locale): New function.
2933         * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
2934         lc_messages.
2935         * engine.h (_gpgme_engine_new): Likewise.
2936         * engine-gpgsm.c (gpgsm_new): Likewise.
2937         * rungpg.c (gpg_new): Likewise.
2938         * engine-backend.h (struct engine_ops): Likewise to NEW.
2939         * op-support.c (_gpgme_op_reset): Likewise to invocation of
2940         _gpgme_engine_new.
2941
2942 2003-09-13  Marcus Brinkmann  <marcus@g10code.de>
2943
2944         * gpgme.h (gpgme_strerror_r): New prototype.
2945         * error.c (gpgme_strerror_r): New function.
2946
2947         * get-env.c: New file.
2948         * util.h (_gpgme_getenv): Add prototype.
2949         * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
2950         * rungpg.c (build_argv): Use _gpgme_getenv.
2951         * debug.c (debug_init): Likewise.
2952         * engine-gpgsm.c (gpgsm_new): Likewise.
2953         (gpgsm_new): Use ttyname_r.
2954         * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
2955
2956 2003-09-03  Marcus Brinkmann  <marcus@g10code.de>
2957
2958         * gpgme-config.in: Use $libdir, not @libdir@, for the echo
2959         command.
2960
2961         * gpgme-config.in: Rewritten.
2962         * gpgme.m4: Rewritten.
2963
2964 2003-08-19  Marcus Brinkmann  <marcus@g10code.de>
2965
2966         The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
2967         ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
2968         updated to have better thread support, and the Makefile.am was
2969         changed to reflect that.
2970
2971         * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
2972         * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
2973         value of status_fnc.
2974         * rungpg.c (start): Return SAVED_ERRNO, not errno.
2975
2976 2003-08-18  Marcus Brinkmann  <marcus@g10code.de>
2977
2978         * rungpg.c (start): Use saved_errno instead errno.
2979
2980 2003-08-18  Marcus Brinkmann  <marcus@g10code.de>
2981
2982         * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
2983         * fopencookie.c: File removed.
2984
2985 2003-08-15  Marcus Brinkmann  <marcus@g10code.de>
2986
2987         * gpgme-config.in: Put gpg-error related flags after gpgme's.
2988
2989 2003-08-14  Marcus Brinkmann  <marcus@g10code.de>
2990
2991         * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
2992         _OBSOLETE_CLASS, add member CLASS with type unsigned int.
2993         * sign.c (parse_sig_created): Also set SIG->_unused_class for
2994         backward compatibility.
2995
2996 2003-08-04  Marcus Brinkmann  <marcus@g10code.de>
2997
2998         * verify.c (parse_new_sig): Fix status parsing case.
2999
3000 2003-07-31  Marcus Brinkmann  <marcus@g10code.de>
3001
3002         * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
3003         Lower _UNUSED to 23 bits.
3004         (struct _gpgme_key): Likewise.
3005         * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
3006         (set_subkey_capability): Support 'a'.
3007
3008         * keylist.c (gpgme_get_key): Check if there is more than one key
3009         listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
3010
3011         * util.h (_gpgme_decode_c_string): Change type of LEN argument to
3012         size_t.
3013         (_gpgme_decode_percent_string): Likewise.
3014         * conversion.c (_gpgme_decode_c_string): Likewise.
3015         (_gpgme_decode_percent_string): Likewise.
3016         (_gpgme_map_gnupg_error): Change type of I to unsigned int.
3017         * signers.c (gpgme_signers_clear): Likewise.
3018         (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
3019         Use SEQNO instead SEQ.
3020         * wait.c (fd_table_put): Change type of I and J to unsigned int.
3021         * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
3022         to unsigned int.
3023         (gpgme_wait): Change type of I and IDX to unsigned int.
3024         * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
3025         and I to unsigned int.
3026         * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
3027         int to suppress gcc warning.
3028         (_gpgme_io_set_close_notify): Likewise.
3029         (_gpgme_io_select): Change type of I to unsigned int.
3030         * engine.c (gpgme_get_engine_info): Change type of PROTO to
3031         unsigned int.
3032         * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
3033         I to unsigned int.
3034
3035 2003-07-29  Marcus Brinkmann  <marcus@g10code.de>
3036
3037         * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
3038         and wrong expression.
3039         * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3040         * encrypt.c (encrypt_sym_status_handler): Likewise.
3041         * sign.c (sign_status_handler): Likewise.
3042         * verify.c (verify_status_handler): Likewise.
3043         * decrypt.c (decrypt_status_handler): Likewise.
3044
3045         * engine.c (gpgme_get_engine_info): Initialize NULL.
3046
3047 2003-07-23  Marcus Brinkmann  <marcus@g10code.de>
3048
3049         * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
3050         GPG_ERROR_LIBS when setting the corresponding variables.
3051         Reported by Stéphane Corthésy.
3052
3053 2003-07-22  Marcus Brinkmann  <marcus@g10code.de>
3054
3055         * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
3056         the beginning of the block.
3057
3058 2003-06-22  Marcus Brinkmann  <marcus@g10code.de>
3059
3060         * data-mem.c (mem_write): Copy original buffer content.
3061
3062 2003-06-22  Marcus Brinkmann  <marcus@g10code.de>
3063
3064         * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
3065         prototypes.
3066
3067 2003-06-06  Marcus Brinkmann  <marcus@g10code.de>
3068
3069         * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
3070         * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
3071         Print them.
3072
3073         * op-support.c (_gpgme_parse_inv_userid): Rename to
3074         _gpgme_parse_inv_recp and change to new datatype.
3075         * ops.h (_gpgme_parse_inv_key): Fix prototype.
3076         * gpgme.h (struct _gpgme_invalid_user_id): Rename to
3077         __gpgme_invalid_key.  Rename field ID to KEY.
3078         (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
3079         (struct _gpgme_op_encrypt_result): Here, too.
3080         (struct _gpgme_op_sign_result): Likewise.
3081         * encrypt.c (struct op_data): Likewise.
3082         (release_op_data): Likewise.
3083         * sign.c (struct op_data): Likewise.
3084         (release_op_data): Likewise.
3085
3086         * posix-io.c (_gpgme_io_read): Save errno across debug calls.
3087         (_gpgme_io_write): Likewise.
3088         (_gpgme_io_pipe): Likewise.
3089         (_gpgme_io_select): Likewise.
3090
3091         * rungpg.c (struct engine_gpg): Remove arg_error.
3092         (add_arg): Don't set arg_error.
3093         (add_data): Likewise.
3094         (start): Don't check arg_error.
3095         (gpg_new): Check return value of add_arg.
3096         * verify.c (parse_notation): Free allocated memory at error.
3097
3098 2003-06-05  Marcus Brinkmann  <marcus@g10code.de>
3099
3100         Everywhere: Use libgpg-error error codes.
3101
3102         * Makefile.am (EXTRA_DIST): Remove mkerrors.
3103         (BUILT_SOURCES): Remove errors.c.
3104         (MOSTLYCLEANFILES): Likewise.
3105         (libgpgme_la_SOURCES): Likewise.  Add error.c.
3106         (errors.c): Remove target.
3107         * mkerrors: File removed.
3108         * error.c: New file.
3109
3110         * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
3111         (gpgme_err_code_t, gpgme_err_source_t): New types.
3112         (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
3113         New static inline functions.
3114         (gpgme_strsource, gpgme_err_code_from_errno,
3115         gpgme_err_code_to_errno, gpgme_err_make_from_errno,
3116         gpgme_error_from_errno): New prototypes.
3117
3118 2003-05-29  Marcus Brinkmann  <marcus@g10code.de>
3119
3120         * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
3121         (gpgme_op_export): Likewise.
3122         (gpgme_op_export_ext_start): New prototype.
3123         (gpgme_op_export_ext): Likewise.
3124         * engine.h: Likewise for _gpgme_engine_op_export and
3125         _gpgme_engine_op_export_ext.
3126         * engine-backend.h (struct engine_ops): Change second argument of
3127         prototype of export to const char *, and add reserverd int as
3128         third argument.  Add prototype for export_ext.
3129         * engine.c (_gpgme_engine_op_export_ext): New function.
3130         (_gpgme_engine_op_export): Change second argument of prototype of
3131         export to const char *, and add reserverd int as third argument.
3132         * rungpg.c (gpg_export): Change second argument of prototype of
3133         export to const char *, and add reserverd int as third argument.
3134         (gpg_export_ext): New function.
3135         (gpg_keylist_ext): Break loop at error.
3136         (_gpgme_engine_ops_gpg): Add gpg_export_ext.
3137         * engine-gpgsm.c (gpgsm_export): Change second argument of
3138         prototype of export to const char *, and add reserverd int as
3139         third argument.
3140         (gpgsm_export_ext): New function.
3141         (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
3142         * export.c (export_start): Change second argument of prototype of
3143         export to const char *, and add reserverd int as third argument.
3144         (gpgme_op_export_start): Likewise.
3145         (export_ext_start): New function.
3146         (gpgme_op_export_ext_start): Likewise.
3147         (gpgme_op_export_ext): Likewise.
3148
3149         * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
3150         (gpgme_sigsum_t): New type for anonymous enum.
3151
3152         * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
3153         and return an error if RECP is not set.
3154
3155         * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
3156         * user-id.c: Remove file.
3157         * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
3158         * gpgme.h (gpgme_encrypt_flags_t): New type.
3159         (gpgme_op_encrypt_start): Change second parameter to type
3160         gpgme_key_t[], and add third parameter.
3161         (gpgme_op_encrypt): Likewise.
3162         (gpgme_op_encrypt_sign_start): Likewise.
3163         (gpgme_op_encrypt_sign): Likewise.
3164         * encrypt.c (encrypt_start): Likewise.
3165         (gpgme_op_encrypt_start): Likewise.
3166         (gpgme_op_encrypt): Likewise.  Pass flags to engine.
3167         * encrypt-sign.c (encrypt_sign_start): Likewise.
3168         (gpgme_op_encrypt_sign_start): Likewise.
3169         (gpgme_op_encrypt_sign): Likewise.
3170         * engine-backend.h (struct engine_ops): Likewise for prototypes of
3171         encrypt and encrypt_sign.
3172         * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
3173         and _gpgme_engine_op_encrypt_sign.
3174         * engine.c (_gpgme_engine_op_encrypt): Likewise.
3175         (_gpgme_engine_op_encrypt_sign): Likewise.
3176         * rungpg.c (gpg_encrypt): Likewise.
3177         (gpg_encrypt_sign): Likewise.
3178         * rungpg.c (gpg_encrypt): Check flags for always trust option.
3179         * engine-gpgsm.c (gpgsm_encrypt): Likewise.
3180         (set_recipients): Rewritten to use keys instead user IDs.
3181         * rungpg.c (append_args_from_recipients): Rewritten to use keys
3182         instead user IDs.
3183         * encrypt.c (_gpgme_encrypt_status_handler): Change errors
3184         returned to GPGME_Invalid_Key and GPGME_General_Error.
3185
3186 2003-05-28  Marcus Brinkmann  <marcus@g10code.de>
3187
3188         * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
3189         (struct gpgsm_object_s): Rename to struct engine_gpgsm.
3190         * rungpg.c: Rename GpgObject to engine_gpg_t.
3191         (struct gpg_object_s): Rename to struct engine_gpg.
3192
3193         * context.h (struct gpgme_context): Change EngineObject to
3194         engine_object_t.
3195         (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
3196         (ctx_op_data_t): New type.
3197         (struct gpgme_context): Use it.
3198         * ops.h (_gpgme_op_data_lookup): Use new type name.
3199         * op-support.c (_gpgme_op_data_lookup): Likewise.
3200         * engine.c: Rename EngineObject to engine_t in the file.  Also
3201         EngineStatusHandler to engine_status_handler_t,
3202         EngineCommandHandler to engine_command_handler_t and
3203         EngineColonLineHandler to engine_colon_line_handler.
3204         * rungpg.c (start): Likewise.
3205         * engine-gpgsm.c: Likewise.
3206         * engine-backend.h (struct engine_ops): Likewise
3207         * engine.h (struct engine_object_s): Rename to struct engine.
3208         (EngineObject): Rename to engine_t.  Also everywhere else in the
3209         file.
3210         (EngineStatusHandler): Rename to engine_status_handler_t.
3211         (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
3212         (EngineCommandHandler): Rename to engine_command_handler_t.
3213
3214         * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
3215
3216         * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
3217         user-id.c.
3218         * gpgme.h (gpgme_recipients_t): Removed.
3219         (gpgme_recipients_new, gpgme_recipients_release,
3220         gpgme_recipients_add_name,
3221         gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
3222         gpgme_recipients_enum_open, gpgme_recipients_enum_read,
3223         gpgme_recipients_enum_close): Removed.
3224         (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
3225         gpgme_op_encrypt_sign_start, gpgme_op_export_start,
3226         gpgme_op_export): Change second argument to gpgme_user_id_t.
3227         (gpgme_user_ids_release): New prototype.
3228         (gpgme_user_ids_append): Likewise.
3229         * ops.h (_gpgme_recipients_all_valid): Remove.
3230         (_gpgme_user_ids_all_valid): Add.
3231         * context.h (struct gpgme_recipients): Removed.
3232         * user-id.c: New file.
3233         * recipient.c: Removed file.
3234         * rungpg.c (append_args_from_recipients): Change last arg to
3235         gpgme_user_id_t.  Reimplement.
3236         (gpg_encrypt): Change second arg to gpgme_user_id_t.
3237         (gpg_encrypt_sign): Likewise.
3238         (gpg_export): Likewise.  Rewrite user ID list code.
3239         * engine.c (_gpgme_engine_op_encrypt): Change second arg to
3240         gpgme_user_id_t.
3241         (_gpgme_engine_op_encrypt_sign): Likewise.
3242         (_gpgme_engine_op_export): Likewise.
3243         * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
3244         _gpgme_engine_op_export): Likewise.
3245         * engine-gpgsm.c (set_recipients): Likewise.  Rewrite loop code.
3246         (gpgsm_encrypt): Likewise.
3247         (gpgsm_export): Likewise.
3248         * engine-backend.h (struct engine_ops): Likewise for members
3249         ENCRYPT, ENCRYPT_SIGN and EXPORT.
3250         * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
3251         Likewise.
3252         * encrypt.c (encrypt_start): Likewise.  Don't check for count of
3253         recipients.
3254         (gpgme_op_encrypt_start): Likewise.
3255         (gpgme_op_encrypt): Likewise.
3256         * encrypt-sign.c (encrypt_sign_start): Likewise.
3257         (gpgme_op_encrypt_sign): Likewise.
3258         (gpgme_op_encrypt_sign_start): Likewise.
3259
3260 2003-05-27  Marcus Brinkmann  <marcus@g10code.de>
3261
3262         * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
3263         * import.c (parse_import_res): Add skipped_new_keys parser.
3264
3265         * op-support.c (_gpgme_parse_inv_userid): Add missing break
3266         statements.
3267         * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
3268
3269 2003-05-27  Marcus Brinkmann  <marcus@g10code.de>
3270
3271         * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
3272         HOOK to avoid compiler warning.  Don't ask, you don't want to know.
3273         (_gpgme_encrypt_status_handler): Likewise.
3274         (_gpgme_op_encrypt_init_result): Likewise.
3275         * decrypt.c (gpgme_op_decrypt_result): Likewise.
3276         (_gpgme_decrypt_status_handler): Likewise.
3277         (_gpgme_op_decrypt_init_result): Likewise.
3278         * verify.c (gpgme_op_verify_result): Likewise.
3279         (_gpgme_verify_status_handler): Likewise.
3280         (_gpgme_op_verify_init_result): Likewise.
3281         * edit.c (edit_status_handler): Likewise.
3282         (command_handler): Likewise.
3283         (edit_start): Likewise.
3284         * genkey.c (gpgme_op_genkey_result): Likewise.
3285         (genkey_status_handler): Likewise.
3286         (genkey_start): Likewise.
3287         * import.c (gpgme_op_import_result): Likewise.
3288         (import_status_handler): Likewise.
3289         (_gpgme_op_import_start): Likewise.
3290         * trustlist.c (gpgme_op_trustlist_next): Likewise.
3291         (_gpgme_op_trustlist_event_cb): Likewise.
3292         (gpgme_op_trustlist_start): Likewise.
3293         * keylist.c (gpgme_op_keylist_result): Likewise.
3294         (keylist_colon_handler): Likewise.
3295         (keylist_status_handler): Likewise.
3296         (_gpgme_op_keylist_event_cb): Likewise.
3297         (gpgme_op_keylist_start): Likewise.
3298         (gpgme_op_keylist_ext_start): Likewise.
3299         (gpgme_op_keylist_next): Likewise.
3300         * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
3301         (_gpgme_passphrase_command_handler_internal): Likewise.
3302         * sign.c (gpgme_op_sign_result): Likewise.
3303         (_gpgme_sign_status_handler): Likewise.
3304         (_gpgme_op_sign_init_result): Likewise.
3305
3306         * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
3307         access to pointer type.
3308
3309 2003-05-26  Marcus Brinkmann  <marcus@g10code.de>
3310
3311         * engine.h (EngineCommandHandler): Change last argument to int fd.
3312         * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
3313         description and fd.
3314         (gpgme_edit_cb_t): Change last argument to int fd.
3315         * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
3316         * passphrase.c: Include <assert.h>.
3317         (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
3318         (release_op_data): Check values before calling free.
3319         (_gpgme_passphrase_status_handler): Likewise.
3320         (_gpgme_passphrase_command_handler_internal): New function.
3321         (_gpgme_passphrase_command_handler): Rewritten.
3322         * edit.c (edit_status_handler): Pass -1 as fd argument.
3323         (command_handler): Update prototype.  New variable processed.  Use
3324         it to store return value of
3325         _gpgme_passphrase_command_handler_internal which is now used
3326         instead _gpgme_passphrase_command_handler.  Use it also to check
3327         if we should call the user's edit function.  Pass fd to user's
3328         edit function.
3329         * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
3330         void *.
3331         (gpg_release): Check value before calling free.  Do not release
3332         cmd.cb_data.
3333         (command_cb): Function removed.
3334         (command_handler): New function.  Thus we don't use a data object
3335         for command handler stuff anymore, but handle it directly.  This
3336         allows proper error reporting (cancel of passphrase requests, for
3337         example).  Also all callbacks work via direct writes to the file
3338         descriptor (so that passphrases are not kept in insecure memory).
3339         (gpg_set_command_handler): Rewritten to use even more ugly hacks.
3340         (read_status): Check cmd.keyword before calling free.  Install
3341         command_handler as the I/O callback handler with GPG as private
3342         data.
3343
3344         * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
3345         invocation.
3346         * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
3347         decrypt_verify_start.
3348         (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
3349         (gpgme_op_decrypt_verify): Likewise.
3350         * verify.c (verify_status_handler): New function that also calls
3351         progress status handler.
3352         (_gpgme_op_verify_start): Set status handler to verify_status_handler.
3353         Rename to (verify_start).
3354         (gpgme_op_verify_start): Call verify_start.
3355         (gpgme_op_verify): Likewise.
3356         * encrypt.c (encrypt_status_handler): New function.
3357         (_gpgme_encrypt_sym_status_handler): Call progress status handler.
3358         Make static.  Rename to encrypt_sym_status_handler.
3359         (encrypt_start): Set status handler to encrypt_sym_status_handler
3360         or encrypt_status_handler.
3361         * sign.c (sign_status_handler): New function.
3362         (sign_start): Set status handler to sign_status_handler.
3363         * decrypt.c (decrypt_status_handler): New function that also calls
3364         progress status handler.
3365         (decrypt_start): Set status handler to decrypt_status_handler.
3366         * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3367         * decrypt-verify.c (decrypt_verify_status_handler): Call
3368         _gpgme_progress_status_handler.
3369
3370         * conversion.c (_gpgme_decode_c_string): Add missing break
3371         statement.
3372
3373         * recipient.c (gpgme_recipients_add_name_with_validity): Add one
3374         to buffer to allocate.
3375
3376 2003-05-19  Marcus Brinkmann  <marcus@g10code.de>
3377
3378         * verify.c (parse_new_sig): Fix ERRSIG case.
3379         Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
3380
3381 2003-05-18  Marcus Brinkmann  <marcus@g10code.de>
3382
3383         * gpgme.h: The following types are renamed.  The old name is kept
3384         as a deprecated typedef.
3385         (GpgmeCtx): Rename to gpgme_ctx_t.
3386         (GpgmeData): Rename to gpgme_data_t.
3387         (GpgmeRecipients): Rename to gpgme_recipients_t.
3388         (GpgmeError): Rename to gpgme_error_t.
3389         (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
3390         (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
3391         (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
3392         (GpgmeSigStat): Rename to gpgme_sig_stat_t.
3393         (GpgmeSigMode): Rename to gpgme_sig_mode_t.
3394         (GpgmeAttr): Rename to gpgme_attr_t.
3395         (GpgmeValidity): Rename to gpgme_validity_t.
3396         (GpgmeProtocol): Rename to gpgme_protocol_t.
3397         (GpgmeStatusCode): Rename to gpgme_status_code_t.
3398         (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
3399         (GpgmeSubkey): Rename to gpgme_subkey_t.
3400         (GpgmeKeySig): Rename to gpgme_keysig_t.
3401         (GpgmeUserID): Rename to gpgme_user_id_t.
3402         (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
3403         (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
3404         (GpgmeEditCb): Rename to gpgme_edit_cb_t.
3405         (GpgmeIOCb): Rename to gpgme_io_cb_t.
3406         (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
3407         (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
3408         (GpgmeEventIO): Rename to gpgme_event_io_t.
3409         (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
3410         (GpgmeIOCbs): Rename to gpgme_io_cbs.
3411         (gpgme_io_cbs_t): New type.
3412         (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
3413         (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
3414         (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
3415         (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
3416         (GpgmeDataCbs): Rename to gpgme_data_cbs.
3417         (gpgme_data_cbs_t): New type.
3418         (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
3419         (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
3420         (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
3421         (GpgmeNewSignature): Rename to gpgme_new_signature_t.
3422         (GpgmeSignResult): Rename to gpgme_sign_result_t.
3423         (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
3424         (GpgmeSignature): Rename to gpgme_signature_t.
3425         (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
3426         (GpgmeImportStatus): Rename to gpgme_import_status_t.
3427         (GpgmeImportResult): Rename to gpgme_import_result_t.
3428         (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
3429         (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
3430         (GpgmeTrustItem): Rename to gpgme_trust_item_t.
3431         * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
3432         GPGME_No_Recipients, GPGME_Invalid_Recipient and
3433         GPGME_No_Passphrase.
3434         * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
3435         * context.h (struct gpgme_context_s): Rename to struct
3436         gpgme_context.
3437         (struct gpgme_recipients_s): Rename to gpgme_recipients.
3438
3439 2003-05-18  Marcus Brinkmann  <marcus@g10code.de>
3440
3441         * keylist.c (finish_key): Clear OPD->tmp_uid.
3442
3443 2003-05-18  Marcus Brinkmann  <marcus@g10code.de>
3444
3445         * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
3446         for NODATA status without signatures.
3447
3448 2003-05-05  Marcus Brinkmann  <marcus@g10code.de>
3449
3450         * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
3451         (_gpgme_key_add_sig): Likewise.
3452
3453 2003-05-04  Marcus Brinkmann  <marcus@g10code.de>
3454
3455         * context.h (struct gpgme_context_s): Remove member op_info.
3456
3457         * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
3458
3459         * gpgme.h (GpgmeError): Add deprecated values for
3460         GPGME_Invalid_Type and GPGME_Invalid_Mode.
3461
3462 2003-04-30  Marcus Brinkmann  <marcus@g10code.de>
3463
3464         * gpgme.h (gpgme_get_op_info): Remove prototype.
3465         * ops.h (_gpgme_set_op_info,
3466         _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
3467         _gpgme_data_append, _gpgme_data_append_string,
3468         _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
3469         _gpgme_data_append_percentstring_for_xml): Likewise.
3470         (_gpgme_progress_status_handler): Change first arg to void *.
3471         * progress.c (_gpgme_progress_status_handler): Likewise.
3472         * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
3473         and <sys/types.h>, but <string.h>.
3474         (_gpgme_data_append): Remove function.
3475         (_gpgme_data_append_string): Likewise.
3476         (_gpgme_data_append_for_xml): Likewise.
3477         (_gpgme_data_append_string_for_xml): Likewise.
3478         (_gpgme_data_append_percentstring_for_xml): Likewise.
3479         * data-mem.c (_gpgme_data_get_as_string): Likewise.
3480         (_gpgme_data_release_and_return_string): Likewise.
3481         * gpgme.c (gpgme_get_op_info): Likewise.
3482         (_gpgme_set_op_info): Likewise.
3483
3484         * gpgme.h (struct _gpgme_key): New structure.
3485         (GpgmeKey): Define using _gpgme_key.
3486         (struct _gpgme_subkey): New structure.
3487         (GpgmeSubKey): New type.
3488         (struct _gpgme_key_sig): New structure.
3489         (GpgmeKeySig): New type.
3490         (struct _gpgme_user_id): New structure.
3491         (GpgmeUserID): New type.
3492         (struct _gpgme_op_keylist_result): New structure.
3493         (GpgmeKeyListResult): New type.
3494         (gpgme_op_keylist_result): New function.
3495         (gpgme_key_get_as_xml): Remove prototype.
3496         * context.h (struct gpgme_context_s): Remove members tmp_key,
3497         tmp_uid, key_cond and key_queue.
3498         (struct key_queue_item_s): Remove structure.
3499         (struct user_id_s): Remove structure.
3500         (struct gpgme_recipients_s): Replace with simple
3501         GpgmeUserID list.
3502         * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
3503         * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
3504         _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
3505         * rungpg.c (command_cb): Return GpgmeError instead int.
3506         New variable ERR.  Use it to hold return value of cmd handler.
3507         (gpg_delete): Access fingerprint of key directly.
3508         (append_args_from_signers): Likewise.
3509         (gpg_edit): Likewise.
3510         (append_args_from_recipients): Use GpgmeUserID for recipient list.
3511         * engine-gpgsm.c: Do not include "key.h".
3512         (gpgsm_delete): Access fingerprint of key directly.
3513         (gpgsm_sign): Likewise.
3514         (set_recipients): Use GpgmeUserID for recipients.  Invert invalid
3515         user ID flag.
3516         * key.h: File removed.
3517         * key.c: Completely reworked to use exposed GpgmeKey data types.
3518         * keylist.c: Likewise.
3519         * recipient.c: Completely reworked to use GpgmeUserID.
3520
3521 2003-04-29  Marcus Brinkmann  <marcus@g10code.de>
3522
3523         * gpgme.h (gpgme_get_key): Remove force_update argument.
3524         * key-cache.c: File removed.
3525         * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
3526         * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
3527         prototypes.
3528         * keylist.c (_gpgme_op_keylist_event_cb): Don't call
3529         _gpgme_key_cache_add.
3530         (gpgme_get_key): New function.
3531         * verify.c (gpgme_get_sig_key): Remove last argument to
3532         gpgme_get_key invocation.
3533
3534         * gpgme.h (struct _gpgme_trust_item): New structure.
3535         (GpgmeTrustItem): New type.
3536         (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
3537         * context.h (struct trust_queue_item_s): Remove structure.
3538         (struct gpgme_context_s): Remove trust_queue member.
3539         * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
3540         * trust-item.c: New file.
3541         * trustlist.c: Do not include <stdio.h> or <time.h>, but
3542         "gpgme.h".
3543         (struct trust_queue_item_s): Change to new type op_data_t.
3544         (trust_status_handler): Change first argument to void *.
3545         (trust_colon_handler): Likewise.
3546         (_gpgme_op_trustlist_event_cb): Use op_data_t type.
3547         (gpgme_op_trustlist_start): Use op_data_t and rework error
3548         handling.
3549         (gpgme_op_trustlist_next): Use op_data_t.
3550         (gpgme_trust_item_release): Remove function.
3551         (gpgme_trust_item_get_string_attr): Likewise.
3552         (gpgme_trust_item_get_int_attr): Likewise.
3553
3554         * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
3555         for bad signatures.
3556
3557 2003-04-28  Marcus Brinkmann  <marcus@g10code.de>
3558
3559         * context.h: Remove OPDATA_VERIFY_COLLECTING.
3560         (struct gpgme_context_s): Remove member notation.
3561         * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
3562
3563         * gpgme.h (struct _gpgme_sig_notation): New structure.
3564         (GpgmeSigNotation): New type.
3565         (struct _gpgme_signature): New structure.
3566         (GpgmeSignature): New type.
3567         (struct _gpgme_op_verify_result): New structure.
3568         (GpgmeVerifyResult): New type.
3569         (gpgme_op_verify_result): New prototype.
3570         (gpgme_get_notation): Remove prototype.
3571         * ops.h (_gpgme_op_verify_init_result): New prototype.
3572         (_gpgme_verify_status_handler): Change first argument to void *.
3573         * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
3574         New prototypes.
3575         * conversion.c (_gpgme_decode_percent_string): New function.
3576         (gnupg_errors): New static global.
3577         (_gpgme_map_gnupg_error): New function.
3578         * gpgme.c (gpgme_release): Don't release CTX->notation.
3579         (gpgme_get_notation): Remove function.
3580         * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
3581         _gpgme_op_verify_init_result.
3582         * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
3583         do include "gpgme.h".
3584         (struct verify_result): Replace with ...
3585         (op_data_t): ... this type.
3586         (release_verify_result): Remove function.
3587         (release_op_data): New function.
3588         (is_token): Remove function.
3589         (skip_token): Remove function.
3590         (copy_token): Remove function.
3591         (gpgme_op_verify_result): New function.
3592         (calc_sig_summary): Rewritten.
3593         (finish_sig): Remove function.
3594         (parse_new_sig): New function.
3595         (parse_valid_sig): New function.
3596         (parse_notation): New function.
3597         (parse_trust): New function.
3598         (parse_error): New function.
3599         (_gpgme_verify_status_handler): Rewritten.  Change first argument
3600         to void *.
3601         (_gpgme_op_verify_start): Rework error handling.  Call
3602         _gpgme_op_verify_init_result.
3603         (gpgme_op_verify): Do not release or clear CTX->notation.
3604         (gpgme_get_sig_status): Rewritten.
3605         (gpgme_get_sig_string_attr): Likewise.
3606         (gpgme_get_sig_ulong_attr): Likewise.
3607         (gpgme_get_sig_key): Likewise.
3608
3609         * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
3610         (GpgmeDecryptResult): New type.
3611         (gpgme_op_decrypt_result): New prototype.
3612         * ops.h (_gpgme_op_decrypt_init_result): New prototype.
3613         (_gpgme_decrypt_status_handler): Fix prototype.
3614         (_gpgme_decrypt_start): Remove prototype.
3615         * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
3616         <string.h> and <assert.h>, "util.h" and "context.h", but
3617         "gpgme.h".
3618         (decrypt_verify_status_handler): Change first argument to void *,
3619         and rework error handling.
3620         (_gpgme_op_decrypt_verify_start): New function.
3621         (gpgme_op_decrypt_verify_start): Rewrite using
3622         _gpgme_op_decrypt_verify_start.
3623         (gpgme_op_decrypt_verify): Likewise.
3624         * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
3625         (struct decrypt_result): Change to typedef op_data_t, rewritten.
3626         (is_token): Remove function.
3627         (release_op_data): New function.
3628         (skip_token): Remove function.
3629         (gpgme_op_decrypt_result): New function.
3630         (_gpgme_decrypt_status_handler): Change first argument to void *.
3631         Rework error handling.
3632         (_gpgme_decrypt_start): Rename to ...
3633         (decrypt_start): ... this.  Call _gpgme_op_decrypt_init_result.
3634         (_gpgme_op_decrypt_init_result): New function.
3635         (gpgme_op_decrypt_start): Use decrypt_start.
3636         (gpgme_op_decrypt): Likewise.
3637
3638 2003-04-27  Marcus Brinkmann  <marcus@g10code.de>
3639
3640         * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
3641         <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
3642         (_gpgme_op_encrypt_sign_start): Rename to ...
3643         (encrypt_sign_start): ... this.
3644         (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
3645         _gpgme_op_encrypt_sign_start.
3646         (gpgme_op_encrypt_sign): Likewise.
3647
3648         * gpgme.h (GpgmeEncryptResult): New data type.
3649         (gpgme_op_encrypt_result): New prototype.
3650         * ops.h (_gpgme_op_encrypt_init_result): New prototype.
3651         (_gpgme_op_encrypt_status_handler): Fix prototype.
3652         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
3653         _gpgme_op_encrypt_init_result.
3654         * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
3655         "wait.h".  Include <errno.h> and "gpgme.h".
3656         (SKIP_TOKEN_OR_RETURN): Remove macro.
3657         (struct encrypt_result): Rename to ...
3658         (op_data_t): ... new data type.  Rewrite for user result data.
3659         (append_xml_encinfo): Remove function.
3660         (release_op_data): New function.
3661         (gpgme_op_encrypt_result): New function.
3662         (_gpgme_op_encrypt_status_handler): Change first argument to void *.
3663         Rewrite result parsing.
3664         (_gpgme_op_encrypt_sym_status_handler): Change first argument to
3665         void *.
3666         (_gpgme_op_encrypt_init_result): New function.
3667         (_gpgme_op_encrypt_start): Rename to ...
3668         (encrypt_start): ... this.
3669         (gpgme_op_encrypt_start): Use encrypt_start, not
3670         gpgme_op_encrypt_start.
3671         (gpgme_op_encrypt): Likewise.
3672
3673         * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
3674         GpgmeNewSignature, GpgmeSignResult): New data types.
3675         (gpgme_op_sign_result, gpgme_pubkey_algo_name,
3676         gpgme_hash_algo_name): New prototypes.
3677         * gpgme.c (gpgme_pubkey_algo_name): New function.
3678         (gpgme_hash_algo_name): Likewise.
3679         * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
3680         prototype.
3681         (_gpgme_op_sign_status_handler): Fix prototype.
3682         * op-support.c: Include <errno.h> and <string.h>.
3683         (_gpgme_parse_inv_userid): New function.
3684         * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
3685         <assert.h> and "util.h".
3686         (SKIP_TOKEN_OR_RETURN): Remove macro.
3687         (struct sign_result): Change to op_data_t type and rework it.
3688         (release_sign_result): Rename to ...
3689         (release_op_data): ... this and rewrite it.
3690         (append_xml_info): Remove function.
3691         (gpgme_op_sign_result): New function.
3692         (parse_sig_created): New function.
3693         (_gpgme_sign_status_handler): Change first argument to void *.
3694         Rewrite the function to use the new result structure and functions.
3695         (_gpgme_op_sign_init_result): New function.
3696         (_gpgme_op_sign_start): Rename to ...
3697         (sign_start): ... this.  Call _gpgme_op_sign_init_result.
3698         (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
3699         (gpgme_op_sign): Likewise.
3700         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
3701         _gpgme_op_sign_init_result.
3702
3703         * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
3704         "key.h".
3705         (enum delete_problem): Move into function delete_status_handler.
3706         (delete_status_handler): Change first argument to void *.  Parse
3707         delete problem with strtol instead atoi.  Return better error
3708         values.
3709         (_gpgme_op_delete_start): Rename to ...
3710         (delete_start): ... this.  Rework error handling.
3711         (gpgme_op_delete_start): Use delete_start instead
3712         _gpgme_op_delete_start.
3713         (gpgme_op_delete): Likewise.
3714         * gpgme.h (GpgmeDataType): Removed.
3715
3716 2003-04-25  Marcus Brinkmann  <marcus@g10code.de>
3717
3718         * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
3719         * import.c (parse_import_res): Parse unchanged field.
3720
3721         * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
3722         GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
3723         (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
3724         GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
3725         GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
3726         GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
3727         GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
3728         GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
3729         GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
3730         (struct _gpgme_import_status): New structure.
3731         (GpgmeImportStatus): New type.
3732         (struct _gpgme_op_import_result): New structure.
3733         (GpgmeImportResult): New type.
3734         (gpgme_op_import_result): New function.
3735         * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
3736         (struct import_result): Change to type op_data_t.
3737         (release_import_result): Rename to ...
3738         (release_op_data): ... this.
3739         (append_xml_impinfo): Function removed.
3740         (gpgme_op_import_result): New function.
3741         (parse_import): New function.
3742         (parse_import_res): Likewise.
3743         (import_status_handler): Change first argument to void *.  Rewrite
3744         to use new functions.
3745         (_gpgme_op_import_start): Rework error handling.
3746
3747         * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
3748         (edit_resut): Change to typedef for op_data_t.
3749         (edit_status_handler): Change first argument to void *.
3750         Rework error handling.
3751         (command_handler): Rework error handling.
3752         (_gpgme_op_edit_start): Rename to ...
3753         (edit_start): ... this.  Rework error handling.
3754         (gpgme_op_edit_start): Rewrite using edit_start.
3755         (gpgme_op_edit): Likewise.
3756
3757         * ops.h (_gpgme_passphrase_start): Remove prototype.
3758         * passphrase.c: Do not include <assert.h>, "util.h" or
3759         "debug.h", but "gpgme.h".
3760         (struct passphrase_result): Change to typedef for op_data_t.
3761         (release_passphrase_result): Rename to release_op_data.
3762         (_gpgme_passphrase_status_handler): Change first argument to void *.
3763         Use new op_data_t type.
3764         (_gpgme_passphrase_command_handler): Use new op_data_t type.
3765         (_gpgme_passphrase_start): Remove function.
3766         * decrypt.c (_gpgme_decrypt_start): Rewrite error handling.  Do
3767         not call _gpgme_passphrase_start, but install command handler.
3768         * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3769         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3770         * sign.c (_gpgme_op_sign_start): Likewise.
3771
3772         * context.h (struct gpgme_context_s): Remove member initialized,
3773         use_cms and help_data_1.  Add member protocol.  Make use_armor and
3774         use_textmode bit flags.  Make keylist_mode, include_certs,
3775         signers_len and signers_size unsigned.
3776         * gpgme.c (gpgme_new): Initialize CTX->protocol.
3777         (gpgme_set_protocol): Do not check CTX.  Use CTX->protocol.
3778         (gpgme_get_protocol): Likewise.
3779         (gpgme_release): Do not release CTX->help_data_1.
3780         * op-support.c (_gpgme_op_reset): Use CTX->protocol.
3781
3782         * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
3783
3784         * data.c: Do not include <assert.h>, but "gpgme.h".
3785         (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
3786         it will go.  Do not assert DH.
3787         (_gpgme_data_outbound_handler): Do not assert DH.
3788
3789         * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
3790         "gpgme.h".
3791         (export_status_handler): Change type of first argument to void *.
3792         (_gpgme_op_export_start): Rename to ...
3793         (export_start): ... this.  Rework error handling.
3794         (gpgme_op_export_start): Rewritten to use export_start instead
3795         _gpgme_op_export_start.
3796         (gpgme_op_export): Likewise.
3797
3798         * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
3799         (GPGME_No_Recipients, GPGME_Invalid_Recipient,
3800         GPGME_No_Passphrase): New macros.
3801
3802         * key.c (gpgme_key_get_string_attr): Fix validity attribute.
3803
3804 2003-04-24  Marcus Brinkmann  <marcus@g10code.de>
3805
3806         * gpgme.h (struct _gpgme_op_genkey_result): New structure.
3807         (GpgmeGenKeyResult): New type.
3808         (gpgme_op_genkey): Drop last argument.
3809         (gpgme_op_genkey_result): New function.
3810         * genkey.c: Do not include "util.h", but "gpgme.h".
3811         (struct genkey_result): Replace with ...
3812         (op_data_t): ... this new type.
3813         (release_genkey_result): Replace with ...
3814         (release_op_data): ... this new function.
3815         (gpgme_op_genkey_result): New function.
3816         (genkey_status_handler): Rewritten using new op_data_t type.
3817         (get_key_parameter): New function.
3818         (_gpgme_op_genkey_start): Renamed to
3819         (genkey_start): ... this and rewritten.
3820         (gpgme_op_genkey_start): Use genkey_start instead
3821         _gpgme_op_genkey_start.
3822         (gpgme_op_genkey): Rewritten.  Remove FPR argument.
3823
3824         * context.h (struct gpgme_context_s): Remove member verbosity.
3825         * gpgme.c (gpgme_new): Do not set member verbosity.
3826         * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
3827         * engine.c (_gpgme_engine_set_verbosity): Remove function.
3828         * engine-backend.h (struct engine_ops): Remove set_verbosity.
3829         * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
3830         * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
3831         (gpg_set_verbosity): Remove function.
3832         * decrypt.c (_gpgme_decrypt_start): Don't call
3833         _gpgme_engine_set_verbosity.
3834         * delete.c (_gpgme_op_delete_start): Likewise.
3835         * edit.c (_gpgme_op_edit_start): Likewise.
3836         * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3837         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3838         * export.c (_gpgme_op_export_start): Likewise.
3839         * genkey.c (_gpgme_op_genkey_start): Likewise.
3840         * import.c (_gpgme_op_import_start): Likewise.
3841         * keylist.c (gpgme_op_keylist_start): Likewise.
3842         (gpgme_op_keylist_ext_start): Likewise.
3843         * sign.c (_gpgme_op_sign_start): Likewise.
3844         * verify.c (_gpgme_op_verify_start): Likewise.
3845
3846         * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
3847         * key.c (key_cache_initialized, key_cache_size,
3848         key_cache_max_chain_length, ): Removed.
3849         (struct key_cache_item_s, key_cache_lock, key_cache,
3850         key_cache_unused_items, hash_key, _gpgme_key_cache_add,
3851         _gpgme_key_cache_get, gpgme_get_key): Moved to ...
3852         * key-cache.c: ... here.  New file.
3853         * key.h (_gpgme_key_cache_init): Remove prototypes.
3854         (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
3855         * ops.h: ... here.
3856         * version.c: Do not include "key.h".
3857         (do_subsystem_inits): Do not call _gpgme_key_cache_init.
3858
3859         * mkstatus: Strip trailing comma.
3860         * gpgme.h (GpgmeStatus): Pretty print.
3861
3862         * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
3863         GPGME_Bad_Passphrase.
3864         * passphrase.c (_gpgme_passphrase_status_handler): Use
3865         GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
3866
3867         * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
3868         GPGME_No_UserID and GPGME_Invalid_Recipient to
3869         GPGME_Invalid_UserID.
3870         * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
3871         instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
3872         GPGME_Invalid_Recipient.
3873         (_gpgme_op_encrypt_start): Likewise.
3874
3875         * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
3876         * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
3877         * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
3878         * wait-global.c (gpgme_wait): Likewise.
3879         * verify.c (_gpgme_op_verify_start): Likewise.
3880         (gpgme_get_sig_status): Don't check pending flag.
3881         (gpgme_get_sig_string_attr): Likewise.
3882         (gpgme_get_sig_ulong_attr): Likewise.
3883         (gpgme_get_sig_key): Likewise.
3884         * op-support.c (_gpgme_op_reset): Likewise.
3885         * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
3886         (gpgme_op_trustlist_next): Don't check or clear pending flag.
3887         (gpgme_op_trustlist_end): Likewise.
3888         * sign.c (_gpgme_op_sign_start): Likewise.
3889         * context.h (struct gpgme_context_s): Remove member PENDING.
3890         * decrypt.c (_gpgme_decrypt_start): Likewise.
3891         * delete.c (_gpgme_op_delete_start): Likewise.
3892         * edit.c (_gpgme_op_edit_start): Likewise.
3893         * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3894         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3895         * export.c (_gpgme_op_export_start): Likewise.
3896         * genkey.c (_gpgme_op_genkey_start): Likewise.
3897         * import.c (_gpgme_op_import_start): Likewise.
3898         * key.c (gpgme_get_key): Likewise.
3899         * keylist.c (gpgme_op_keylist_start): Likewise.
3900         (gpgme_op_keylist_ext_start): Likewise.
3901         (gpgme_op_keylist_next): Likewise.
3902         (gpgme_op_keylist_end): Likewise.
3903         * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
3904
3905 2003-02-06  Marcus Brinkmann  <marcus@g10code.de>
3906
3907         * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
3908         and add argument for returning the result string.
3909         (gpgme_cancel): Remove prototype.
3910         * gpgme.c (gpgme_cancel): Remove function.
3911         * context.h (struct gpgme_context_s): Remove member cancel.
3912         * passphrase.c (_gpgme_passphrase_command_handler): Call the
3913         passphrase callback in the new way.
3914
3915 2003-01-30  Marcus Brinkmann  <marcus@g10code.de>
3916
3917         * edit.c (_gpgme_edit_status_handler): Call the progress status
3918         handler.
3919
3920 2003-02-05  Marcus Brinkmann  <marcus@g10code.de>
3921
3922         * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
3923         I/O handlers left to ...
3924         (_gpgme_user_io_cb_handler): ... here.
3925
3926 2003-02-04  Marcus Brinkmann  <marcus@g10code.de>
3927
3928         * trustlist.c (trustlist_colon_handler): Release ITEM if name
3929         could not be allocated.
3930         (gpgme_trust_item_release): Only release name if it is allocated.
3931         Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
3932
3933 2003-02-04  Marcus Brinkmann  <marcus@g10code.de>
3934
3935         * rungpg.c (read_status): If he status handler returns an error,
3936         return it.
3937         (status_handler): If read_status fails, just return the error.
3938
3939 2003-02-01  Marcus Brinkmann  <marcus@g10code.de>
3940
3941         * engine-gpgsm.c (start): Handle all errors, not only most of
3942         them.
3943         (xtoi_1, xtoi_2): Remove macro.
3944         (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
3945
3946 2003-02-01  Marcus Brinkmann  <marcus@g10code.de>
3947
3948         * engine-gpgsm.c (map_assuan_error): Replace
3949         ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
3950         (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
3951
3952         * util.h (DIMof): Remove macro.
3953
3954         * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
3955         _gpgme_data_unread): Prototypes removed.
3956
3957 2003-01-30  Marcus Brinkmann  <marcus@g10code.de>
3958
3959         * types.h: File removed.
3960         * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
3961         * io.h (struct spawn_fd_item_s): Do not include "types.h".
3962         * key.h: Likewise.
3963         * context.h: Likewise.
3964         * cengine-gpgsm.h: Likewise.
3965         * engine.h: Include "gpgme.h" instead "types.h".  Add prototypes
3966         for EngineStatusHandler, EngineColonLineHandler and
3967         EngineCommandHandler.
3968         (_gpgme_engine_set_status_handler): Change parameter type from
3969         GpgmeStatusHandler to EngineStatusHandler.
3970         (_gpgme_engine_set_command_handler): Change parameter type from
3971         GpgmeCommandHandler to EngineCommandHandler.
3972         (_gpgme_engine_set_colon_line_handler): Change parameter type from
3973         GpgmeColonLineHandler to EngineColonLineHandler.
3974         * engine-backend.h: Include "engine.h" instead "types.h".
3975         (struct engine_ops): Change Gpgme*Handler parameters in members
3976         set_command_handler, set_colon_line_handler and set_status_handler
3977         to Engine*Handler.
3978         * engine.c (_gpgme_engine_set_status_handler): Change parameter
3979         type from GpgmeStatusHandler to EngineStatusHandler.
3980         (_gpgme_engine_set_command_handler): Change parameter type from
3981         GpgmeCommandHandler to EngineCommandHandler.
3982         (_gpgme_engine_set_colon_line_handler): Change parameter type from
3983         GpgmeColonLineHandler to EngineColonLineHandler.
3984         * rungpg.c (struct gpg_object_s): Change type of member status.fnc
3985         from GpgmeStatusHandler to EngineStatusHandler.  Change type of
3986         member colon.fnc from GpgmeColonLineHandler to
3987         EngineColonLineHandler.  Change type of member cmd.fnc from
3988         GpgmeCommandHandler to EngineCommandHandler.
3989         * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
3990         * rungpg.c (gpg_set_status_handler): Change parameter type from
3991         GpgmeStatusHandler to EngineStatusHandler.
3992         * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
3993         (assuan_simple_command): Likewise.
3994         * rungpg.c (gpg_set_colon_line_handler): Change parameter type
3995         from GpgmeColonLineHandler to EngineColonLineHandler.
3996         * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
3997         * rungpg.c (gpg_set_command_handler): Change parameter type from
3998         GpgmeCommandHandler to EngineCommandHandler.
3999
4000         * engine-gpgsm.c (status_handler): Do not close status fd at end
4001         of function.
4002
4003         * ops.h (_gpgme_op_data_lookup): Add prototype.
4004         * op-support.c: Include <stdlib.h>.
4005         (_gpgme_op_data_lookup): New function.
4006         * decrypt.c (_gpgme_release_decrypt_result): Function removed.
4007         (struct decrypt_result_s): Rename to ...
4008         (struct decrypt_resul): ... this.
4009         (DecryptResult): New type.
4010         (_gpgme_decrypt_status_handler): Don't use
4011         test_and_allocate_result, but use _gpgme_op_data_lookup to
4012         retrieve result data object.
4013         * sign.c (_gpgme_release_sign_result): Function removed.
4014         (release_sign_result): New function.
4015         (struct sign_result_s): Rename to ...
4016         (struct sign_result): ... this.
4017         (SignResult): New type.
4018         (_gpgme_sign_status_handler): Don't use
4019         test_and_allocate_result, but use _gpgme_op_data_lookup to
4020         retrieve result data object.
4021         * encrypt.c (struct encrypt_result_s): Rename to ...
4022         (struct encrypt_result): ... this.
4023         (_gpgme_release_encrypt_result): Function removed.
4024         (release_encrypt_result): New function.
4025         (_gpgme_encrypt_status_handler): Don't use
4026         test_and_allocate_result, but use _gpgme_op_data_lookup to
4027         retrieve result data object.
4028         * verify.c (struct verify_result_s): Rename to ...
4029         (struct verify_result): ... this.  Remove member next.
4030         (VerifyResult): New type.
4031         (_gpgme_release_verify_result): Function removed.
4032         (release_verify_result): New function.
4033         (finish_sig): Change first argument to type VerifyResult.  Diddle
4034         the type of the op_data structure.
4035         (add_notation): Change first argument to type VerifyResult.
4036         (_gpgme_verify_status_handler): Don't use
4037         test_and_allocate_result, but use _gpgme_op_data_lookup to
4038         retrieve result data object.
4039         * passphrase.c (struct passphrase_result_s): Rename to ...
4040         (struct passphrase_result): ... this.  Remove member next.
4041         (PassphraseResult): New type.
4042         (_gpgme_release_passphrase_result): Function removed.
4043         (release_passphrase_result): New function.
4044         (_gpgme_passphrase_status_handler): Don't use
4045         test_and_allocate_result, but use _gpgme_op_data_lookup to
4046         retrieve result data object.
4047         (_gpgme_passphrase_command_handler): Likewise.
4048         * keylist.c (struct keylist_result_s): Rename to ...
4049         (struct keylist_result): ... this.  Remove member next.
4050         (KeylistResult): New type.
4051         (_gpgme_release_keylist_result): Function removed.
4052         (release_keylist_result): New function.
4053         (keylist_status_handler): Don't use
4054         test_and_allocate_result, but use _gpgme_op_data_lookup to
4055         retrieve result data object.
4056         * edit.c (struct edit_result_s): Rename to ...
4057         (struct edit_result): ... this.  Remove member next.
4058         (EditResult): New type.
4059         (_gpgme_release_edit_result): Function removed.
4060         (release_edit_result): New function.
4061         (edit_status_handler): Don't use
4062         test_and_allocate_result, but use _gpgme_op_data_lookup to
4063         retrieve result data object.
4064         (command_handler): Likewise.
4065         * types.h (DecryptResult, SignResult, EncryptResult,
4066         PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
4067         KeylistResult, EditResult): Types removed.
4068         * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
4069         (test_and_allocate_result): Remove macro.
4070         (_gpgme_release_decrypt_result): Remove prototype.
4071         (_gpgme_decrypt_result): Remove prototype.
4072         (_gpgme_release_sign_result): Remove prototype.
4073         (_gpgme_release_encrypt_result): Remove prototype.
4074         (_gpgme_release_passphrase_result): Remove prototype.
4075         (_gpgme_release_import_result): Remove prototype.
4076         (_gpgme_release_delete_result): Remove prototype.
4077         (_gpgme_release_genkey_result): Remove prototype.
4078         (_gpgme_release_keylist_result): Remove prototype.
4079         (_gpgme_release_edit_result): Remove prototype.
4080         (_gpgme_release_verify_result): Remove prototype.
4081         * gpgme.c (_gpgme_release_result): Rewritten.
4082         * context.h (enum ctx_op_data_type): New enum.
4083         (struct ctx_op_data): New structure.
4084         (struct gpgme_context_s): Replace the member result with a member
4085         op_data.
4086         (fail_on_pending_request): Remove macro.
4087         * op-support.c (_gpgme_op_reset): Expand macro
4088         fail_on_pending_request.
4089         * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
4090
4091 2003-01-19  Marcus Brinkmann  <marcus@g10code.de>
4092
4093         * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
4094         (gpg_start): Rename to ...
4095         (start): ... this function.  Change arguments to GpgObject.
4096         (gpg_decrypt): Call start.
4097         (gpg_edit): Likewise.
4098         (gpg_encrypt): Likewise.
4099         (gpg_encrypt_sign): Likewise.
4100         (gpg_export): Likewise.
4101         (gpg_import): Likewise.
4102         (gpg_keylist): Likewise.
4103         (gpg_keylist_ext): Likewise.
4104         (gpg_trustlist): Likewise.
4105         (gpg_verify): Likewise.
4106
4107         * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
4108         (gpgsm_start): Rename to ...
4109         (struct gpgsm_object_s): Remove member command.
4110         (gpgsm_release): Don't free command.
4111         (start): ... this function.  Change arguments to GpgsmObject and
4112         const char *.
4113         (gpgsm_decrypt): Call start.
4114         (gpgsm_delete): Likewise.
4115         (gpgsm_encrypt): Likewise.
4116         (gpgsm_export): Likewise.
4117         (gpgsm_genkey): Likewise.
4118         (gpgsm_import): Likewise.
4119         (gpgsm_keylist): Likewise.
4120         (gpgsm_keylist_ext): Likewise.
4121         (gpgsm_verify): Likewise.
4122
4123         * decrypt.c (_gpgme_decrypt_start): Don't call
4124         _gpgme_engine_start.
4125         * delete.c (_gpgme_op_delete_start): Likewise.
4126         * edit.c (_gpgme_op_edit_start): Likewise.
4127         * encrypt.c (_gpgme_op_encrypt_start):
4128         * encrypt-sign.c (_gpgme_op_encrypt_sign_start):
4129         * export.c (_gpgme_op_export_start): Likewise.
4130         * genkey.c (_gpgme_op_genkey_start): Likewise.
4131         * import.c (_gpgme_op_import_start): Likewise.
4132         * keylist.c (gpgme_op_keylist_ext_start): Likewise.
4133         (gpgme_op_keylist_start): Likewise.
4134         * sign.c (_gpgme_op_sign_start): Likewise.
4135         * trustlist.c (gpgme_op_trustlist_start): Likewise.
4136         * verify.c (_gpgme_op_verify_start): Likewise.
4137
4138         * engine-backend.h (struct engine_ops): Remove member start.
4139
4140         * engine.h (_gpgme_engine_start): Remove prototype.
4141         * engine.c (_gpgme_engine_start): Remove function.
4142
4143 2003-01-19  Miguel Coca  <mcoca@gnu.org>
4144
4145         * w32-io.c (_gpgme_io_select): Add missing argument in calls to
4146         DEBUG_BEGIN.
4147         * w32-util.c: Include "sema.h".
4148         (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
4149         error.
4150
4151 2003-01-29  Marcus Brinkmann  <marcus@g10code.de>
4152
4153         * types.h: Remove byte and ulong types.
4154         * util.h (_gpgme_hextobyte): Change prototype to unsigned char
4155         instead byte.
4156         * conversion.c (_gpgme_hextobyte): Change argument to unsigned
4157         char instead byte.
4158         (_gpgme_decode_c_string): Likewise, and beautify.  Also support a
4159         few more escaped characters.  Be more strict about buffer size.
4160         (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
4161         BUF and DST to unsigned char instead byte.
4162         * progress.c (_gpgme_progress_status_handler): Use unsigned char
4163         instead byte.
4164         * debug.c (trim_spaces): Likewise.
4165
4166         * util.h (mk_error): Remove macro.
4167         * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
4168         edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
4169         export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
4170         passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
4171         signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
4172         wait-private (literally everywhere): Expand the mk_error macro.
4173
4174         * context.h (wait_on_request_or_fail): Remove macro.
4175
4176         * context.h (gpgme_context_s): Remove member ERROR.
4177         * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
4178         (GpgmeCommandHandler): Change return type to GpgmeError and add
4179         new argument RESULT.
4180         * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
4181         (GpgmeEventIO): New event GPGME_EVENT_START.
4182         (GpgmeIdleFunc): Remove type.
4183         (gpgme_register_idle): Remove prototype.
4184         * data.c: Include <assert.h>.
4185         (_gpgme_data_inbound_handler): Change return type to GpgmeError.
4186         Return any error instead ignoring it, don't close file descriptor
4187         on error.
4188         (_gpgme_data_outbound_handler): Likewise.
4189         * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
4190         (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
4191         Return error instead setting ctx->error.  Return success at end of
4192         function.
4193         (gpgme_op_decrypt): Don't work around the old kludge anymore.
4194         * decrypt-verify.c (decrypt_verify_status_handler): Change return
4195         type to GpgmeError.  Return possible errors.
4196         * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
4197         <assert.h>.
4198         (delete_status_handler): Change return type to GpgmeError.  Return
4199         error instead setting ctx->error.  Return success at end of
4200         function.
4201         * edit.c: Do not include <stdio.h> and <string.h>.
4202         (_gpgme_edit_status_handler): Change type to GpgmeError,
4203         make static and rename to ...
4204         (edit_status_handler): ... this.  Return error directly.
4205         (command_handler): Change return type to GpgmeError, add result
4206         argument.  Return error directly.
4207         * encrypt.c (status_handler_finish): Remove function.
4208         (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
4209         Return error directly.
4210         (_gpgme_encrypt_sym_status_handler): Likewise.
4211         * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
4212         * engine-gpgsm.c (close_notify_handler): Do not signal done event
4213         anymore.
4214         (status_handler): Change return type to GpgmeError.  Diddle things
4215         around a bit to return errors directly.
4216         (start): Send start event.
4217         * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
4218         (export_status_handler): Change return type to GpgmeError.  Don't
4219         check ctx->error.
4220         * genkey.c: Do not include <stdio.h> and <assert.h>.
4221         (genkey_status_handler): Change return type to GpgmeError.  Don't
4222         check ctx->error.  Return errors directly.
4223         * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
4224         (_gpgme_op_event_cb): Function removed.
4225         (_gpgme_op_event_cb_user): Likewise.
4226         * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
4227         (import_status_handler): Change return type to GpgmeError.  Don't
4228         check ctx->error.
4229         * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
4230         Change return type to GpgmeError, return error directly.
4231         * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
4232         wait-private.c and wait-user.c
4233         * ops.h (test_and_allocate_result): Return error instead setting
4234         ctx->error.
4235         (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
4236         _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
4237         _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
4238         _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
4239         Change return type to GpgmeError.
4240         (_gpgme_passphease_command_handler): Change return type to
4241         GpgmeError and add new argument RESULT.
4242         * op-support.c: Use new callback functions, and change private
4243         data to ctx everywhere.
4244         * passphrase.c (_gpgme_passphrase_status_handler): Change return
4245         type to GpgmeError, return error directly.
4246         (_gpgme_passphrase_command_handler): Change return type to
4247         GpgmeError, add result argument.  Return results accordingly.
4248         * progress.c (_gpgme_progress_status_handler): Change return type
4249         to GpgmeError, return errors directly.
4250         * rungpg.c (status_handler): Change return type to GpgmeError.
4251         Return error directly.
4252         (close_notify_handler): Don't send done event.
4253         (colon_line_handler): Change return type to GpgmeError, return
4254         errors directly.
4255         * rungpg.c (start): Send start event.
4256         * sign.c (_gpgme_sign_status_handler): Change return type to
4257         GpgmeError, return errors directly.
4258         * trustlist.c (trustlist_status_handler): Change return type to
4259         GpgmeError.  Return 0.
4260         (trustlist_colon_handler): Change return type GpgmeError.  Return
4261         errors directly.
4262         * verify.c (add_notation): Change return type to GpgmeError,
4263         return errors directly.
4264         (_gpgme_verify_status_handler): Likewise.
4265         * wait.h (struct fd_table): Remove lock member.
4266         (struct wait_item_s): Moved here from wait.c.
4267         (struct tag): New structure.
4268         (_gpgme_wait_event_cb): Remove prototype.
4269         (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
4270         _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
4271         _gpgme_wait_user_event_io_cb): New prototypes.
4272         * wait.c: Don't include <stdio.h>.
4273         (ftd_global, ctx_done_list, ctx_done_list_size,
4274         ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
4275         global variable.
4276         (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
4277         function.
4278         (gpgme_wait): Move to file wait-global.c.
4279         (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
4280         member in wait item and tag.
4281         (_gpgme_remove_io_cb): Take ctx from tag.  Don't use FDT lock.
4282         (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
4283         wait-private.c.
4284         (gpgme_fd_table_init): Don't initialize FDT->lock.
4285         (gpgme_fd_table_deinit): Don't destroy FDT->lock.
4286         (_gpgme_fd_table_put): Make static and rename to ...
4287         (fd_table_put): ... this function.  Don't use FDT->lock.
4288         (struct wait_item_s): Move to wait.h.
4289         * wait-global.c: New file.
4290         * wait-private.c: New file.
4291         * wait-user.c: New file.
4292
4293         * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
4294         instead otrust_to_string to calculate validity.
4295
4296 2003-01-30  Marcus Brinkmann  <marcus@g10code.de>
4297
4298         * types.h (EngineObject): Move typedef to ...
4299         * engine.h: ... here.
4300         * types.h (GpgObject): Move typedef to ...
4301         * rungpg.c: ... here.
4302         * types.h (GpgsmObject): Move typedef to ...
4303         * engine-gpgsm.c: ... here.
4304
4305         * util.h (return_if_fail, return_null_if_fail,
4306         return_val_if_fail): Remove macro.
4307         * gpgme.c (gpgme_cancel): Don't use return_if_fail.
4308         * key.c (gpgme_key_ref): Likewise.
4309         * signers.c (gpgme_signers_enum): Likewise.
4310         (gpgme_signers_clear): Likewise.
4311
4312         * engine-backend.h (struct engine_ops): Rename get_path to
4313         get_file_name.
4314         * gpgme.h (struct _gpgme_engine_info): Rename member path to
4315         file_name.
4316         * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
4317         util.h.  Other clean ups.
4318         (parse_version_number): Protect more seriously against
4319         overflow.
4320         (gpgme_get_engine_info): Move to ...
4321         * engine.c (gpgme_get_engine_info): ... here.
4322         (_gpgme_engine_get_info): Function removed.
4323         (_gpgme_engine_get_path): Make static and rename to ...
4324         (engine_get_file_name): .. this.
4325         (_gpgme_engine_get_version): Make static and rename to ...
4326         (engine_get_version): ... this.
4327         (_gpgme_engine_get_req_version): Make static and rename to ...
4328         (engine_get_req_version): ... this.
4329         * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
4330         _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
4331         prototypes.
4332
4333         * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
4334         * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
4335         (gpgme_get_protocol_name): New function.
4336
4337         * engine-backend.h (struct engine_ops): New member
4338         get_req_version, remove member check_version.
4339         * engine.h (_gpgme_Engine_get_version): New prototype.
4340         * rungpg.c (gpg_get_req_version): New function.
4341         (gpg_check_version): Function removed.
4342         (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
4343         gpg_check_version.
4344         * engine-gpgsm.c (gpgsm_get_req_version): New function.
4345         (gpgsm_check_version): Function removed.
4346         (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
4347         gpgsm_check_version.
4348         * engine.c: Include ops.h.
4349          (_gpgme_engine_get_req_version): New function.
4350         (gpgme_engine_check_version): Rewritten.
4351         * version.c (gpgme_get_engine_info): Rewritten.
4352         * gpgme.h (gpgme_engine_info): New structure.
4353         (GpgmeEngineInfo): New type.
4354
4355 2003-01-06  Werner Koch  <wk@gnupg.org>
4356
4357         * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
4358         since gpg 1.3 to denote disabled keys.
4359
4360 2003-01-06  Marcus Brinkmann  <marcus@g10code.de>
4361
4362         * data-mem.c: Include <string.h>.
4363         * engine.c: Likewise.
4364
4365 2003-01-06  Marcus Brinkmann  <marcus@g10code.de>
4366
4367         * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
4368
4369 2002-12-24  Marcus Brinkmann  <marcus@g10code.de>
4370
4371         * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
4372         argument.
4373         * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
4374         argument.
4375         * verify.c (gpgme_op_verify): Drop R_STAT argument.
4376         (_gpgme_intersect_stati): Function removed.
4377         * ops.h (_gpgme_intersect_stati): Remove prototype.
4378
4379 2002-12-24  Marcus Brinkmann  <marcus@g10code.de>
4380
4381         * libgpgme.vers: New file.
4382         * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
4383         (libgpgme_version_script_cmd): New variable.
4384         (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
4385         (libgpgme_la_DEPENDENCIES): New variable.
4386
4387 2002-12-23  Marcus Brinkmann  <marcus@g10code.de>
4388
4389         * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
4390         (otrust_to_string): New function.
4391         (gpgme_key_get_as_xml): Use it.
4392         (validity_to_string): New function.
4393         (gpgme_key_get_string_attr): Beautify using above functions.
4394         (gpgme_key_get_ulong_attr): Likewise.
4395
4396 2002-12-23  Marcus Brinkmann  <marcus@g10code.de>
4397
4398         * data-mem.c (mem_release): Fix gcc warning.
4399         * data-user.c (user_release): Likewise.
4400
4401 2002-12-06  Marcus Brinkmann  <marcus@g10code.de>
4402
4403         * data.h (gpgme_data_release_cb): Change return type to void.
4404         (gpgme_data_read_cb): Change return type to ssize_t.
4405         * data.c (gpgme_data_read): Likewise.
4406         * data-stream.c (stream_read): Likewise.
4407         * data-fd.c (fd_read): Likewise.
4408         * data-mem.c (mem_read): Likewise.
4409         (mem_release): Change return type to void.
4410         * data-user.c (user_read): Change return type to ssize_t.
4411         (user_release): Change return type to void.
4412         * data-compat.c (old_user_read): Change return type to ssize_t.
4413         * gpgme.h (GpgmeDataReadCb): Likewise.
4414         (gpgme_data_read): Likewise.
4415         (GpgmeDataSeekCb): Change return type to off_t.
4416
4417 2002-12-04  Marcus Brinkmann  <marcus@g10code.de>
4418
4419         * gpgme.h: Add prototype for gpgme_get_key.
4420         * key.c (gpgme_get_key): New function.
4421         * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
4422
4423         * gpgme.h: Add prototypes for new interfaces
4424         gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
4425         (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
4426         * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
4427         * key.h (struct certsig_s): New members ALGO, NAME_PART,
4428         EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
4429
4430         * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
4431         Use that to determine if allocation is desired or not.
4432         * util.h: Adjust prototype of _gpgme_decode_c_string.
4433         * keylist.c (keylist_colon_handler): Adjust caller of
4434         _gpgme_decode_c_string.
4435
4436         * key.h (struct gpgme_key_s): New member last_uid.
4437         * key.c (_gpgme_key_append_name): Rewritten using
4438         _gpgme_decode_c_string and the last_uid pointer.
4439         (my_isdigit): Macro removed.
4440         (ALLOC_CHUNK): Likewise.
4441         * keylist.c (set_userid_flags): Use last_uid member of KEY.
4442
4443         * context.h (struct user_id_s): New member last_certsig.
4444         * key.h: Add prototype for _gpgme_key_add_certsig.
4445         * key.c (_gpgme_key_add_certsig): New function.
4446         (set_user_id_part): Move function before _gpgme_key_add_certsig.
4447         (parse_user_id): Change first argument to SRC, add new arguments
4448         NAME, EMAIL and COMMENT.  Change code to use these arguments
4449         instead going through UID.  Move function before
4450         _gpgme_add_certsig.
4451         (parse_x509_user_id): Likewise.
4452         (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
4453         and parse_user_id invocation.
4454         (one_certsig_as_xml): New function.
4455         (one_uid_as_xml): Print signatures.
4456         * context.h (struct gpgme_context_s): New member TMP_UID.
4457         * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
4458         record entries.
4459
4460         * key.c (get_certsig): New function.
4461         (gpgme_key_sig_get_string_attr): Likewise.
4462         (gpgme_key_sig_get_ulong_attr): Likewise.
4463
4464         * keylist.c: Include <ctype.h>.
4465         (my_isdigit): Macro removed.
4466         (set_mainkey_trust_info): Use isdigit, not my_isdigit.
4467         (set_userid_flags): Likewise.
4468         (set_subkey_trust_info): Likewise.
4469         (set_ownertrust): Likewise.
4470         (finish_key): Move function up a bit and remove prototype.
4471
4472         * rungpg.c (gpg_keylist_ext): Correct precedence of signature
4473         listing mode.
4474         (gpg_keylist_ext): Implement signature listing mode.
4475
4476 2002-11-25  Marcus Brinkmann  <marcus@g10code.de>
4477
4478         * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
4479         * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
4480         for parent fds.
4481         * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
4482         CloseHandle for parent fds.
4483
4484 2002-11-22  Marcus Brinkmann  <marcus@g10code.de>
4485
4486         * gpgme.h [_MSC_VER]: Define ssize_t as long.
4487
4488 2002-11-22  Werner Koch  <wk@gnupg.org>
4489
4490         * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
4491         setlocale before doing another setlocale.
4492
4493 2002-11-21  Marcus Brinkmann  <marcus@g10code.de>
4494
4495         * decrypt.c: Some beautyfication.
4496
4497         * verify.c (_gpgme_verify_status_handler): Treat
4498         GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
4499         Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
4500
4501 2002-11-19  Marcus Brinkmann  <marcus@g10code.de>
4502
4503         * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
4504         (struct genkey_result_s): Add new member FPR.
4505         (_gpgme_release_genkey_result): Free RESULT->fpr if set.
4506         (genkey_status_handler): Extract the fingerprint from the status
4507         line.
4508         (gpgme_op_genkey): Add new argument FPR and return the fingerprint
4509         in it.
4510         * gpgme.h: Adjust prototype of gpgme_op_genkey.
4511
4512 2002-11-19  Marcus Brinkmann  <marcus@g10code.de>
4513
4514         * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
4515         twice, to get fingerprints on subkeys.  Suggested by Timo Schulz
4516         <twoaday@freakmail.de>.
4517         (gpg_keylist_ext): Likewise.
4518
4519 2002-11-05  Marcus Brinkmann  <marcus@g10code.de>
4520
4521         * import.c (append_xml_impinfo): Use
4522         _gpgme_data_append_string_for_xml rather than
4523         _gpgme_data_append_string for the field content.
4524         Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
4525
4526 2002-10-10  Marcus Brinkmann  <marcus@g10code.de>
4527
4528         * rungpg.h, engine-gpgsm.h: File removed.
4529         * engine-backend.h: New file.
4530         * Makefile.am (gpgsm_components): New variable, set depending on
4531         automake conditional HAVE_GPGSM.
4532         (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
4533         engine-gpgsm.h.  Replace engine-gpgsm.c with ${gpgsm_components}.
4534         (status-table.h): Depend on gpgme.h, not rungpg.h.
4535         * conversion.c: Include <stdlib.h>.
4536         * engine-gpgsm.c: Do not set ENABLE_GPGSM here.  Include
4537         "engine-backend.h" instead "engine-gpgsm.h".  Reorder some
4538         functions and remove all function prototypes.
4539         (_gpgme_gpgsm_get_version): Make static and rename to ...
4540         (gpgsm_get_version): ... this.
4541         (_gpgme_gpgsm_check_version): Make static and rename to ...
4542         (gpgsm_check_version): ... this.
4543         (_gpgme_gpgsm_new): Make static.  Change argument type from
4544         GpgsmObject * to void **.  Call gpgsm_release instead
4545         _gpgme_gpgsm_release.
4546         (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
4547         (gpgsm_check_decrypt): ... this.
4548         (_gpgme_gpgsm_op_delete): Make static and rename to ...
4549         (gpgsm_check_delete): ... this.
4550         (_gpgme_gpgsm_set_recipients): Make static and rename to ...
4551         (gpgsm_check_set_recipients): ... this.
4552         (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
4553         (gpgsm_encrypt): ... this.
4554         (_gpgme_gpgsm_op_export): Make static and rename to ...
4555         (gpgsm_export): ... this.
4556         (_gpgme_gpgsm_op_genkey): Make static and rename to ...
4557         (gpgsm_genkey): ... this.
4558         (_gpgme_gpgsm_op_import): Make static and rename to ...
4559         (gpgsm_import): ... this.
4560         (_gpgme_gpgsm_op_keylist): Make static and rename to ...
4561         (gpgsm_keylist): ... this.
4562         (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
4563         (gpgsm_keylist_ext): ... this.
4564         (_gpgme_gpgsm_op_sign): Make static and rename to ...
4565         (gpgsm_sign): ... this.
4566         (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
4567         (gpgsm_trustlist): ... this.
4568         (_gpgme_gpgsm_op_verify): Make static and rename to ...
4569         (gpgsm_verify): ... this.
4570         (gpgsm_status_handler): Rename to ...
4571         (status_handler): ... this.
4572         (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
4573         (gpgsm_set_status_handler): ... this.
4574         (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
4575         (gpgsm_set_colon_line_handler): ... this.
4576         (_gpgme_gpgsm_add_io_cb): Rename to ...
4577         (add_io_cb): ... this.
4578         (_gpgme_gpgsm_start): Make static and rename to ...
4579         (gpgsm_start): ... this.
4580         (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
4581         (gpgsm_set_io_cb): ... this.
4582         (_gpgme_gpgsm_io_event): Make static and rename to ...
4583         (gpgsm_io_event): ... this.
4584         (struct _gpgme_engine_ops_gpgsm): New variable.
4585         [!ENABLE_GPGSM]: Removed.
4586         * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
4587         <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h".  Include
4588         <stdlib.h> and "engine-backend.h".
4589         (struct engine_object_s): Rewritten.
4590         (engine_ops): New variable.
4591         * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
4592         _gpgme_engine_check_version, _gpgme_engine_new,
4593         _gpgme_engine_release, _gpgme_engine_set_verbosity,
4594         _gpgme_engine_set_status_handler,
4595         _gpgme_engine_set_command_handler,
4596         _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
4597         _gpgme_engine_op_delete, _gpgme_engine_op_edit,
4598         _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
4599         _gpgme_engine_op_export, _gpgme_engine_op_genkey,
4600         _gpgme_engine_op_import, _gpgme_engine_op_keylist,
4601         _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
4602         _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
4603         _gpgme_engine_start, _gpgme_engine_set_io_cbs,
4604         _gpgme_engine_io_event): Reimplement.
4605         * engine.h: Fix a few comments and a variable name in a prototype.
4606         * ops.h: Do not include "rungpg.h".
4607         * passphrase.c: Include config.h only if [HAVE_CONFIG_H].  Do not
4608         include "rungpg.h".
4609         * recipient.c: Likewise.
4610         * signers.c: Likewise.
4611         * version.c: Likewise.
4612         * rungpg.c: Likewise.  Include "engine-backend.h".  Reorder
4613         functions and remove prototypes.
4614         (_gpgme_gpg_get_version): Make static and rename to ...
4615         (gpg_get_version): ... this.
4616         (_gpgme_gpg_check_version): Make static and rename to ...
4617         (gpg_check_version): ... this.
4618         (_gpgme_gpg_new): Make static.  Change argument type from
4619         GpgObject * to void **.  Call gpg_release instead
4620         _gpgme_gpg_release.
4621         (_gpgme_gpg_op_decrypt): Make static and rename to ...
4622         (gpg_check_decrypt): ... this.
4623         (_gpgme_gpg_op_delete): Make static and rename to ...
4624         (gpg_check_delete): ... this.
4625         (_gpgme_gpg_set_recipients): Make static and rename to ...
4626         (gpg_check_set_recipients): ... this.
4627         (_gpgme_gpg_op_encrypt): Make static and rename to ...
4628         (gpg_encrypt): ... this.
4629         (_gpgme_gpg_op_export): Make static and rename to ...
4630         (gpg_export): ... this.
4631         (_gpgme_gpg_op_genkey): Make static and rename to ...
4632         (gpg_genkey): ... this.
4633         (_gpgme_gpg_op_import): Make static and rename to ...
4634         (gpg_import): ... this.
4635         (_gpgme_gpg_op_keylist): Make static and rename to ...
4636         (gpg_keylist): ... this.
4637         (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
4638         (gpg_keylist_ext): ... this.
4639         (_gpgme_gpg_op_sign): Make static and rename to ...
4640         (gpg_sign): ... this.
4641         (_gpgme_gpg_op_trustlist): Make static and rename to ...
4642         (gpg_trustlist): ... this.
4643         (_gpgme_gpg_op_verify): Make static and rename to ...
4644         (gpg_verify): ... this.
4645         (gpg_status_handler): Rename to ...
4646         (status_handler): ... this.
4647         (_gpgme_gpg_set_status_handler): Make static and rename to ...
4648         (gpg_set_status_handler): ... this.
4649         (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
4650         (gpg_set_colon_line_handler): ... this.
4651         (gpgme_gpg_add_io_cb): Rename to ...
4652         (add_io_cb): ... this.
4653         (_gpgme_gpg_start): Make static and rename to ...
4654         (gpg_start): ... this.
4655         (_gpgme_gpg_set_io_cb): Make static and rename to ...
4656         (gpg_set_io_cb): ... this.
4657         (_gpgme_gpg_io_event): Make static and rename to ...
4658         (gpg_io_event): ... this.
4659         (struct _gpgme_engine_ops_gpg): New variable.
4660
4661 2002-10-10  Marcus Brinkmann  <marcus@g10code.de>
4662
4663         * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
4664         missing argument.
4665
4666 2002-10-09  Marcus Brinkmann  <marcus@g10code.de>
4667
4668         * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
4669         data-compat.c: New file.  Really check them in this time, completes
4670         2002-10-08 change.
4671
4672         * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
4673         and move to ...
4674         * types.h (GpgmeStatusHandler): ... here.
4675         * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
4676         and move to ...
4677         * types.h (GpgmeColonLineHandler): ... here.
4678         * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
4679         and move to ...
4680         * types.h (GpgmeCommandHandler): ... here.
4681         * engine.h: Don't include "rungpg.h".
4682         (_gpgme_engine_set_status_handler): Change type of
4683         argument from GpgStatusHandler to GpgmeStatusHandler.
4684         (_gpgme_engine_set_colon_line_handler): Change type of
4685         argument from GpgColonLineHandler to GpgmeColonLineHandler.
4686         (_gpgme_engine_set_command_handler): Change type of
4687         argument from GpgCommandHandler to GpgmeCommandHandler.
4688         * engine-gpgsm.h: Don't include "rungpg.h".
4689         (_gpgme_gpgsm_set_status_handler): Change type of
4690         argument from GpgStatusHandler to GpgmeStatusHandler.
4691         (_gpgme_gpgsm_set_colon_line_handler): Change type of
4692         argument from GpgColonLineHandler to GpgmeColonLineHandler.
4693         * engine-gpgsm.c: Do not include "rungpg.h".
4694         (struct gpgsm_object_s): Change type of
4695         status.fnc to GpgmeStatusHandler.  Change type of colon.fnc to
4696         GpgmeColonLineHandler.
4697         (gpgsm_assuan_simple_command): Change type of argument from
4698         GpgStatusHandler to GpgmeStatusHandler.
4699         (_gpgme_gpgsm_set_status_handler): Likewise.
4700         (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
4701         GpgColonLineHandler to GpgmeColonLineHandler.
4702         * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
4703         argument from GpgStatusHandler to GpgmeStatusHandler.
4704         (_gpgme_gpg_set_colon_line_handler): Change type of
4705         argument from GpgColonLineHandler to GpgmeColonLineHandler.
4706         (_gpgme_gpg_set_command_handler): Change type of
4707         argument from GpgCommandHandler to GpgmeCommandHandler.
4708         * rungpg.c (struct gpg_object_s): Change type of status.fnc to
4709         GpgmeStatusHandler.  Change type of colon.fnc to
4710         GpgmeColonLineHandler.  Change type of cmd.fnc to
4711         GpgmeCommandLineHandler.
4712         (_gpgme_gpg_set_status_handler): Change type of argument FNC to
4713         GpgmeStatusHandler.
4714         (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
4715         to GpgmeColonLineHandler.
4716         (_gpgme_gpg_set_command_handler): Change type of argument FNC to
4717         GpgmeCommandHandler.
4718         * engine.c (_gpgme_engine_set_status_handler): Change type of
4719         argument FNC to GpgmeStatusHandler.
4720         (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
4721         to GpgmeColonLineHandler.
4722         (_gpgme_engine_set_command_handler): Change type of argument FNC to
4723         GpgmeCommandHandler.
4724
4725         * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
4726         * rungpg.c (struct gpg_object_s): Remove PM.
4727         (pipemode_cb): Prototype removed.
4728         (add_pm_data): Function removed.
4729         (_gpgme_gpg_enable_pipemode): Likewise.
4730         (pipemode_copy): Likewise.
4731         (pipemode_cb): Likewise.
4732         (add_arg): Don't check for pipemode.
4733         (add_data): Likewise.
4734         (_gpgme_gpg_set_status_handler): Likewise.
4735         (_gpgme_gpg_set_colon_line_handler): Likewise.
4736         (_gpgme_gpg_set_command_handler): Likewise.
4737         (_gpgme_gpg_spawn): Likewise.
4738         (_gpgme_gpg_spawn): Don't set PM.active.
4739         (_gpgme_gpg_op_verify): Remove pipemode case.
4740         * verify.c (_gpgme_op_verify_start): Remove pipemode case.
4741
4742         * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4743         _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
4744         _gpgme_gpg_set_simple_line_handler): Prototype removed.
4745         (_gpgme_gpg_set_verbosity): New prototype.
4746         * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
4747         (add_data): ... this.
4748         (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
4749         (_gpgme_gpg_set_command_handler): Likewise.
4750         (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4751         _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4752         _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4753         _gpgme_gpg_op_verify): Likewise.
4754         (_gpgme_gpg_add_pm_data): Rename to ...
4755         (add_pm_data): ... this.
4756         (_gpgme_gpg_op_verify): Call add_pm_data, not
4757         _gpgme_gpg_add_pm_data.
4758         (_gpgme_gpg_add_arg): Make static and rename to ...
4759         (add_arg): ... this.
4760         (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
4761         _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
4762         _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
4763         _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
4764         _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4765         _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
4766         _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
4767         _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
4768         _gpgme_gpg_add_arg.
4769         (_gpgme_gpg_set_verbosity): New function.
4770         (struct gpg_object_s): Remove member simple from colon.
4771         (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
4772         (_gpgme_gpg_set_simple_line_handler): Removed function.
4773         (read_colon_line): Don't check the GPG->colon.simple.
4774         * engine.c (_gpgme_engine_set_verbosity): Call
4775         _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
4776
4777 2002-10-08  Marcus Brinkmann  <marcus@g10code.de>
4778
4779         * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
4780         _gpgme_strdup, _gpgme_free): Remove prototypes.
4781         (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
4782         macros.
4783         * util.c: File removed.
4784         * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
4785         * conversion.c (_gpgme_decode_c_string): Use malloc instead of
4786         xtrymalloc, realloc instead of xtryrealloc, calloc instead of
4787         xtrycalloc, free instead of xfree.
4788         (_gpgme_data_append_percentstring_for_xml): Likewise.
4789         * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
4790         * data-compat.c (gpgme_data_new_from_filepart): Likewise.
4791         * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
4792         _gpgme_data_get_as_string): Likewise.
4793         * debug.c (debug_init): Likewise.
4794         * decrypt.c (_gpgme_release_decrypt_result): Likewise.
4795         * delete.c (_gpgme_release_delete_result): Likewise.
4796         * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
4797         Likewise.
4798         * encrypt.c (_gpgme_release_encrypt_result): Likewise.
4799         * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
4800         _gpgme_engine_release): Likewise.
4801         * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
4802         _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
4803         gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
4804         _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
4805         _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
4806         _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
4807         _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
4808         * genkey.c (_gpgme_release_genkey_result): Likewise.
4809         * gpgme.c (gpgme_new, gpgme_release): Likewise.
4810         * import.c (_gpgme_release_import_result): Likewise.
4811         * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
4812         add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
4813         * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
4814         _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
4815         * ops.h (test_and_allocate_result): Likewise.
4816         * passphrase.c (_gpgme_release_passphrase_result,
4817         _gpgme_passphrase_status_handler,
4818         _gpgme_passphrase_command_handler): Likewise.
4819         * progress.c (_gpgme_progress_status_handler): Likewise.
4820         * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
4821         gpgme_recipients_add_name_with_validity): Likewise.
4822         * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
4823         _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4824         _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
4825         build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
4826         Likewise.
4827         * sign.c (_gpgme_release_sign_result): Likewise.
4828         * signers.c (_gpgme_signers_add): Likewise.
4829         * trustlist.c (trust_item_new, trustlist_colon_handler,
4830         _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
4831         gpgme_trustitem_release): Likewise.
4832         * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
4833         * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
4834         Likewise.
4835         * w32-io.c (create_reader, create_writer, destroy_reader,
4836         destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
4837         * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
4838         * w32-util.c (read_w32_registry_string): Likewise.
4839         * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
4840         _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
4841         * data-compat.c: Include <stdlib.h>.
4842
4843 2002-10-08  Marcus Brinkmann  <marcus@g10code.de>
4844
4845         New data object component:
4846
4847         * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
4848         GpgmeDataReleaseCb): New types.
4849         (struct GpgmeDataCbs): New structure.
4850         (gpgme_data_read): Changed prototype to match that of read() closely.
4851         (gpgme_data_write): Similar for write().
4852         (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
4853         gpgme_data_new_from_stream): New prototypes.
4854         (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
4855
4856         * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
4857         data-stream.c, data-mem.c, data-user.c and data-compat.c.
4858         * data.c: Reimplemented from scratch.
4859         * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
4860         data-user.c): New file.
4861         * context.h (struct gpgme_data_s): Removed.
4862         * conversion.c: Include <errno.h> and <sys/types.h>.
4863         (_gpgme_data_append): New function.
4864         * data.c (_gpgme_data_append_string): Move to ...
4865         * conversion.c (_gpgme_data_append_string): ... here.
4866         * data.c (_gpgme_data_append_for_xml): Move to ...
4867         * conversion.c (_gpgme_data_append_for_xml): ... here.
4868         * data.c (_gpgme_data_append_string_for_xml): Move to ...
4869         * conversion.c (_gpgme_data_append_string_for_xml): ... here.
4870         * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
4871         * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
4872
4873         * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
4874         removed.
4875         * types.h (GpgmeDataMode): Type removed.
4876
4877         * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
4878         * edit.c (_gpgme_op_edit_start): Likewise.
4879         * encrypt.c (_gpgme_op_encrypt_start): Likewise.
4880         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4881         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4882         * export.c (_gpgme_op_export_start): Likewise.
4883         * genkey.c (_gpgme_op_genkey_start): Likewise.
4884         * import.c (_gpgme_op_import_start): Likewise.
4885         * sign.c (_gpgme_op_sign_start): Likewise.
4886         * verify.c (_gpgme_op_verify_start): Likewise.
4887
4888         * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
4889         no recipient if no data was returned.
4890         * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4891         no recipient if no data was returned.
4892         * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4893         no recipient if no data was returned.
4894
4895         * engine.c (_gpgme_engine_op_verify): Add new argument to
4896         differentiate detached from normal signatures.
4897         * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
4898         * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.  Don't check
4899         mode of data argument.
4900         * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
4901         * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
4902         (gpgme_op_verify): Likewise for prototype.
4903         * rungpg.c (_gpgme_gpg_op_verify): Likewise.
4904         * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
4905         * verify.c (_gpgme_op_verify_start): Likewise.
4906         (gpgme_op_verify_start): Likewise.
4907         (gpgme_op_verify): Likewise.
4908
4909         * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
4910         direction of data object.
4911         (_gpgme_gpg_add_data): Add new argument INBOUND.  Use it to
4912         determine direction of data object.
4913         (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
4914         _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4915         _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4916         _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4917         _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
4918         invocation.
4919         (build_argv): Use new member INBOUND to determine direction of
4920         file descriptor.  Don't check the data type.
4921         * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
4922
4923         * gpgme.c (gpgme_get_op_info): Don't call
4924         _gpgme_data_get_as_string if CTX->op_info is NULL.
4925
4926         * version.c (gpgme_check_engine): Function removed.
4927
4928 2002-09-30  Werner Koch  <wk@gnupg.org>
4929
4930         * keylist.c (keylist_colon_handler): Take care when printing a
4931         NULL with the DEBUG.
4932
4933         * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
4934         (gpgsm_status_handler): Run the colon function to indicate EOF.
4935         (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
4936
4937 2002-09-28  Marcus Brinkmann  <marcus@g10code.de>
4938
4939         * conversion.c (_gpgme_hextobyte): Prevent superfluous
4940         multiplication with base.  Reported by Stéphane Corthésy.
4941
4942         * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
4943         operation type in invocation of _gpgme_op_reset.
4944
4945 2002-09-20  Werner Koch  <wk@gnupg.org>
4946
4947         * ath.c: Include sys/time.h if sys/select.h is not available.
4948
4949 2002-09-13  Marcus Brinkmann  <marcus@g10code.de>
4950
4951         * keylist.c (keylist_status_handler): Do not call finish_key() here.
4952         (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
4953
4954 2002-09-03  Marcus Brinkmann  <marcus@g10code.de>
4955
4956         * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
4957         into gpgme unconditionally.
4958         (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
4959
4960 2002-09-02  Marcus Brinkmann  <marcus@g10code.de>
4961
4962         * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
4963
4964 2002-09-02  Marcus Brinkmann  <marcus@g10code.de>
4965
4966         * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
4967         (_gpgme_debug_end): Likewise.
4968         Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4969
4970 2002-09-02  Marcus Brinkmann  <marcus@g10code.de>
4971
4972         * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
4973         initializer.
4974         * version.c (_gpgme_get_program_version): Likewise.
4975         Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4976
4977 2002-09-02  Marcus Brinkmann  <marcus@g10code.de>
4978
4979         * conversion.c (_gpgme_decode_c_string): Set DESTP before
4980         modifying DEST.
4981
4982         * conversion.c (_gpgme_decode_c_string): Fix off by one error in
4983         last change.
4984         * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
4985         _gpgme_op_edit so its prototype is known early on.
4986
4987         * conversion.c: New file.
4988         * util.h: Add prototypes for _gpgme_decode_c_string and
4989         _gpgme_hextobyte.
4990         * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
4991         on issuer name.
4992         * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
4993         * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
4994         calls to _gpgme_hextobyte.
4995         (hash_key): Likewise.
4996
4997 2002-09-01  Marcus Brinkmann  <marcus@g10code.de>
4998
4999         * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
5000         _gpgme_engine_release, as this will reset pending to zero in the
5001         event done callback on cancelled operations.
5002
5003 2002-08-30  Marcus Brinkmann  <marcus@g10code.de>
5004
5005         * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
5006         Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
5007
5008         * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
5009         * rungpg.h: Also to prototype.
5010         * engine.c (_gpgme_engine_op_edit): Likewise.
5011         * engine.h: Likewise.
5012         * edit.c (_gpgme_op_edit_start): Likewise.
5013
5014 2002-08-29  Werner Koch  <wk@gnupg.org>
5015
5016         * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
5017         selection.
5018         * vasprintf.c (va_copy): Define macro if not yet defined.
5019
5020 2002-08-29  Marcus Brinkmann  <marcus@g10code.de>
5021
5022         * passphrase.c (_gpgme_passphrase_status_handler): Reset
5023         CTX->result.passphrase->no_passphrase if passphrase is given (good
5024         or bad).  Submitted by Jean DIRAISON <jean.diraison@free.fr>.
5025
5026 2002-08-28  Marcus Brinkmann  <marcus@g10code.de>
5027
5028         * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
5029         Return 0 on success, -1 on error.
5030         * version.c (_gpgme_get_program_version): Don't wait for the child.
5031         * engine.c (_gpgme_engine_housecleaning): Function removed.
5032         (do_reaping): Likewise.
5033         (_gpgme_engine_add_child_to_reap_list): Likewise.
5034         (struct reap_s): Removed.
5035         (reap_list): Likewise.
5036         (reap_list_lock): Likewise.
5037         * engine.h (_gpgme_engine_io_event): Remove prototypes for
5038         _gpgme_engine_housecleaning and
5039         _gpgme_engine_add_child_to_reap_list.
5040         * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
5041         (struct gpg_object_s): Remove PID member.
5042         (_gpgme_gpg_new): Don't initialize GPG->pid.
5043         (_gpgme_gpg_spawn): Don't set GPG->pid.
5044         * wait.c (run_idle): Removed.
5045         (gpgme_wait): Run idle_function directly.
5046
5047 2002-08-21  Marcus Brinkmann  <marcus@g10code.de>
5048
5049         * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
5050         variables encrypt_info and encrypt_info_len.
5051         * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
5052         * posix-sema.c (sema_fatal): Remove function.
5053         All these reported by Stéphane Corthésy.
5054
5055 2002-08-23  Werner Koch  <wk@gnupg.org>
5056
5057         * gpgme-config.in: Made --prefix work for --libs.
5058
5059 2002-08-21  Marcus Brinkmann  <marcus@g10code.de>
5060
5061         * ath.h: Update list of symbols that get a prefix: Rename the
5062         ath_mutex_*_available symbols to ath_*_available.
5063
5064 2002-08-21  Marcus Brinkmann  <marcus@g10code.de>
5065
5066         * stpcpy.c: New file from gnulib.
5067         * Makefile.am (assuan_libobjs): Remove jnlib.
5068
5069 2002-08-20  Marcus Brinkmann  <marcus@g10code.de>
5070
5071         * gpgme.h: Add prototype for gpgme_op_import_ext.
5072         * import.c (struct import_result_s): New member `nr_considered'.
5073         Rename `any_imported' to `nr_imported'.
5074         (import_status_handler): Increment nr_imported.  Set nr_considered
5075         if appropriate.
5076         (gpgme_op_import_ext): New function.
5077         (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
5078
5079 2002-08-20  Werner Koch  <wk@gnupg.org>
5080
5081         * gpgme.m4: Replaced with a new and faster version.  This does not
5082         anymore try to build test programs.  If we really need test
5083         programs, we should add an option to gpgme-config to do so.
5084
5085         * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
5086
5087 2002-08-20  Marcus Brinkmann  <marcus@g10code.de>
5088
5089         * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
5090         * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
5091         handling.
5092
5093 2002-08-19  Werner Koch  <wk@gnupg.org>
5094
5095         * decrypt.c (is_token,skip_token): Duplicated from verify.c
5096         (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
5097         (_gpgme_decrypt_status_handler): Create an operation info.
5098
5099 2002-08-14  Werner Koch  <wk@gnupg.org>
5100
5101         * key.h (struct certsig_s): New.  Use it in gpgme_key_s.
5102         * key.c (gpgme_key_release): Release it. We need to add more code
5103         of course.
5104         (_gpgme_key_append_name): Use memset to intialize the struct.
5105         * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
5106         * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
5107         non the list mode.
5108
5109         * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
5110         information about the key type (PGP or X.509).
5111         (gpgme_key_get_ulong_attr): Likewise.
5112
5113         * keylist.c (keylist_colon_handler): Include 1 in the check for
5114         valid algorithms so that RSA is usable.  Store the issuer name and
5115         serial number also for "crs" records.  Parse the expire date for
5116         subkeys.
5117         (set_userid_flags): Put them onto the last appended key.
5118
5119 2002-07-29  Marcus Brinkmann  <marcus@g10code.de>
5120
5121         * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
5122
5123 2002-07-28  Marcus Brinkmann  <marcus@g10code.de>
5124
5125         * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
5126         instead an error.
5127
5128         The following changes make it possible to flush an inbound data
5129         pipe before invoking a command handler:
5130
5131         * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
5132         _gpgme_io_select.  Set timeout of 0 if this is set.
5133         * w32-io.c (_gpgme_io_select): Likewise.
5134         * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
5135         * wait.c (do_select): Add new argument to _gpgme_io_select
5136         invocation.
5137         * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
5138         linked_data to prototype.
5139         * engine.h (_gpgme_engine_set_command_handler): Likewise.
5140         * engine.c (_gpgme_engine_set_command_handler): Likewise.
5141         * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
5142         argument to _gpgme_engine_set_command_handler.
5143         * rungpg.c (struct gpg_object_s): New members linked_data and
5144         linked_idx in CMD.
5145         (_gpgme_gpg_new): Initialize those new members.
5146         (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
5147         (build_argv): Handle linked_data in the same hack as cb_data.
5148         (read_status): If linked_data is in use, flush the pipe before
5149         activating the command handler.
5150         * gpgme.h: Add prototypes for gpgme_op_edit_start and
5151         gpgme_op_edit.
5152
5153         The next changes export the status codes to the user:
5154
5155         * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
5156         all STATUS_ with GPGME_.
5157         * delete.c (delete_status_handler): Likewise.
5158         * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
5159         * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
5160         (_gpgme_encrypt_sym_status_handler): Likewise.
5161         * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
5162         * engine-gpgsm.c (parse_status): Likewise.
5163         (gpgsm_status_handler): Likewise.
5164         (gpgsm_set_recipients): Likewise.
5165         * export.c (export_status_handler): Likewise.
5166         * genkey.c (genkey_status_handler): Likewise.
5167         * import.c (append_xml_impinfo): Likewise.
5168         (import_status_handler): Likewise.
5169         * keylist.c (keylist_status_handler): Likewise.
5170         * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
5171         (command_handler): Likewise.
5172         * progress.c (_gpgme_progress_status_handler): Likewise.
5173         * sign.c (_gpgme_sign_status_handler): Likewise.
5174         * trustlist.c (trustlist_status_handler): Likewise.
5175         * verify.c (_gpgme_verify_status_handler): Likewise.
5176         * gpgme.h (GpgmeEditCb): New type.
5177         * rungpg.h (GpgStatusCode): Rename and move to ...
5178         * gpgme.h (GpgmeStatusCode): ... this and here.
5179         * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
5180         * mkstatus: Prefix STATUS with GPGME_.
5181         * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
5182         accordingly.
5183         * ops.h (_gpgme_verify_status_handler,
5184         _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
5185         _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
5186         _gpgme_progress_status_handler): Likewise.
5187         * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
5188
5189         These changes add an edit operation to GPGME:
5190
5191         * context.h (struct gpgme_context_s): New member RESULT.edit.  *
5192         ops.h: Add prototype for _gpgme_release_edit_result and
5193         _gpgme_passphrase_command_handler.
5194         * passphrase.c (command_handler): Make non-static and rename to ...
5195         (_gpgme_passphrase_command_handler): ... this.
5196         (_gpgme_passphrase_start): Use new name for command handler.
5197         * types.h: Add EditResult type.
5198         * gpgme.c (_gpgme_release_result): Release EDIT result.
5199         * edit.c: New file.
5200         * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
5201         (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
5202         assuan_libobjs.
5203         (assuan_libobjs): New variable, set this instead
5204         libgpgme_la_LIBADD.
5205         * engine.h (_gpgme_engine_op_edit): New prototype.
5206         * engine.c (_gpgme_engine_op_edit): New function.
5207         * rungpg.h (_gpgme_gpg_op_edit): New prototype.
5208         * rungpg.c (_gpgme_gpg_op_edit): New function.
5209
5210 2002-07-27  Marcus Brinkmann  <marcus@g10code.de>
5211
5212         * delete.c (delete_problem): New case ambigious specification.
5213         (delete_status_handler): Handle new case (poorly).
5214
5215 2002-07-25  Marcus Brinkmann  <marcus@g10code.de>
5216
5217         * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
5218
5219 2002-07-25  Marcus Brinkmann  <marcus@g10code.de>
5220
5221         * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
5222         fopencookie.
5223         * vasprintf.c: Update to more recent libiberty version.
5224         * debug.h: Replace #elsif with #elif.
5225
5226         Submitted by Stéphane Corthésy:
5227         * util.h (vasprintf): Correct prototype.
5228         * encrypt-sign.c: Include <stddef.h>.
5229         (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
5230         size_t.
5231         * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
5232         * ath-pth.c: Likewise.
5233
5234 2002-07-25  Marcus Brinkmann  <marcus@g10code.de>
5235
5236         * wait.c (fdt_global): Make static.  Reported by Stéphane
5237         Corthésy.
5238
5239         * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
5240         patterns.  Reported by Stéphane Corthésy.
5241
5242         * key.c (gpgme_key_get_as_xml): Add OTRUST attribute.  Requested
5243         by Stéphane Corthésy.
5244         (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
5245         silence gcc warning.
5246
5247         * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
5248
5249 2002-07-03  Marcus Brinkmann  <marcus@g10code.de>
5250
5251         * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
5252
5253         * gpgme.c (_gpgme_op_event_cb_user): New function.
5254         * op-support.c (_gpgme_op_reset): Support a new mode of operation
5255         for private or user event loop.  Use new user event callback
5256         wrapper.
5257         * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
5258         * keylist.c (gpgme_op_keylist_start): Likewise.
5259
5260         * rungpg.c (_gpgme_gpg_io_event): New function.
5261         * rungpg.h (_gpgme_gpg_io_event): New prototype.
5262         * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
5263         * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
5264         * engine.c (_gpgme_engine_io_event): New function.
5265         * engine.h (_gpgme_engine_io_event): New prototype.
5266         * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
5267         the real work for the default IO callback routines to ...
5268         (_gpgme_op_keylist_event_cb): ... here.  New function.
5269         * trustlist.c (trustlist_colon_handler): Signal
5270         GPGME_EVENT_NEXT_TRUSTITEM.  Move queue manipulation to ...
5271         (_gpgme_op_trustlist_event_cb): ... here.  New function.
5272         * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
5273         and _gpgme_op_trustlist_event_cb when appropriate.
5274         * ops.h (_gpgme_op_keylist_event_cb): New prototype.
5275         (_gpgme_op_trustlist_event_cb): Likewise.
5276         * op-support.c (_gpgme_op_reset): Add comment why we don't use the
5277         user provided event handler directly.
5278         * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
5279         a pointer argument.
5280         * wait.c (_gpgme_add_io_cb): Likewise.
5281         * wait.h (_gpgme_add_io_cb): Likewise for prototype.
5282         * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
5283         argument.  Fix up error handling.
5284         * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
5285         new argument, fix up error handling.
5286
5287 2002-07-03  Werner Koch  <wk@gnupg.org>
5288
5289         * encrypt.c (status_handler_finish): New.
5290         (_gpgme_encrypt_status_handler): Moved some code out to the new
5291         function and call this function also in case we get into the
5292         status handler with an error which might happen due to a kludge in
5293         engine-gpgsm.c
5294
5295 2002-06-28  Marcus Brinkmann  <marcus@g10code.de>
5296
5297         * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
5298         table (eg use synchronous mode).
5299
5300 2002-06-27  Marcus Brinkmann  <marcus@g10code.de>
5301
5302         * gpgme.h: Fix documentation of key attribute retrieval functions.
5303
5304 2002-06-28  Marcus Brinkmann  <marcus@g10code.de>
5305
5306         * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
5307         prototype and change return type to GpgmeError.
5308         (_gpgme_wait_one): New prototype.
5309         * wait.c (gpgme_wait): Replace with the meat from
5310         _gpgme_wait_on_condition here, and remove the support for
5311         conditions.
5312         (_gpgme_wait_on_condition): Remove HANG argument from prototype
5313         and change return type to GpgmeError.  Replace with meat from
5314         _gpgme_wait_one and add support for conditions.
5315         (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
5316         condition.
5317         * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
5318         table (eg use synchronous mode).
5319         (gpgme_op_keylist_next): Remove HANG argument from
5320         _gpgme_wait_on_condition.  Check its return value.
5321         * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
5322         table (eg use synchronous mode).
5323         (gpgme_op_trustlist_next): Remove HANG argument from
5324         _gpgme_wait_on_condition.  Check its return value.
5325
5326 2002-06-26  Werner Koch  <wk@gnupg.org>
5327
5328         * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
5329
5330         * import.c (append_xml_impinfo): Kludge to print fingerprint
5331         instead of keyid for use with gpgsm.
5332         (import_status_handler): Set a flag to know whether any import
5333         occured.
5334         (gpgme_op_import): Reurn -1 if no certificate ewas imported.
5335
5336 2002-06-25  Werner Koch  <wk@gnupg.org>
5337
5338         * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
5339         function arguments.
5340
5341 2002-06-25  Marcus Brinkmann  <marcus@g10code.de>
5342
5343         * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
5344         listed in RECP.
5345         * export.c (gpgme_op_export): If no data was returned, return
5346         GPGME_No_Recipients.
5347
5348 2002-06-25  Marcus Brinkmann  <marcus@g10code.de>
5349
5350         * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
5351
5352 2002-06-21  Marcus Brinkmann  <marcus@g10code.de>
5353
5354         * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
5355         (parse_status): New function.
5356         (gpgsm_status_handler): Use parse_status.
5357         (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
5358         STATUS_FNC_VALUE and process status messages.
5359         (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
5360         (gpgsm_set_fd): Likewise.
5361         (_gpgme_gpgsm_op_keylist): Likewise.
5362         (_gpgme_gpgsm_op_keylist_ext): Likewise.
5363         (_gpgme_gpgsm_op_sign): Likewise.
5364
5365 2002-06-21  Marcus Brinkmann  <marcus@g10code.de>
5366
5367         * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
5368
5369 2002-06-20  Werner Koch  <wk@gnupg.org>
5370
5371         * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
5372
5373         * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
5374         (skip_token): New.
5375         (_gpgme_verify_status_handler): Watch out for wrong key usage.
5376         (gpgme_get_sig_string_attr): Hack to return info on the key
5377         usage.  Does now make use of the former RESERVED argument which
5378         has been renamed to WHATIDX.
5379         (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
5380
5381 2002-06-14  Marcus Brinkmann  <marcus@g10code.de>
5382
5383         * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
5384         (_gpgme_wait_one): Only set HANG to zero if do_select returned an
5385         error, or there are no more file descriptors to wait on.
5386         (_gpgme_wait_on_condition): Ignore return value from do_select for
5387         now.
5388
5389 2002-06-13  Werner Koch  <wk@gnupg.org>
5390
5391         * verify.c (gpgme_op_verify): Make sure that we never access an
5392         unitialized result structure.
5393
5394 2002-06-12  Werner Koch  <wk@gnupg.org>
5395
5396         * keylist.c (struct keylist_result_s): New.
5397         (_gpgme_release_keylist_result): Release it here
5398         (keylist_status_handler): Handle truncated.
5399         (append_xml_keylistinfo): New.
5400         * gpgme.c (_gpgme_release_result): and use it here.
5401         * types.h: Declare the new type here.
5402         * context.h (struct gpgme_context_s): Use it here.
5403
5404 2002-06-11  Marcus Brinkmann  <marcus@g10code.de>
5405
5406         * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
5407         (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
5408         use our own close notification mechanism without interfering with
5409         assuan.
5410
5411 2002-06-11  Werner Koch  <wk@gnupg.org>
5412
5413         * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
5414         constants.
5415         * verify.c (calc_sig_summary): New.
5416         (gpgme_get_sig_ulong_attr): And use it here.
5417
5418 2002-06-10  Werner Koch  <wk@gnupg.org>
5419
5420         * rungpg.h: Add new status codes TRUNCATED and ERROR.
5421         * verify.c (is_token, copy_token): New.
5422         (_gpgme_verify_status_handler): Use copy_token, handle the new
5423         ERROR status and store the errorcode used withgpgsm and trust
5424         status codes.
5425         * gpgme.h: New attribute ERRTOK.
5426         * key.c (gpgme_key_get_string_attr): Add dummy case for it.
5427         (gpgme_get_sig_string_attr): Use it here to return the last error.
5428
5429 2002-06-10  Marcus Brinkmann  <marcus@g10code.de>
5430
5431         * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
5432         close notification for the status fd to ...
5433         (_gpgme_gpgsm_new): ... here.
5434         * wait.h: Include "sema.h".  Remove prototypes of
5435         _gpgme_remove_proc_from_wait_queue and
5436         _gpgme_register_pipe_handler.  Add prototypes of
5437         _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
5438         _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
5439         _gpgme_wait_one..
5440         * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
5441         FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK.  New global variables
5442         FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
5443         CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK.  Remove struct
5444         proc_s.  Replace struct wait_item_s.
5445         (_gpgme_fd_table_init): New function.
5446         (_gpgme_fd_table_deinit): Likewise.
5447         (_gpgme_fd_table_put): Likewise.
5448         (set_process_done): Remove function.
5449         (do_select): Take argument FDT.  Use that to decide which fds to
5450         select on.
5451         (_gpgme_remove_proc_from_wait_queue): Remove function.
5452         (_gpgme_wait_event_cb): New function.
5453         (_gpgme_wait_one): Likewise.
5454         (_gpgme_register_pipe_hanldler): Remove function.
5455         (_gpgme_add_io_cb): New function.
5456         (_gpgme_remove_io_cb): Likewise.
5457         (_gpgme_freeze_fd): Remove function.
5458         (_gpgme_thaw_fd): Remove function.
5459         * rungpg.c (struct fd_data_map_s): Add new member TAG.
5460         (struct gpg_object_s): Likewise for STATUS and COLON.  Add member
5461         IDX to CMD.  Add new member IO_CBS.
5462         (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
5463         For each I/O callback, check if it should be unregistered.  If all
5464         callbacks have been unregistered, trigger GPGME_EVENT_DONE.
5465         Remove member RUNNING.
5466         (_gpgme_gpg_new): Initialize new members.
5467         (_gpgme_gpg_release): Check PID not RUNNING.  Don't call
5468         _gpgme_remove_proc_from_wait_queue.  Close GPG->CMD.FD if set.
5469         (build_argv): Store away the index instead the file descriptor for
5470         CMD.
5471         (_gpgme_gpg_add_io_cb): New function.
5472         (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
5473         callbacks.
5474         (gpg_status_handler): Change return type to void, remove PID
5475         argument, close filedescriptor if EOF or error occurs.
5476         (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
5477         Use IO_CBS->remove instead _gpgme_freeze_fd.
5478         (gpg_colon_line_handler): Change return type to void, remove PID
5479         argument, close filedescriptor if EOF or error occurs.
5480         (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
5481         (_gpgme_gpg_set_io_cbs): New function.
5482         * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
5483         _gpgme_gpg_set_io_cbs.
5484         * gpgme.h (GpgmeIOCb): New type.
5485         (GpgmeRegisterIOCb): Likewise.
5486         (GpgmeRemoveIOCb): Likewise.
5487         (GpgmeEventIO): Likewise.
5488         (GpgmeEventIOCb): Likewise.
5489         (struct GpgmeIOCbs): New structure to hold I/O callbacks.
5490         (gpgme_set_op_io_cbs): New prototype.
5491         (gpgme_get_op_io_cbs): Likewise.
5492         * ops.h: New prototype for _gpgme_op_event_cb.  Remove prototypes
5493         for _gpgme_freeze_fd and _gpgme_thaw_fd.  Remove PID argument from
5494         _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
5495         prototype.  Add prototype for _gpgme_op_reset.
5496         Add synchronous argument to _gpgme_decrypt_start prototype.
5497         * io.h: Beautification.
5498         * gpgme.c: Include "wait.h".
5499         (gpgme_new): Initialize FDT.
5500         (gpgme_set_io_cbs): New function.
5501         (gpgme_get_io_cbs): Likewise.
5502         (_gpgme_op_event_cb): Likewise.
5503         * data.c (_gpgme_data_inbound_handler): Change return type to
5504         void.  Drop PID argument.  Close FD on error and EOF.
5505         (write_mem_data): Don't close FD here ...
5506         (write_cb_data): ... or here ...
5507         (_gpgme_data_outbound_handler): ... but here.  Change return type
5508         to void.  Drop PID argument.
5509         * context.h: Include "wait.h".
5510         (struct gpgme_context_s): New members FDT and IO_CBS.
5511         * op-support.c: New file.
5512         * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
5513         * ops.h: Add prototype for _gpgme_op_reset().
5514         * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS.  Use
5515         _gpgme_op_reset.
5516         (gpgme_op_decrypt_start): Add synchronous argument.
5517         (gpgme_op_decrypt): Likewise.  Use _gpgme_wait_one instead
5518         gpgme_wait.
5519         * delete.c (gpgme_op_delete_start): Rename to ...
5520         (_gpgme_op_delete_start): ... this.  New argument SYNCHRONOUS.
5521         Use _gpgme_op_reset.  Make function static.
5522         (gpgme_op_delete_start): Just a wrapper around
5523         _gpgme_op_delete_start now.
5524         (gpgme_op_delete): Add synchronous argument.  Use _gpgme_wait_one
5525         instead gpgme_wait.
5526         * encrypt.c: Include "wait.h".
5527         (ggpgme_op_encrypt_start): Rename to ...
5528         (_gpgme_op_encrypt_start): ... this.  New argument SYNCHRONOUS.
5529         Use _gpgme_op_reset.  Make function static.
5530         (gpgme_op_encrypt_start): Just a wrapper around
5531         _gpgme_op_encrypt_start now.
5532         (gpgme_op_encrypt): Add synchronous argument.  Use _gpgme_wait_one
5533         instead gpgme_wait.
5534         * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
5535         (_gpgme_op_encrypt_sign_start): ... this.  New argument
5536         SYNCHRONOUS.  Use _gpgme_op_reset.  Make function static.
5537         (gpgme_op_encrypt_sign_start): Just a wrapper around
5538         _gpgme_op_encrypt_sign_start now.
5539         (gpgme_op_encrypt_sign): Add synchronous argument.  Use
5540         _gpgme_wait_one instead gpgme_wait.
5541         * export.c (gpgme_op_export_start): Rename to ...
5542         (_gpgme_op_export_start): ... this.  New argument SYNCHRONOUS.
5543         Use _gpgme_op_reset.  Make function static.
5544         (gpgme_op_export_start): Just a wrapper around
5545         _gpgme_op_export_start now.
5546         (gpgme_op_export): Add synchronous argument.  Use _gpgme_wait_one
5547         instead gpgme_wait.
5548         * genkey.c (gpgme_op_genkey_start): Rename to ...
5549         (_gpgme_op_genkey_start): ... this.  New argument SYNCHRONOUS.
5550         Use _gpgme_op_reset.  Make function static.
5551         (gpgme_op_genkey_start): Just a wrapper around
5552         _gpgme_op_genkey_start now.
5553         (gpgme_op_genkey): Add synchronous argument.  Use _gpgme_wait_one
5554         instead gpgme_wait.
5555         * import.c (gpgme_op_import_start): Rename to ...
5556         (_gpgme_op_import_start): ... this.  New argument SYNCHRONOUS.
5557         Use _gpgme_op_reset.  Make function static.
5558         (gpgme_op_import_start): Just a wrapper around
5559         _gpgme_op_import_start now.
5560         (gpgme_op_import): Add synchronous argument.  Use _gpgme_wait_one
5561         instead gpgme_wait.
5562         * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
5563         (gpgme_op_keylist_ext_start): Likewise.
5564         * sign.c (gpgme_op_sign_start): Rename to ...
5565         (_gpgme_op_sign_start): ... this.  New argument SYNCHRONOUS.  Use
5566         _gpgme_op_reset.  Make function static.
5567         (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
5568         now.
5569         (gpgme_op_sign): Add synchronous argument.  Use _gpgme_wait_one
5570         instead gpgme_wait.
5571         * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
5572         * verify.c (gpgme_op_verify_start): Rename to ...
5573         (_gpgme_op_verify_start): ... this.  New argument SYNCHRONOUS.
5574         Use _gpgme_op_reset.  Make function static.
5575         (gpgme_op_verify_start): Just a wrapper around
5576         _gpgme_op_verify_start now.
5577         (gpgme_op_verify): Add synchronous argument.  Use _gpgme_wait_one
5578         instead gpgme_wait.
5579         * engine-gpgsm.c (iocb_data_t): New type.
5580         (struct gpgsm_object_s): New member status_cb.  Replace input_fd
5581         and input_data with input_cb.  Replace output_fd and output_data
5582         with output_cb.  Replace message_fd and message_data with
5583         message_cb.  New member io_cbs.
5584         (_gpgme_gpgsm_new): Initialize all new members (and drop the old
5585         ones).
5586         (close_notify_handler): New variable POSSIBLY_DONE.  For each I/O
5587         callback, check if it should be unregistered.  If all callbacks
5588         have been unregistered, trigger GPGME_EVENT_DONE.
5589         (_gpgme_gpgsm_release): Remove variable PID.  Use new variable
5590         names to close the file descriptors.
5591         (_gpgme_gpgsm_op_decrypt): Use new variable names,
5592         (_gpgme_gpgsm_op_encrypt): Likewise.
5593         (_gpgme_gpgsm_op_genkey): Likewise.
5594         (_gpgme_gpgsm_op_import): Likewise.
5595         (_gpgme_gpgsm_op_keylist): Likewise.
5596         (_gpgme_gpgsm_op_keylist_ext): Likewise.
5597         (_gpgme_gpgsm_op_sign): Likewise.
5598         (_gpgme_gpgsm_op_verify): Likewise.
5599         (gpgsm_status_handler): Drop argument PID.  Change return type to
5600         void.  Close status pipe before returning because of EOF or error.
5601         (_gpgme_gpgsm_add_io_cb): New function.
5602         (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
5603         callback function.
5604         (_gpgme_gpgsm_set_io_cbs): New function.
5605         * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
5606         * engine.c (_gpgme_engine_set_io_cbs): New function.
5607         * engine.h: New prototype for _gpgme_engine_set_io_cbs.
5608
5609 2002-06-04  Marcus Brinkmann  <marcus@g10code.de>
5610
5611         * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
5612
5613 2002-06-03  Marcus Brinkmann  <marcus@g10code.de>
5614
5615         * key.c: Include <ctype.h>.
5616         (_gpgme_key_append_name): Skip one more char when
5617         processing escaped char.  Submitted by Marc Mutz <mutz@kde.org>.
5618         Handle hexadecimal encodings.  Also reported by Marc.  Thanks!
5619
5620 2002-06-02  Marcus Brinkmann  <marcus@g10code.de>
5621
5622         * ath.h: Enable the _gpgme_ prefix.  Fix all those prefix macros.
5623         * posix-sema.c: Use that prefix here.
5624         * posix-io.c: Include "ath.h".
5625         (_gpgme_io_read): Use _gpgme_ath_read instead read.
5626         (_gpgme_io_write): Use _gpgme_ath_write instead write.
5627         (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
5628         (_gpgme_io_select): Use _gpgme_ath_select instead select.
5629
5630 2002-06-02  Marcus Brinkmann  <marcus@g10code.de>
5631
5632         * Makefile.am (ath_components): New variable.
5633         (ath_components_pthread): Likewise.
5634         (ath_components_pth): Likewise.
5635         (system_components): Add ath_componentes.
5636
5637         * ath.h: New file.
5638         * ath.c: Likewise.
5639         * ath-pthread.c: Likewise.
5640         * ath-pth.c: Likewise.
5641         * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
5642         interface.
5643         * mutex.h: Remove file.
5644
5645 2002-05-30  Werner Koch  <wk@gnupg.org>
5646
5647         * key.c (gpgme_key_get_string_attr): Return NULL when asking for
5648         an issuer with IDX > 0.  We don't support altIssuerNames for now.
5649
5650 2002-05-22  Werner Koch  <wk@gnupg.org>
5651
5652         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
5653         missing variable definition.  Oohh - Marcus was faster.
5654
5655 2002-05-22  Marcus Brinkmann  <marcus@gnu.org>
5656
5657         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
5658
5659 2002-05-21  Werner Koch  <wk@gnupg.org>
5660
5661         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
5662         (_gpgme_gpgsm_op_keylist_ext):  Pass the keylist mode to gpgsm.
5663
5664 2002-05-10  Werner Koch  <wk@gnupg.org>
5665
5666         * key.h (gpgme_key_s): Add OTRUST.
5667         * keylist.c (set_ownertrust): New.
5668         (keylist_colon_handler): Get the ownertrust value
5669         * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
5670         Return that value.
5671
5672 2002-05-08  Marcus Brinkmann  <marcus@g10code.de>
5673
5674         * w32-util.c: New static variable GET_PATH_LOCK.
5675         (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
5676         Take lock while determining path.
5677         (_gpgme_get_gpgsm_path): Likewise.
5678         * version.c (do_subsystem_inits): Set DONE to 1 after
5679         initialization.
5680         (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK.  Take lock
5681         while determining engine info.
5682         * rungpg.c (_gpgme_gpg_get_version): New variable
5683         GPG_VERSION_LOCK.  Take the lock while determining the program
5684         version.
5685         * posix-io.c: Include "sema.h".
5686         (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK.  Take the lock
5687         while fixing the signals.
5688         (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
5689         * key.c: Include "sema.h".  New globals KEY_CACHE_LOCK and
5690         KEY_REF_LOCK.
5691         (capabilities_to_string): Make STRINGS very const.
5692         (_gpgme_key_cache_add): Lock the key cache.
5693         (_gpgme_key_cache_get): Likewise.
5694         (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
5695         * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
5696         IMPORT_RES_FIELDS very const.  Make FIELD and FIELD_NAME a litle
5697         const.
5698         * engine.c (_gpgme_engine_get_info): New variable
5699         ENGINE_INFO_LOCK.  Take lock while determining engine info.
5700         * engine-gpgsm.c: Include "sema.h".
5701         (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK.  Take
5702         lock while getting program version.
5703
5704 2002-05-08  Marcus Brinkmann  <marcus@g10code.de>
5705
5706         * debug.h: New file.
5707         * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
5708         * util.h: Removed all prototypes and declarations related to
5709         debugging.  Include "debug.h".
5710
5711         * debug.c (debug_level): Comment variable and remove superfluous
5712         zero initializer.
5713         (errfp): Likewise.
5714         (_gpgme_debug_enabled): Function removed.
5715         (struct debug_control_s): Definition removed.
5716         (_gpgme_debug_level): Function removed.
5717         (_gpgme_debug_begin): Rewritten to use vasprintf.  Accept a
5718         pritnf-style format specification and a variable number of
5719         arguments.
5720         (_gpgme_debug_add): Rewritten using vasprintf.  Expect that format
5721         starts out with "%s" for simplicity.
5722         (_gpgme_debug_end): Rewritten using vasprintf.  Do not accept a
5723         TEXT argument anymore.
5724
5725         * posix-io.c (_gpgme_io_select): Use new level argument for
5726         DEBUG_BEGIN instead explicit if construct.
5727
5728         * debug.c (debug_init): Remove superfluous zero initializer,
5729         remove volatile flag of INITIALIZED.  Do not use the
5730         double-checked locking algorithm, it is fundamentally flawed and
5731         will empty your fridge (on a more serious note, despite the
5732         volatile flag it doesn't give you the guarantee you would expect,
5733         for example on a DEC Alpha or an SMP machine.  The volatile only
5734         serializes accesses to the volatile variable, but not to the other
5735         variables).
5736
5737 2002-05-03  Werner Koch  <wk@gnupg.org>
5738
5739         * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
5740         output to /dev/null.
5741
5742         * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
5743         * gpgme.c (gpgme_get_protocol): New.
5744
5745         * data.c (gpgme_data_write): Changed type of BUFFER to void*.
5746         (gpgme_data_read): Ditto.
5747
5748         * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
5749         lines so that a claim can be made without looking up the key.
5750         (gpgme_get_sig_string_attr): New.
5751         (gpgme_get_sig_ulong_attr): New.
5752
5753         * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
5754
5755         * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
5756         list to align with the status.h file from gnupg.
5757
5758         * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
5759         * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
5760         these new status codes.  Store the expiration time
5761
5762 2002-04-27  Werner Koch  <wk@gnupg.org>
5763
5764         * gpgme.h (GpgmeData_Encoding): New.
5765         * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
5766         * engine-gpgsm.c (map_input_enc): New. Use it in all local
5767         functions where the INPUT command gets send.
5768
5769 2002-04-27  Marcus Brinkmann  <marcus@g10code.de>
5770
5771         * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
5772         descriptor only when we don't need it anymore.  Close the message
5773         descriptor if we don't need it.
5774
5775 2002-04-26  Werner Koch  <wk@gnupg.org>
5776
5777         * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
5778
5779 2002-04-25  Marcus Brinkmann  <marcus@g10code.de>
5780
5781         * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
5782         GPG->cmd.cb_data, not xfree.
5783
5784 2002-04-25  Marcus Brinkmann  <marcus@g10code.de>
5785
5786         * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
5787         ttytype, lc_ctype and lc_messages options in the server.
5788
5789 2002-04-24  Marcus Brinkmann  <marcus@g10code.de>
5790
5791         * engine-gpgsm.c (map_assuan_error): Add new error codes.
5792
5793 2002-04-23  Werner Koch  <wk@gnupg.org>
5794
5795         * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
5796         can_certify to return the requested values.
5797
5798 2002-04-23  Marcus Brinkmann  <marcus@g10code.de>
5799
5800         * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
5801         to be NULL.
5802         (gpgme_get_passphrase_cb): Likewise.
5803
5804 2002-04-22  Marcus Brinkmann  <marcus@g10code.de>
5805
5806         * gpgme.c (gpgme_get_passphrase_cb): New function.
5807         (gpgme_get_progress_cb): New function.
5808         * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
5809         gpgme_get_progress_cb.
5810
5811 2002-03-28  Werner Koch  <wk@gnupg.org>
5812
5813         * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
5814         * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
5815         * keylist.c (keylist_colon_handler): Store them.
5816         * key.c (gpgme_key_release): Free them.
5817         (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
5818
5819 2002-03-26  Werner Koch  <wk@gnupg.org>
5820
5821         * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
5822
5823 2002-03-21  Werner Koch  <wk@gnupg.org>
5824
5825         * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
5826         defined.
5827
5828 2002-03-18  Marcus Brinkmann  <marcus@g10code.de>
5829
5830         * Makefile.am (system_components): New variable, set depending on
5831         HAVE_DOSISH_SYSTEM.
5832         (libgpgme_la_SOURCES): Use system_components.  Remove `syshdr.h'.
5833         * syshdr.h: File removed.
5834
5835         * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard.  Clean up source.
5836         * posix-sema.c: Likewise.
5837         * posix-util.c: Likewise.
5838
5839         * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
5840         * w32-sema.c: Likewise.
5841         * w32-util.c: Likewise.
5842
5843         * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
5844         * posix-sema.c: Likewise.
5845         * w32-io.c: Include `io.h', do not include `syshdr.h'
5846         * w32-sema.c: Likewise.
5847         * w32-util.c: Likewise.
5848         * data.c: Do not include `syshdr.h'.
5849         * wait.c: Likewise.
5850         * wait.h: Code cleanup.
5851
5852         * mutex.h: New file.
5853         * posix-sema.c: Implement.
5854
5855 2002-03-08  Werner Koch  <wk@gnupg.org>
5856
5857         * util.h [!HAVE_FOPENCOOKIE]: Fixed type.  Thanks to Frank Heckenbach.
5858
5859 2002-03-07  Werner Koch  <wk@gnupg.org>
5860
5861         * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
5862
5863 2002-03-06  Marcus Brinkmann  <marcus@g10code.de>
5864
5865         * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
5866         (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
5867         is null, and if it is set, use _gpgme_encrypt_sym_status_handler
5868         as status handler and run _gpgme_passphrase_start.
5869         * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
5870         encryption.
5871         * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
5872         return error value.
5873
5874         * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
5875
5876 2002-03-03  Marcus Brinkmann  <marcus@g10code.de>
5877
5878         * passphrase.c (_gpgme_passphrase_status_handler): Also set the
5879         error No_Passphrase if only a bad passphrase was provided.
5880
5881 2002-03-03  Marcus Brinkmann  <marcus@g10code.de>
5882
5883         * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
5884         GPGME_DATA_MODE_IN, construct a command line that stores the
5885         plaintext in TEXT.
5886         * verify.c (gpgme_op_verify_start): Accept TEXT being
5887         uninitialized, and in this case interpret SIG as a normal or
5888         cleartext signature and TEXT as a return data object.
5889         * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
5890
5891 2002-03-03  Marcus Brinkmann  <marcus@g10code.de>
5892
5893         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
5894         Add stub function.
5895
5896 2002-02-28  Werner Koch  <wk@gnupg.org>
5897
5898         * key.h (subkey_s): New member expires_at.
5899         * keylist.c (keylist_colon_handler): Set it here
5900         * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
5901
5902 2002-02-27  Marcus Brinkmann  <marcus@g10code.de>
5903
5904         * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
5905         * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
5906         * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
5907         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
5908         * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
5909         * engine.c (_gpgme_engine_op_keylist_ext): New function.
5910         * keylist.c (gpgme_op_keylist_ext_start): New function.
5911
5912 2002-02-27  Marcus Brinkmann  <marcus@g10code.de>
5913
5914         * gpgme.h: Add new error code GPGME_Invalid_Recipient.
5915         * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
5916         rename no_recipients to no_valid_recipients.
5917         (_gpgme_encrypt_status_handler): Include error for invalid
5918         recipients.
5919         * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
5920         argument to GpgsmObject.  Use that to report back the status about
5921         the recipients.
5922
5923 2002-02-26  Marcus Brinkmann  <marcus@g10code.de>
5924
5925         * verify.c (_gpgme_verify_status_handler): Fix the last change.
5926
5927 2002-02-25  Marcus Brinkmann  <marcus@g10code.de>
5928
5929         * verify.c (_gpgme_verify_status_handler): Parse the args line to
5930         see if the problem is due to a missing key, and report that back
5931         to the user.
5932
5933 2002-02-25  Marcus Brinkmann  <marcus@g10code.de>
5934
5935         * engine.c (_gpgme_engine_op_encrypt_sign): New function.
5936         * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
5937         * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
5938         (_gpgme_gpg_op_sign): Use that new function.
5939         (_gpgme_gpg_op_encrypt_sign): New function.
5940         * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
5941         * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
5942         (gpgme_op_encrypt_sign): Likewise.
5943         * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
5944         * ops.h (_gpgme_encrypt_status_handler): Add prototype.
5945         (_gpgme_sign_status_handler): Add prototype.
5946         * sign.c (sign_status_handler): Rename to ...
5947         (_gpgme_sign_status_handler): ... this and make non-static.
5948         * encrypt.c (encrypt_status_handler): Rename to ...
5949         (_gpgme_encrypt_status_handler): ... this and make non-static.
5950         * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
5951         * sign.c (gpgme_op_sign_start): Likewise.
5952
5953 2002-02-25  Marcus Brinkmann  <marcus@g10code.de>
5954
5955         * context.h (struct gpgme_context_s): New member include_certs.
5956         * gpgme.h (gpgme_set_include_certs): Add prototype.
5957         (gpgme_get_include_certs): Likewise.
5958         * gpgme.c (gpgme_set_include_certs): New function.
5959         (gpgme_get_include_certs): Likewise.
5960         (gpgme_new): Set include_certs to 1 (the default).
5961         * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
5962         and pass it to _gpgme_gpgsm_op_sign.
5963         * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
5964         * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
5965         include_certs and handle it.
5966         * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
5967         * sign.c (gpgme_op_sign_start): Add new argument to
5968         _gpgme_engine_op_sign call.
5969
5970 2002-02-14  Werner Koch  <wk@gnupg.org>
5971
5972         * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
5973
5974 2002-02-13  Werner Koch  <wk@gnupg.org>
5975
5976         * vasprintf.c, fopencookie.c: Add replacement functions.
5977         * util.h: Add prototypes for them.
5978
5979 2002-02-09  Marcus Brinkmann  <marcus@g10code.de>
5980
5981         * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
5982         reach the end of the function.
5983
5984 2002-02-09  Marcus Brinkmann  <marcus@g10code.de>
5985
5986         * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
5987         (gpgme_op_genkey_start): Skip newlines after opening tag.
5988
5989         * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
5990
5991 2002-02-08  Marcus Brinkmann  <marcus@g10code.de>
5992
5993         * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
5994         set, and pass them down to the crypto engine.
5995         * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
5996         * engine.h: Likewise.
5997         * rungpg.h (_gpgme_gpg_spawn): Likewise.
5998         * engine.c (_gpgme_engine_op_genkey): Likewise.  Use those
5999         arguments.
6000         * rungpg.c (_gpgme_gpg_op_genkey): Likewise.  Complain if those
6001         arguments are set.
6002         * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise.  Implement
6003         function.
6004
6005         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
6006
6007 2002-02-06  Marcus Brinkmann  <marcus@g10code.de>
6008
6009         * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
6010         mode (for now).
6011
6012 2002-02-06  Marcus Brinkmann  <marcus@g10code.de>
6013
6014         * wait.c (gpgme_wait): Add new argument STATUS, in which the
6015         status of the returned context is returned.
6016         (_gpgme_wait_on_condition): Rework the function a bit, to make it
6017         aware of cancelled processes, and to allow to use gpgme_wait with
6018         CTX being NULL (as documented in the source).
6019         (struct proc_s): New member REPORTED.
6020         * gpgme.h: Fix prototype.
6021         * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
6022         * sign.c (gpgme_op_sign): Likewise.
6023         * import.c (gpgme_op_import): Likewise.
6024         * genkey.c (gpgme_op_genkey): Likewise.
6025         * export.c (gpgme_op_export): Likewise.
6026         * encrypt.c (gpgme_op_encrypt): Likewise.
6027         * delete.c (gpgme_op_delete): Likewise.
6028         * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
6029
6030 2002-02-06  Marcus Brinkmann  <marcus@g10code.de>
6031
6032         * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
6033         value.
6034         (gpgme_get_keylist_mode): New function.
6035         (gpgme_new): Set the default for keylist_mode member of CTX.
6036
6037         * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
6038         (gpgme_get_keylist_mode): New prototype.
6039         (GPGME_KEYLIST_MODE_LOCAL): New macro.
6040         (GPGME_KEYLIST_MODE_EXTERN): Likewise..
6041
6042 2002-02-02  Marcus Brinkmann  <marcus@g10code.de>
6043
6044         This patch has gotten a bit large... mmh.  The main thing that
6045         happens here is that error values are now not determined in the
6046         operation function after gpgme_wait completed, but in the status
6047         handler when EOF is received.  It should always be the case that
6048         either an error is flagged or EOF is received, so that after a
6049         gpgme_wait you should never have the situation that no error is
6050         flagged and EOF is not received.  One problem is that the engine
6051         status handlers don't have access to the context, a horrible
6052         kludge works around this for now.  All errors that happen during a
6053         pending operation should be catched and reported in ctx->error,
6054         including out-of-core and cancellation.  This rounds up neatly a
6055         couple of loose ends, and makes it possible to pass up any errors
6056         in the communication with the backend as well.  As a bonus, there
6057         will be a function to access gpgme->wait, so that the operations
6058         can truly be implemented with their _start function.
6059
6060         * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
6061         error back to the context.
6062         * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
6063
6064         * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
6065
6066         * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
6067         to a value indication that.
6068
6069         * verify.c (add_notation): Set error, not out_of_core.
6070         (finish_sig): Likewise.
6071         (gpgme_op_verify_start): Don't clear out_of_core.
6072         (_gpgme_verify_status_handler): At EOF, clean up the notation data.
6073         (gpgme_op_verify): And don't do it here.
6074
6075         * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
6076         (gpgme_op_trustlist_start): Don't clear out_of_core.
6077         (gpgme_op_trustlist_next): Check error, not out_of_core.
6078         (gpgme_op_trustlist_end): Likewise.
6079
6080         * ops.h (test_and_allocate_result): New macro.
6081         (_gpgme_passphrase_result): Remove prototype.
6082         * delete.c (gpgme_op_delete): Return error from context.
6083         (delete_status_handler): Use macro test_and_allocate_result.
6084         Perform error checking at EOF.
6085         (gpgme_op_delete_start): Release result.
6086         * passphrase.c (_gpgme_passphrase_status_handler): Use macro
6087         test_and_allocate_result, and perform error checking here.
6088         (_gpgme_passphrase_result): Function removed.
6089         * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
6090         (gpgme_op_sign): Just return the error value from the context.
6091         (sign_status_handler): Only progress if no error is set yet.  If
6092         we process an EOF, set the resulting error value (if any).
6093         * decrypt.c (_gpgme_decrypt_result): Function removed.
6094         (create_result_struct): Function removed.
6095         (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
6096         caclulate error on EOF, do not progress with errors.
6097         (_gpgme_decrypt_start): Do not set out_of_core to zero.
6098         (gpgme_op_decrypt): Just return the error value from the context.
6099         * encrypt.c (encrypt_status_handler): Perform the error checking
6100         here.
6101         (gpgme_op_encrypt_start): Do not clear out_of_core.
6102         * export.c (export_status_handler): Return if error is set in context.
6103         (gpgme_op_export_start): Release result.
6104         (gpgme_op_export): Return error from context.
6105         * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
6106         the context.
6107         * genkey.c (genkey_status_handler): Use macro
6108         test_and_allocate_result.  Perform error checking at EOF.
6109         (gpgme_op_genkey): Just return the error from context.
6110         * import.c (gpgme_op_import): Return the error from context.
6111         (import_status_handler): Use macro test_and_allocate_result.
6112         * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
6113         (gpgme_op_keylist_next): Return error of context.
6114         (keylist_colon_handler): Set error instead out_of_code.
6115         (finish_key): Likewise.
6116
6117         * context.h: Remove member out_of_core, add member error.
6118         * gpgme.c (_gpgme_release_result): Clear error flag.
6119
6120         * engine.h (_gpgme_engine_get_error): New prototype.
6121         * engine.c (_gpgme_engine_get_error): New function.
6122         * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
6123
6124         * engine-gpgsm.c (map_assuan_error): New function.
6125         (gpgsm_assuan_simple_command): Change return type to GpgmeError,
6126         use the new function to map error values.
6127         (gpgsm_set_fd): Change return type tp GpgmeError.
6128         (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
6129         (gpgsm_set_recipients): Likewise.  Change type of return value
6130         equivalently.  Adjust error values.
6131         (_gpgme_gpgsm_op_import): Likewise.
6132         (_gpgme_gpgsm_op_sign): Likewise.
6133         (struct gpgsm_object_s): New member error.
6134         (gpgsm_status_handler): Set error if error occurs.  Determine
6135         error number from ERR line received.  If assuan_read_line fails,
6136         terminate the connection.
6137
6138 2002-02-01  Marcus Brinkmann  <marcus@g10code.de>
6139
6140         * Makefile.am (MOSTLYCLEANFILES): New variable.
6141
6142 2002-02-01  Marcus Brinkmann  <marcus@g10code.de>
6143
6144         * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
6145         connection to the server.
6146
6147 2002-01-31  Marcus Brinkmann  <marcus@g10code.de>
6148
6149         * rungpg.h: Add STATUS_KEY_CREATED.
6150
6151         * progress.c: New file.
6152         * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
6153
6154         * genkey.c (genkey_status_handler): Use
6155         _gpgme_progress_status_handler.  Add check for status.
6156         (struct genkey_result_s): New structure.
6157         (_gpgme_release_genkey_result): New function.
6158         (gpgme_op_genkey): Check for error.
6159         * gpgme.c (_gpgme_release_result): Call
6160         _gpgme_release_genkey_result.
6161         * ops.h (_gpgme_release_genkey_result): Add prototype.
6162         * types.h (GenKeyResult): New type.
6163         * context.h (gpgme_context_s): Add GenKeyResult to member result.
6164
6165 2002-01-30  Marcus Brinkmann  <marcus@g10code.de>
6166
6167         * gpgme.c (_gpgme_release_result): Call
6168         _gpgme_release_delete_result.
6169         * ops.h (_gpgme_release_delete_result): Add prototype.
6170         * types.h (DeleteResult): New type.
6171         * context.h (gpgme_context_s): Add DeleteResult to member result.
6172
6173         * delete.c (enum delete_problem): New type.
6174         (struct delete_result_s): New structure.
6175         (_gpgme_release_delete_result): New function.
6176         (delete_status_handler): Implement more status codes.
6177         (gpgme_op_delete): Return error on failure.
6178
6179         * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
6180
6181 2002-01-30  Marcus Brinkmann  <marcus@g10code.de>
6182
6183         * import.c (struct import_result_s): New structure.
6184         (_gpgme_release_import_result): New function.
6185         (append_xml_impinfo): Likewise.
6186         (import_status_handler): Implement.
6187         * gpgme.c (_gpgme_release_result): Add call to
6188         _gpgme_release_import_result.
6189         * ops.h (_gpgme_release_import_result): Add prototype.
6190         * types.h (ImportResult): New type.
6191         * context.h (gpgme_context_s): Add ImportResult to member result.
6192
6193         * encrypt.c (gpgme_op_encrypt): Code clean up.
6194
6195 2002-01-30  Marcus Brinkmann  <marcus@g10code.de>
6196
6197         * gpgme.h: Add lots of comment and fix the formatting.  Add
6198         gpgme_trustlist_end prototype.
6199
6200 2002-01-29  Marcus Brinkmann  <marcus@g10code.de>
6201
6202         * gpgme.h: Add new type GpgmeIdleFunc.  Change type of
6203         gpgme_register_idle to return and accept this type.
6204         * wait.c (gpgme_register_idle): Fix type.
6205         Save and return old value of idle_function.
6206
6207 2002-01-29  Werner Koch  <wk@gnupg.org>
6208
6209         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
6210
6211         * keylist.c (keylist_colon_handler): Add support for the new "crs"
6212         record type.
6213
6214 2002-01-22  Marcus Brinkmann  <marcus@g10code.de>
6215
6216         * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
6217         not assuan_pipe_disconnect.
6218
6219         * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
6220         jnlib (needed by assuan) statically into libgpgme.  Linking a
6221         static library into a shared library this way is not portable.
6222
6223 2002-01-22  Marcus Brinkmann  <marcus@g10code.de>
6224
6225         * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
6226         void**.
6227
6228 2002-01-22  Marcus Brinkmann  <marcus@g10code.de>
6229
6230         * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
6231         from off_t to size_t.
6232         * gpgme.h: Likewise.
6233
6234 2002-01-22  Marcus Brinkmann  <marcus@g10code.de>
6235
6236         * wait.c (_gpgme_wait_on_condition): If the process finished,
6237         reset the pending flag.  Also if the operation was cancelled.
6238
6239         (struct proc_s): Rename READY to DONE.
6240         (wait_item_s): Likewise.
6241         (set_process_ready): Rename to ...
6242         (set_process_done): ... this.
6243         (_gpgme_remove_proc_from_wait_queue): Call set_process_done
6244         instead set_process_ready.
6245         (_gpgme_wait_on_condition): Likewise.
6246         (do_select): Rename READY to DONE.
6247
6248         * verify.c (gpgme_op_verify): Do not set pending to zero here.
6249         * sign.c (gpgme_op_sign): Likewise.
6250         * import.c (gpgme_op_import): Likewise.
6251         * genkey.c (gpgme_op_genkey): Likewise.
6252         * export.c (gpgme_op_export): Likewise.
6253         * encrypt.c (gpgme_op_encrypt): Likewise.
6254         * delete.c (gpgme_op_delete): Likewise.
6255         * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
6256         * decrypt.c (gpgme_op_decrypt): Likewise.
6257
6258 2002-01-22  Marcus Brinkmann  <marcus@g10code.de>
6259
6260         * export.c: Cleanup.
6261
6262 2002-01-15  Marcus Brinkmann  <marcus@g10code.de>
6263
6264         * trustlist.c: Various source clean ups.
6265         (my_isdigit): Removed.
6266         (gpgme_op_trustlist_end): New function.
6267
6268 2002-01-13  Marcus Brinkmann  <marcus@g10code.de>
6269
6270         * gpgme.c: Various source clean ups, like renaming C to CTX where
6271         appropriate.
6272         (gpgme_new): Clear R_CTX before starting the work.
6273         (my_isdigit): Removed.
6274         (my_isxdigit): Likewise.
6275
6276         * data.c: Various source clean ups.
6277         (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
6278         (gpgme_data_new_with_read_cb): Similar for READ_CB.
6279         (gpgme_data_new_from_file): Loop over fread while EINTR.
6280         (gpgme_data_new_from_filepart): Rediddled a bit.  Allow LENGTH to
6281         be zero.  Loop over fread while EINTR.
6282
6283         (my_isdigit): Removed.
6284         (my_isxdigit): Likewise.
6285
6286 2001-12-21  Marcus Brinkmann  <marcus@g10code.de>
6287
6288         * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
6289         Pipe_Error where appropriate.
6290
6291 2001-12-19  Marcus Brinkmann  <marcus@g10code.de>
6292
6293         * engine.c: Include `string.h'.  Reported by Stéphane Corthésy.
6294
6295         * version.c (get_engine_info): Remove prototype.
6296
6297 2001-12-19  Marcus Brinkmann  <marcus@g10code.de>
6298
6299         * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
6300         Fill it with the servers fds, and pass it to assuan_pipe_connect.
6301
6302 2001-12-18  Marcus Brinkmann  <marcus@g10code.de>
6303
6304         * keylist.c (gpgme_op_keylist_end): New function.
6305         * gpgme.h (gpgme_op_keylist_end): New prototype.
6306
6307         * engine.h (gpgme_engine_check_version): Move prototype to ...
6308         * gpgme.h (gpgme_engine_check_version): ... here.
6309
6310         * genkey.c (gpgme_op_genkey_start): Remove unused variable.
6311
6312 2001-12-18  Marcus Brinkmann  <marcus@g10code.de>
6313
6314         * version.c (gpgme_get_engine_info): Reimplemented.
6315         (gpgme_check_engine): Reimplemented.
6316         (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
6317
6318         * engine.c: Include `io.h'.
6319         (gpgme_engine_get_info): New function.
6320         * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
6321         Add prototype.
6322
6323 2001-12-18  Marcus Brinkmann  <marcus@g10code.de>
6324
6325         * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
6326         * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
6327         Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
6328
6329         * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
6330         (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
6331         * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
6332         * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
6333         own function by call to _gpgme_engine_add_child_to_reap_list().
6334
6335         * wait.c: Include `engine.h'.
6336         (run_idle): Call _gpgme_engine_housecleaning(), not
6337         _gpgme_gpg_housecleaning().
6338
6339 2001-12-18  Marcus Brinkmann  <marcus@g10code.de>
6340
6341         * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
6342         Initialize the next field of the uid structure.
6343         (gpgme_key_get_as_xml): Do not list last uid first.
6344
6345 2001-12-17  Marcus Brinkmann  <marcus@g10code.de>
6346
6347         * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
6348         function [!ENABLE_GPGSM].
6349
6350 2001-12-14  Marcus Brinkmann  <marcus@g10code.de>
6351
6352         * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
6353         message_data, not SIG.
6354         (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
6355
6356         * sign.c (sign_status_handler): Call
6357         _gpgme_passphrase_status_handler early.
6358
6359 2001-12-14  Marcus Brinkmann  <marcus@g10code.de>
6360
6361         * engine-gpgsm.c: Revert last change.
6362
6363 2001-12-14  Marcus Brinkmann  <marcus@g10code.de>
6364
6365         * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
6366         handler when ending this operation, otherwise the wait function
6367         will sit on it.
6368
6369 2001-12-14  Marcus Brinkmann  <marcus@g10code.de>
6370
6371         * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
6372         (_gpgme_gpgsm_new): Initialize some more members.
6373         (_gpgme_gpgsm_release): Free the colon line handler's attic line.
6374         (gpgsm_status_handler): Rework the inline-data processing.
6375
6376 2001-12-13  Marcus Brinkmann  <marcus@g10code.de>
6377
6378         * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
6379         list that are not dup'ed, for those the close-on-exec flag is set
6380         now.
6381         * version.c (_gpgme_get_program_version): Remove first entry in
6382         CFD, as the close-on-exec flag is now set for this fd.
6383
6384 2001-12-13  Marcus Brinkmann  <marcus@g10code.de>
6385
6386         * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
6387         option to `ENCRYPT'.
6388         * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
6389         successfully.
6390
6391 2001-12-13  Marcus Brinkmann  <marcus@g10code.de>
6392
6393         * engine-gpgsm.c (close_notify_handler): New function.
6394         (_gpgme_gpgsm_new): Manage the file descriptors a
6395         bit differently.  Do not set close-on-exec flags.
6396         (_gpgme_gpgsm_op_decrypt): Do not set message_fd
6397         to -1, this is done by the close handler.
6398         (_gpgme_gpgsm_op_encrypt): Likewise.
6399         (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
6400         (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
6401         (_gpgme_gpgsm_op_sign): Likewise.
6402         (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
6403
6404         * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
6405         non-inherited file descriptor index of the pipe.
6406
6407 2001-12-13  Werner Koch  <wk@gnupg.org>
6408
6409         * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
6410         (gpgsm_status_handler): Pass datalines to a colon handler
6411         * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
6412         handler for gpgsm.
6413
6414         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
6415         pattern.
6416         (gpgsm_assuan_simple_command): Removed underscore from
6417         assuan_write_line.
6418         (_gpgme_gpgsm_start): Ditto.
6419         (gpgsm_assuan_simple_command): Replaced interal Assuan read
6420         function by the new assuan_read_line.  Removed the use of the
6421         internal header.
6422         (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
6423         (_gpgme_gpgsm_start): Use the documented way to get an fd from
6424         assuan.
6425
6426         * keylist.c (keylist_colon_handler): Handle "crt" records
6427         * key.h (gpgme_key_s): Add an x509 flag.
6428         * key.c (parse_x509_user_id): New.
6429         (_gpgme_key_append_name): Handle x.509 names.
6430
6431 2001-12-05  Marcus Brinkmann  <marcus@g10code.de>
6432
6433         * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
6434         version of assuan.
6435
6436 2001-12-05  Marcus Brinkmann  <marcus@g10code.de>
6437
6438         * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
6439         (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
6440         output descriptor.
6441         (_gpgme_gpgsm_op_sign): Likewise.
6442
6443 2001-12-05  Marcus Brinkmann  <marcus@g10code.de>
6444
6445         * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
6446         occurs.
6447
6448 2001-11-26  Marcus Brinkmann  <marcus@g10code.de>
6449
6450         * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
6451
6452 2001-11-24  Marcus Brinkmann  <marcus@g10code.de>
6453
6454         * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
6455         Deal with assuan read line returning more than one line (for now).
6456
6457 2001-11-23  Marcus Brinkmann  <marcus@g10code.de>
6458
6459         * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
6460         the current protocol definition.
6461
6462 2001-11-23  Marcus Brinkmann  <marcus@g10code.de>
6463
6464         * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
6465         ends of the pipe.
6466
6467 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6468
6469         * engine-gpgsm.c: Include stdlib.h and string.h.  Also include,
6470         for now, rungpg.h and status-table.h.
6471         (gpgsm_status_handler): Implement more of the status handler.
6472
6473 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6474
6475         * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
6476         (_gpgme_engine_op_delete): Likewise.
6477         (_gpgme_engine_op_encrypt): Likewise.
6478         (_gpgme_engine_op_export): Likewise.
6479         (_gpgme_engine_op_genkey): Likewise.
6480         (_gpgme_engine_op_keylist): Likewise.
6481         (_gpgme_engine_op_sign): Likewise.
6482         (_gpgme_engine_op_trustlist): Likewise.
6483
6484         * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
6485         (gpgsm_assuan_simple_command): Likewise.
6486         (gpgsm_set_recipients): Likewise.
6487         (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
6488         (_gpgme_gpgsm_op_delete): New function.
6489         (_gpgme_gpgsm_op_export): Likewise.
6490         (_gpgme_gpgsm_op_genkey): Likewise.
6491         (_gpgme_gpgsm_op_sign): Likewise.
6492         (_gpgme_gpgsm_op_keylist): Likewise.
6493         (_gpgme_gpgsm_op_trustlist): Likewise.
6494         (_gpgme_gpgsm_release): Release command.
6495         (_gpgme_gpgsm_op_decrypt): Allocate command.
6496         (_gpgme_gpgsm_op_import): Likewise.
6497         (gpgsm_status_handler): Also treat `ERR' strings as EOF.
6498
6499 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6500
6501         * gpgme.h (gpgme_set_protocol): New prototype.
6502
6503 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6504
6505         * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
6506         (_gpgme_gpgsm_op_import): Likewise.
6507
6508 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6509
6510         * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
6511         keep them seperate.
6512         (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
6513
6514 2001-11-22  Werner Koch  <wk@gnupg.org>
6515
6516         * engine-gpgsm.c: Include more headers so that NULL and mk_error
6517         is defined even with an undefined GPGSM_PATH.
6518
6519 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6520
6521         * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
6522         gpg_outbound_handler): Moved to ...
6523         * data.c (_gpgme_data_inbound_handler, write_mem_data,
6524         write_cb_data, _gpgme_data_outbound_handler): ... here.  Make the
6525         _gpgme_* ones non-static.
6526         * data.c: Include io.h.
6527
6528         * ops.h (_gpgme_data_inbound_handler): New prototype.
6529         (_gpgme_data_outbound_handler): Likewise.
6530         (_gpgme_gpg_spawn): Use these new functions.
6531
6532         * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
6533         _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
6534         _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
6535         _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
6536         _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
6537         _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
6538         Include <rungpg.h> for status handler function.
6539
6540         * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
6541         input_data, output_fd, output_data, message_fd, message_data, command
6542         and status.
6543         (_gpgme_gpgsm_new): Open input, output and message pipes before
6544         connecting to the client.  Close server's ends afterwards.
6545         (_gpgme_gpgsm_release): Close open file descriptors.  Remove
6546         server process from wait queue.
6547         (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
6548         _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
6549
6550         * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
6551         (_gpgme_engine_set_status_handler): Likewise.
6552         (_gpgme_engine_op_verify): Likewise.
6553
6554 2001-11-21  Marcus Brinkmann  <marcus@g10code.de>
6555
6556         * context.h: Do not include rungpg.h, but engine.h.
6557         (struct gpgme_context_s): Replace member gpg with engine.
6558         * gpgme.c (gpgme_release): Release engine, not gpg.
6559
6560         * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
6561         moved ...
6562         * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
6563         Make static, change order of arguments, and return an error value.
6564         * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
6565
6566         * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
6567         (_gpgme_gpg_op_encrypt): Likewise.
6568         (_gpgme_gpg_op_decrypt): Likewise.
6569         (_gpgme_gpg_op_delete): Likewise.
6570         (_gpgme_gpg_op_export): Likewise.
6571         (_gpgme_gpg_op_genkey): Likewise.
6572         (_gpgme_gpg_op_import): Likewise.
6573         (_gpgme_gpg_op_keylist): Likewise.
6574         (_gpgme_gpg_op_sign): Likewise.
6575         (_gpgme_gpg_op_trustlist): Likewise.
6576         * rungpg.c (_gpgme_gpg_op_verify): New function.
6577         (_gpgme_gpg_op_encrypt): Likewise.
6578         (_gpgme_gpg_op_decrypt): Likewise.
6579         (_gpgme_gpg_op_delete): Likewise.
6580         (_gpgme_gpg_op_export): Likewise.
6581         (_gpgme_gpg_op_genkey): Likewise.
6582         (_gpgme_gpg_op_import): Likewise.
6583         (_gpgme_gpg_op_keylist): Likewise.
6584         (_gpgme_gpg_op_sign): Likewise.
6585         (_gpgme_gpg_op_trustlist): Likewise.
6586
6587         * engine.h (_gpgme_engine_set_status_handler): Add prototype.
6588         (_gpgme_engine_set_command_handler): Likewise.
6589         (_gpgme_engine_set_colon_line_handler): Likewise.
6590         (_gpgme_engine_op_decrypt): Likewise.
6591         (_gpgme_engine_op_delete): Likewise.
6592         (_gpgme_engine_op_encrypt): Likewise.
6593         (_gpgme_engine_op_export): Likewise.
6594         (_gpgme_engine_op_genkey): Likewise.
6595         (_gpgme_engine_op_import): Likewise.
6596         (_gpgme_engine_op_keylist): Likewise.
6597         (_gpgme_engine_op_sign): Likewise.
6598         (_gpgme_engine_op_trustlist): Likewise.
6599         (_gpgme_engine_op_verify): Likewise.
6600         (_gpgme_engine_start): Likewise.
6601         * engine.c (_gpgme_engine_set_status_handler): New function.
6602         (_gpgme_engine_set_command_handler): Likewise.
6603         (_gpgme_engine_set_colon_line_handler): Likewise.
6604         (_gpgme_engine_op_decrypt): Likewise.
6605         (_gpgme_engine_op_delete): Likewise.
6606         (_gpgme_engine_op_encrypt): Likewise.
6607         (_gpgme_engine_op_export): Likewise.
6608         (_gpgme_engine_op_genkey): Likewise.
6609         (_gpgme_engine_op_import): Likewise.
6610         (_gpgme_engine_op_keylist): Likewise.
6611         (_gpgme_engine_op_sign): Likewise.
6612         (_gpgme_engine_op_trustlist): Likewise.
6613         (_gpgme_engine_op_verify): Likewise.
6614         (_gpgme_engine_start): Likewise.
6615
6616         * verify.c (gpgme_op_verify_start): Reimplement in terms of above
6617         functions.
6618         * encrypt.c (gpgme_op_encrypt_start): Likewise.
6619         * decrypt.c (_gpgme_decrypt_start): Likewise.
6620         * passphrase.c (_gpgme_passphrase_start): Likewise.
6621         * keylist.c (gpgme_op_keylist_start): Likewise.
6622
6623 2001-11-20  Marcus Brinkmann  <marcus@g10code.de>
6624
6625         * types.h: Add types EngineObject and GpgsmObject.
6626
6627         * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
6628         engine-gpgsm.c, engine.h and engine.c.
6629         * engine.h: New file.
6630         * engine.c: Likewise.
6631         * engine-gpgsm.h: Likewise.
6632         * engine-gpgsm.c: Likewise.
6633
6634         * rungpg.c (_gpgme_gpg_get_version): New function.
6635         (_gpgme_gpg_check_version): Likewise.
6636         * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
6637         _gpgme_gpg_check_version.
6638
6639         * version.c (compare_versions): Rename to ...
6640         (_gpgme_compare_versions): ... this.  Make non-static.
6641         (gpgme_check_version): Use _gpgme_compare_versions rather than
6642         compare_versions.
6643         (gpgme_check_engine): Likewise.
6644         * ops.h (_gpgme_get_program_version): Add prototype.
6645
6646 2001-11-20  Marcus Brinkmann  <marcus@g10code.de>
6647
6648         * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
6649         (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
6650         (libgpgme_la_LIBADD): Likewise.
6651
6652 2001-11-20  Marcus Brinkmann  <marcus@g10code.de>
6653
6654         * version.c: Remove global variables lineno and
6655         tmp_engine_version.
6656         (version_handler): Removed.
6657         (_gpgme_get_program_version): New function.
6658         (get_engine_info): Don't use context and version_handler,
6659         but _gpgme_get_program_version.
6660         * ops.h (_gpgme_get_program_version): Add prototype for
6661         _gpgme_get_program_version (we expect to use it elsewhere soon).
6662
6663 2001-11-18  Marcus Brinkmann  <marcus@g10code.de>
6664
6665         * version.c (get_engine_info): If GnuPG is not available, return
6666         an error message.
6667         * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
6668         undefined.
6669         (_gpgme_get_gpgsm_path): New function.
6670         * w32-util.c (find_program_in_registry): New static function.
6671         (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined.  Rework
6672         to use find_program_in_registry.
6673         (_gpgme_get_gpgsm_path): New function.
6674         (util.h): Prototype _gpgme_get_gpgsm_path).
6675         * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
6676         returns non-null.
6677
6678 2001-11-16  Marcus Brinkmann  <marcus@g10code.de>
6679
6680         * decrypt-verify.c: New file.
6681         * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
6682         * types.h: Add decrypt-verify types.
6683         * ops.h: Likewise.
6684         * context.h: Add result type for decrypt-verify.
6685         * gpgme.h: Add decrypt-verify prototypes.
6686
6687         * decrypt.c (decrypt_status_handler): Renamed to ...
6688         (_gpgme_decrypt_status_handler): ... this.  Make non-static.
6689         (_gpgme_decrypt_start): New function, derived from
6690         gpgme_op_decrypt_start.
6691         (gpgme_op_decrypt_start): Reimplement in terms of
6692         _gpgme_decrypt_start.
6693         (_gpgme_decrypt_result): New function to retrieve error value.
6694         (gpgme_op_decrypt): Use _gpgme_decrypt_result.
6695         * ops.h: Add prototypes for new functions.
6696
6697         * verify.c (verify_status_handler): Renamed to ...
6698         (_gpgme_verify_status_handler): ... this.  Make non-static.
6699         (gpgme_op_verify_start): Use new function name.
6700         (intersect_stati): Renamed to ...
6701         (_gpgme_intersect_stati): ... this.  Make non-static.
6702         (gpgme_op_verify): Use new name.
6703         * ops.h: Add prototypes for new functions.
6704
6705 2001-11-16  Marcus Brinkmann  <marcus@g10code.de>
6706
6707         * passphrase.c: New file.
6708         * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
6709         * ops.h (_gpgme_passphrase_result): Add prototypes from
6710         passphrase.c.
6711         * types.h: Likewise.
6712         * context.h: Add member passphrase to result.
6713         * gpgme.c (_gpgme_release_result): Release passphrase member.
6714
6715         * decrypt.c: Some formatting and variable name changes (like
6716         CTX instead C).
6717         (struct decrypt_result_s): Remove members now found in
6718         passphrase result.
6719         (_gpgme_release_decrypt_result): Don't release removed members.
6720         (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
6721         and don't handle the cases catched there.
6722         (command_handler): Removed.
6723         (gpgme_op_decrypt_start): Don't set command handler, but invoke
6724         _gpgme_passphrase_start which does it.
6725         (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
6726         cases covered by it.
6727
6728         * sign.c Some formatting and variable name changes (like
6729         CTX instead C).
6730         (struct sign_result_s): Remove members now found in
6731         passphrase result.
6732         (_gpgme_release_sign_result): Don't release removed members.
6733         (sign_status_handler): Call _gpgme_passphrase_status_handler,
6734         and don't handle the cases catched there.
6735         (command_handler): Removed.
6736         (gpgme_op_sign_start): Don't set command handler, but invoke
6737         _gpgme_passphrase_start which does it.
6738         (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
6739         cases covered by it.
6740
6741 2001-11-15  Marcus Brinkmann  <marcus@g10code.de>
6742
6743         * decrypt.c (command_handler): Fix last change.
6744
6745 2001-11-15  Marcus Brinkmann  <marcus@g10code.de>
6746
6747         * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
6748         Rename R2 to NEXT_RESULT.
6749         (intersect_stati): Rename RES to RESULT.
6750         (gpgme_get_sig_status): Likewise.  Do not check return_type, but
6751         the member verify of result.
6752         (gpgme_get_sig_key): Likewise.
6753
6754         * sign.c (_gpgme_release_sign_result): Rename RES to RESULT.  If
6755         RESULT is zero, return.
6756         (sign_status_handler, command_handler): Do not check return_type,
6757         but the member sign of result.
6758         (gpgme_op_sign): Likewise.  Drop assertion.
6759
6760         * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
6761         If RESULT is zero, return.
6762         (encrypt_status_handler): Do not check return_type, but the member
6763         encrypt of result.
6764         (gpgme_op_encrypt): Likewise.  Drop assertion.
6765
6766         * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
6767         (create_result_struct): Do not set result_type.
6768         (command_handler, decrypt_status_handler): Do not check
6769         return_type, but the member decrypt of result.
6770         (gpgme_op_decrypt): Likewise.  Drop assertion.
6771
6772         * context.h (enum ResultType): Removed.
6773         (struct gpgme_context_s): Remove member result_type.
6774         (struct result): Replaces union result.
6775         * gpgme.c: Include string.h.
6776         (_gpgme_release_result): Release all members of c->result, which
6777         is now a struct.  Zero out all members of the struct afterwards.
6778
6779 2001-11-11  Marcus Brinkmann  <marcus@g10code.de>
6780
6781         * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
6782         Release all members of the list GPG->arglist.
6783         Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
6784
6785 2001-11-02  Marcus Brinkmann  <marcus@g10code.de>
6786
6787         * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
6788
6789         * key.c: Include string.h.
6790         * data.c: Likewise.
6791         * recipient.c: Likewise.
6792
6793 2001-10-29  Marcus Brinkmann  <marcus@g10code.de>
6794
6795         * context.h: New member signers_len.
6796         * signers.c (gpgme_signers_clear): Require that signers are
6797         non-NULL with assertion.  Use signers_len to determine how much
6798         keys to release.  Add documentation.
6799         (gpgme_signers_add): Use signers_len to determine if the buffer is
6800         large enough.  Use xtryrealloc rather than xtrymalloc and copying.
6801         Add documentation.
6802         (gpgme_signers_enum): Use signers_len to determine if key is
6803         available.  Add documentation.
6804
6805 2001-10-22  Marcus Brinkmann  <marcus@g10code.de>
6806
6807         * data.c (_gpgme_data_append): Check if LENGTH is smaller than
6808         ALLOC_CHUNK, not DH->length.
6809
6810 2001-10-17  Marcus Brinkmann  <marcus@g10code.de>
6811
6812         * gpgme.c (gpgme_set_protocol): Fix last change.
6813
6814 2001-10-15  Werner Koch  <wk@gnupg.org>
6815
6816         * gpgme.h (GpgmeProtocol): New.
6817         * gpgme.c (gpgme_set_protocol): New.
6818
6819 2001-09-26  Werner Koch  <wk@gnupg.org>
6820
6821         * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
6822         (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
6823
6824 2001-09-17  Werner Koch  <wk@gnupg.org>
6825
6826         * keylist.c (finish_key): Shortcut for no tmp_key.  Changed all
6827         callers to use this function without a check for tmp_key.
6828
6829         * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
6830         emptying the queue.  Bug reported by Stéphane Corthésy.
6831
6832 2001-09-12  Werner Koch  <wk@gnupg.org>
6833
6834         * data.c (gpgme_data_rewind): Allow rewind for callbacks.
6835
6836 2001-09-07  Werner Koch  <wk@gnupg.org>
6837
6838         * rungpg.h: Add NO_RECP.
6839         * encrypt.c (encrypt_status_handler): Take on No_RECP.
6840         (gpgme_op_encrypt): Better error return.
6841
6842         * verify.c (verify_status_handler): Take on NODATA.
6843
6844 2001-09-03  Werner Koch  <wk@gnupg.org>
6845
6846         * rungpg.h: Added STATUS_INV_RECP.
6847         * gpgme.c (_gpgme_release_result): Add support for new
6848         EncryptResult object.
6849         * encrypt.c (append_xml_encinfo): New.
6850         (encrypt_status_handler): Add some status parsing.
6851         (_gpgme_release_encrypt_result): New.
6852
6853 2001-08-29  Werner Koch  <wk@gnupg.org>
6854
6855         * recipient.c (gpgme_recipients_release): Free the list.  By Timo.
6856
6857         * keylist.c (keylist_colon_handler): Do a finish key if we receive
6858         an EOF here.  This is probably the reason for a lot of bugs
6859         related to keylisting.  It is so obvious.  Kudos to Enno Cramer
6860         for pointing that out.
6861
6862 2001-08-28  Werner Koch  <wk@gnupg.org>
6863
6864         * gpgme.c, gpgme.h (gpgme_get_op_info): New.
6865         (_gpgme_set_op_info): New.
6866         (_gpgme_release_result): Reset the op_info here.
6867         * sign.c (append_xml_siginfo): New.
6868         (sign_status_handler): Store the sig create information.
6869
6870 2001-07-31  Werner Koch  <wk@gnupg.org>
6871
6872         * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
6873
6874 2001-07-30  Werner Koch  <wk@gnupg.org>
6875
6876         * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
6877
6878         * rungpg.c (build_argv): Disable armor comments
6879         * w32-io.c (build_commandline): Need to add quotes here
6880
6881 2001-07-24  Werner Koch  <wk@gnupg.org>
6882
6883         * data.c (gpgme_data_read): Add a a way to return the available bytes.
6884
6885 2001-07-23  Werner Koch  <wk@gnupg.org>
6886
6887         * util.c: Removed stpcpy() because we use the version from jnlib.
6888
6889 2001-07-19  Werner Koch  <wk@gnupg.org>
6890
6891         * mkstatus: Define the collating sequence for sort.
6892
6893 2001-06-26  Werner Koch  <wk@gnupg.org>
6894
6895         * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
6896
6897 2001-06-15  Werner Koch  <wk@gnupg.org>
6898
6899         * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
6900         to Timo for pointing this out.
6901
6902 2001-06-01  Werner Koch  <wk@gnupg.org>
6903
6904         * debug.c (_gpgme_debug_begin): Fixed a /tmp race.  Noted by
6905         Johannes Poehlmann.
6906
6907 2001-05-28  Werner Koch  <wk@gnupg.org>
6908
6909         * version.c (gpgme_check_engine): Stop version number parsing at
6910         the opening angle and not the closing one.  By Tommy Reynolds.
6911
6912 2001-05-01  José Carlos García Sogo <jose@jaimedelamo.eu.org>
6913
6914         * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
6915         line, because it gave an error if another operation had been made
6916         before using the same context.
6917
6918         * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
6919         one line to release the gpg object in the context (if any).
6920
6921 2001-04-26  Werner Koch  <wk@gnupg.org>
6922
6923         * key.c, key.h (_gpgme_key_cache_init): New.
6924         (_gpgme_key_cache_add): New.
6925         (_gpgme_key_cache_get): New.
6926         * version.c (do_subsystem_inits): Init the cache.
6927         * keylist.c (finish_key): Put key into the cache
6928         * verify.c (gpgme_get_sig_key): First look into the cache.
6929
6930 2001-04-19  Werner Koch  <wk@gnupg.org>
6931
6932         * keylist.c (parse_timestamp): Adjusted for the changed
6933         --fixed-list-mode of gpg 1.0.4h.
6934
6935 2001-04-05  Werner Koch  <wk@gnupg.org>
6936
6937         * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
6938
6939 2001-04-04  Werner Koch  <wk@gnupg.org>
6940
6941         * w32-io.c (_gpgme_io_select): Don't select on the writer if there
6942         are still bytes pending.  Timo found this not easy to track down
6943         race condition.
6944
6945 2001-04-02  Werner Koch  <wk@gnupg.org>
6946
6947         * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
6948         * key.c (gpgme_key_get_ulong_attr): And return those attribs.
6949
6950         * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
6951         the mode set in the current context.  Suggested by Timo.
6952
6953         * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
6954         can_encrypt. By Timo.
6955
6956 2001-03-30  Werner Koch  <wk@gnupg.org>
6957
6958         * debug.c (debug_init): Allow to specify a debug file.
6959         (_gpgme_debug_level): New.
6960
6961         * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
6962         (_gpgme_io_select): Debug only with level > 2.
6963
6964 2001-03-15  Werner Koch  <wk@gnupg.org>
6965
6966         * rungpg.c: Included time.h.
6967
6968         * key.h: New keyflags for capabilities.
6969         * keylist.c (set_mainkey_capability, set_subkey_capability): New.
6970         (keylist_colon_handler): Parse them.
6971         * gpgme.h: New attribute values for capabilties.
6972         * key.c (gpgme_key_get_string_attr): Return them.
6973         (capabilities_to_string): New.
6974         (gpgme_key_get_ulong_attr): Return the global caps.
6975
6976 2001-03-14  Werner Koch  <wk@gnupg.org>
6977
6978         * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
6979         Thanks to Jan Oliver Wagner.
6980
6981 2001-03-13  Werner Koch  <wk@gnupg.org>
6982
6983         * context.h: Add invalid and revoke flags to user_id structure.
6984         * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
6985         (keylist_colon_handler): Adjust for that.
6986         (set_userid_flags): New.
6987         (set_mainkey_trust_info): Handle new key invalid flag
6988         (set_subkey_trust_info): Ditto.
6989         * gpgme.h: Add new attributes for key and user ID flags.
6990         * key.c (_gpgme_key_append_name): Init these flags
6991         (gpgme_key_get_as_xml): Print them.
6992         (one_uid_as_xml): New helper for above.
6993         (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
6994         Return the new attributes.  Enhanced, so that subkey information
6995         can be returned now.
6996
6997 2001-02-28  Werner Koch  <wk@gnupg.org>
6998
6999         * w32-io.c (destroy_reader): Set stop_me flag.
7000         (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
7001         (_gpgme_io_write): Use a writer thread to avaoid blocking.
7002         (_gpgme_io_close): Cleanup a writer thread
7003         (_gpgme_io_select): Repalce tthe faked wait on writing by a real
7004         waiting which is now possible due to the use of a writer thread.
7005
7006 2001-02-20  Werner Koch  <wk@gnupg.org>
7007
7008         * w32-io.c (destroy_reader,kill_reader): New.
7009         (create_reader, reader): Add a new event to stop the thread.
7010         (_gpgme_io_close): Kill the reader thread.
7011
7012         * posix-io.c (_gpgme_io_select): Handle frozen fds here.
7013         * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
7014
7015         * wait.c: Reworked the whole thing.
7016         * rungpg.c (_gpgme_gpg_new): Init pid to -1.
7017         (_gpgme_gpg_release): Remove the process from the wait queue.
7018
7019 2001-02-19  Werner Koch  <wk@gnupg.org>
7020
7021         * w32-io.c (_gpgme_io_set_close_notify): New.
7022         (_gpgme_io_close): Do the notification.
7023
7024         * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
7025         microseconds.
7026
7027         * wait.c (remove_process): Don't close the fd here.
7028         (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
7029         (_gpgme_wait_on_condition): Remove the assert on the queue and
7030         break out if we could not find the queue.  The whole thing should
7031         be reworked.
7032
7033         * posix-io.c (_gpgme_io_set_close_notify): New.
7034         (_gpgme_io_close): Do the notification.
7035
7036         * rungpg.c (close_notify_handler): New.
7037         (_gpgme_gpg_new): Register a callback for the fd.
7038         (_gpgme_gpg_set_colon_line_handler): Ditto.
7039         (build_argv): Ditto
7040
7041 2001-02-13  Werner Koch  <wk@gnupg.org>
7042
7043         * rungpg.c (struct reap_s): Replaced pid_t by int.
7044
7045         * types.h: Add ulong typedef.
7046
7047         * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
7048         (_gpgme_gpg_release): Reap children.
7049         * io.h, posix-io.c (_gpgme_io_kill): New.
7050         * w32-io.c (_gpgme_io_kill): New (dummy).
7051
7052         * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
7053
7054         * posix-io.c (_gpgme_io_read): Add some debug output.
7055         (_gpgme_io_write): Ditto.
7056         (_gpgme_io_select): Increased the timeout.
7057
7058 2001-02-12  Werner Koch  <wk@gnupg.org>
7059
7060         Enhanced the signature verification, so that it can how handle
7061         more than one signature and is able to return more information on
7062         the signatures.
7063         * verify.c (gpgme_get_sig_key): New.
7064         (gpgme_get_sig_status): New.
7065
7066         * gpgme.h: Add stdio.h.
7067         (GpgmeSigStat): New status DIFF.
7068
7069 2001-02-01  Werner Koch  <wk@gnupg.org>
7070
7071         * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE.  Add Debug
7072         code to all Set/ResetEvent().
7073
7074         * rungpg.c (read_status): Check for end of stream only if we have
7075         an r.  By Timo.
7076
7077 2001-01-31  Werner Koch  <wk@gnupg.org>
7078
7079         * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
7080         (propagate_term_results,clear_active_fds): Removed.
7081         (count_active_fds): Renamed to ..
7082         (count_active_and_thawed_fds): .. this and count only thawed fds.
7083
7084         * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
7085         status.eof ;-)
7086
7087 2001-01-30  Werner Koch  <wk@gnupg.org>
7088
7089         * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
7090
7091         * version.c (get_engine_info): Return better error information.
7092
7093         * posix-util.c, w32-util.c: New.
7094         (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
7095         * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
7096
7097         * signers.c (gpgme_signers_add): Ooops, one should test code and
7098         not just write it; the newarr was not assigned.  Thanks to José
7099         for pointing this out.  Hmmm, still not tested, why should a coder
7100         test his fix :-)
7101
7102         * w32-io.c: Does now use reader threads, so that we can use
7103         WaitForMultipleObjects.
7104         * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
7105         Does currently only work for W32.
7106
7107         * debug.c, util.h : New. Changed all fprintfs to use this new
7108         set of debugging functions.
7109
7110 2001-01-23  Werner Koch  <wk@gnupg.org>
7111
7112         * data.c (_gpgme_data_release_and_return_string): Fixed string
7113         termination.
7114
7115 2001-01-22  Werner Koch  <wk@gnupg.org>
7116
7117         * delete.c: New.
7118
7119         * signers.c: New.
7120         * key.c (gpgme_key_ref, gpgme_key_unref): New.
7121         * sign.c (gpgme_op_sign_start): Allow the use of other keys.
7122
7123         * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
7124         * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
7125
7126 2001-01-05  Werner Koch  <wk@gnupg.org>
7127
7128         * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
7129
7130
7131  Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,
7132            2011 g10 Code GmbH
7133
7134  This file is free software; as a special exception the author gives
7135  unlimited permission to copy and/or distribute it, with or without
7136  modifications, as long as this notice is preserved.
7137
7138  This file is distributed in the hope that it will be useful, but
7139  WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
7140  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.