<commit_before>/* 
 * jcom.dataspace
 * External for Jamoma: map input to output: y=f(x)
 * Copyright © 2007
 * 
 * License: This code is licensed under the terms of the GNU LGPL
 * http://www.gnu.org/licenses/lgpl.html 
 */

#include "Jamoma.h"


// Data Structure for this object
typedef struct _dataspace{
	t_object		ob;	
	void			*obex;
	void			*outlet_active;
	void			*outlet_native;
	DataspaceLib	*dataspace;
	long			ac;						// for return values from the dataspace conversion
	t_atom			*av;					//	...
	t_symbol		*attr_dataspace;		// name of the dataspace -- e.g. "temperature"
	t_symbol		*attr_dataspace_active;	// name of the current unit within the dataspace -- e.g. "celsius"
	t_symbol		*attr_dataspace_native;	// name of the desired native unit within the dataspace -- e.g. "celsius"
} t_dataspace;


// Prototypes for methods
void*		dataspace_new(t_symbol *name, long argc, t_atom *argv);
void		dataspace_free(t_dataspace *obj);
void		dataspace_assist(t_dataspace *obj, void *b, long m, long a, char *s);
void		dataspace_int(t_dataspace *obj, long x);
void		dataspace_float(t_dataspace *obj, double x);
void		dataspace_getDataspaces(t_dataspace *obj);
void		dataspace_getUnits(t_dataspace *obj);
t_max_err	dataspace_setDataspace(t_dataspace *obj, void *attr, long argc, t_atom *argv);
t_max_err	dataspace_setDataspaceActive(t_dataspace *obj, void *attr, long argc, t_atom *argv);
t_max_err	dataspace_setDataspaceNative(t_dataspace *obj, void *attr, long argc, t_atom *argv);


// Globals
t_class		*dataspace_class;


/************************************************************************************/
// Main() Function

int main(void)
{
	t_class *c;
	
	jamoma_init();

	// Define our class
	c = class_new("jcom.dataspace",(method)dataspace_new, (method)dataspace_free, (short)sizeof(t_dataspace), (method)0L, A_GIMME, 0);
	class_obexoffset_set(c, calcoffset(t_dataspace, obex));

	// Make methods accessible for our class: 

	class_addmethod(c, (method)dataspace_int,			"int",			A_GIMME, 0L);
	class_addmethod(c, (method)dataspace_float,			"float",		A_GIMME, 0L);
	class_addmethod(c, (method)dataspace_getDataspaces,	"getDataspaces", 0);
 	class_addmethod(c, (method)dataspace_getUnits,		"getUnits",		A_GIMME, 0);
	class_addmethod(c, (method)dataspace_assist,		"assist",		A_CANT, 0L); 
    class_addmethod(c, (method)object_obex_dumpout, 	"dumpout",		A_CANT,0);  
    class_addmethod(c, (method)object_obex_quickref,	"quickref",		A_CANT, 0);

	class_addattr(c, 
		attr_offset_new("dataspace", _sym_symbol, 0,
		(method)0, (method)dataspace_setDataspace, calcoffset(t_dataspace, attr_dataspace)));
	class_addattr(c, 
		attr_offset_new("dataspace.active", _sym_symbol, 0,
		(method)0, (method)dataspace_setDataspaceActive, calcoffset(t_dataspace, attr_dataspace_active)));
	class_addattr(c, 
		attr_offset_new("dataspace.native", _sym_symbol, 0,
		(method)0, (method)dataspace_setDataspaceNative, calcoffset(t_dataspace, attr_dataspace_native)));

	// Finalize our class<commit_msg>changed the parameter's acces syntax, for consistency with all the other stuff I did tonight....  seems though that this is  a problem with getting values, as Max wants it to be called getparameter, when the rest of Jamoma namespace tends to behave in a more parameter.get way... we'll have to discuss that after coffee....<commit_after>/* 
 * jcom.dataspace
 * External for Jamoma: map input to output: y=f(x)
 * Copyright © 2007
 * 
 * License: This code is licensed under the terms of the GNU LGPL
 * http://www.gnu.org/licenses/lgpl.html 
 */

#include "Jamoma.h"


// Data Structure for this object
typedef struct _dataspace{
	t_object		ob;	
	void			*obex;
	void			*outlet_active;
	void			*outlet_native;
	DataspaceLib	*dataspace;
	long			ac;						// for return values from the dataspace conversion
	t_atom			*av;					//	...
	t_symbol		*attr_dataspace;		// name of the dataspace -- e.g. "temperature"
	t_symbol		*attr_dataspace_active;	// name of the current unit within the dataspace -- e.g. "celsius"
	t_symbol		*attr_dataspace_native;	// name of the desired native unit within the dataspace -- e.g. "celsius"
} t_dataspace;


// Prototypes for methods
void*		dataspace_new(t_symbol *name, long argc, t_atom *argv);
void		dataspace_free(t_dataspace *obj);
void		dataspace_assist(t_dataspace *obj, void *b, long m, long a, char *s);
void		dataspace_int(t_dataspace *obj, long x);
void		dataspace_float(t_dataspace *obj, double x);
void		dataspace_getDataspaces(t_dataspace *obj);
void		dataspace_getUnits(t_dataspace *obj);
t_max_err	dataspace_setDataspace(t_dataspace *obj, void *attr, long argc, t_atom *argv);
t_max_err	dataspace_setDataspaceActive(t_dataspace *obj, void *attr, long argc, t_atom *argv);
t_max_err	dataspace_setDataspaceNative(t_dataspace *obj, void *attr, long argc, t_atom *argv);


// Globals
t_class		*dataspace_class;


/************************************************************************************/
// Main() Function

int main(void)
{
	t_class *c;
	
	jamoma_init();

	// Define our class
	c = class_new("jcom.dataspace",(method)dataspace_new, (method)dataspace_free, (short)sizeof(t_dataspace), (method)0L, A_GIMME, 0);
	class_obexoffset_set(c, calcoffset(t_dataspace, obex));

	// Make methods accessible for our class: 

	class_addmethod(c, (method)dataspace_int,			"int",			A_GIMME, 0L);
	class_addmethod(c, (method)dataspace_float,			"float",		A_GIMME, 0L);
	class_addmethod(c, (method)dataspace_getDataspaces,	"dataspaces.get", 0);
 	class_addmethod(c, (method)dataspace_getUnits,		"units.get",		A_GIMME, 0);
	class_addmethod(c, (method)dataspace_assist,		"assist",		A_CANT, 0L); 
    class_addmethod(c, (method)object_obex_dumpout, 	"dumpout",		A_CANT,0);  
    class_addmethod(c, (method)object_obex_quickref,	"quickref",		A_CANT, 0);

	class_addattr(c, 
		attr_offset_new("dataspace", _sym_symbol, 0,
		(method)0, (method)dataspace_setDataspace, calcoffset(t_dataspace, attr_dataspace)));
	class_addattr(c, 
		attr_offset_new("unit.active", _sym_symbol, 0,
		(method)0, (method)dataspace_setDataspaceActive, calcoffset(t_dataspace, attr_dataspace_active)));
	class_addattr(c, 
		attr_offset_new("unit.native", _sym_symbol, 0,
		(method)0, (method)dataspace_setDataspaceNative, calcoffset(t_dataspace, attr_dataspace_native)));

	// Finalize our class
{'fraction_non_alphanumeric': 0.1406101048617731, 'fraction_numerical': 0.0060374960279631395, 'mean_word_length': 5.423469387755102, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3830316', 'n_tokens_mistral': 2573, 'n_tokens_neox': 2336, 'n_words': 546}