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