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