Tou
Tou header library
Loading...
Searching...
No Matches
Various definitions

Macros

#define nullptr   ((void*)0)
 nullptr def in case i felt like using it
 
#define TOU_DEFAULT_BLOCKSIZE   4096
 How many bytes to read when reading a file if unspecified.
 
#define TOU_JSON_DATA_VER   "1.0"
 Data format version when exporting INI to JSON.
 
#define TOU_XML_DATA_VER   "1.0"
 Data format version when exporting INI to JSON.
 
#define TOU_STR(s)   #s
 Helps convert 's' into a literal.
 
#define TOU_MSTR(s)   TOU_STR(s)
 Helps convert 's' into C literal.
 
#define TOU_IS_BLANK(c)   ((c)==' ' || (c)=='\n' || (c)=='\r' || (c)=='\t')
 Is character a whitespace char?
 
#define TOU_ARRSIZE(x)   (sizeof(x) / sizeof(x[0]))
 Size of array, should also work with const char* [].
 
#define TOU_RANDINT(mx, mn)   ((int)(((float)rand()/RAND_MAX) * ((mx)-(mn)) + (mn)))
 Quick and simple random integer.
 

Typedefs

typedef void *(* tou_func) (void *)
 Arbitrary function pointer with 1 parameter.
 
typedef void *(* tou_func2) (void *, void *)
 Arbitrary function pointer with 2 parameters.
 
typedef void *(* tou_func3) (void *, void *, void *)
 Arbitrary function pointer with 3 parameters.
 

Enumerations

enum  tou_iter_action { TOU_BREAK = 0 , TOU_CONTINUE = 1 }
 Can be used while iterating to indicate user wishing to abort or continue as normal.
 

Detailed Description

Macro Definition Documentation

◆ TOU_MSTR

#define TOU_MSTR ( s)    TOU_STR(s)

Helps convert 's' into C literal.

Ex. MSTR(0xFFBA) -> "0xFFBA" MSTR(abcdef) -> "abcdef"

◆ TOU_RANDINT

#define TOU_RANDINT ( mx,
mn )   ((int)(((float)rand()/RAND_MAX) * ((mx)-(mn)) + (mn)))

Quick and simple random integer.

Outputs values in range from mn (inclusive) to mx (not inclusive).

Parameters
[in]mxUpper bound (not included)
[in]mnLower bound (included)