Library loading

Imagine allows the loading of dynamic libraries and the description of function call interfaces between libraries and host applications. The host starts by creating an interface and then load function pointers in to it. It then loads a library that can access these functions pointers to comunicate with the host application. The same interface can be used for multiple loaded libraries.

imagine_library_interface_create

IInterface *imagine_library_interface_create();

Description: Create an interface.

imagine_library_interface_destroy

void imagine_library_interface_destroy(IInterface *i);

Description: Destroy an interface.

imagine_library_interface_register

void imagine_library_interface_register(IInterface *i, void *funtion_pointer, char *name);

Description: load a function pointer with a name in to identy fy it in to an interface

imagine_library_interface_count

int imagine_library_interface_count(IInterface *i);

Description: Find ount hown many functions are available in the interface.

imagine_library_interface_list

char *imagine_library_interface_list(IInterface *i, uint number);

Description: Get the name of a specific function in the interface.

imagine_library_interface_get_by_number

void *imagine_library_interface_get_by_number(IInterface *i, uint number);

Description: Get the function pointer belonging to a specific number from an interface.

imagine_library_interface_get_by_name

void *imagine_library_interface_get_by_name(IInterface *i, char *name);

Description: Look up a function pointer by name from an interface. Returns NULL is not available

imagine_library_load

ILib *imagine_library_load(char *path, IInterface *i, char *interface_name);

Description: Load a library.

imagine_library_unload

void imagine_library_unload(ILib *lib, boolean interface_delete);

Description: Deletes a library. if interface_delete is set top TRUE, the interface used to load the library will als be deleted