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