/** * @file staticstring.h * @brief Declares the public staticstring API. */ #ifndef _STRING_H_ #define _STRING_H_ #include "string.h" #include #include #define AKGL_MAX_STRING_LENGTH PATH_MAX /** @brief Provides a fixed-capacity, heap-managed string buffer. */ typedef struct { int refcount; char data[AKGL_MAX_STRING_LENGTH]; } akgl_String; /** * @brief String initialize. * @param obj Object to initialize, inspect, or modify. * @param init Optional initial string contents; `NULL` clears the buffer. * @return `NULL` on success, otherwise an error context owned by the caller. * @throws AKERR_NULLPOINTER When the corresponding validation or operation fails. */ akerr_ErrorContext AKERR_NOIGNORE *akgl_string_initialize(akgl_String *obj, char *init); /** * @brief String copy. * @param src Source value to copy or inspect. * @param dst Output destination populated by the function. * @param count Maximum number of elements or bytes to process; zero selects the default. * @return `NULL` on success, otherwise an error context owned by the caller. * @throws AKERR_NULLPOINTER When the corresponding validation or operation fails. */ akerr_ErrorContext AKERR_NOIGNORE *akgl_string_copy(akgl_String *src, akgl_String *dst, int count); #endif //_STRING_H_