23#ifndef BAGEL_BOFLIB_MISC_H
24#define BAGEL_BOFLIB_MISC_H
26#include "bagel/boflib/stdinc.h"
30extern int mapWindowsPointSize(
int pointSize);
35extern void timerStart();
41extern uint32 timerStop();
46extern uint32 getTimer();
52extern void bofSleep(uint32 milli);
54extern Fixed fixedDivide(Fixed Dividend, Fixed Divisor);
55extern Fixed fixedMultiply(Fixed Multiplicand, Fixed Multiplier);
57#define intToFixed(i) (Fixed)(((long)(i)) << 16)
58#define fixedToInt(f) (int)(((long)(f)) >> 16)
75extern void *bofMemAlloc(uint32 nSize,
const char *pFile,
int nLine,
bool bClear);
81extern void bofMemFree(
void *pBuf);
83#define bofAlloc(n) bofMemAlloc((n), __FILE__, __LINE__, false)
84#define bofCleanAlloc(n) bofMemAlloc((n), __FILE__, __LINE__, true)
85#define bofFree(p) bofMemFree((p))
87inline uint32 getFreePhysMem() {
97void encrypt(
void *pBuf, int32 lSize,
const char *pszPassword =
nullptr);
98#define decrypt encrypt
99#define Decrypt encrypt
101extern void encryptPartial(
void *, int32, int32,
const char *pPassword =
nullptr);
102#define decryptPartial encryptPartial
109extern bool ProbableTrue(
int nProbability);
111extern void ErrorLog(
const char *logFile,
const char *format, ...);
113extern int StrFreqMatch(
const char *,
const char *);
114extern bool StrCompare(
const char *,
const char *,
unsigned int);
115extern int StrCharCount(
const char *,
char);
116extern char *StriStr(
char *,
const char *);
117extern void StrUprStr(
char *,
const char *);
118extern void StrCpyStripChar(
char *,
const char *,
char);
119extern char *StrStripChar(
char *,
char);
120extern char *StrReplaceChar(
char *,
char,
char);