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