<commit_before>/**********************************************************************
 *
 * PROJECT:		Stringy
 * FILE:		Stringy.c
 * LICENCE:		See Licence.txt
 * PURPOSE:		Re-written standard operations on C strings.
 *
 *				(c) <NAME> 2012-13
 *
 **********************************************************************/

#include "Stringy.h"
#include "Platform/Alloc.h"
#include <string.h>
#include <assert.h>

#define GETWLENGTH(x) x /= sizeof(wchar_t) // Nasty hack for wide string lengths

static char*		last	= NULL;
static wchar_t*		wlast	= NULL;

/**
 * Tests whether the two given strings match.
 * @arg str1 - String 1
 * @arg str2 - String 2
 * @return true if the strings were equal, false otherwise
 */
bool str_equal( const char* str1, const char* str2 )
{
	while ( *str1 == *str2++ )
	{
		if ( !*str1++ ) return true;
	}

	return false;
}

bool wstr_equal( const wchar_t* str1, const wchar_t* str2 )
{
	while ( *str1 == *str2++ )
	{
		if ( !*str1++ ) return true;
	}<commit_msg>Fix a warning about a missing header on linux.<commit_after>/**********************************************************************
 *
 * PROJECT:		Stringy
 * FILE:		Stringy.c
 * LICENCE:		See Licence.txt
 * PURPOSE:		Re-written standard operations on C strings.
 *
 *				(c) <NAME> 2012-13
 *
 **********************************************************************/

#include "Stringy.h"
#include "Platform/Alloc.h"
#include <string.h>
#include <ctype.h>
#include <assert.h>

#define GETWLENGTH(x) x /= sizeof(wchar_t) // Nasty hack for wide string lengths

static char*		last	= NULL;
static wchar_t*		wlast	= NULL;

/**
 * Tests whether the two given strings match.
 * @arg str1 - String 1
 * @arg str2 - String 2
 * @return true if the strings were equal, false otherwise
 */
bool str_equal( const char* str1, const char* str2 )
{
	while ( *str1 == *str2++ )
	{
		if ( !*str1++ ) return true;
	}

	return false;
}

bool wstr_equal( const wchar_t* str1, const wchar_t* str2 )
{
	while ( *str1 == *str2++ )
	{
		if ( !*str1++ ) return true;
	}
{'fraction_non_alphanumeric': 0.2598231827111984, 'fraction_numerical': 0.019646365422396856, 'mean_word_length': 3.9562043795620436, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '2512469', 'n_tokens_mistral': 727, 'n_tokens_neox': 689, 'n_words': 210}