ath.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef ATH_H
00021 #define ATH_H
00022
00023 #ifdef HAVE_SYS_SELECT_H
00024 # include <sys/select.h>
00025 #else
00026 # include <sys/time.h>
00027 #endif
00028 #include <sys/types.h>
00029 #include <sys/socket.h>
00030
00031
00032
00033
00034 #define _ATH_EXT_SYM_PREFIX _gpgme_
00035
00036 #ifdef _ATH_EXT_SYM_PREFIX
00037 #define _ATH_PREFIX1(x,y) x ## y
00038 #define _ATH_PREFIX2(x,y) _ATH_PREFIX1(x,y)
00039 #define _ATH_PREFIX(x) _ATH_PREFIX2(_ATH_EXT_SYM_PREFIX,x)
00040 #define ath_mutex_init _ATH_PREFIX(ath_mutex_init)
00041 #define ath_mutex_destroy _ATH_PREFIX(ath_mutex_destroy)
00042 #define ath_mutex_lock _ATH_PREFIX(ath_mutex_lock)
00043 #define ath_mutex_unlock _ATH_PREFIX(ath_mutex_unlock)
00044 #define ath_read _ATH_PREFIX(ath_read)
00045 #define ath_write _ATH_PREFIX(ath_write)
00046 #define ath_select _ATH_PREFIX(ath_select)
00047 #define ath_waitpid _ATH_PREFIX(ath_waitpid)
00048 #define ath_connect _ATH_PREFIX(ath_connect)
00049 #define ath_accept _ATH_PREFIX(ath_accept)
00050 #define ath_sendmsg _ATH_PREFIX(ath_sendmsg)
00051 #define ath_recvmsg _ATH_PREFIX(ath_recvmsg)
00052 #endif
00053
00054
00055 typedef void *ath_mutex_t;
00056 #define ATH_MUTEX_INITIALIZER 0;
00057
00058
00059 int ath_mutex_init (ath_mutex_t *mutex);
00060 int ath_mutex_destroy (ath_mutex_t *mutex);
00061 int ath_mutex_lock (ath_mutex_t *mutex);
00062 int ath_mutex_unlock (ath_mutex_t *mutex);
00063
00064
00065
00066 ssize_t ath_read (int fd, void *buf, size_t nbytes);
00067 ssize_t ath_write (int fd, const void *buf, size_t nbytes);
00068 ssize_t ath_select (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
00069 struct timeval *timeout);
00070 ssize_t ath_waitpid (pid_t pid, int *status, int options);
00071 int ath_accept (int s, struct sockaddr *addr, socklen_t *length_ptr);
00072 int ath_connect (int s, const struct sockaddr *addr, socklen_t length);
00073 int ath_sendmsg (int s, const struct msghdr *msg, int flags);
00074 int ath_recvmsg (int s, struct msghdr *msg, int flags);
00075
00076 #define _ATH_COMPAT
00077 #ifdef _ATH_COMPAT
00078 struct ath_ops
00079 {
00080 int (*mutex_init) (void **priv, int just_check);
00081 int (*mutex_destroy) (void *priv);
00082 int (*mutex_lock) (void *priv);
00083 int (*mutex_unlock) (void *priv);
00084 ssize_t (*read) (int fd, void *buf, size_t nbytes);
00085 ssize_t (*write) (int fd, const void *buf, size_t nbytes);
00086 ssize_t (*select) (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
00087 struct timeval *timeout);
00088 ssize_t (*waitpid) (pid_t pid, int *status, int options);
00089 int (*accept) (int s, struct sockaddr *addr, socklen_t *length_ptr);
00090 int (*connect) (int s, const struct sockaddr *addr, socklen_t length);
00091 int (*sendmsg) (int s, const struct msghdr *msg, int flags);
00092 int (*recvmsg) (int s, struct msghdr *msg, int flags);
00093 };
00094
00095
00096 #define ath_init _ATH_PREFIX(ath_init)
00097 void ath_init (void);
00098
00099
00100 #define ath_pthread_available _ATH_PREFIX(ath_pthread_available)
00101 struct ath_ops *ath_pthread_available (void);
00102 #define ath_pth_available _ATH_PREFIX(ath_pth_available)
00103 struct ath_ops *ath_pth_available (void);
00104 #endif
00105
00106 #endif
This file is part of the documentation for libkdenetwork Library Version 3.3.2.