fixed after breaking everything with errno.h and vector.h changes, config still borked

This commit is contained in:
herbglitch 2024-08-28 02:57:29 -06:00
parent 2df9f318a5
commit cdd6c3976b
18 changed files with 86 additions and 84 deletions

View file

@ -204,7 +204,7 @@ double ARC_String_ToDouble(ARC_String *string){
uint64_t ARC_String_Find(ARC_String *string, ARC_String *substring){
if(!string || !substring){
ARC_DEBUG_ERR("ARC_String_Find(string, substring), string or substring was null");
ARC_DEBUG_LOG_ERROR("ARC_String_Find(string, substring), string or substring was null");
arc_errno = ARC_ERRNO_NULL;
return ~(uint64_t)0;
}
@ -226,7 +226,7 @@ uint64_t ARC_String_Find(ARC_String *string, ARC_String *substring){
uint64_t ARC_String_FindCString(ARC_String *string, const char *cstring, uint64_t length){
if(!string || !cstring){
arc_errno = ARC_ERRNO_NULL;
ARC_DEBUG_ERR("ARC_String_FindCString(string, cstring, length), string or cstring was null");
ARC_DEBUG_LOG_ERROR("ARC_String_FindCString(string, cstring, length), string or cstring was null");
return ~(uint64_t)0;
}
@ -251,7 +251,7 @@ uint64_t ARC_String_FindCStringWithStrlen(ARC_String *string, const char *cstrin
uint64_t ARC_String_FindBack(ARC_String *string, ARC_String *substring){
if(!string || !substring){
arc_errno = ARC_ERRNO_NULL;
ARC_DEBUG_ERR("ARC_String_FindBack(string, substring), string or substring was null");
ARC_DEBUG_LOG_ERROR("ARC_String_FindBack(string, substring), string or substring was null");
return ~(uint64_t)0;
}
@ -272,7 +272,7 @@ uint64_t ARC_String_FindBack(ARC_String *string, ARC_String *substring){
uint64_t ARC_String_FindBackCString(ARC_String *string, const char *cstring, uint64_t length){
if(!string || !cstring){
arc_errno = ARC_ERRNO_NULL;
ARC_DEBUG_ERR("ARC_String_FindBack(string, substring), string or substring was null");
ARC_DEBUG_LOG_ERROR("ARC_String_FindBack(string, substring), string or substring was null");
return ~(uint64_t)0;
}
@ -512,7 +512,7 @@ void ARC_String_CopyReplaceMatching(ARC_String **newString, ARC_String *original
//TODO: probs want to check if the replacement goes over a uint64_t size
if(original == NULL || pattern == NULL || replacement == NULL){
arc_errno = ARC_ERRNO_NULL;
ARC_DEBUG_ERR("ARC_String_CopyReplaceMatching(newString, original, pattern, replacement), original, pattern, or replacement was null");
ARC_DEBUG_LOG_ERROR("ARC_String_CopyReplaceMatching(newString, original, pattern, replacement), original, pattern, or replacement was null");
return;
}
@ -551,20 +551,11 @@ void ARC_String_CopyReplaceMatching(ARC_String **newString, ARC_String *original
(*newString)->data[(*newString)->length] = '\0';
}
/**
* @brief replaces characters in string matching the given pattern
*
* @param string the string that will be modified, will discard changes and set arc_errno on fail
* @param patternCString the cstring pattern to replace in the string on match
* @param patternLength the lenght of the cstring pattern
* @param replacementCstring the cstring that will replace the matched pattern
* @param replacementLength the length of the cstring replacement
*/
void ARC_String_ReplaceMatchingCString(ARC_String **string, char *patternCString, uint64_t patternLength, char *replacementCString, uint64_t replacementLength){
//TODO: probs want to check if the replacement goes over a uint64_t size
if(*string == NULL || patternCString == NULL || replacementCString == NULL){
arc_errno = ARC_ERRNO_NULL;
ARC_DEBUG_ERR("ARC_String_ReplaceMatchingCString(string, patternCString, patternLength, replacementCString, replacementLength), *string, patternCString, or replacementCString was null");
ARC_DEBUG_LOG_ERROR("ARC_String_ReplaceMatchingCString(string, patternCString, patternLength, replacementCString, replacementLength), *string, patternCString, or replacementCString was null");
return;
}