LibJuno 0.1.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
JUNO_STRING_API_TAG Struct Reference

#include <string_api.h>

Data Fields

JUNO_STATUS_T(* Init )(JUNO_STRING_T *ptString, JUNO_MEMORY_ALLOC_T *ptAlloc, const char *pcStr, size_t zLen, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvUserData)
 Creates a JUNO string from a C string.
 
JUNO_STATUS_T(* SetAlloc )(JUNO_STRING_T *ptString, JUNO_MEMORY_ALLOC_T *ptAlloc)
 Sets a new memory allocator for a JUNO string.
 
JUNO_STATUS_T(* Length )(JUNO_STRING_T *ptString, size_t *pzRetSize)
 Retrieves the size of the JUNO string.
 
JUNO_STATUS_T(* Concat )(JUNO_STRING_T *ptString1, JUNO_STRING_T *ptString2)
 
JUNO_STATUS_T(* Append )(JUNO_STRING_T *ptString, const char *pcCstr, size_t zLen)
 
JUNO_STATUS_T(* Free )(JUNO_STRING_T *ptString)
 Frees resources associated with the JUNO string.
 

Field Documentation

◆ Append

JUNO_STATUS_T(* JUNO_STRING_API_TAG::Append) (JUNO_STRING_T *ptString, const char *pcCstr, size_t zLen)

Writes a C-String to the Juno String

Parameters
ptStringThe juno string to write to
pcCstrThe C string
zLenThe length of the C string
Returns
JUNO_STATUS_T result status

◆ Concat

JUNO_STATUS_T(* JUNO_STRING_API_TAG::Concat) (JUNO_STRING_T *ptString1, JUNO_STRING_T *ptString2)

Concat two strings together

Parameters
ptString1The first string
ptString2The second string
zNewSizeThe size of the new string. If the size is 0, the new size will be inferred

◆ Free

JUNO_STATUS_T(* JUNO_STRING_API_TAG::Free) (JUNO_STRING_T *ptString)

Frees resources associated with the JUNO string.

Parameters
ptStringPointer to the JUNO string structure.
Returns
JUNO_STATUS_T result status.

◆ Init

JUNO_STATUS_T(* JUNO_STRING_API_TAG::Init) (JUNO_STRING_T *ptString, JUNO_MEMORY_ALLOC_T *ptAlloc, const char *pcStr, size_t zLen, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvUserData)

Creates a JUNO string from a C string.

Parameters
ptStringPointer to the JUNO string structure.
ptAllocMemory allocator.
pcStrC-string input.
zLenLength of the input string.
pfcnFailureHandlerFailure handler callback.
pvUserDataUser data pointer.
Returns
JUNO_STATUS_T result status.

◆ Length

JUNO_STATUS_T(* JUNO_STRING_API_TAG::Length) (JUNO_STRING_T *ptString, size_t *pzRetSize)

Retrieves the size of the JUNO string.

Parameters
ptStringPointer to the JUNO string structure.
pzRetSizePointer to variable to store the string size.
Returns
JUNO_STATUS_T result status.

◆ SetAlloc

JUNO_STATUS_T(* JUNO_STRING_API_TAG::SetAlloc) (JUNO_STRING_T *ptString, JUNO_MEMORY_ALLOC_T *ptAlloc)

Sets a new memory allocator for a JUNO string.

Parameters
ptStringPointer to the JUNO string structure.
ptAllocNew memory allocator.
Returns
JUNO_STATUS_T result status.

The documentation for this struct was generated from the following file: