|
Tou
Tou header library
|
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. | |
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. | |
| #define TOU_MSTR | ( | s | ) | TOU_STR(s) |
Helps convert 's' into C literal.
Ex. MSTR(0xFFBA) -> "0xFFBA" MSTR(abcdef) -> "abcdef"
| #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).
| [in] | mx | Upper bound (not included) |
| [in] | mn | Lower bound (included) |