Compare commits

..

1 Commits

Author SHA1 Message Date
b8ef8b0dd2 Added aksl_atof 2026-05-25 21:29:46 -04:00
2 changed files with 0 additions and 18 deletions

View File

@@ -5,7 +5,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
akerr_ErrorContext AKERR_NOIGNORE *aksl_fopen(char *pathname, char *mode, FILE **fp);
akerr_ErrorContext AKERR_NOIGNORE *aksl_fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
@@ -25,10 +24,7 @@ akerr_ErrorContext AKERR_NOIGNORE *aksl_sprintf(int *count, char *restrict str,
akerr_ErrorContext AKERR_NOIGNORE *aksl_atoi(const char *nptr, int *dest);
akerr_ErrorContext AKERR_NOIGNORE *aksl_atol(const char *nptr, long *dest);
akerr_ErrorContext AKERR_NOIGNORE *aksl_atoll(const char *nptr, long long *dest);
akerr_ErrorContext AKERR_NOIGNORE *aksl_atof(const char *nptr, double *dest);
akerr_ErrorContext AKERR_NOIGNORE *aksl_realpath(const char *restrict path, char *restrict resolved_path);
akerr_ErrorContext AKERR_NOIGNORE *aksl_strhash_djb2(char *str, size_t len, uint32_t *hashval);
#endif

View File

@@ -4,7 +4,6 @@
#include <errno.h>
#include <string.h>
#include <stdarg.h>
#include <stdint.h>
akerr_ErrorContext AKERR_NOIGNORE *aksl_malloc(size_t size, void **dst)
{
@@ -175,16 +174,3 @@ akerr_ErrorContext AKERR_NOIGNORE *aksl_realpath(const char *restrict path, char
FAIL_ZERO_RETURN(e, result, errno, "path=%s, dest=%s", path, resolved_path);
SUCCEED_RETURN(e);
}
akerr_ErrorContext AKERR_NOIGNORE *aksl_strhash_djb2(char *str, size_t len, uint32_t *hashval)
{
PREPARE_ERROR(e);
FAIL_ZERO_RETURN(e, str, AKERR_NULLPOINTER, "str");
FAIL_ZERO_RETURN(e, hashval, AKERR_NULLPOINTER, "hashval");
uint32_t h = 5381;
while (len--) {
h = ((h << 5) + h) + *str++;
}
*hashval = h;
SUCCEED_RETURN(e);
}