<commit_before>#include "pch.h"
#include "jnc_Library.h"
#include "jnc_StdLib.h"

namespace jnc {

//.............................................................................

bool 
Library::loadImpl (const char* fileName)
{
	bool result = getDynamicLibrary ()->load (fileName);
	if (!result)
	{
		err::pushFormatStringError ("cannot load library '%s'", fileName);
		return false;
	}

	return true;
}

void* 
Library::getFunctionImpl (const char* name)
{
	ASSERT (sizeof (mt::DynamicLibrary) == sizeof (m_handle));

	if (!m_handle)
	{
		err::setError (err::SystemErrorCode_InvalidDeviceState);
		return NULL;
	}

	void* p = getDynamicLibrary ()->getFunction (name);
	if (!p)
	{
		err::pushFormatStringError ("cannot get library function '%s'", name);
		return NULL;
	}

	return p;
}

//.............................................................................

} // namespace jnc
<commit_msg>[jancy] remove duplicate strings in dynamic library error messages<commit_after>#include "pch.h"
#include "jnc_Library.h"
#include "jnc_StdLib.h"

namespace jnc {

//.............................................................................

bool 
Library::loadImpl (const char* fileName)
{
	bool result = getDynamicLibrary ()->load (fileName);
	if (!result)
	{
#if (_AXL_ENV == AXL_ENV_WIN)
		err::pushFormatStringError ("cannot load library '%s'", fileName);
#endif
		return false;
	}

	return true;
}

void* 
Library::getFunctionImpl (const char* name)
{
	ASSERT (sizeof (mt::DynamicLibrary) == sizeof (m_handle));

	if (!m_handle)
	{
		err::setError (err::SystemErrorCode_InvalidDeviceState);
		return NULL;
	}

	void* p = getDynamicLibrary ()->getFunction (name);
	if (!p)
	{
#if (_AXL_ENV == AXL_ENV_WIN)
		err::pushFormatStringError ("cannot get library function '%s'", name);
#endif
		return NULL;
	}

	return p;
}

//.............................................................................

} // namespace jnc

{'fraction_non_alphanumeric': 0.28645563051375195, 'fraction_numerical': 0.0, 'mean_word_length': 2.251264755480607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5684920', 'n_tokens_mistral': 602, 'n_tokens_neox': 586, 'n_words': 152}