/** @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 "term.h" /* * External variables. */ extern LSUP_NSMap *LSUP_default_nsm; /// Default namespace prefix map. extern LSUP_Term *LSUP_default_ctx; /// Default context. extern LSUP_Buffer *LSUP_default_ctx_buf; /// Serialized default context. /** @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); #endif /* _LSUP_ENVIRONMENT_H */