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