refactoring

This commit is contained in:
2023-06-08 15:15:38 +06:00
parent a983df1ac6
commit c5585bbb0c
88 changed files with 922 additions and 1071 deletions

View File

@@ -1,8 +1,7 @@
#include "string.h"
kt_define(string, NULL, NULL);
Array_define(string)
Autoarr_define(string, false)
Autoarr_define(string, false);
// copies str content to new char pointer value (adding '\0' at the end)
char* string_extract(string str){
@@ -33,7 +32,7 @@ bool string_compare(string str0, string str1){
if(!str0.ptr) return str1.ptr ? false : true;
else if(!str1.ptr) return false;
while(str0.length-->0)
if(*str0.ptr++ != *str1.ptr++)
if(*str0.ptr++ != *str1.ptr++)
return false;
return true;
}