diff options
author | Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de> | 2011-09-26 16:42:50 +0200 |
---|---|---|
committer | Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de> | 2012-01-03 22:45:12 +0100 |
commit | e23e6f2bd49f415f4fdca013e4f61e1b17995a51 (patch) | |
tree | f969efed88efaa7f7012642b6b7e76908f64bd86 /src | |
parent | 6ff1083166366b9d627e5e909f245cfb119b27a7 (diff) | |
download | libassuan-e23e6f2bd49f415f4fdca013e4f61e1b17995a51.tar.gz |
Make assuan portable to NPTH.
Diffstat (limited to 'src')
-rw-r--r-- | src/assuan.h.in | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/assuan.h.in b/src/assuan.h.in index 5c30a99..2e43c81 100644 --- a/src/assuan.h.in +++ b/src/assuan.h.in @@ -510,6 +510,37 @@ int __assuan_connect (assuan_context_t ctx, int sock, struct sockaddr *addr, soc extern struct assuan_system_hooks _assuan_system_pth; #define ASSUAN_SYSTEM_PTH &_assuan_system_pth +#define ASSUAN_SYSTEM_NPTH_IMPL \ + static void _assuan_npth_usleep (assuan_context_t ctx, unsigned int usec) \ + { (void) ctx; npth_usleep (usec); } \ + static ssize_t _assuan_npth_read (assuan_context_t ctx, assuan_fd_t fd, \ + void *buffer, size_t size) \ + { (void) ctx; return npth_read (fd, buffer, size); } \ + static ssize_t _assuan_npth_write (assuan_context_t ctx, assuan_fd_t fd, \ + const void *buffer, size_t size) \ + { (void) ctx; return npth_write (fd, buffer, size); } \ + static int _assuan_npth_recvmsg (assuan_context_t ctx, assuan_fd_t fd, \ + assuan_msghdr_t msg, int flags) \ + { (void) ctx; return npth_recvmsg (fd, msg, flags); } \ + static int _assuan_npth_sendmsg (assuan_context_t ctx, assuan_fd_t fd, \ + const assuan_msghdr_t msg, int flags) \ + { (void) ctx; return npth_sendmsg (fd, msg, flags); } \ + static pid_t _assuan_npth_waitpid (assuan_context_t ctx, pid_t pid, \ + int nowait, int *status, int options) \ + { (void) ctx; \ + if (!nowait) return npth_waitpid (pid, status, options); \ + else return 0; } \ + \ + struct assuan_system_hooks _assuan_system_npth = \ + { ASSUAN_SYSTEM_HOOKS_VERSION, _assuan_npth_usleep, __assuan_pipe, \ + __assuan_close, _assuan_npth_read, _assuan_npth_write, \ + _assuan_npth_recvmsg, _assuan_npth_sendmsg, \ + __assuan_spawn, _assuan_npth_waitpid, __assuan_socketpair, \ + __assuan_socket, __assuan_connect } + +extern struct assuan_system_hooks _assuan_system_npth; +#define ASSUAN_SYSTEM_NPTH &_assuan_system_npth + @include:w32ce-add@ #ifdef __cplusplus |