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