Naming Convention

A fairly big amount of functions and variable are using the “snake_case” format, although you may find some classes that use the “CamelFormat”.

We strongly recommend to stick to the “snake_case” format to ease the reading of the code flow. Switching from one to the other is difficult and requires extra brain power.

Functions associated with a concept or a module and be prefixed with the name of the concept. For example, all Bacula Virtual FileSystem (bvfs) functions are prefixed with bvfs_.

Function and variable names must be readable, in general it is a bad idea to use striped down version of a function or a variable. In general you will find the following variables, functions or label in the code:

  • ret - int/bool return code for a function

  • buf - buffer

  • bail_out - cleanup label for a function

  • ed1, ed2, ed3 - temporary buffer used to convert integers (50c long)

  • len - length of a buffer

  • src - source

  • dest - destination

  • argc - argument count

  • argk - argument key (key=val)

  • argv - argument value (key=val)

  • ua - User Agent object

  • bvfs - Bacula Virtual File System

  • lmgr - Lock Manager

  • DCR - Device Control Resource

  • ctx - Context

Possible Next Steps

Go to Locks and Threads.

Go back to Developer Notes.

Go back to Developer Guide.