<commit_before>/**
 * @file
 *
 * @brief
 *
 * @copyright BSD License (see doc/LICENSE.md or https://www.libelektra.org)
 *
 */

#ifndef SWIG_TYPE_TABLE
#error Build system error, SWIG_TYPE_TABLE is not defined
#endif

#include <ruby.h>

#ifndef HAVE_KDBCONFIG
#include <kdbconfig.h>
#endif

#include <kdbmacros.h>

#include SWIG_RUNTIME
#include "ruby.hpp"

#include <key.hpp>
#include <keyset.hpp>

/* for global variable access */
#include <mutex>

#include <kdbassert.h>
#include <kdberrors.h>
#include <kdblogger.h>

#include <stdarg.h>

using namespace ckdb;

typedef struct
{
	VALUE rbInstance = Qnil;

} moduleData;


/*
 * CPP helper function to create new Ruby objects
 */

/* create a new Ruby Kdb::Key object from the given ckdb::Key
 * will be deleted by the Ruby gc. */
static inline VALUE newRubyObject (ckdb::Key * key)
{
	return SWIG_NewPointerObj (new kdb::Key (key), SWIG_TypeQuery ("kdb::Key *"), 1);
}

/* create a new Ruby object and take ownership of this object, thus given keySet will be deleted by
 * the Ruby gc. */
static inline VALUE newRubyObject (kdb::KeySet * keySet)
{
	return SWIG_NewPointerObj (keySet, SWIG_TypeQuery ("kdb::KeySet *"), 1);
}

/*
 * Plugin global variables<commit_msg>ruby: give the struct a name<commit_after>/**
 * @file
 *
 * @brief
 *
 * @copyright BSD License (see doc/LICENSE.md or https://www.libelektra.org)
 *
 */

#ifndef SWIG_TYPE_TABLE
#error Build system error, SWIG_TYPE_TABLE is not defined
#endif

#include <ruby.h>

#ifndef HAVE_KDBCONFIG
#include <kdbconfig.h>
#endif

#include <kdbmacros.h>

#include SWIG_RUNTIME
#include "ruby.hpp"

#include <key.hpp>
#include <keyset.hpp>

/* for global variable access */
#include <mutex>

#include <kdbassert.h>
#include <kdberrors.h>
#include <kdblogger.h>

#include <stdarg.h>

using namespace ckdb;

typedef struct _moduleData
{
	VALUE rbInstance = Qnil;

} moduleData;


/*
 * CPP helper function to create new Ruby objects
 */

/* create a new Ruby Kdb::Key object from the given ckdb::Key
 * will be deleted by the Ruby gc. */
static inline VALUE newRubyObject (ckdb::Key * key)
{
	return SWIG_NewPointerObj (new kdb::Key (key), SWIG_TypeQuery ("kdb::Key *"), 1);
}

/* create a new Ruby object and take ownership of this object, thus given keySet will be deleted by
 * the Ruby gc. */
static inline VALUE newRubyObject (kdb::KeySet * keySet)
{
	return SWIG_NewPointerObj (keySet, SWIG_TypeQuery ("kdb::KeySet *"), 1);
}

/*
 * Plugin global variables
{'fraction_non_alphanumeric': 0.12444264288609648, 'fraction_numerical': 0.0016214025131738954, 'mean_word_length': 4.353579175704989, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4408497', 'n_tokens_mistral': 899, 'n_tokens_neox': 873, 'n_words': 277}