15 #include <kApi/Utils/kUtils.x.h>
402 return (memcmp(a, b, size) == 0);
kSize kStrLength(const kChar *str)
Determines the number of kChar units in a characater sequence.
Represents a 32-bit unsigned integer.
kStatus kStrPrintvf(kChar *dest, kSize capacity, const kChar *format, kVarArgList argList)
Variable-argument version of kStrPrintf.
k32s kStrCompareN(const kChar *a, const kChar *b, kSize maxCount)
Compares one string to another, only up to a maximum number of characters.
kStatus kMemFree(void *mem)
Frees a block of memory that was allocated using kMemAlloc or kMemAllocZero.
Represents a 64-bit unsigned integer.
kStatus kLoad5(kObject *object, const kChar *fileName, kAlloc allocator)
Loads an object from file using kDat-5 serialization.
kStatus kStrCat(kChar *dest, kSize capacity, const kChar *src)
Appends characters from source to destination.
#define kIsNull(POINTER)
Tests for equality with null pointer.
Definition: kApiDef.h:339
kStatus kMemMove(void *dest, const void *src, kSize size)
Copies memory from a source buffer to a potentially-overlapping destination.
kStatus kDisposeItems(kType type, void *items, kSize count)
Disposes a generic array of items.
k32s kStrCompareLower(const kChar *a, const kChar *b)
Performs a case-insenstive comparison of two strings.
kStatus kLogvf(const kChar *format, kVarArgList argList)
Variable-argument version of kLogf.
const kChar * kStrFindLast(const kChar *str, const kChar *subStr)
Finds the last occurrence of a character sequence.
kBool kStrEquals(const kChar *a, const kChar *b)
Tests a pair of character sequences for equality.
kStatus kSave5(kObject object, const kChar *fileName)
Saves an object to file using kDat-5 serialization.
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
kStatus kObject_Share(kObject object)
Increments the reference count associated with this object.
Definition: kObject.h:119
kStatus kMemAlloc(kSize size, void *mem)
Allocates a block of memory from the application heap.
kStatus kShareRef(kObject *object, kObject source)
Shares an object and sets a handle to refer to the shared object.
Definition: kUtils.h:64
#define kCheck(EXPRESSION)
Executes a return statement if the given expression is not kOK.
Definition: kApiDef.h:559
k32s kStrCompare(const kChar *a, const kChar *b)
Compares one string to another.
#define kInlineFx(TYPE)
Inline method declaration helper.
Definition: kApiDef.h:26
kStatus kStrToLower(kChar *str)
Converts characters in the given sequence to lower case.
kBool kMemEquals(const void *a, const void *b, kSize size)
Compares one memory buffer with another.
Definition: kUtils.h:400
kStatus kMemCopy(void *dest, const void *src, kSize size)
Copies memory from a source buffer to a non-overlapping destination.
Represents a single unit (byte) in a UTF-8 character.
kStatus kRandomBytes(void *data, kSize length)
Generates a random array of bytes.
Represents a byte on the current platform.
kSize kMeasureItems(kType type, const void *items, kSize count)
Calculates the total size, in bytes, of a generic array of items.
kStatus kDisposeRef(kObject *object)
Disposes an object and resets the object handle to kNULL.
Definition: kUtils.h:47
kStatus kMemFreeRef(void *mem)
Frees a block of memory that was allocated using kMemAlloc or kMemAllocZero and resets the memory poi...
k32u kRandom32u()
Generates a random 32-bit number.
kStatus kCloneItems(kType type, void *dest, const void *src, kSize count, kAlloc allocator)
Performs a deep copy of a generic array of items.
kStatus kDestroyRef(kObject *object)
Destroys an object and resets the object handle to kNULL.
Definition: kUtils.h:31
kStatus kLogf(const kChar *format,...)
Formats and writes a message to log handlers (if registered).
kStatus kMemZero(void *dest, kSize size)
Sets a block of memory to zero.
Definition: kUtils.h:343
Type of compression algorithm.
kStatus kSave6(kObject object, const kChar *fileName)
Saves an object to file using kDat-6 serialization.
kStatus kLoad6(kObject *object, const kChar *fileName, kAlloc allocator)
Loads an object from file using kDat-6 serialization.
kStatus kMemAllocZero(kSize size, void *mem)
Allocates and zero-initializes block of memory from the application heap.
kStatus kSaveCompressed5(kObject object, const kChar *fileName, kCompressionType algorithm, k32s level)
Saves an object to file using kDat-5 serialization and compression.
Core Zen type declarations.
Represents a 32-bit signed integer.
kStatus kLog(const kChar *message)
Writes a message to log handlers (if registered).
kStatus kMemReverseCopy(void *dest, const void *src, kSize size)
Copies memory in reverse from a source buffer to a non-overlapping destination.
k64u kRandom64u()
Generates a random 64-bit number.
kStatus kStrPrintf(kChar *dest, kSize capacity, const kChar *format,...)
Formats a string using printf-style arguments.
kStatus kObject_Destroy(kObject object)
Destroys the object.
Definition: kObject.h:165
kStatus kLogBackTrace(kSize skip)
Writes a stack backtrace to the logging handler (if registered).
kStatus kStrCopy(kChar *dest, kSize capacity, const kChar *src)
Copies characters from source to destination.
Represents a character string.
kStatus kCloneItemsEx(kType type, void *dest, const void *src, kSize count, kAlloc destAlloc, kAlloc srcAlloc)
Performs a deep copy of a generic array of items.
kStatus kCopyItems(kType type, void *dest, const void *src, kSize count)
Performs a shallow copy of a generic array of items.
Represents metadata about a type (class, interface, or value).
kStatus kObject_Dispose(kObject object)
Destroys the object and any aggregated child elements.
Definition: kObject.h:193
kStatus kSaveCompressed6(kObject object, const kChar *fileName, kCompressionType algorithm, k32s level)
Saves an object to file using kDat-6 serialization and compression.
kSize kRandomSize()
Generates a random number of type kSize.
#define kOK
Operation successful.
Definition: kApiDef.h:513
Represents an error code.
#define kNULL
Null pointer.
Definition: kApiDef.h:267
kStatus kMemReverse(void *buffer, kSize size)
Reverse the order of bytes in a buffer.
kStatus kShareItems(kType type, void *items, kSize count)
Increments the reference count of a generic array of items.
const kChar * kStrFindFirst(const kChar *str, const kChar *subStr)
Finds the first occurrence of a character sequence.
Represents a boolean value.
kBool kStrnEquals(const kChar *a, const kChar *b, kSize maxCount)
Tests a pair of character sequences for equality, up to a maximum number of characters.
kStatus kReplaceRef(kObject *object, kObject source)
Replaces a reference to existing object with a new object.
Definition: kUtils.h:94
kStatus kZeroItems(kType type, void *items, kSize count)
Zeros the memory associated with a generic array of items.
kStatus kMemSet(void *dest, kByte fill, kSize size)
Sets a block of memory to the given byte value.
kBool kHasForeignData(kType type, const void *items, kSize count)
Reports whether any objects in the specified array reference memory in a foreign address space...