News for hackers. Stuff that matters.
Re:The abominable strtok() by tptacek on Saturday September 25, 2010 @01:38PM (#1727405)
You are, in other words, reinventing strspn?
Re:The abominable strtok() by philwelch on Saturday September 25, 2010 @02:04PM (#1727452)
strspn takes a set of characters to match against and tells you how long to go until you reach a non-matching character. My tokenizer, like strtok, takes a set of delimiter characters. So same thing except with complement sets, I guess.

It's also part of a larger library that consistently uses pointer/length pairs to designate strings as opposed to null termination, which admittedly is quite non-C. No clue whether it's actually a good idea.

EDIT: If anyone's actually curious, I have it on github: http://github.com/philwelch/string