Blame src/ath.h

Packit Service 672cf4
/* ath.h - Interfaces for thread-safeness library.
Packit Service 672cf4
   Copyright (C) 2002, 2003, 2004 g10 Code GmbH
Packit Service 672cf4
Packit Service 672cf4
   This file is part of GPGME.
Packit Service 672cf4
Packit Service 672cf4
   GPGME is free software; you can redistribute it and/or modify it
Packit Service 672cf4
   under the terms of the GNU Lesser General Public License as
Packit Service 672cf4
   published by the Free Software Foundation; either version 2.1 of
Packit Service 672cf4
   the License, or (at your option) any later version.
Packit Service 672cf4
Packit Service 672cf4
   GPGME is distributed in the hope that it will be useful, but
Packit Service 672cf4
   WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 672cf4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 672cf4
   Lesser General Public License for more details.
Packit Service 672cf4
Packit Service 672cf4
   You should have received a copy of the GNU Lesser General Public
Packit Service 672cf4
   License along with this program; if not, write to the Free Software
Packit Service 672cf4
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Packit Service 672cf4
   02111-1307, USA.  */
Packit Service 672cf4
Packit Service 672cf4
#ifndef ATH_H
Packit Service 672cf4
#define ATH_H
Packit Service 672cf4
Packit Service 672cf4
#ifdef HAVE_STDINT_H
Packit Service 672cf4
#include <stdint.h>
Packit Service 672cf4
#endif
Packit Service 672cf4
#ifdef HAVE_W32_SYSTEM
Packit Service 672cf4
  /* fixme: Check how we did it in libgcrypt.  */
Packit Service 672cf4
  struct msghdr { int dummy; };
Packit Service 672cf4
  typedef int socklen_t;
Packit Service 6c01f9
# if defined(HAVE_W32CE_SYSTEM) && defined(_MSC_VER)
Packit Service 6c01f9
#  include <winsock2.h>
Packit Service 6c01f9
# endif
Packit Service 672cf4
# include <windows.h>
Packit Service 672cf4
# include <io.h>
Packit Service 672cf4
Packit Service 672cf4
#else /*!HAVE_W32_SYSTEM*/
Packit Service 672cf4
Packit Service 672cf4
# ifdef HAVE_SYS_SELECT_H
Packit Service 672cf4
#  include <sys/select.h>
Packit Service 672cf4
# else
Packit Service 672cf4
#  ifdef HAVE_SYS_TIME_H
Packit Service 672cf4
#   include <sys/time.h>
Packit Service 672cf4
#  endif
Packit Service 672cf4
# endif
Packit Service 672cf4
# ifdef HAVE_SYS_TYPES_H
Packit Service 672cf4
#  include <sys/types.h>
Packit Service 672cf4
# endif
Packit Service 672cf4
# include <sys/socket.h>
Packit Service 672cf4
Packit Service 672cf4
#endif  /*!HAVE_W32_SYSTEM*/
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4

Packit Service 672cf4
/* Define _ATH_EXT_SYM_PREFIX if you want to give all external symbols
Packit Service 672cf4
   a prefix.  */
Packit Service 672cf4
#define _ATH_EXT_SYM_PREFIX _gpgme_
Packit Service 672cf4
Packit Service 672cf4
#ifdef _ATH_EXT_SYM_PREFIX
Packit Service 672cf4
#define _ATH_PREFIX1(x,y) x ## y
Packit Service 672cf4
#define _ATH_PREFIX2(x,y) _ATH_PREFIX1(x,y)
Packit Service 672cf4
#define _ATH_PREFIX(x) _ATH_PREFIX2(_ATH_EXT_SYM_PREFIX,x)
Packit Service 672cf4
#define ath_read _ATH_PREFIX(ath_read)
Packit Service 672cf4
#define ath_write _ATH_PREFIX(ath_write)
Packit Service 672cf4
#define ath_select _ATH_PREFIX(ath_select)
Packit Service 672cf4
#define ath_waitpid _ATH_PREFIX(ath_waitpid)
Packit Service 672cf4
#define ath_connect _ATH_PREFIX(ath_connect)
Packit Service 672cf4
#define ath_accept _ATH_PREFIX(ath_accept)
Packit Service 672cf4
#define ath_sendmsg _ATH_PREFIX(ath_sendmsg)
Packit Service 672cf4
#define ath_recvmsg _ATH_PREFIX(ath_recvmsg)
Packit Service 672cf4
#endif
Packit Service 672cf4
Packit Service 672cf4

Packit Service 672cf4
uintptr_t ath_self (void);
Packit Service 672cf4
Packit Service 672cf4
/* Replacement for the POSIX functions, which can be used to allow
Packit Service 672cf4
   other (user-level) threads to run.  */
Packit Service 672cf4
gpgme_ssize_t ath_read (int fd, void *buf, size_t nbytes);
Packit Service 672cf4
gpgme_ssize_t ath_write (int fd, const void *buf, size_t nbytes);
Packit Service 672cf4
gpgme_ssize_t ath_select (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
Packit Service 672cf4
                           struct timeval *timeout);
Packit Service 672cf4
gpgme_ssize_t ath_waitpid (pid_t pid, int *status, int options);
Packit Service 672cf4
int ath_accept (int s, struct sockaddr *addr, socklen_t *length_ptr);
Packit Service 672cf4
int ath_connect (int s, const struct sockaddr *addr, socklen_t length);
Packit Service 672cf4
int ath_sendmsg (int s, const struct msghdr *msg, int flags);
Packit Service 672cf4
int ath_recvmsg (int s, struct msghdr *msg, int flags);
Packit Service 672cf4
Packit Service 672cf4
#endif	/* ATH_H */