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