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