Beispiel #1
0
void *IoCFFILibrary_rawGetFuctionPointer_(IoCFFILibrary *self, const char *name)
{
	DynLib *library = DATA(self)->library;

	if (!library)
	{
		const char *name = CSTRING(IoObject_getSlot_(self, IOSYMBOL("name")));

		library = DATA(self)->library = DynLib_new();
		DynLib_setPath_(library, name);
		DynLib_open(library);
	}

	return DynLib_pointerForSymbolName_(library, name);
}
Beispiel #2
0
IoDynLib *IoDynLib_open(IoDynLib *self, IoObject *locals, IoMessage *m)
{
	/*doc DynLib open
	Opens the dynamic library and returns self or raises a DynLoad.open Error if there is an error. 
	*/

	if (IoMessage_argCount(m))
	{
		IoDynLib_setPath(self, locals, m);
	}

	DynLib_open(DATA(self));

	if (DynLib_error(DATA(self)))
	{
		IoState_error_(IOSTATE, m, "Error loading object '%s': '%s'",
					DynLib_path(DATA(self)), DynLib_error(DATA(self)));
	}

	return self;
}