C interface reference

The C interface is define in the chemfiles.h, in which all the functions and enums have a chfl_ prefix for namespacing. Main chemfiles types are the following opaque pointer types:

The user is reponsible for memory management when using these types. Constructors functions (functions returning pointers to types defined above) return freshly allocated memory, and calling the chfl_*_free functions return the corresponding memory to the operating system.

typedef double chfl_vector3d[3]

A 3-dimmensional vector for the chemfiles interface.

chemfiles.h also exports the same macro as in the C++ interface, and the chfl_version function allow to access the version of the Chemfiles library.

const char *chfl_version(void)

Get the version of the chemfiles library.

const char* version = chfl_version();
assert(strcmp(version, CHEMFILES_VERSION) == 0);
A null-terminated string containing the version of Chemfiles.