You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.8 KiB
70 lines
1.8 KiB
#ifndef __BASIC_FUNCTIONALITY_HEADER__
|
|
#define __BASIC_FUNCTIONALITY_HEADER__
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <sys/types.h>
|
|
#include <time.h>
|
|
#include "basicTypes.h"
|
|
#ifdef __linux__
|
|
#include <ifaddrs.h>
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
#include <arpa/inet.h>
|
|
#include <sys/statvfs.h>
|
|
#include "basicBuildTimeStamp.h"
|
|
#else
|
|
#include <winsock2.h>
|
|
#include <ws2tcpip.h>
|
|
#include <atlbase.h>
|
|
#include <windows.h>
|
|
#include <VersionHelpers.h>
|
|
#include <dshow.h>
|
|
#endif
|
|
|
|
|
|
bool fileExist( const char *strFilename );
|
|
CSTR trim( CSTR string );
|
|
uint8_t checksum8( uint8_t *Buffer, size_t BufferSize );
|
|
uint16_t checksum16( uint8_t *Buffer, size_t BufferSize );
|
|
uint8_t checksumLGS( uint8_t *Buffer, size_t BufferSize );
|
|
CArray *explode( char Delim, CSTR S_Str );
|
|
CSTR implode( CArray *Data, CSTR S_Str, U8 Start, U8 End );
|
|
CSTR getTStr( CSTR Fmt = NULL );
|
|
|
|
#ifdef __linux__
|
|
#define SLEEP(X) usleep(X*1000)
|
|
long long getMilliseconds( void );
|
|
#else
|
|
#ifndef WIN_XP
|
|
#include <VersionHelpers.h>
|
|
#endif
|
|
#define SLEEP(X) Sleep(X)
|
|
unsigned __int64 getMilliseconds( void );
|
|
#endif
|
|
|
|
int getIP4( if_info **arrParam, int max_ifs = 10 );
|
|
|
|
#ifdef __linux__
|
|
long long getTotalSpace( CSTR DirName );
|
|
long long getFreeSpace( CSTR DirName );
|
|
bool enumerateDevices( enumeratorInfo *mlist, const char *dTemplate = "video" );
|
|
#else
|
|
__int64 getTotalSpace( CSTR DirName );
|
|
__int64 getFreeSpace( CSTR DirName );
|
|
bool enumerateDevices(enumeratorInfo *mlist, REFGUID category);
|
|
#endif
|
|
|
|
typedef struct S_localIp4Info{
|
|
char address[16];
|
|
char netmask[16];
|
|
char broadcast[16];
|
|
char gateway[16];
|
|
}localIp4Info;
|
|
|
|
typedef vector<localIp4Info*> localIpAddresses;
|
|
|
|
localIpAddresses *getLocalIP();
|
|
|
|
#endif
|
|
|