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

Last change on this file since 457 was 457, checked in by rossy, 13 years ago

Flatline

File size: 951 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));
33int Net_CreateSocket(uint16_t port);
34bool Net_Send(int socket, int ip, uint16_t port, char* data, int datalen);
35void Net_CloseSocket(int sock);
36bool FLrListen_PacketCallback(char* data, int datalen, int from);
37bool FLrListen_Run();
Note: See TracBrowser for help on using the repository browser.