📄 wz.hxx
字号:
#ifndef wz_hxx#define wz_hxx#include "wzsymbols.hxx"#ifndef wzObsoleteCode#define wzObsoleteCode private#define wzUseObsolete#else#undef wzObsoleteCode#undef wzUseObsolete#define wzObsoleteCode public#endif#include <float.h>#define wzOffset(p_type,field) ((long unsigned int)&(((p_type)0)->field))#define wzOffsetOf(s_type,field) wzOffset(s_type*,field)// redeclaration of the standard type names// #define instead of typedefs because of decladebug-problemstypedef void* wzAddress;typedef char* wzString;#define wzFloat doubleconst wzFloat wzFloatEpsilon = DBL_EPSILON;#define wzDouble double#define wzIndex unsigned int#define wzInteger signed int#define wzShort short signed int#define wzBoolean short int#define wzName wzString#define wzByte unsigned char// introduction of general self-commenting type names:typedef long unsigned int wzFlag;typedef wzIndex wzDimension;typedef wzIndex wzReturnCode;typedef wzIndex wzSize;typedef void (*wzProcedure)(void);class wzVoid{};typedef void (wzVoid::*wzMethod)(void);// some general self-commenting constantsstatic const wzReturnCode wzSuccess = 1;static const wzBoolean wzFalse = 0;static const wzBoolean wzTrue = 1;static const wzFlag wzOff = 0;static const wzFlag wzOn = ~0;static const wzFloat wzNoFloat = 8.888888888888e36;static const wzFloat wzInfty = 1.e32;static const wzIndex wzNoIndex = 888888888;// Sides, Wedges, Cornerstypedef enum { wzSideRight,wzSideUp,wzSideNear,wzSideLeft,wzSideDown,wzSideFar}wzSide;typedef enum { wzWedgeRightUp, wzWedgeRightDown, wzWedgeLeftUp, wzWedgeLeftDown, wzWedgeRightNear, wzWedgeRightFar, wzWedgeLeftNear, wzWedgeLeftFar, wzWedgeUpNear, wzWedgeUpFar, wzWedgeDownNear, wzWedgeDownFar}wzWedge;typedef enum { wzCornerRightUpNear, wzCornerRightUpFar, wzCornerRightDownNear, wzCornerRightDownFar, wzCornerLeftUpNear, wzCornerLeftUpFar, wzCornerLeftDownNear, wzCornerLeftDownFar}wzCorner;static const wzIndex wzX = wzSideRight;static const wzIndex wzY = wzSideUp;static const wzIndex wzZ = wzSideNear;static const wzIndex wzXup = wzSideRight;static const wzIndex wzYup = wzSideUp;static const wzIndex wzZup = wzSideNear;static const wzIndex wzXdown = wzSideLeft;static const wzIndex wzYdown = wzSideDown;static const wzIndex wzZdown = wzSideFar;static const wzIndex wzXY = 2;static const wzIndex wzYZ = 0;static const wzIndex wzZX = 1;static const wzIndex wzXZ = 4;static const wzIndex wzYX = 5;static const wzIndex wzZY = 3;extern const wzFloat wzPi;extern const wzString wzHomePath;void wzDebugger();class wzFailure{public: wzString description; wzFailure(wzString d="unspecified");};class wzDetectionFailure: public wzFailure{public: wzDetectionFailure(wzString d="error detection has failed");};class wzInternalFailure: public wzFailure{public: wzInternalFailure(wzString d="unspecified internal");};class wzAssertionFailure: public wzFailure{public: wzAssertionFailure(wzString d="unspecified assertion failure");};class wzNotEnoughMemory: public wzFailure{public: wzNotEnoughMemory();};inline void wzFailed(){throw wzInternalFailure();}#ifdef wzDebuginline void wzAssert(wzBoolean x) //{if(!x){throw wzAssertionFailure();}}{if(!x)wzDebugger();}#else#define wzAssert(x)#endifclass wzError{public: wzString module; wzString entry; void print(); wzError(wzString m="errors",wzString e="errors");};class wzAssertionError: public wzError{public: wzAssertionError();};class wzMathError{}; // no initialization for making it fastclass wzDetectionError: public wzError{public: wzDetectionError();};class wzFileOpenError: public wzError{public: wzFileOpenError();};class wzFileReadError: public wzError{public: wzFileReadError();};class wzFileWriteError: public wzError{public: wzFileWriteError();};void wzMessage(wzString);#ifdef wzPrefixNotRequiredinline void now(wzBoolean x){if(!x) wzDebugger();}inline void should_fail() {wzDebugger();}inline void fine() {wzMessage("success");}#define msg wzOutputDefault#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -