<commit_before>//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by <NAME>
// Last modified: 02/19/2002 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_internal.h
//
// Description: Internal stuff for DevIL
//
//-----------------------------------------------------------------------------

#ifndef INTERNAL_H
#define INTERNAL_H


#define _IL_BUILD_LIBRARY

// Standard headers
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>

// Local headers
#ifdef _WIN32
	#define HAVE_CONFIG_H
#endif

#ifdef HAVE_CONFIG_H
	#include <IL/config.h>
#endif

#include <IL/il.h>
#include <IL/devil_internal_exports.h>

#include "il_files.h"
#include "il_endian.h"

// Windows-specific
#ifdef _WIN32
	#ifdef _MSC_VER
		#if _MSC_VER > 1000
			#pragma once
			#pragma intrinsic(memcpy)
			#pragma intrinsic(memset)
			#pragma intrinsic(strcmp)
			#pragma intrinsic(strlen)
			#pragma intrinsic(strcpy)
			#if _MSC_VER >= 1300  // Erroneous size_t conversion warnings
				#pragma warning(disable : 4267)
			#endif
			#pragma comment(linker, "/NODEFAULTLIB:libc")
			#pragma comment(linker, "/NODEFAULTLIB:libcd")
			#pragma comment(linker, "/NODEFAULTLIB:libcmt.lib")
			#ifdef _DEBUG
				#pragma comment(linker, "/NODEFAULTLIB:libcmtd")
				#pragma comment(linker, "/NODEFAULTLIB:msvcrt.lib")
			#endif // _DEBUG
		#endif // _MSC_VER > 1000
	#endif
	#define WIN32_LEAN_AND_MEAN  // Exclude rarely-used stuff from Windows headers
	#include <windows.h>
#endif


// Windows has a TEXT macro defined in WinNT.h that makes string Unicode if UNICODE is defined.
/*#ifndef _WIN32
	#define IL_TEXT(s) s
#endif*/

/*#ifdef _WIN32_WCE
	#define IL_TEXT(s) ((char*)TEXT(s))
#elif _WIN32
	#define IL_TEXT(s) (s)
#else
	#define IL_TEXT(s) (s)
	#define TEXT(s) (s)
#endif*/

#ifdef _UNICODE
	#define IL_TEXT(s) L##s
#else
	#define IL_TEXT(s) (s)
#endif

#ifdef IL_INLINE_ASM
	#ifdef _MSC_VER  // MSVC++ only
		#define USE_WIN32_ASM
	#endif
#endif


extern ILimage *iCurImage;


#define BIT_0	0x00000001
#define BIT_1	0x00000002
#define BIT_2	0x00000004
#define BIT_3	0x00000008
#define BIT_4	0x00000010
#define BIT_5	0x00000020
#define BIT_6	0x00000040
#define BIT_7	0x00000080
#define BIT_8	0x00000100
#define BIT_9	0x00000200
#define BIT_10	0x00000400
#define BIT_11	0x00000800
#define BIT_12	0x00001000
#define BIT_13	0x00002000
#define BIT_14	0x00004000
#define BIT_15	0x00008000
#define BIT_16	0x00010000
#define BIT_17	0x00020000
#define BIT_18	0x00040000
#define BIT_19	0x00080000
#define BIT_20	0x00100000
#define BIT_21	0x00200000
#define BIT_22	0x00400000
#define BIT_23	0x00800000
#define BIT_24	0x01000000
#define BIT_25	0x02000000
#define BIT_26	0x04000000
#define BIT_27	0x08000000
#define BIT_28	0x10000000
#define BIT_29	0x20000000
#define BIT_30	0x40000000
#define BIT_31	0x80000000

#define NUL '\0'  // Easier to type and ?portable?


#if !_WIN32 || _WIN32_WCE
	int stricmp(const char *src1, const char *src2);
	int strnicmp(const char *src1, const char *src2, size_t max);
#endif//_WIN32

int iStrCmp(const ILstring src1, const ILstring src2);


//
// Useful miscellaneous functions
//

ILboolean	iCheckExtension(const ILstring Arg, const ILstring Ext);
ILbyte*		iFgets(char *buffer, ILuint maxlen);
ILboolean	iFileExists(const ILstring FileName);
ILstring	iGetExtension(const ILstring FileName);
char*		ilStrDup(const char *Str);
ILuint		ilStrLen(const char *Str);


// Miscellaneous functions
ILvoid					ilDefaultStates(ILvoid);
ILenum					iGetHint(ILenum Target);
ILint					iGetInt(ILenum Mode);<commit_msg>Added a fast integer squareroot<commit_after>//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2002 by <NAME>
// Last modified: 02/19/2002 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_internal.h
//
// Description: Internal stuff for DevIL
//
//-----------------------------------------------------------------------------

#ifndef INTERNAL_H
#define INTERNAL_H


