ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/Flatline/src/Flatline.h
Revision: 457
Committed: Fri Aug 14 10:45:13 2009 UTC (16 years, 2 months ago) by rossy
Content type: text/x-chdr
File size: 951 byte(s)
Log Message:
Flatline

File Contents

# Content
1 #pragma once
2
3 #include <stdlib.h>
4 #include <stdio.h>
5 #define DDrStartupMessage printf
6
7 #include <string.h>
8 #include <stdbool.h>
9 #include <stdint.h>
10
11 #ifdef WIN32
12 #include <winsock2.h>
13 #include "Flatline_Win32.h"
14 #else
15 #include <sys/ioctl.h>
16 #include <sys/types.h>
17 #include <sys/socket.h>
18 #include <unistd.h>
19 #include <stropts.h>
20 #include <arpa/inet.h>
21 #include <netinet/in.h>
22
23 #define NetPlatform_Initalize() /* */
24 #define NetPlatform_Shutdown() /* */
25 #define closesocket close
26 #define ioctlsocket ioctl
27 #endif
28
29 typedef struct sockaddr sockaddr;
30 typedef struct sockaddr_in sockaddr_in;
31
32 bool Net_Listen(uint16_t port, bool (*packet_callback)(char* data, int datalen, int from));
33 int Net_CreateSocket(uint16_t port);
34 bool Net_Send(int socket, int ip, uint16_t port, char* data, int datalen);
35 void Net_CloseSocket(int sock);
36 bool FLrListen_PacketCallback(char* data, int datalen, int from);
37 bool FLrListen_Run();