Crate nstd_core[−][src]
Structs
Represents a signed range.
Represents an unsigned range.
Represents a view into a sequence of data.
Enums
Represents a CPU architecture.
Represents an operating system.
Functions
Returns the size (in bytes) of a pointer.
Returns: NSTDUSize size - Size of a pointer.
Returns a null pointer.
Returns: void *null - A null pointer.
Copies bytes from other to copycat.
Parameters:
NSTDByte *const copycat - Pointer to memory to be copied to.
const NSTDByte *const other - Pointer to memory to be copied from.
const NSTDUSize size - Number of bytes to copy.
Fills a block of memory with byte.
Parameters:
NSTDByte *const ptr - Pointer to block of memory.
const NSTDUSize size - Size of block.
const NSTDByte byte - Byte to fill with.
Moves bytes from from to to. Zeroes out from’s memory.
Parameters:
NSTDByte *const from - Memory to be moved from.
NSTDByte *const to - Memory to be moved to.
const NSTDUSize size - Number of bytes to move.
Moves memory from *ptr1 to *ptr2 and vice versa.
Parameters:
void *const ptr1 - First pointer to memory to swap.
void *const ptr2 - Second pointer to memory to swap.
const NSTDUSize size - Number of bytes to swap.
Zeros a memory range pointed to by ptr.
Parameters:
NSTDByte *const ptr - Pointer to memory to be zeroed.
NSTDUSize start - Starting index of memory to be zeroed.
const NSTDUSize end - Ending index of memory to be zeroed. (Excluded).
Returns an NSTDCPUArch value representing the target CPU architecture.
Returns: NSTDCPUArch arch - The target CPU architecture.
Returns an NSTDOperatingSystem value representing the target OS.
Returns: NSTDOperatingSystem os - The target OS.
Gets the first element in the view.
NOTE: This function follows the same behaviour rules as nstd_core_view_get.
Parameters:
const NSTDView *const view - The view.
Returns: void *element - Pointer to the first element.
Gets a pointer to an element from a view.
NOTE: The returned element pointer can quickly become a dangling pointer if the view’s memory
gets reallocated or deallocated, so it is advised to create a copy of the element after
getting it.
Parameters:
const NSTDView *const view - The view.
const NSTDUSize pos - The position of the element to get.
Returns: void *element - Pointer to the element.
Gets the last element in the view.
NOTE: This function follows the same behaviour rules as nstd_core_view_get.
Parameters:
const NSTDView *const view - The view.
Returns: void *element - Pointer to the last element.
Creates a new view from raw data.
Parameters:
const NSTDUSize size - Number of elements to view.
const NSTDUSize element_size - Size of each element.
NSTDByte *const data - Pointer to the raw data.
Returns: NSTDView view - The new view.
Reverses a view’s elements.
Parameters:
const NSTDView *const view - The view.
Type Definitions
Represents a unicode char type.