3 ms·
I'd argue sds meets that challenge, though not in the way you probably mean: https://github.com/antirez/sds/blob/master/README.md https://github.com/antirez/sds
by tyingq 10y ago
I'd argue sds meets that challenge, though not in the way you probably mean: https://github.com/antirez/sds/blob/master/README.md https://github.com/antirez/sds/blob/master/README.md
- hedora 10y agoThe challenge is to do it with the strn* functions. :-) String manipulation isn't that hard, and strcpy and friends aren't very good. I'm a fan of creating a struct that has a uint8_t* and a length, and using that for all buffers, including strings. Thanks for the pointer though! I'll definitely give it a careful read.
- masklinn 10y ago> I'm a fan of creating a struct that has a uint8_t* and a length, and using that for all buffers, including strings. Unsurprisingly, "record strings" are what most every language even just slightly higher-level than C does: C++, Rust, Swift, Go, …