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

[RFC] Refining our naming rules

From: Stefan Fuhrmann <stefan.fuhrmann_at_wandisco.com>
Date: Mon, 29 Dec 2014 13:59:36 +0100

Hi there,

FSX code contains various violations to our naming rules,
mostly taken over FSFS. I thought about a scheme that
complies to our rules but also refines them.

I'd like to amend our coding guideline with the following
suggestions (not as a strict requirement). The first one is
actually "new" while the other two have already been used
by various portions of our fs_* libs:

1. Use the svn_ prefix only for identifiers meant to be used
   by other libs, i.e. only for declarations in the ./include sub-
   tree. We currently lack that distinction and it lead to minor
   confusion in the past.

2. If the library name contains multiple elements, use only
   the last one as prefix for internal identifiers. In combination
   with the svn_ prefix, use the full library name.

3. Static functions implementing a v-table function should be
   named <lib>_<func>. <func> is the name of the respective
   API function without its prefixes.

Combined with the existing rules, this is how a "commit"
function in libsvn_fs_base would be named. This is a theoretical
example; not all of these identifiers actually do exist in SVN:

* commit - static function
* base_commit - static function implementing svn_fs_commit
* base__commit - library-local, defined in some local header
* svn_fs_base__commit - to be used by any SVN lib and must
  be declared in ./include/private
* svn_fs_base_commit - to be used by any part of an application,
  subject to compatibility rules and must be declared in ./include

-- Stefan^2.
Received on 2014-12-29 14:01:19 CET

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