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