[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Issue #2219 - Canonicalize values in svn:keywords

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-03-09 03:47:29 CET

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

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.