On Tue, 10 Feb 2015 22:07:52 +0000 Connor Lane Smith <c...@lubutu.com> wrote:
> 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); I like this approach and the way you wrote the functions! :) And using "utf" instead of "char" also makes more sense. > 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). That would also be very consistent. What do the others think? Cheers FRIGN -- FRIGN <d...@frign.de>