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