For Example:
For Example:
For Example:
and a header file of private stuff
and a header for private prototypes
By splitting the prototypes into separate include files we don't have to recompile everything when just one function prototype changes.
Names exported beyond function scope begin with `H5' followed by zero, one, or two upper-case letters that describe the class of object. This prefix is the package name. The implementation of packages doesn't necessarily have to map 1:1 to the source files.
Each package implements a single main class of object (e.g., the H5B package implements B-link trees). The main data type of a package is the package name followed by `_t'.
Not all packages implement a data type (H5, H5MF) and some packages provide access to a preexisting data type (H5MM, H5S).
If the symbol is for internal use only, then the package name is followed by an underscore and the rest of the name. Otherwise, the symbol is part of the API and there is no underscore between the package name and the rest of the name.
For functions, this is important because the API functions never pass pointers around (they use atoms instead for hiding the implementation) and they perform stringent checks on their arguments. Internal unctions, on the other hand, check arguments with assert().
Data types like H5B_t carry no information about whether the type is public or private since it doesn't matter.
Integral fixed-point type names are an optional `u' followed by `int' followed by the size in bits (8, 16, 32, or 64). There is no trailing `_t' because these are common enough and follow their own naming convention.
hbool_t -- boolean values (BTRUE, BFALSE, BFAIL)
int8 -- signed 8-bit integers
uint8 -- unsigned 8-bit integers
int16 -- signed 16-bit integers
uint16 -- unsigned 16-bit integers
int32 -- signed 32-bit integers
uint32 -- unsigned 32-bit integers
int64 -- signed 64-bit integers
uint64 -- unsigned 64-bit integers
intn -- "native" integers
uintn -- "native" unsigned integers
Other data types are always followed by `_t'.
H5B_key_t-- additional data type used by H5B package.
However, if the name is so common that it's used almost everywhere, then we make an alias for it by removing the package name and leading underscore and replacing it with an `h' (the main datatype for a package already has a short enough name, so we don't have aliases for them).
typedef H5E_err_t herr_t;
Global variables include the package name and end with `_g'.
H5AC_methods_g -- global variable in the H5AC package.
MACROS, PREPROCESSOR CONSTANTS, AND ENUM MEMBERS
Same rules as other symbols except the name is all upper case. There
are a few exceptions:
- MIN(x,y), MAX(x,y) and their relatives
No naming scheme; determined by OS and compiler.
These appear only in one header file anyway.