#pragma once

#include <bnb/export.h>

#ifdef __cplusplus
extern "C"
{
#endif

    /*
     * Error processing
     */
    /**
     * Opaque structure to represent an error. Always the last argument of the call.
     * You may pass a `NULL`. You must call `bnb_error_destroy` if the error was returned.
     */
    typedef struct bnb_error bnb_error;

    BNB_EXPORT void bnb_error_destroy(bnb_error*);
    BNB_EXPORT const char* bnb_error_get_message(const bnb_error*);
    BNB_EXPORT const char* bnb_error_get_type(const bnb_error*);

#ifdef __cplusplus
} // extern "C"
#endif
