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