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