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