Added initialization, data type defenitons and started with TcpClient

This commit is contained in:
xX-TheDoctor-Xx
2016-07-16 23:26:56 +01:00
parent d9be5d3f2b
commit 97262ee8c6
20 changed files with 595 additions and 36 deletions

188
include/Defs.hpp Normal file
View File

@ -0,0 +1,188 @@
#ifndef DEFS_HPP
#define DEFS_HPP
#ifdef _MSC_VER
#pragma once
#endif
#ifdef _MSC_VER
#define WIN32_LEAN_AND_MEAN
#define _WINSOCKAPI_
#include <windows.h>
#include <winsock2.h>
#include <WS2tcpip.h>
#pragma comment(lib, "ws2_32.lib")
WSADATA wsa_data;
typedef signed char int8, sbyte;
typedef unsigned char uint8, byte;
typedef signed short int16;
typedef unsigned short uint16;
typedef signed int int32;
typedef unsigned int uint32;
typedef signed __int64 int64;
typedef unsigned __int64 uint64;
#ifdef _WIN64
typedef signed __int64 int_ptr;
typedef unsigned __int64 uint_ptr;
#else
typedef signed long int_ptr;
typedef unsigned long uint_ptr;
#endif // win64
#elif defined(__GNUC__) || defined(__clang__)
typedef signed char int8, sbyte;
typedef unsigned char uint8, byte;
typedef signed short int16;
typedef unsigned short uint16;
typedef signed int int32;
typedef unsigned int uint32;
#ifdef _WIN64
typedef signed long long int_ptr, int64;
typedef unsigned long long uint_ptr, uint64;
#else
typedef signed long int_ptr;
typedef unsigned long uint_ptr;
#ifdef __LP64__
typedef signed long int64;
typedef unsigned long uint64;
#else
typedef signed long long int64;
typedef unsigned long long uint64;
#endif // __LP64__
#endif // win64
#elif defined(__DECCXX)
typedef signed char int8, sbyte;
typedef unsigned char uint8, byte;
typedef signed short int16;
typedef unsigned short uint16;
typedef signed int int32;
typedef unsigned int uint32;
typedef signed __int64 int64;
typedef unsigned __int64 uint64;
#ifdef __VMS
#ifdef __32BITS
typedef signed long int_ptr;
typedef unsigned long uint_ptr;
#else
typedef signed __int64 int_ptr;
typedef unsigned __int64 uint_ptr;
#endif // __32BITS
#else
typedef signed long int_ptr;
typedef unsigned long uint_ptr
#endif // __VMS
#elif defined(__HP_aCC)
typedef signed char int8, sbyte;
typedef unsigned char uint8, byte;
typedef signed short int16;
typedef unsigned short uint16;
typedef signed int int32;
typedef unsigned int uint32;
typedef signed long int_ptr;
typedef unsigned long uint_ptr;
#ifdef __LP64__
typedef signed long int64;
typedef unsigned long uint64;
#else
typedef signed long long int64;
typedef unsigned long long uint64;
#endif // __LP64__
#elif defined(__SUNPRO_CC)
typedef signed char int8, sbyte;
typedef unsigned char uint8, byte;
typedef signed short int16;
typedef unsigned short uint16;
typedef signed int int32;
typedef unsigned int uint32;
typedef signed long int_ptr;
typedef unsigned long uint_otr
#ifdef __sparcv9
typedef signed long int64;
typedef unsigned long uint64;
#else
typedef signed long long int64;
typedef unsigned long long uint64;
#endif // __sparcv9
#elif defined(__IBMCPP__)
typedef signed char int8, sbyte;
typedef unsigned char uint8, byte;
typedef signed short int16;
typedef unsigned short uint16;
typedef signed int int32;
typedef unsigned int uint32;
typedef signed long int_ptr;
typedef unsigned long uint_ptr;
#ifdef __64BIT__
typedef signed long int64;
typedef unsigned long uint64;
#else
typedef signed long long int64;
typedef unsigned long long uint64;
#endif // __64BIT__
#elif defined(__sgi)
typedef signed char int8, sbyte;
typedef unsigned char uint8, byte;
typedef signed short int16;
typedef unsigned short uint16;
typedef signed int int32;
typedef unsigned int uint32;
typedef signed long int_ptr;
typedef unsigned long uint_ptr;
#if _MIPS_SZLONG == 64
typedef signed long int64;
typedef unsigned long uint64;
#else
typedef signed long long int64;
typedef unsigned long long uint64;
#endif // _MIPS_SZLONG
#elif defined(_DIAB_TOOL)
typedef signed char int8, sbyte;
typedef unsigned char uint8, byte;
typedef signed short int16;
typedef unsigned short uint16;
typedef signed int in32;
typedef unsigned int uint32;
typedef signed long int_ptr;
typedef unsigned long uint_ptr;
typedef signed long long int64;
typedef unsigned long long uint64;
#endif // compiler data type defenitions
const uint16 default_port = 60250;
enum VoidCode
{
VOID_SUCCESS,
VOID_WSA_INIT_FAILED,
VOID_TCP_INIT_FAILED,
VOID_INVALID_IP_ADDRESS,
VOID_INVALID_PORT,
VOID_COULDNT_CONNECT,
};
#endif // DEFS_HPP