/** @file environment.h * * @brief Handle LSUP environment initialization and teardown. * * #LSUP_init() should be called before performing any other interaction with * this library. * * #LSUP_done() is called automatically on program exit (`atexit`). */ #ifndef _LSUP_ENVIRONMENT_H #define _LSUP_ENVIRONMENT_H #include "lsup/term.h" /**@defgroup environment Environment module * @ingroup public * @{ */ /* * External variables. */ /** @brief Default context. * * The actual default context IRI used throughout the application may use a * value from the `LSUP_DEFAULT_CTX_URI` environment variable. */ #define DEFAULT_CTX_LABEL LSUP_NS "default" /// Default context. extern LSUP_Term *LSUP_default_ctx; /// Serialized default context. extern LSUP_Buffer *LSUP_default_ctx_buf; /** @brief Initialize the default environment. * * This must be called before using the library. * * The default environment is cleaned up automatically on exit. * * This environment should suit most cases, unless an application needs to use * multiple environments and call #LSUP_init with specific handles. Such * other environment(s) must be freed up manually with #LSUP_done(). */ LSUP_rc LSUP_init (void); /** @brief Close the default environment. * * This is called by atexit(). If called before then, subsequent calls have * no effect. */ void LSUP_done (void); /** TODO */ LSUP_rc LSUP_env_put_id (const uint32_t key, const char *data); /** TODO */ const char * LSUP_env_get_id (const uint32_t key); /// @} END defgroup environment #endif /* _LSUP_ENVIRONMENT_H */