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