[PD-dev] Problem with renaming setup functions

Thomas Mayer thomas at residuum.org
Thu Nov 14 23:44:44 CET 2013


Hello,

I am currently documenting and refactoring the code of PuREST JSON to be
consistent, but I seem to be unable to rename setup function from
setup_json0x2dencode to json_encode_setup, as after renaming, I get the
following error:

error: load_object: Symbol "setup_json0x2dencode" not found
 json-encode
error: ... couldn't create


Here is the relevant code:

In purest_json.h:

#ifdef _WIN32
	#define APIEXPORT __declspec(dllexport)
	#define APICALL __cdecl
#else
	#define APIEXPORT
	#define APICALL
#endif

/* [json-encode] */
APIEXPORT void APICALL json_encode_setup(void);

In purest_json.c:

#include "purest_json.h"

void purest_json_setup(void) {
	post("PuREST JSON version %s: A library for executing HTTP queries and
encoding and decoding JSON data from Puredata.", PUREST_JSON_VERSION);
	post("(c) Thomas Mayer (Residuum) 2013");
	post("Get the latest source from https://github.com/residuum/PuRestJson");
	post("Website: http://ix.residuum.org/pd/purest_json.html");
	post("Report bugs to: purest-json-bugs at ix.residuum.org");
	rest_setup();
	oauth_setup();
	json_encode_setup();
	json_decode_setup();
	urlparams_setup();
}

And finally in json_encode.c:


void json_encode_setup(void) {
	json_encode_class = class_new(gensym("json-encode"),
(t_newmethod)json_encode_new,
			(t_method)json_encode_free, sizeof(t_json_encode), 0, A_GIMME, 0);
	class_addbang(json_encode_class, (t_method)json_encode_bang);
	class_addmethod(json_encode_class, (t_method)json_encode_add,
gensym("add"), A_GIMME, 0);
	class_addmethod(json_encode_class, (t_method)json_encode_add,
gensym("array"), A_GIMME, 0);
	class_addmethod(json_encode_class, (t_method)json_encode_read,
gensym("read"), A_SYMBOL, A_DEFSYM, 0);
	class_addmethod(json_encode_class, (t_method)json_encode_write,
gensym("write"), A_SYMBOL, A_DEFSYM, 0);
	class_addmethod(json_encode_class, (t_method)json_encode_clear,
gensym("clear"), A_GIMME, 0);
	class_sethelpsymbol(json_encode_class, gensym("json"));
}

-- 
"Theoretically, [the amount of money in circulation] is watched
carefully by clever, serious economists. In practice, all the world's
money is one big swirling, whirling pool." (Cory Doctorow - For The Win)
http://www.residuum.org/



More information about the Pd-dev mailing list