#define _IL_BUILD_LIBRARY

// Standard headers
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>

// Local headers
#ifdef _WIN32
	#define HAVE_CONFIG_H
#endif

#ifdef HAVE_CONFIG_H
	#include <IL/config.h>
#endif

#include <IL/il.h>
#include <IL/devil_internal_exports.h>

#include "il_files.h"
#include "il_endian.h"

// Windows-specific
#ifdef _WIN32
	#ifdef _MSC_VER
		#if _MSC_VER > 1000
			#pragma once
			#pragma intrinsic(memcpy)
			#pragma intrinsic(memset)
			#pragma intrinsic(strcmp)
			#pragma intrinsic(strlen)
			#pragma intrinsic(strcpy)
			#if _MSC_VER >= 1300  // Erroneous size_t conversion warnings
				#pragma warning(disable : 4267)
			#endif
			#pragma comment(linker, "/NODEFAULTLIB:libc")
			#pragma comment(linker, "/NODEFAULTLIB:libcd")
			#pragma comment(linker, "/NODEFAULTLIB:libcmt.lib")
			#ifdef _DEBUG
				#pragma comment(linker, "/NODEFAULTLIB:libcmtd")
				#pragma comment(linker, "/NODEFAULTLIB:msvcrt.lib")
			#endif // _DEBUG
		#endif // _MSC_VER > 1000
	#endif
	#define WIN32_LEAN_AND_MEAN  // Exclude rarely-used stuff from Windows headers
	#include <windows.h>
#endif


// Windows has a TEXT macro defined in WinNT.h that makes string Unicode if UNICODE is defined.
/*#ifndef _WIN32
	#define IL_TEXT(s) s
#endif*/

/*#ifdef _WIN32_WCE
	#define IL_TEXT(s) ((char*)TEXT(s))
#elif _WIN32
	#define IL_TEXT(s) (s)
#else
	#define IL_TEXT(s) (s)
	#define TEXT(s) (s)
#endif*/

#ifdef _UNICODE
	#define IL_TEXT(s) L##s
#else
	#define IL_TEXT(s) (s)
#endif

#ifdef IL_INLINE_ASM
	#ifdef _MSC_VER  // MSVC++ only
		#define USE_WIN32_ASM
	#endif
#endif


extern ILimage *iCurImage;


#define BIT_0	0x00000001
#define BIT_1	0x00000002
#define BIT_2	0x00000004
#define BIT_3	0x00000008
#define BIT_4	0x00000010
#define BIT_5	0x00000020
#define BIT_6	0x00000040
#define BIT_7	0x00000080
#define BIT_8	0x00000100
#define BIT_9	0x00000200
#define BIT_10	0x00000400
#define BIT_11	0x00000800
#define BIT_12	0x00001000
#define BIT_13	0x00002000
#define BIT_14	0x00004000
#define BIT_15	0x00008000
#define BIT_16	0x00010000
#define BIT_17	0x00020000
#define BIT_18	0x00040000
#define BIT_19	0x00080000
#define BIT_20	0x00100000
#define BIT_21	0x00200000
#define BIT_22	0x00400000
#define BIT_23	0x00800000
#define BIT_24	0x01000000
#define BIT_25	0x02000000
#define BIT_26	0x04000000
#define BIT_27	0x08000000
#define BIT_28	0x10000000
#define BIT_29	0x20000000
#define BIT_30	0x40000000
#define BIT_31	0x80000000

#define NUL '\0'  // Easier to type and ?portable?


#if !_WIN32 || _WIN32_WCE
	int stricmp(const char *src1, const char *src2);
	int strnicmp(const char *src1, const char *src2, size_t max);
#endif//_WIN32

int iStrCmp(const ILstring src1, const ILstring src2);

//
// Some math functions
//

// A fast integer squareroot, completely accurate for x < 289.
// Taken from http://atoms.org.uk/sqrt/
// There is also a version that is accurate for all integers
// < 2^31, if we should need it
int iSqrt(int x);

//
// Useful miscellaneous functions
//

ILboolean	iCheckExtension(const ILstring Arg, const ILstring Ext);
ILbyte*		iFgets(char *buffer, ILuint maxlen);
ILboolean	iFileExists(const ILstring FileName);
ILstring	iGetExtension(const ILstring FileName);
char*		ilStrDup(const char *Str);
ILuint		ilStrLen(const char *Str);


// Miscellaneous functions
ILvoid					ilDefaultStates(ILvoid);
ILenum					iGetHint(ILenum Target);
ILint					iGetInt(ILenum Mode);
{'fraction_non_alphanumeric': 0.14274258219727345, 'fraction_numerical': 0.1082598235765838, 'mean_word_length': 3.7692797960484383, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 16, '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': '4764404', 'n_tokens_mistral': 3422, 'n_tokens_neox': 2752, 'n_words': 750}