Constants

xs.inc

XS Library Version 0.1 MACROS THAT YOU CAN DEFINE BEFORE INCLUDING XS.INC: XS_FLEQ_TOLERANCE: Tolerance that is used for XS_FLEQ float nearly-equal comparisions DEFAULT: 0.000005 XS_DEBUG Turn debug logging on DEFAULT: 0 XS_LOGBUFFER_SIZE Buffer size for logging DEFAULT: 512 XS_TASK_MAXPARAMS Maximal parameter count for managed tasks DEFAULT: 8 XS_TASK_MAXPARAMSIZE Maximal size of string parameter for tasks Has to be power of 2 and has to be >= 8 DEFAULT: 512 XS_TASK_MANAGEDIDS Number of managed IDs for tasks. DEFAULT: 2048 XS_REPLACEBUF_SIZE DEFAULT: 3072 NOTES: On AMX, VexdUM is required for some math functions xs__ / XS__ (2 underscores) stuff is meant to be intern untested: never tested half-tested: succesfully used in other applications; not extensively tested in xs though tested: fully tested If you have any useful functions / ideas for functions, please tell me.

_xs_included
#if defined _xs_included
  #endinput
#endif
#define _xs_included

// **** CONFIG CHECK

#if !defined XS_FLEQ_TOLERANCE
	#define XS_FLEQ_TOLERANCE 0.000005
#endif

#if !defined XS_DEBUG
	#define XS_DEBUG 0
#endif

#if !defined XS_LOGBUFFER_SIZE
	#define XS_LOGBUFFER_SIZE 512
#endif

#if !defined XS_TASK_MAXPARAMS
	#define XS_TASK_MAXPARAMS 8
#endif

#if !defined XS_TASK_MAXPARAMSIZE
	#define XS_TASK_MAXPARAMSIZE 512
#endif

#if !defined XS_TASK_MANAGEDIDS
	#define XS_TASK_MANAGEDIDS 2048
#endif

#if !defined XS_REPLACEBUF_SIZE
	#define XS_REPLACEBUF_SIZE 3072
#endif

Checks if two floating point values are nearly equal.

XS_FLEQ

Return

1 if they are nearly equal, 0 otherwise.

#define XS_FLEQ(%1,%2) (((%1) <= ((%2) + XS_FLEQ_TOLERANCE)) && ((%1) >= ((%2) - XS_FLEQ_TOLERANCE)))