anna
026bfd0b39
string: add nstr2i and nstr2u
3 years ago
anna
57b24014dc
string: add nstrtrim
3 years ago
anna
0ecf0be554
utf: ensure neat() is called in utf8_check
3 years ago
anna
9fef6c5a6d
remove double asterisk from license notice
3 years ago
anna
e1e401798c
nstr: add nput convenience wrappers
3 years ago
anna
ac7172c841
nbuf: make clones zero-copy
3 years ago
anna
cf4bd2ea5b
nstr: Make cloning zero-copy
3 years ago
anna
3040b09669
nstr: avoid double allocation
...
String contents are stored immediately after the
struct _neo_nstr in memory now.
3 years ago
anna
c797540dbc
string: rename string type to nstr_t
...
This might annoy a bunch of people, but it kinda
follows the "traditional" C coding style and i
like it more. Also it reminds you that strings
are absolutely not a primitive data type.
3 years ago
anna
b6659a321d
string: add static NSTR_DEFINE initializer macro
3 years ago
anna
30954cd078
string: add tests
3 years ago
anna
0f3c11110c
string: implement nstrdup
3 years ago
anna
66032c95f2
string: sanitize nstrcmp return value on error
3 years ago
anna
7169a434bf
utf: add utf8_ncheck
3 years ago
anna
6ab34d0893
string: rename _capacity field to _size
3 years ago
anna
f27d00a4a2
utf: fix name ambiguity of utf8_chrsize
3 years ago
anna
aae039ae29
string: nstrcat refactor
3 years ago
anna
2fbbfc61c0
string: use memcpy instead of strncpy in nstrmul
3 years ago
anna
8c591796fb
string: always call strcmp() in nstrcmp()
...
Some people seem to depend on the unstandardized
behavior of some (notably glibc) implementations
of strcmp() where the arithemtic difference
between s1 and s2 is returned, not just any
positive or negative number. This is explicitly
undocumented in libneo as well, but still doing
it won't hurt either.
3 years ago
anna
7d64438f70
string: fix off-by-one error in leftpad
3 years ago
anna
900bce9b8e
string: add nnstr string constructor
3 years ago
anna
b011d5feb5
string: remove unnecessary refcount update
...
Passing the argument to a pure function is
essentially a "borrow", and the caller has had to
make sure the refcount doesn't drop to zero anyway
3 years ago
anna
5aed426864
string: add more utility functions
3 years ago
anna
b010638dd1
string: add creationg and char access functions
3 years ago
anna
c70068f1b8
utf: fix some more bugs
...
It's beginning to actually work, wow
3 years ago
anna
06d538bc4a
utf: use unsigned types
...
Turns out the people warning about doing signed bitshifts were right
3 years ago
anna
54869dcd6c
utf: use correct format specifier
3 years ago
anna
30a29150c3
implement UTF-8 conversion
...
i have no idea whether this works, the only thing i have is PTSD
3 years ago