M
metiu
Hi all,
maybe it's an old question, but I couldn't find an answer...
let's say I have this kind of directory structure for project foo:
/foo/includes/mod1.h (exported by mod1)
/foo/includes/mod2.h (exported by mod2)
/foo/mod1/file1.c
/foo/mod1/file1.h (exported by file1)
/foo/mod1/file2.c
/foo/mod1/file2.h (exported by file2)
/foo/mod2/file1.c
/foo/mod2/file1.h (exported by file1)
/foo/mod2/file2.c
/foo/mod2/file2.h (exported by file2)
...... I think you got the picture
How can I make function "bar()" exported by /foo/mod1/file1.c only to
other files in /foo/mod1, without making it visible to mod2?
Just omitting it from mod1.h won't work: someone could declare it
extern in his/her file and use it. I'd like to make it foolproof.
One solution that comes up to me is making a mod1.c file which is
#include "file1.c"
#include "file2.c"
and using static functions/variables.
Is there a more elegant way?
Thanks
maybe it's an old question, but I couldn't find an answer...
let's say I have this kind of directory structure for project foo:
/foo/includes/mod1.h (exported by mod1)
/foo/includes/mod2.h (exported by mod2)
/foo/mod1/file1.c
/foo/mod1/file1.h (exported by file1)
/foo/mod1/file2.c
/foo/mod1/file2.h (exported by file2)
/foo/mod2/file1.c
/foo/mod2/file1.h (exported by file1)
/foo/mod2/file2.c
/foo/mod2/file2.h (exported by file2)
...... I think you got the picture
How can I make function "bar()" exported by /foo/mod1/file1.c only to
other files in /foo/mod1, without making it visible to mod2?
Just omitting it from mod1.h won't work: someone could declare it
extern in his/her file and use it. I'd like to make it foolproof.
One solution that comes up to me is making a mod1.c file which is
#include "file1.c"
#include "file2.c"
and using static functions/variables.
Is there a more elegant way?
Thanks