nt protocol);
int __assuan_connect (assuan_context_t ctx, assuan_fd_t sock,
                      struct sockaddr *addr, socklen_t length);
ssize_t __assuan_read (assuan_context_t ctx, assuan_fd_t fd,
                       void *buffer, size_t size);
ssize_t __assuan_write (assuan_context_t ctx, assuan_fd_t fd,
                        const void *buffer, size_t size);
int __assuan_recvmsg (assuan_context_t ctx, assuan_fd_t fd,
                      assuan_msghdr_t msg, int flags);
int __assuan_sendmsg (assuan_context_t ctx, assuan_fd_t fd,
                      const assuan_msghdr_t msg, int flags);
assuan_pid_t __assuan_waitpid (assuan_context_t ctx, assuan_pid_t pid,
                               int nowait, int *status, int options);

#if defined(LIBASSUAN_API_REQUESTED) && LIBASSUAN_API_REQUESTED >= 3
#defined ASSUAN_NO_NPTH_SYSTEM_HOOKS_ANY_MORE 1
#endif

#if defined(ASSUAN_REALLY_REQUIRE_V2_NPTH_SYSTEM_HOOKS) \
    || !defined(ASSUAN_NO_NPTH_SYSTEM_HOOKS_ANY_MORE)
/* Standard system hooks for nPth.  */
#define ASSUAN_SYSTEM_NPTH_IMPL						\
  static void _assuan_npth_usleep (assuan_context_t ctx, unsigned int usec) \
  { npth_unprotect();				                        \
    __assuan_usleep (ctx, usec);					\
    npth_protect(); }							\
  static ssize_t _assuan_npth_read (assuan_context_t ctx, assuan_fd_t fd, \
				    void *buffer, size_t size)		\
  { ssize_t res; (void) ctx; npth_unprotect();				\
    res = __assuan_read (ctx, fd, buffer, size);			\
    npth_protect(); return res; }					\
  static ssize_t _assuan_npth_write (assuan_context_t ctx, assuan_fd_t fd, \
				     const void *buffer, size_t size)	\
  { ssize_t res; (void) ctx; npth_unprotect();				\
    res = __assuan_write (ctx, fd, buffer, size);			\
    npth_protect(); return res; }					\
  static int _assuan_npth_recvmsg (assuan_context_t ctx, assuan_fd_t fd, \
				  assuan_msghdr_t msg, int flags)	\
  { int res; (void) ctx; npth_unprotect();				\
    res = __assuan_recvmsg (ctx, fd, msg, flags);			\
    npth_protect(); return res; }					\
  static int _assuan_npth_sendmsg (assuan_context_t ctx, assuan_fd_t fd, \
				  const assuan_msghdr_t msg, int flags) \
  { int res; (void) ctx; npth_unprotect();				\
    res = __assuan_sendmsg (ctx, fd, msg, flags);			\
    npth_protect(); return res; }					\
  static assuan_pid_t _assuan_npth_waitpid (assuan_context_t ctx,         \
                                            assuan_pid_t pid, int nowait, \
                                            int *status, int options)     \
  { assuan_pid_t res; (void) ctx; npth_unprotect();			\
    res = __assuan_waitpid (ctx, pid, nowait, status, options);		\
    npth_protect(); return res; }					\
  static int _assuan_npth_connect (assuan_context_t ctx, assuan_fd_t sock, \
				   struct sockaddr *addr, socklen_t len)\
  { int res; npth_unprotect();						\
    res = __assuan_connect (ctx, sock, addr, len);			\
    npth_protect(); return res; }					\
  static int _assuan_npth_close (assuan_context_t ctx, assuan_fd_t fd)	\
  { int res; npth_unprotect();						\
    res = __assuan_close (ctx, fd);					\
    npth_protect(); return res; }					\
									\
  struct assuan_system_hooks _assuan_system_npth =			\
    { ASSUAN_SYSTEM_HOOKS_VERSION, _assuan_npth_usleep, __assuan_pipe,	\
      _assuan_npth_close, _assuan_npth_read, _assuan_npth_write,	\
      _assuan_npth_recvmsg, _assuan_npth_sendmsg,			\
      __assuan_spawn, _assuan_npth_waitpid, __assuan_socketpair,	\
      __assuan_socket, _assuan_npth_connect }

extern struct assuan_system_hooks _assuan_system_npth;
#define ASSUAN_SYSTEM_NPTH &_assuan_system_npth
#else
#define ASSUAN_SYSTEM_NPTH_IMPL /**/
#define ASSUAN_SYSTEM_NPTH NULL
#endif

#ifdef __cplusplus
}
#endif
#endif /* ASSUAN_H */
/*
Local Variables:
buffer-read-only: t
End:
*/
