dmlfw (Daniyal Machine Learning Framework)
|
Core unordered string set types and utilities. More...
#include <dmlfw_types.h>
Go to the source code of this file.
typedef struct __dmlfw_set_string | dmlfw_set_string |
Opaque structure representing an unordered set of unique strings. | |
int | dmlfw_set_string_add (dmlfw_set_string *set, char *string) |
Adds a unique string to the set. | |
dmlfw_set_string * | dmlfw_set_string_create_new (void) |
Creates an empty unordered set of strings. | |
void | dmlfw_set_string_destroy (dmlfw_set_string *set) |
Destroys the string set, freeing all resources. | |
void | dmlfw_set_string_get (dmlfw_set_string *set, index_t i, char **string) |
Retrieves a copy of the string at the given index. | |
dimension_t | dmlfw_set_string_get_size (dmlfw_set_string *set) |
Retrieves the number of unique strings in the set. | |
Core unordered string set types and utilities.
This header defines opaque unordered set structures specialized for string data. It provides APIs for creation, destruction, element access, adding unique strings, and querying the set size.
All functions report errors via the centralized error API. Use dmlfw_error()
to check for errors after calls. dmlfw_get_error_string()
and dmlfw_get_debug_string()
provide diagnostic details.
Functions returning new set pointers transfer ownership to the caller, who is responsible for freeing with dmlfw_set_string_destroy()
. Returned strings from get operations are allocated and must be freed by callers.
typedef struct __dmlfw_set_string dmlfw_set_string |
Opaque structure representing an unordered set of unique strings.
The internal details are encapsulated. Use provided API functions for creation, manipulation, and destruction.
int dmlfw_set_string_add | ( | dmlfw_set_string * | set, |
char * | string | ||
) |
Adds a unique string to the set.
set | [in] Set (must not be NULL). |
string | [in] String to add (must not be NULL). |
Usage example:
dmlfw_set_string * dmlfw_set_string_create_new | ( | void | ) |
Creates an empty unordered set of strings.
Usage example:
void dmlfw_set_string_destroy | ( | dmlfw_set_string * | set | ) |
Destroys the string set, freeing all resources.
set | [in] Pointer to set or NULL (no-op). |
Usage example:
void dmlfw_set_string_get | ( | dmlfw_set_string * | set, |
index_t | i, | ||
char ** | string | ||
) |
Retrieves a copy of the string at the given index.
set | [in] Set (must not be NULL). |
i | [in] Zero-based index. |
string | [out] Pointer to receive newly allocated string. |
Usage example:
dimension_t dmlfw_set_string_get_size | ( | dmlfw_set_string * | set | ) |
Retrieves the number of unique strings in the set.
set | [in] Set (may be NULL). |
Usage example: