<commit_before>/* 
 * Jamoma RampUnit Glue & Wrapper
 * This glue code wraps access to a RampUnit with a C++ API
 *
 * By <NAME>, Copyright � 2007
 * 
 * License: This code is licensed under the terms of the GNU LGPL
 * http://www.gnu.org/licenses/lgpl.html 
 */


#include "ext.h"
#include "ext_obex.h"
#include "ext_hashtab.h"
#include "RampUnitWrap.h"

static t_hashtab	*rampunit_cache = NULL;		// cache of all previously loaded rampunit bundles


rampunit::rampunit(char *filename, rampunit_method_callback_type pf_callback, void *baton)
{			
	char 			*temppath;
	short 			path;					// pathID#
	long			outtype;				// the file type that is actually true
	char 			fullpath[512];			// path and name passed on to the plug-in loader		
	char			extended_filename[256];	// has file extension added
#ifdef MAC_VERSION
	CFBundleRef		bun = NULL;
	CFURLRef 		url = NULL;
#else // WIN_VERSION
	HANDLE			hLib = NULL;
	char			winpath[512];
#endif
	
	// 0. Look for the rampunit in the cache
	if(rampunit_cache){
#ifdef MAC_VERSION
		hashtab_lookup(rampunit_cache, gensym(filename), (t_object **)&bun);
		if(bun)
#else // WIN_VERSION
		hashtab_lookup(rampunit_cache, gensym(filename), (t_object **)&hLib);
		if(hLib)
#endif
			goto fetchpointers;
	}
	else
		rampunit_cache = hashtab_new(17);

	// 1. Find and open the RampUnit plug-in from the searchpath
	strcpy(extended_filename, filename);<commit_msg>extremely minor optimization<commit_after>/* 
 * Jamoma RampUnit Glue & Wrapper
 * This glue code wraps access to a RampUnit with a C++ API
 *
 * By <NAME>, Copyright � 2007
 * 
 * License: This code is licensed under the terms of the GNU LGPL
 * http://www.gnu.org/licenses/lgpl.html 
 */


#include "ext.h"
#include "ext_obex.h"
#include "ext_hashtab.h"
#include "RampUnitWrap.h"

static t_hashtab	*rampunit_cache = NULL;		// cache of all previously loaded rampunit bundles


rampunit::rampunit(char *filename, rampunit_method_callback_type pf_callback, void *baton)
{			
	char 			*temppath;
	short 			path;					// pathID#
	long			outtype;				// the file type that is actually true
	char 			fullpath[512];			// path and name passed on to the plug-in loader		
	char			extended_filename[256];	// has file extension added
#ifdef MAC_VERSION
	CFBundleRef		bun = NULL;
	CFURLRef 		url = NULL;
#else // WIN_VERSION
	HANDLE			hLib = NULL;
	char			winpath[512];
#endif
	
	// 0. Look for the rampunit in the cache
	if(rampunit_cache){
#ifdef MAC_VERSION
		hashtab_lookup(rampunit_cache, gensym(filename), (t_object **)&bun);
		if(bun)
#else // WIN_VERSION
		hashtab_lookup(rampunit_cache, gensym(filename), (t_object **)&hLib);
		if(hLib)
#endif
			goto fetchpointers;
	}
	else
		rampunit_cache = hashtab_new(7);

	// 1. Find and open the RampUnit plug-in from the searchpath
	strcpy(extended_filename, filename);
{'fraction_non_alphanumeric': 0.10507505360972123, 'fraction_numerical': 0.011794138670478913, 'mean_word_length': 3.8175559380378656, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '3099127', 'n_tokens_mistral': 1120, 'n_tokens_neox': 1017, 'n_words': 297}