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