Hi,
Is anybody using Paul Hsieh's
Better String Library?
I am a little bit stuck.
Here is an example by Paul Hsieh himself but it fails miserably with loads of error messages
However, I got this working; it loads the correct #strings, and the timings are plausible, but I can't figure out how to use the 'tokens' for string operations including printing:
/* called as follows - WinStr is a pointer to a buffer containing Windows.inc:
bstring MyBuffer = bfromcstr(WinStr);
rv=ArrayJJ(MyBuffer);
*/
int ArrayJJ(const_bstring src) { // bstrlib.c, line 2655
struct bstrList* tokens;
int ct;
tokens = bsplit(src, '\n'); // translates source string to an array
#if 0
// how can we use the array???
// compiles but prints garbage:
printf("T0=%s\n", tokens->entry[0]);
printf("T1=%s\n", (*tokens).entry[1]); // different syntax, same garbage
printf("T2=%s\n", tokens->entry[2]);
#endif
return ct;
}
Grateful for any hint, JJ