Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F27670706
D122.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
2 KB
Subscribers
None
D122.id.diff
View Options
Index: gpgme-1.3.0/doc/gpgme.texi
===================================================================
--- gpgme-1.3.0/doc/gpgme.texi
+++ gpgme-1.3.0/doc/gpgme.texi
@@ -5312,6 +5312,8 @@
operation in @acronym{GPGME} is not predictable.
@example
+#include <stdlib.h>
+#include <errno.h>
#include <pthread.h>
#include <sys/types.h>
#include <gpgme.h>
@@ -5391,7 +5393,7 @@
if (type == GPGME_EVENT_DONE)
@{
result->done = 1;
- result->err = *type_data;
+ result->err = *(gpgme_error_t*)type_data;
@}
@}
@end example
@@ -5405,16 +5407,17 @@
@{
fd_set rfds;
fd_set wfds;
+ struct one_fd *fds = loop->fds;
int i, n;
int any = 0;
pthread_mutex_lock (&loop->lock);
FD_ZERO (&rfds);
FD_ZERO (&wfds);
- for (i = 0; i < FDLIST_MAX; i++)
- if (fdlist[i].fd != -1)
- FD_SET (fdlist[i].fd, fdlist[i].dir ? &rfds : &wfds);
- pthread_mutex_unlock (&loop->unlock);
+ for (i = 0; i < MAX_FDS; i++)
+ if (fds[i].fd != -1)
+ FD_SET (fds[i].fd, fds[i].dir ? &rfds : &wfds);
+ pthread_mutex_unlock (&loop->lock);
do
@{
@@ -5426,11 +5429,11 @@
return n; /* Error or timeout. */
pthread_mutex_lock (&loop->lock);
- for (i = 0; i < FDLIST_MAX && n; i++)
+ for (i = 0; i < MAX_FDS && n; i++)
@{
- if (fdlist[i].fd != -1)
+ if (fds[i].fd != -1)
@{
- if (FD_ISSET (fdlist[i].fd, fdlist[i].dir ? &rfds : &wfds))
+ if (FD_ISSET (fds[i].fd, fds[i].dir ? &rfds : &wfds))
@{
assert (n);
n--;
@@ -5438,7 +5441,7 @@
/* The I/O callback handler can register/remove callbacks,
so we have to unlock the file descriptor list. */
pthread_mutex_unlock (&loop->lock);
- (*fdlist[i].fnc) (fdlist[i].fnc_data, fdlist[i].fd);
+ (*fds[i].fnc) (fds[i].fnc_data, fds[i].fd);
pthread_mutex_lock (&loop->lock);
@}
@}
@@ -5457,7 +5460,7 @@
ret = do_select (loop);
@}
while (ret >= 0 && !result->done);
- return ret;
+ return;
@}
@end example
@@ -5472,9 +5475,8 @@
gpgme_ctx_t ctx;
gpgme_error_t err;
gpgme_data_t sig, text;
- gpgme_sig_stat_t status;
int i;
- struct gpgme_io_cb_ts io_cbs =
+ struct gpgme_io_cbs io_cbs =
@{
add_io_cb,
&loop,
@@ -5483,12 +5485,13 @@
&result
@};
- init_gpgme (void);
+ gpgme_check_version (NULL);
/* Initialize the loop structure. */
- loop.lock = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
+ loop.lock = lock;
for (i = 0; i < MAX_FDS; i++)
- loop->fds[i].fd = -1;
+ loop.fds[i].fd = -1;
/* Initialize the result structure. */
result.done = 0;
@@ -5501,7 +5504,7 @@
if (!err)
@{
gpgme_set_io_cbs (ctx, &io_cbs);
- err = gpgme_op_verify_start (ctx, sig, text, &status);
+ err = gpgme_op_verify_start (ctx, sig, text, NULL);
@}
if (err)
@{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 14, 10:33 PM (16 h, 53 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b8/de/009656a071a382b37b5a2fedc775
Attached To
D122: 280_gpgme-callbacks-example.patch
Event Timeline
Log In to Comment