LibJuno 0.1.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
string.h File Reference
#include "juno/memory/memory_types.h"
#include "juno/status.h"
#include "juno/string/string_api.h"
#include <stddef.h>
#include "juno/string/string_types.h"
Include dependency graph for string.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

JUNO_STATUS_T Juno_StringInit (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 Juno_StringSetAlloc (JUNO_STRING_T *ptString, JUNO_MEMORY_ALLOC_T *ptAlloc)
 Sets a new memory allocator for a JUNO string.
 
JUNO_STATUS_T Juno_StringLength (JUNO_STRING_T *ptString, size_t *pzRetSize)
 Retrieves the size of the JUNO string.
 
JUNO_STATUS_T Juno_StringAppend (JUNO_STRING_T *ptString, const char *pcCstr, size_t zLen)
 
JUNO_STATUS_T Juno_StringConcat (JUNO_STRING_T *ptString1, JUNO_STRING_T *ptString2)
 Concatenates two JUNO strings.
 
JUNO_STATUS_T Juno_StringFree (JUNO_STRING_T *ptString)
 Frees resources associated with the JUNO string.
 
const JUNO_STRING_API_TJuno_StringApi (void)
 

Function Documentation

◆ Juno_StringApi()

const JUNO_STRING_API_T * Juno_StringApi ( void  )

◆ Juno_StringAppend()

JUNO_STATUS_T Juno_StringAppend ( 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

◆ Juno_StringConcat()

JUNO_STATUS_T Juno_StringConcat ( JUNO_STRING_T ptString1,
JUNO_STRING_T ptString2 
)

Concatenates two JUNO strings.

Parameters
ptString1Pointer to the first string.
ptString2Pointer to the second string.
Returns
JUNO_STATUS_T result status.

◆ Juno_StringFree()

JUNO_STATUS_T Juno_StringFree ( JUNO_STRING_T ptString)

Frees resources associated with the JUNO string.

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

◆ Juno_StringInit()

JUNO_STATUS_T Juno_StringInit ( 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.

◆ Juno_StringLength()

JUNO_STATUS_T Juno_StringLength ( 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.

◆ Juno_StringSetAlloc()

JUNO_STATUS_T Juno_StringSetAlloc ( 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.