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