<commit_before>#include "etvdb_private.h"

/**
 * @brief Basic Setup Functions
 * @defgroup Setup Init / Shutdown
 *
 * @{
 *
 * Basic setup routines.
 *
 * Before any etvdb functions can be used,
 * etvdb has to be initialized with @ref etvdb_init().
 *
 * After the application no longer requires any etvdb functions,
 * etvdb should be properly shut down with @ref etvdb_shutdown()
 * to avoid problems and memory leaks.
 *
 * etvdb logs via Eina's logging subsystem, using the "etvdb" log domain.
 */

/**
 * @brief Initialize etvdb.
 *
 * This function initializes etvdb and its dependencies.
 * It does not depend on any other init routine and has to be called
 * before any etvdb function is called.
 * You need to check its return value, on failure the behaviour of 
 * all functions is undefined.
 *
 * @return EINA_TRUE on success, EINA_FALSE on failure.
 *
 * @see etvdb_shutdown().
 *
 * @ingroup Init
 */
EAPI Eina_Bool etvdb_init(char *api_key)
{
	if (!eina_init()) {
		printf("Eina couldn't be initialized.\n");
		return 0;
	}

	_etvdb_log_dom = eina_log_domain_register("etvdb", EINA_COLOR_CYAN); 
	if (_etvdb_log_dom < 0) {
		EINA_LOG_CRIT("Eina couldn't initialize a logging domain for: etvdb.");
		return EINA_FALSE;
	}

	/* initialize default language */
	strcpy(etvdb_language, "en");

	if (!api_key) {<commit_msg>documantation: document API Key usage<commit_after>#include "etvdb_private.h"

/**
 * @brief Basic Setup Functions
 * @defgroup Setup Init / Shutdown
 *
 * @{
 *
 * Basic setup routines.
 *
 * Before any etvdb functions can be used,
 * etvdb has to be initialized with @ref etvdb_init().
 *
 * After the application no longer requires any etvdb functions,
 * etvdb should be properly shut down with @ref etvdb_shutdown()
 * to avoid problems and memory leaks.
 *
 * etvdb logs via Eina's logging subsystem, using the "etvdb" log domain.
 */

/**
 * @brief Initialize etvdb.
 *
 * This function initializes etvdb and its dependencies.
 * It does not depend on any other init routine and has to be called
 * before any etvdb function is called.
 * You need to check its return value, on failure the behaviour of 
 * all functions is undefined.
 *
 * @param api_key Your applications API key as given out by thetvdb.com.
 * Can be NULL to use etvdb's API key for applications not creating much traffic.
 *
 * @return EINA_TRUE on success, EINA_FALSE on failure.
 *
 * @see etvdb_shutdown().
 *
 * @ingroup Init
 */
EAPI Eina_Bool etvdb_init(char *api_key)
{
	if (!eina_init()) {
		printf("Eina couldn't be initialized.\n");
		return 0;
	}

	_etvdb_log_dom = eina_log_domain_register("etvdb", EINA_COLOR_CYAN); 
	if (_etvdb_log_dom < 0) {
		EINA_LOG_CRIT("Eina couldn't initialize a logging domain for: etvdb.");
		return EINA_FALSE;
	}

	/* initialize default language */
	strcpy(etvdb_language, "en");

	if (!api_key) {
{'fraction_non_alphanumeric': 0.09782608695652174, 'fraction_numerical': 0.001402524544179523, 'mean_word_length': 3.893653516295026, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5057615', 'n_tokens_mistral': 979, 'n_tokens_neox': 931, 'n_words': 339}