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