<commit_before>
#ifndef _BOZ_DISCOVERY_H_
#define _BOZ_DISCOVERY_H_

typedef struct boz_disc_s *boz_disc_t;
#define BOZ_DISC_ZERO NULL

int boz_discovery_init(boz_disc_t *mgr);
int boz_discovery_term(boz_disc_t *mgr);

int boz_discovery_register(const boz_disc_t mgr, const char* uri);
int boz_discovery_unregister(const boz_disc_t mgr, const int id);
char* boz_discovery_geturi(const boz_disc_t mgr, const int id);

#endif
<commit_msg>add doxygen content<commit_after>/**
 * \defgroup BOZ_DISCOVERY Discovery
 * @{
 */

#ifndef _BOZ_DISCOVERY_H_
#define _BOZ_DISCOVERY_H_

/*!
 * Discovery manager 
 * 
 * \note variable must be initialised to BOZ_DISC_ZERO.
 */
typedef struct boz_disc_s *boz_disc_t;

/*! 
 * Discovery manager init value 
 */
#define BOZ_DISC_ZERO NULL

/*!
 * \param[in,out] mgr
 * \return error code
 * \retval 0 on success
 * \retval -1 on failure (errno set accordingly)
 *
 * errno managed:
 * - 0 on success
 * - EINVAL if mgr is not set to BOZ_DISC_ZERO as input value
 * - ENOSPC if mgr can't be instanciated
 */
int boz_discovery_init(boz_disc_t *mgr);

/*!
 * \param[in,out] mgr
 * \return error code
 * \retval 0 on success
 * \retval -1 on failure (errno set accordingly)
 *
 * errno managed:
 * - 0 on success
 * - EINVAL if mgr has not been set with \ref boz_discovery_init
 * 
 * \note \p mgr is reset to BOZ_DISC_ZERO on success
 */
int boz_discovery_term(boz_disc_t *mgr);

/*!
 * \param[in] mgr
 * \param[in] uri
 * \return register ID
 * \retval >=0 on success
 * \retval -1 on failure (errno set accordingly)
 *
 * errno managed:
 * - 0 on success
 * - EINVAL if mgr has not been set with \ref boz_discovery_init
 * - EFAULT if uri is NULL
 * - EFBIG if uri iexceeds max length managed
 * - EEXIST if uri is already registred to this manager
 * 
 */
int boz_discovery_register(const boz_disc_t mgr, const char* uri);

/*!
 * \param[in] mgr
 * \param[in] id
 * \return error code
 * \retval 0 on success
 * \retval -1 on failure (errno set accordingly)
 *
 * errno managed:
 * - 0 on success
 * - EINVAL if mgr has not been set with \ref boz_discovery_init
 * - ENOENT if id has not been registerd before with \ref boz_discovery_register
 * 
 */
int boz_discovery_unregister(const boz_disc_t mgr, const int id);

/*!
 * \param[in] mgr
 * \param[in] id
 * \retval uri string
 * \retval NULL on failure (errno set accordingly)
 *
 * errno managed:
 * - 0 on success
 * - EINVAL if mgr has not been set with \ref boz_discovery_init
 * - ENOENT if ID has not been registerd before with \ref boz_discovery_register
 * 
 */
char* boz_discovery_geturi(const boz_disc_t mgr, const int id);

#endif

/**
 * @}
 */

{'fraction_non_alphanumeric': 0.09833585476550681, 'fraction_numerical': 0.004916792738275341, 'mean_word_length': 3.624125874125874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1313290', 'n_tokens_mistral': 1007, 'n_tokens_neox': 961, 'n_words': 314}