aboutsummaryrefslogtreecommitdiff
path: root/lib/cstr/cstr.h
blob: 80dc35953debafa95cae3568b9330911257e6332 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef CSTR_H
#define CSTR_H

#include "../sys/sizes.h"

u64        cstr_length(const char *);
i8         cstr_compare(const char *a, const char *b);
u64        cstr_split(char *cstr, char split);
const char *next_split(const char *previous);
u64        strip_front(char *cstr, char strip);
u64        strip_back(char *cstr, char strip);
u64        strip_cstr(char *cstr, char strip);

u64 cstr_utf8_length(const char *);
u8  next_utf8(const char **);
u8  previous_utf8(const char **);

void u64_to_cstr(u64 n, char *cstr, u64 length);
void i64_to_cstr(i64 n, char *cstr, u64 length);
u64  cstr_to_u64(const char *cstr);
i64  cstr_to_i64(const char *cstr);

#endif