source: Daodan/Flatline/src/Flatline.h @ 459

Last change on this file since 459 was 459, checked in by rossy, 12 years ago

lolol bugfix

File size: 970 bytes
Line 
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
29typedef struct sockaddr sockaddr;
30typedef struct sockaddr_in sockaddr_in;
31
32bool Net_Listen(uint16_t port, bool (*packet_callback)(char* data, int datalen, int from));
33
34int NetUDPSocket_Create(uint16_t port);
35bool NetUDPSocket_Send(int socket, int ip, uint16_t port, char* data, int datalen);
36void NetUDPSocket_Close(int sock);
37
38bool FLrListen_PacketCallback(char* data, int datalen, int from);
39bool FLrListen_Run();
Note: See TracBrowser for help on using the repository browser.