Change cstr to slc function to have proper namespacing

This commit is contained in:
cannoli-fruit 2026-07-16 03:28:11 -04:00
commit c92f5df354
3 changed files with 4 additions and 4 deletions

View file

@ -7,7 +7,7 @@ int isnotalpha(int x) { return !isalpha(x); }
int main() {
char *src = "This is a list of words, which apparently has been referred to previously as a sentence";
Lz_Slc s = lz_cstr_to_slc(src);
Lz_Slc s = lz_slc_from_cstr(src);
Lz_Slc word;
int i = 0;

View file

@ -5,7 +5,7 @@
int main() {
char *src = " \t This text has some extra whitespace \t ";
Lz_Slc s = lz_cstr_to_slc(src);
Lz_Slc s = lz_slc_from_cstr(src);
printf("|"LZ_STR_FMT"|\n", LZ_STR_PRINTF(s));
lz_slc_trim_typ(&s, isspace);

4
lazy.h
View file

@ -32,7 +32,7 @@ size_t lz_hm_hash_void_get(size_t cap, _Bool *exists, _Bool *tombstones,
void *key, void *keys, size_t k_s);
size_t lz_hm_hash_void_set(size_t cap, _Bool *exists,
_Bool *tombstones, void* key, size_t k_s);
Lz_Slc lz_cstr_to_slc(char *dat);
Lz_Slc lz_slc_from_cstr(char *dat);
char *lz_cstr_dup(const char *s);
double lz_slc_atof(Lz_Slc *src);
@ -388,7 +388,7 @@ Lz_SB lz_sb_from_cstr(const char *dat) {
return sb;
}
Lz_Slc lz_cstr_to_slc(char *dat) {
Lz_Slc lz_slc_from_cstr(char *dat) {
Lz_Slc out = {0};
out.data = dat;
out.cnt = strlen(dat);