<commit_before>#ifndef DOC_H
#define DOC_H

#include <kdbplugin.h>

/**
 * @defgroup plugin Plugins
 * 
 * @brief Elektra plugin framework
 *
 * @since version 0.4.9, Elektra can dynamically load different key storage
 * plugins.
 *
 * @since version 0.7.0 Elektra can have multiple backends,
 * mounted at any place in the key database.
 *
 * @since version 0.8.0 Elektra backends are composed out of multiple
 * plugins.
 *
 * To get started with writing plugins, first read our
 * plugin tutorial in doc/tutorials!
 *
 * A plugin can implement any functionality related to
 * configuration.
 * There are 6 possible entry points for a plugin.
 * - elektraDocGet() will be called when configuration or the plugin's
 *   contract is retrieved from the key database
 * - elektraDocSet() will be called when configuration is written to the
 *   key database
 * - elektraDocOpen() will be called before any other method of the
 *   plugin is called
 * - elektraDocClose() will be called as last method
 * - elektraDocError() will be called when kdbSet() failed (to give the
 *   plugin a chance to recover/undo its actions)
 * - elektraPluginExport() exports all methods for the plugin.
 *
 * The names described here contain "Doc" within the method's name
 * just because the plugin described in this document is called doc
 * (the doxygen source was generated from src/plugins/doc/doc.h).
 * Always replace Doc with the name of the plugin you
 * are going to implement or use #ELEKTRA_PLUGIN_FUNCTION.
 *
 *
 * @par Overview
 * There are different types of plugins for different concerns.
 * They all only have the entry points as defined above.
 * The types of plugins handled in this document:
 * - A storage plugin gets an empty keyset in elektraDocGet()
 *   and constructs the information out from a file.
 *   In elektraDocSet() the keyset is written to a file.
 *   \n
 *   Other persistent storage then a file is not handled within
 *   this document because it involves many other issues.
 *   For files the resolver plugin already takes care for
 *   transactions and rollback.
 *   So the storage plugin is the source and dump as known
 *   from pipes and filters.
 * - A filter plugin is a plugin which operates on existing keys.
 *   It may process or change the keyset.
 *   Or it may reject specific keysets which do not meet some
 *   criteria.
 *
 * Use following include to have the functions that are not
 * implement by you available:
 *
 * @snippet doc.c plugin include
 *
 * @par Error and Warnings
 * In case of trouble, in some methods you can use
 * the macro #ELEKTRA_SET_ERROR (in other methods it is not allowed).
 * You might add warnings with the macro #ELEKTRA_ADD_WARNING.
 * Read the documentation of the individual methods to
 * decide what you should do.
 *
 * Use following include to have the macros for setting the error
 * and adding the warnings available:
 *
 * @snippet doc.c plugin errors include
 *
 * @see http://www.libelektra.org/ftp/elektra/thesis.pdf
 *   for an detailed explanation and description of other types
 *   of plugins.
 *   Do not hesitate to ask at the mailinglist if anything
 *   is unclear.
 *
 * @addtogroup plugin
 * @{
 */





/**
 * @brief Sets the error in the keys metadata.
 *
 * Include kdberrors.h to make it work:
 *
 * @snippet doc.c plugin errors include
 *
 * @ingroup plugin
 *<commit_msg>doc: ask by github issue<commit_after>#ifndef DOC_H
#define DOC_H

#include <kdbplugin.h>

/**
 * @defgroup plugin Plugins
 * 
 * @brief Elektra plugin framework
 *
 * @since version 0.4.9, Elektra can dynamically load different key storage
 * plugins.
 *
 * @since version 0.7.0 Elektra can have multiple backends,
 * mounted at any place in the key database.
 *
 * @since version 0.8.0 Elektra backends are composed out of multiple
 * plugins.
 *
 * To get started with writing plugins, first read our
 * plugin tutorial in doc/tutorials!
 *
 * A plugin can implement any functionality related to
 * configuration.
 * There are 6 possible entry points for a plugin.
 * - elektraDocGet() will be called when configuration or the plugin's
 *   contract is retrieved from the key database
 * - elektraDocSet() will be called when configuration is written to the
 *   key database
 * - elektraDocOpen() will be called before any other method of the
 *   plugin is called
 * - elektraDocClose() will be called as last method
 * - elektraDocError() will be called when kdbSet() failed (to give the
 *   plugin a chance to recover/undo its actions)
 * - elektraPluginExport() exports all methods for the plugin.
 *
 * The names described here contain "Doc" within the method's name
 * just because the plugin described in this document is called doc
 * (the doxygen source was generated from src/plugins/doc/doc.h).
 * Always replace Doc with the name of the plugin you
 * are going to implement or use #ELEKTRA_PLUGIN_FUNCTION.
 *
 *
 * @par Overview
 * There are different types of plugins for different concerns.
 * They all only have the entry points as defined above.
 * The types of plugins handled in this document:
 * - A storage plugin gets an empty keyset in elektraDocGet()
 *   and constructs the information out from a file.
 *   In elektraDocSet() the keyset is written to a file.
 *   \n
 *   Other persistent storage then a file is not handled within
 *   this document because it involves many other issues.
 *   For files the resolver plugin already takes care for
 *   transactions and rollback.
 *   So the storage plugin is the source and dump as known
 *   from pipes and filters.
 * - A filter plugin is a plugin which operates on existing keys.
 *   It may process or change the keyset.
 *   Or it may reject specific keysets which do not meet some
 *   criteria.
 *
 * Use following include to have the functions that are not
 * implement by you available:
 *
 * @snippet doc.c plugin include
 *
 * @par Error and Warnings
 * In case of trouble, in some methods you can use
 * the macro #ELEKTRA_SET_ERROR (in other methods it is not allowed).
 * You might add warnings with the macro #ELEKTRA_ADD_WARNING.
 * Read the documentation of the individual methods to
 * decide what you should do.
 *
 * Use following include to have the macros for setting the error
 * and adding the warnings available:
 *
 * @snippet doc.c plugin errors include
 *
 * Do not hesitate to open an issue if anything
 * is unclear.
 *
 * @addtogroup plugin
 * @{
 */





/**
 * @brief Sets the error in the keys metadata.
 *
 * Include kdberrors.h to make it work:
 *
 * @snippet doc.c plugin errors include
 *
 * @ingroup plugin
 *
{'fraction_non_alphanumeric': 0.06471658078205517, 'fraction_numerical': 0.003031221582297666, 'mean_word_length': 3.4288590604026847, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '4379473', 'n_tokens_mistral': 1834, 'n_tokens_neox': 1780, 'n_words': 914}