Hi FRIGN,
It's been a while since I posted to this list. I do still maintain
libutf, though -- glad to hear it's still being of use.
It sounds like it might be a good idea to add these to the library.
However, I have some simplification suggestions, especially to avoid
memory allocation inside libutf. I've attached a file illustrating the
functions as I think they should be (albeit untested). Your
'chartorunearr' could, in this case, be implemented like so:
> Rune *p = emalloc((utflen(s) + 1) * sizeof *p);
> utftorunestr(s, p);
Does this seem alright to you?
I don't have strong opinions on the 'where to put them' question. I
suppose we could split out every function into its own file, as others
have suggested. On the other hand, if 'utftorunestr' were to go in a
larger file of functions then I would actually suggest a runestr.c,
which doesn't exist yet but may as well; see runestrcat(3).
Thanks,
cls
Received on Tue Feb 10 2015 - 23:07:52 CET