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