Re: [dev] [libutf] Proposal for additional rune utility functions

From: Dimitris Papastamos <>
Date: Tue, 10 Feb 2015 20:51:45 +0000

> When you write a library one of the objects is to minimize
> what code is included in the binary when the library is linked.
> When you link with a library you extract object files from the
> archive, so all the functions of the object file are included
> in the program, even if the program don't use them.
> So the common way is to put every function in a different file with
> the name of the function. You can argue that in rune.c there are
> several functions, but if you look them, you will see runetochar calls
> runelen, chartorune calls charntorune, chartorune calls runelen,
> runenlen calls to runelen and fullrune calls to charntorune, so the
> dependences between them are really strong, and they are small
> functions, so it is not a big problem.
> But I think this is not the case of chartorunearr that is a uncommon
> function that has 3 calls to other functions, for example strlen and
> emalloc, so it means you are going to have them in your program even
> if you use only runelen. This is something very bad.

Yes this is how it needs to be done. In sbase libutf each function is in
a separate .c file.
Received on Tue Feb 10 2015 - 21:51:45 CET

This archive was generated by hypermail 2.3.0 : Tue Feb 10 2015 - 22:00:11 CET