Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
29 user(s) are online (19 user(s) are browsing Forums)

Members: 0
Guests: 29

more...

Support us!

Headlines

 
  Register To Post  

Library function exist ?
Quite a regular
Quite a regular


See User information
Hi all,

I've checked in the exec autodoc, and over the net without finding a solution.

I'd like to know if,
when we open a .library using IExec->OpenLibrary( char *libname, int ver );
if there is a function to know if a specific function exist in the lirary. Something like :

GetFunctionExist( char* lifunctionname, void *libtruct );

Possible ?

Regards,
Freddix / AmiDARK

All we have to decide is what to do with the time that is given to us.
Go to top
Re: Library function exist ?
Supreme Council
Supreme Council


See User information
@freddix

No, purely because functions are stored as vectors, it has no concept of a function "name".

The name of a function is purely there to specify the vector offset to the compiler from within human readable source code. You can check manually by interogating the interafce file for the library concerned.

Programatically, you may need to check the version and revision numbers after opening the library to see if the required function is available, but you need to know beforehand.

Simon

Go to top
Re: Library function exist ?
Quite a regular
Quite a regular


See User information
@freddix
It's what I believed ... but I hoped for a solution ...
so ..
no function like "DLL Open" from DarkBASIC Pro in AmiDARK Engine.

All we have to decide is what to do with the time that is given to us.
Go to top
Re: Library function exist ?
Just popping in
Just popping in


See User information
@freddix

Not with standard Amiga shared libraries. But you can generate a library in form of an ELF file (binary) in which you preserve the symbols of the functions you want to use later, and use elf.library to retrieve pointers on them.

Go to top
Re: Library function exist ?
Quite a regular
Quite a regular


See User information
@centaurz
Yes, but for what I need, this method is not adapted.

The objective was to add commands like in DarkBASIC Professional / DarkGDK :

OpenDLL( char *DllName, int DLLChannel )
CloseDLL( int DLLChannel )
FunctionExistDLL( int DLLChannel, char *DLLFunctionName )
FunctionCallDLL( int DLLChannel, char *DLLFunctionName, DWORD Arg1, ... )

User must have to use only these ones .. if he had to recompile a library or something else .. the command set will become too complex for a language similar to BASIC(s) ;)

so, I'll remove the Library version (of DLL command set) in AmiDARK Engine project.

Regards,
Freddix / AmiDARK

All we have to decide is what to do with the time that is given to us.
Go to top
Re: Library function exist ?
Just popping in
Just popping in


See User information
@freddix

Actually anyone who has a fully installed software developer kit should have an SFD file for each library. If an SFD file is anything like its predecessor the FD file it should be possible to probe the SFD file to find out what function names are in a library, what parameters correspond to which registers in the processor and stuff like that. It would only work under AmigaOS 4.x however and it would require a system assign to the directory containing the SFD files and furthermore probing them is deprecated except for using an external executable.

Maybe it's better if you do leave this function out for a while until the ABI settles to a permanent standard.

Go to top
Re: Library function exist ?
Quite a regular
Quite a regular


See User information
@Samurai_Crow
Yes I know this but it don't solve the case of lib not included in the SDK ...

All we have to decide is what to do with the time that is given to us.
Go to top
Re: Library function exist ?
Amigans Defender
Amigans Defender


See User information
@freddix

you can use shared objects. load them with dlopen()/dlclose and use dlsym() to load/test the function existence:

http://www.opengroup.org/onlinepubs/009695399/functions/dlsym.html

i'm really tired...
Go to top
Re: Library function exist ?
Quite a regular
Quite a regular


See User information
@afxgroup:
Nice idea :)
I'll check this carefully :)
if I can replace the DLL functions with so support ones, it can be a good (similarity) replacement.

Regards,
Freddix / AmiDARK.

All we have to decide is what to do with the time that is given to us.
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project