Miscellaneous functions

None of the miscellaneous functions are exported, and should be called by their fully qualified name:

# Get the last error message from the chemfiles runtime.
Chemfiles.last_error()

# Set the global warning `callback` to be used for each warning event.
# The `callback` function must take a `String` and return nothing.
Chemfiles.set_warning_callback(my_callback)
function version()

Error handling

function last_error()
Get the last error message from the chemfiles runtime.
function clear_errors()
Clear any error message stored by the chemfiles runtime.

Warnings

function set_warning_callback(callback::Function)

Set the global warning callback to be used for each warning event.

The callback function must take a String and return nothing.

Configuration files

function add_configuration(path)

Read configuration data from the file at path.

By default, chemfiles reads configuration from any file name .chemfilesrc in the current directory or any parent directory. This function can be used to add data from another configuration file.

This function will fail if there is no file at path, or if the file is incorectly formatted. Data from the new configuration file will overwrite any existing data.