On Tue, Dec 16, 2014 at 9:20 PM, Sean Woods <s...@seanwoods.com> wrote:
>
> I'm curious about the coding convention in fossil with respect to
> variable naming.  It seems that the code follows something like the
> following convention:
>
>  - integers have no prefix
>

Sometime they have "i" for "integer".  Or sometimes they use "n" to mean
"number of".


>  - strings have a "z" prefix e.g. zParam
>

The "z" is for zero-terminated string.


>  - pointers have a "p" prefix e.g. pSomething
>  - function pointers have an "x" prefix e.g. xSaveAll
>

Also "a" for array-of.  And these get combined.  So you see things like:

      char **azStrings;   // An array of zero-terminated strings
      int nStrings;          // number of strings

That's the general idea.  I have not been consistent in the use of these
prefixes, nor have I required other people to use them.  But they are
useful at times.


>
> What else is there?  Is there any document that describes this
> convention?  Perhaps also some rationale behind why this approach is
> used (hungarian notation being a somewhat controversial topic).
>



>
> Perhaps I'll even consolidate the info and contribute to the wiki...
> _______________________________________________
>
-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to