Next: , Previous: The New C Interface, Up: C interface changes from NetCDF 2 to NetCDF 3


B.2 Function Naming Conventions

The netCDF-3 C library employs a new naming convention, intended to make netCDF programs more readable. For example, the name of the function to rename a variable is now NF_RENAME_VAR instead of the previous ncvarrename.

All netCDF-3 C function names begin with the NF_ prefix. The second part of the name is a verb, like get, put, inq (for inquire), or open. The third part of the name is typically the object of the verb: for example dim, var, or att for functions dealing with dimensions, variables, or attributes. To distinguish the various I/O operations for variables, a single character modifier is appended to var:

var entire variable access var1 single value access vara array or array section access vars strided access to a subsample of values varm mapped access to values not contiguous in memory

At the end of the name for variable and attribute functions, there is a component indicating the type of the final argument: text, uchar, schar, short, int, long, float, or double. This part of the function name indicates the type of the data container you are using in your program: character string, unsigned char, signed char, and so on.

Also, all macro names in the public C interface begin with the prefix NF_. For example, the macro which was formerly MAX_NF_NAME is now NF_MAX_NAME, and the former FILL_FLOAT is now NF_FILL_FLOAT.

AS previously mentioned, all the old names are still supported for backward compatibility.