Wow, lot ot very interesting things here... many thanks.
Now, with your help, i see better what i want and i will try to explain it.
In a normal world, when you create a library, you have to export each function/procedure you want be accessible.
Here a traditional library :
library mylib;
...
begin
...
procedure proc1(x, y, z : integer); /// EXPORTED
begin
// something...
end;
procedure proc2(x : string); /// EXPORTED
begin
// something...
end;
procedure proc3(x : boolean); /// EXPORTED
begin
// something...
end;
...
export
proc1 name 'proc1';
proc2 name 'proc2';
proc3 name 'proc3';
end.
You need a wrapper/header for your main program, with declaration of the exported procedures..
And your main application will use the library like this :
program myprog;
uses
...
mylib, // the header of the library
...
begin
proc1(1,2,3);
proc2('yep');
proc3(false);
end.
In the not classical library, only one procedure will be exported .
And that alone procedure will run script that call procedure who are part of the library, but NOT exported.
library mynotnormallib;
...
begin
...
procedure proc1(x, y, z : integer); /// NOT EXPORTED
begin
// something...
end;
procedure proc2(x : string); /// NOT EXPORTED
begin
// something...
end;
procedure proc3(x : boolean); ///NOT EXPORTED
begin
// something...
end;
procedure run_lib_script(thescript : string) ; cdecl; /// THIS IS EXPORTED
begin
fpc_run_script(thescript) ; //// here run the script and HOW to DO that ?
end;
...
export
run_lib_script name 'run_lib_script'; /// only one procedure exported
end.
And your main application will use the library like this :
program myprog;
uses
...
mynotnormallib, // the header of the library with only one exported proc.
...
begin
run_lib_script('proc3(false)');
run_lib_script('proc2('yep')');
run_lib_script('proc1(1,2,3)');
end.
Hum, is it possible ?