diff options
Diffstat (limited to 'src/device.h')
-rw-r--r-- | src/device.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/device.h b/src/device.h new file mode 100644 index 0000000..93b9802 --- /dev/null +++ b/src/device.h @@ -0,0 +1,54 @@ +#ifndef SYNC_DEVICE_H +#define SYNC_DEVICE_H + +#include "base.h" +#include "sync.h" + +#ifndef SYNC_PLAYER + +/* configure socket-stack */ +#ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #define USE_GETADDRINFO + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include <winsock2.h> + #include <ws2tcpip.h> + #include <windows.h> + #include <limits.h> +#elif defined(USE_AMITCP) + #include <sys/socket.h> + #include <proto/exec.h> + #include <proto/socket.h> + #include <netdb.h> + #define SOCKET int + #define INVALID_SOCKET -1 + #define select(n,r,w,e,t) WaitSelect(n,r,w,e,t,0) + #define closesocket(x) CloseSocket(x) +#else + #include <sys/socket.h> + #include <sys/time.h> + #include <netinet/in.h> + #include <netdb.h> + #include <unistd.h> + #define SOCKET int + #define INVALID_SOCKET -1 + #define closesocket(x) close(x) +#endif + +#endif /* !defined(SYNC_PLAYER) */ + +struct sync_device { + char *base; + struct sync_track **tracks; + size_t num_tracks; + +#ifndef SYNC_PLAYER + int row; + SOCKET sock; +#endif + struct sync_io_cb io_cb; +}; + +#endif /* SYNC_DEVICE_H */ |