I have a hard time locating where functions are defined, as opposed to
where they are prototyped or used.  Yeah I know I could use ctags or
such, but I prefer simple greps when possible.

There are a few stylistic techniques to make it easy to find a function
definition.  One is to put the function name at the very start of its
own line, for example:

int
content_get(int rid, Blob *pBlob){

Now this function's definition can be found by grepping "^content_get",
or "^content_get(" to weed out functions prefixed by this name.

Another is to include the function name in a comment before the
function, then follow the function name with space-dash-dash or some
other sequence that is rarely or never used.

/*
** content_get --
** Extract the content for ID rid and put it into the
** uninitialized blob.  Return 1 on success.  If the record
** is a phantom, zero pBlob and return 0.
*/
int content_get(int rid, Blob *pBlob){

The Tcl source code does both.

Is there any interest in adopting these techniques or others in the
Fossil source?

-- 
Andy Goth | <andrew.m.goth/at/gmail/dot/com>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
fossil-dev mailing list
fossil-dev@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/fossil-dev

Reply via email to