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