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