Mike> Hi
Mike> I am confronted witha a set of c files that contain many
Mike> functions, for use in a library. Now, as a point of
Mike> programming style, is it better to have each function in it's
Mike> own file, with the file name being the function name, or to
Mike> keep it the way it is?
Depends. One consideration when building libraries is that the linker
will pull in a whole object file if it needs any symbol from it, so
functions that are logically independent should be kept in separate
files.
On the other hand, a strict one-function-per-file policy is not
necessarily a good thing either, especially if several related
functions share some private data, private functions or implementation
details that you don't want to expose.
As usual, there is no "one answer fits all" rule that works in all
circumstances.
--
Andrew.
comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
or <URL: http://www.whitefang.com/unix/>