John Peacock wrote:
> Madan U Sreenivasan wrote:
>> About typedefs in the .h, that is technically the way to go... I just
>> wasnt sure about adding a structure that is specific only to subst.c
>> into svn_subst.h. What do you think, John?
>
> I can go either way, since this is technically a private structure, used
> only by that one variable (which I think should probably be initialized
> within the function, rather than at the file level).
You imply that the structure is, in some non-technical way, public. I don't
follow that.
It sounds like both of you may be confused about "being logically public" and
"having global linkage", or thinking that all declarations need to be in header
files. Only public information should be in header files.
That type (canon_table_s/canon_table_t) and variable (canon_table_for_keywords)
are only needed within subst.c; in fact, only within one function. The user of
the function does not need to know anything about them. Therefore they are
logically private and should not be declared in a header file. The type
(canon_table_s/canon_table_t) should be defined just as it is, within subst.c,
and the variable (canon_table_for_keywords) should be given local linkage by
adding the "static" keyword or by defining it inside the function that uses it.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 9 03:48:50 2005