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