uLib  User mode C/C++ extended API library for Win32 programmers.
Common.cpp File Reference
#include <uLib\Common.h>

Go to the source code of this file.

Macros

#define DW_HIGH_BIT   0x80000000L
 
#define LT(n)   n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n
 

Functions

bool IsWinVer (BYTE vMajor, BYTE vMinor, bool winNt)
 
bool IsWin7 ()
 
bool IsWinVista ()
 
bool IsWinXP ()
 
bool IsWin2000 ()
 
bool IsWinNT ()
 
bool IsWin98 ()
 
bool IsWin95 ()
 
bool IsWin64Bit ()
 
bool IsWow64 ()
 
void GetWinSystemInfo (SYSTEM_INFO *si)
 
long map (long x, long xMin, long xMax, long toMin, long toMax)
 
long constrain (long x, long lo, long hi)
 
short random (short iMin, short iMax)
 
void randomize ()
 
long runningAvg (long Avg, long X, unsigned int Period)
 
ulong ipow2 (ushort X)
 
uint64 ipow2x (ushort X)
 
ushort ilog2 (ulong X)
 
ushort ilog2x (uint64 X)
 
ushort ilog10 (ulong X)
 
ushort ilog10x (uint64 X)
 
long double _root (long double base, long double x)
 
long double _log (long double base, long double x)
 
double _round (double x, unsigned char ndeci)
 
bool _isprime (unsigned long x)
 
unsigned long _prime (unsigned long x)
 Return nearest prime number not smaller than x. More...
 
unsigned long _nearprime (unsigned long x)
 Return nearest prime above or below x, or precisely x. More...
 
UINT16 __cdecl _bswap16 (UINT16 W)
 
UINT32 __cdecl _bswap32 (UINT32 DW)
 
UINT64 __cdecl _bswap64 (UINT64 Val)
 

Variables

HINSTANCE hInstance = NULL
 
HWND hMainWnd = NULL
 
HWND hCurrDlg = NULL
 
HACCEL hMainAcc = NULL
 
HWND hMdiClient = NULL
 
PISECURITY_DESCRIPTOR pis
 
SECURITY_ATTRIBUTES DefSec = { sizeof(DefSec), NULL, TRUE }
 
SECURITY_DESCRIPTOR DefSecDesc = { 0,0,0,NULL,NULL,NULL,NULL }
 

Macro Definition Documentation

◆ DW_HIGH_BIT

#define DW_HIGH_BIT   0x80000000L

◆ LT

#define LT (   n)    n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n

Function Documentation

◆ _prime()

unsigned long _prime ( unsigned long  x)

Return nearest prime number not smaller than x.

Definition at line 394 of file Common.cpp.

◆ _nearprime()

unsigned long _nearprime ( unsigned long  x)

Return nearest prime above or below x, or precisely x.

Definition at line 404 of file Common.cpp.

Variable Documentation

◆ pis

PISECURITY_DESCRIPTOR pis

Definition at line 19 of file Common.cpp.