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