file
BasicTypes.hBasicTypes provides simple typedefs and limits for fixed-width types and semantic-intention-communicating typedefs for various other types.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Enums
- enum CnxCompare { CNX_LESS_THAN = -1, CNX_EQUAL = 0, CNX_GREATER_THAN = 1 }
- Type signifying how a given value compares to another.
Typedefs
- using nullptr_t = void*
nullptr_t
makes usingNULL
to represent a null pointer (aka anullptr
) a first-class type of its own- using u8 = uint8_t
u8
is a fixed-width 8 bit unsigned integer- using u16 = uint16_t
u16
is a fixed-width 16 bit unsigned integer- using u32 = uint32_t
u32
is a fixed-width 32 bit unsigned integer- using u64 = uint64_t
u64
is a fixed-width 64 bit unsigned integer- using usize = size_t
usize
is the unsigned, platform-dependent type to represent a size- using byte = u8
- a
byte
is an 8 bit unsigned integer - using i8 = int8_t
i8
is a fixed-width 8 bit signed integer- using i16 = int16_t
i16
is a fixed-width 16 bit signed integer- using i32 = int32_t
i32
is a fixed-width 32 bit signed integer- using i64 = int64_t
i64
is a fixed-width 64 bit signed integer- using isize = ssize_t
isize
is the platform-dependent type to represent a signed size. It is the signed alternative tousize
- using f32 = float
f32
is a 32-bit floating point number- using f64 = double
f64
is a 64-bit floating point number- using CnxCompare = enum CnxCompare
- Type signifying how a given value compares to another.
- using u8_ptr = u8*
- alias for a
u8
pointer - using u16_ptr = u16*
- alias for a
u16
pointer - using u32_ptr = u32*
- alias for a
u32
pointer - using u64_ptr = u64*
- alias for a
u64
pointer - using usize_ptr = usize*
- alias for a
usize
pointer - using i8_ptr = i8*
- alias for a
i8
pointer - using i16_ptr = i16*
- alias for a
i16
pointer - using i32_ptr = i32*
- alias for a
i32
pointer - using i64_ptr = i64*
- alias for a
i64
pointer - using isize_ptr = isize*
- alias for a
isize
pointer - using f32_ptr = f32*
- alias for a
f32
pointer - using f64_ptr = f64*
- alias for a
f64
pointer - using const_u8_ptr = const u8*
- alias for a const
u8
pointer - using const_u16_ptr = const u16*
- alias for a const
u16
pointer - using const_u32_ptr = const u32*
- alias for a const
u32
pointer - using const_u64_ptr = const u64*
- alias for a const
u64
pointer - using const_usize_ptr = const usize*
- alias for a const
usize
pointer - using const_i8_ptr = const i8*
- alias for a const
i8
pointer - using const_i16_ptr = const i16*
- alias for a const
i16
pointer - using const_i32_ptr = const i32*
- alias for a const
i32
pointer - using const_i64_ptr = const i64*
- alias for a const
i64
pointer - using const_isize_ptr = const isize*
- alias for a const
isize
pointer - using const_f32_ptr = const f32*
- alias for a const
f32
pointer - using const_f64_ptr = const f64*
- alias for a const
f64
pointer - using cstring = char*
cstring
represents a null-terminated legacy C-style string (aka achar*
) and should be preferred when semantically referring to a string instead ofchar*
to differentiate from references to a pointer to singlechar
- using const_cstring = const char*
const_cstring
represents a const null-terminated legacy C-style string (aka aconst char*
) and should be preferred when semantically referring to a string instead ofchar*
to differentiate from references to a pointer to singleconst char
- using wcstring = wchar_t*
wcstring
represents a null-terminated legacy C-style wide string (aka awchar_t*
) and should be preferred when semantically referring to a wide string instead ofwchar_t*
to differentiate from references to a pointer to singlewchar_t
- using const_wcstring = const wchar_t*
const_wcstring
represents a const null-terminated legacy C-style wide string (aka aconst wchar_t*
) and should be preferred when semantically referring to a wide string instead ofconst wchar_t*
to differentiate from references to a pointer to singleconst wchar_t
- using char_ptr = char*
char_ptr
represents a pointer to a singlechar
and should be preferred when referring to a pointer to singlechar
overchar*
to differentiate from references to a string- using const_char_ptr = const char*
const_char_ptr
represents a pointer to a singleconst char
and should be preferred when referring to a pointer to singleconst char
overconst char*
to differentiate from references to a const string- using wchar_t_ptr = wchar_t*
wchar_t_ptr
represents a pointer to a singlewchar_t
and should be preferred when referring to a pointer to singlewchar_t
overwchar_t*
to differentiate from references to a wide string- using const_wchar_t_ptr = const wchar_t*
const_wchar_t_ptr
represents a pointer to a singleconst wchar_t
and should be preferred when referring to a pointer to singleconst wchar_t
overconst wchar_t*
to differentiate from references to a wide string-
using cstring_ptr = char_
ptr* - Alias for
char_ptr*
. This should be preferred wherever possible when semantically referring to a pointer tocstring
- using const_cstring_ptr = const char**
- Alias for
const char_ptr*
. This should be preferred wherever possible when semantically referring to a pointer toconst cstring
-
using wcstring_ptr = wchar_
t_ ptr* - Alias for
wchar_t_ptr*
. This should be preferred wherever possible when semantically referring to a pointer towcstring
- using const_wcstring_ptr = const wchar_t**
- Alias for
const wchar_t_ptr*
. This should be preferred wherever possible when semantically referring to a pointer toconst wcstring
-
using Ref = char_
ptr(char) - Alias for
char_ptr
used for the inner type of reference-like types (ie iterators) -
using ConstRef = const_
char_ ptr(char) - Alias for
const_char_ptr
used for the inner type of reference-like types (ie iterators) -
using wchar_t_ptr_ref = wchar_
t_ ptr* - Alias for
wchar_t_ptr*
used for the inner type of reference-like types (ie iterators). This should be preferred when semantically referring to a reference to a pointer to a singlewchar_t
-
using const_wchar_t_ptr_ref = const wchar_
t_ ptr* - Alias for
const wchar_t_ptr*
used for the inner type of reference-like types (ie iterators). This should be preferred when semantically referring to a reference to a const pointer to a singlewchar_t
Defines
- #define CNX_BASIC_TYPES
- Declarations and definitions related to Cnx's builtin types.
- #define nullptr
nullptr
is aNULL
pointer- #define CNX_OFORMAT_U8
u8
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U16
u16
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U32
u32
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U64
u64
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_USIZE
usize
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_UMAX
umax
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_BYTE
byte
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_I8
i8
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_I16
i16
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_I32
i32
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_I64
i64
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_ISIZE
isize
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_IMAX
imax
decimal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U8_OCT
u8
octal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U16_OCT
u16
octal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U32_OCT
u32
octal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U64_OCT
u64
octal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_USIZE_OCT
usize
octal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_UMAX_OCT
umax
octal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_BYTE_OCT
byte
octal format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U8_HEX
u8
lower-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U16_HEX
u16
lower-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U32_HEX
u32
lower-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U64_HEX
u64
lower-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_USIZE_HEX
usize
lower-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_UMAX_HEX
umax
lower-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_BYTE_HEX
byte
lower-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U8_HEX_UP
u8
upper-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U16_HEX_UP
u16
upper-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U32_HEX_UP
u32
upper-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_U64_HEX_UP
u64
upper-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_USIZE_HEX_UP
usize
upper-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_UMAX_HEX_UP
umax
upper-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_OFORMAT_BYTE_HEX_UP
byte
upper-case hex format specifier for legacy formatted output functions (printf
,fprintf
, etc)- #define CNX_IFORMAT_U8
u8
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U16
u16
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U32
u32
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U64
u64
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_USIZE
usize
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_UMAX
umax
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_BYTE
byte
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_I8
i8
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_I16
i16
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_I32
i32
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_I64
i64
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_ISIZE
isize
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_IMAX
imax
decimal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U8_OCT
u8
octal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U16_OCT
u16
octal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U32_OCT
u32
octal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U64_OCT
u64
octal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_USIZE_OCT
usize
octal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_UMAX_OCT
umax
octal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_BYTE_OCT
byte
octal format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U8_HEX
u8
lower-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U16_HEX
u16
lower-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U32_HEX
u32
lower-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U64_HEX
u64
lower-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_USIZE_HEX
usize
lower-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_UMAX_HEX
umax
lower-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_BYTE_HEX
byte
lower-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U8_HEX_UP
u8
upper-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U16_HEX_UP
u16
upper-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U32_HEX_UP
u32
upper-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_U64_HEX_UP
u64
upper-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_UMAX_HEX_UP
umax
upper-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define CNX_IFORMAT_BYTE_HEX_UP
byte
upper-case hex format specifier for legacy formatted input functions (scanf
,fscanf
, etc)- #define cnx_max_u8
- Maximum value of a
u8
- #define cnx_max_u16
- Maximum value of a
u16
- #define cnx_max_u32
- Maximum value of a
u32
- #define cnx_max_u64
- Maximum value of a
u64
- #define cnx_max_usize
- Maximum value of a
usize
- #define cnx_max_i8
- Maximum value of an
i8
- #define cnx_max_i16
- Maximum value of an
i16
- #define cnx_max_i32
- Maximum value of an
i32
- #define cnx_max_i64
- Maximum value of an
i64
- #define cnx_max_isize
- Maximum value of an
isize
- #define cnx_max_f32
- Maximum value of an
f32
- #define cnx_max_f64
- Maximum value of an
f64
- #define cnx_min_u8
- Minimum value of a
u8
- #define cnx_min_u16
- Minimum value of a
u16
- #define cnx_min_u32
- Minimum value of a
u32
- #define cnx_min_u64
- Minimum value of a
u64
- #define cnx_min_usize
- Minimum value of a
usize
- #define cnx_min_i8
- Minimum value of an
i8
- #define cnx_min_i16
- Minimum value of an
i16
- #define cnx_min_i32
- Minimum value of an
i32
- #define cnx_min_i64
- Minimum value of an
i64
- #define cnx_min_isize
- Minimum value of an
isize
- #define cnx_min_f32
- Minimum value of an
f32
- #define cnx_min_f64
- Minimum value of an
f64
- #define cnx_min_diff_f32
- Minimum discernible difference value of an
f32
- #define cnx_min_diff_f64
- Minimum discernible difference value of an
f64
- #define cnx_max_value(T)
- Returns the maximum possible value of the given type.
- #define cnx_min_value(T)
- Returns the minimum possible value of the given type.
Typedef documentation
typedef char_ ptrRef(char)
Alias for char_ptr
used for the inner type of reference-like types (ie iterators)
type alias for a reference to CnxStringView
Alias for char_ptr*
used for the inner type of reference-like types (ie iterators). This should be preferred when semantically referring to a reference to a pointer to a single char
Alias for f64_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for f32_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for isize_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for i64_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for i32_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for i16_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for i8_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for usize_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for u64_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for u32_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for u16_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for u8_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for wcstring*
used for the inner type of reference-like types (ie iterators). This should be preferred wherever possible when semantically referring to a reference to wcstring
Alias for cstring*
used for the inner type of reference-like types (ie iterators). This should be preferred wherever possible when semantically referring to a reference to cstring
Alias for f64_ptr
used for the inner type of reference-like types (ie iterators)
Alias for f32_ptr
used for the inner type of reference-like types (ie iterators)
Alias for isize_ptr
used for the inner type of reference-like types (ie iterators)
Alias for i64_ptr
used for the inner type of reference-like types (ie iterators)
Alias for i32_ptr
used for the inner type of reference-like types (ie iterators)
Alias for i16_ptr
used for the inner type of reference-like types (ie iterators)
Alias for i8_ptr
used for the inner type of reference-like types (ie iterators)
Alias for usize_ptr
used for the inner type of reference-like types (ie iterators)
Alias for u64_ptr
used for the inner type of reference-like types (ie iterators)
Alias for u32_ptr
used for the inner type of reference-like types (ie iterators)
Alias for u16_ptr
used for the inner type of reference-like types (ie iterators)
Alias for u8_ptr
used for the inner type of reference-like types (ie iterators)
Ref
and ConstRef
aliases for pointer types, used for the inner type of reference-like types (ie iterators), follow
typedef const_ char_ ptrConstRef(char)
Alias for const_char_ptr
used for the inner type of reference-like types (ie iterators)
type alias for a const reference to CnxStringView
Alias for const char_ptr*
used for the inner type of reference-like types (ie iterators). This should be preferred when semantically referring to a reference to a const pointer to a single char
Alias for const f64_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for const f32_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for const isize_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for const i64_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for const i32_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for const i16_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for const i8_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for const u8_ptr*
used for the inner type of reference-like types (ie iterators).
Alias for const wcstring*
used for the inner type of reference-like types (ie iterators). This should be preferred wherever possible when semantically referring to a reference to const wcstring
Alias for const cstring*
used for the inner type of reference-like types (ie iterators). This should be preferred wherever possible when semantically referring to reference to const cstring
Alias for const_f64_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_f32_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_isize_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_i64_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_i32_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_i16_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_i8_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_usize_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_u64_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_u32_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_u16_ptr
used for the inner type of reference-like types (ie iterators)
Alias for const_u8_ptr
used for the inner type of reference-like types (ie iterators)