dmlfw (Daniyal Machine Learning Framework)
example_utils_string.c

Typical usage:

#include <stdio.h>
#include <string.h>
#include <dmlfw_error.h>
#include <dmlfw_utils.h>
int main(void) {
char err[512], dbg[512];
const char *s1 = "Hello";
const char *s2 = "hello";
int cmp = dmlfw_strcmp_case_insensitive(s1, s2);
if (dmlfw_error()) {
dmlfw_get_error_string(err, sizeof(err));
dmlfw_get_debug_string(dbg, sizeof(dbg));
printf("Comparison error: %s\nDebug info: %s\n", err, dbg);
return 1;
}
printf("Comparison result: %d\n", cmp);
char binary_str[33]; // 32 bits + null
dmlfw_uint32_to_binary(12345U, binary_str);
if (dmlfw_error()) {
dmlfw_get_error_string(err, sizeof(err));
dmlfw_get_debug_string(dbg, sizeof(dbg));
printf("Conversion error: %s\nDebug info: %s\n", err, dbg);
return 1;
}
printf("Binary representation: %s\n", binary_str);
return 0;
}
int main()
Main function to execute batch gradient descent linear regression example.
Definition batch_gd.c:316
Centralized error handling interface for the framework.
void dmlfw_get_error_string(char *error_string, uint32_t size)
Copies the last error message into the provided character buffer.
uint8_t dmlfw_error(void)
Checks if the last framework call resulted in an error.
void dmlfw_get_debug_string(char *debug_string, uint32_t size)
Copies detailed debug information about the last error into the provided character buffer.
Core utility functions for file and string processing.
void dmlfw_uint32_to_binary(uint32_t number, char *string)
Converts a 32-bit unsigned integer to a binary string.
int dmlfw_strcmp_case_insensitive(const char *left, const char *right)
Compares two strings ignoring case differences.