Hello!
I want to develope some Hollywood plugins, but i need full recurces of standart C. I want to include link libs (f.E. libzip.a) in the plugins.
They need fopen/fclose and so on. Andreas, how i can made it? You have develope the SVG-Plugin which use librsvg.
Develope plugins with link libs in it
- airsoftsoftwair
- Posts: 5673
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Develope plugins with link libs in it
There are several options to solve this:
1) If you are not targetting any Amiga platforms, you can just use the link libs as they are
2) If you want to target Amiga platforms, you need to compile your own version of the link lib and replace all calls to C functions that need constructor/destructor code. This can be done in one of the following ways:
2a) Replace all calls to fopen() etc. by cl->CRTBase->fopen() etc. where "cl" is a pointer to Hollywood's plugin interface. Hollywood will pass this pointer to your InitPlugin() function.
or
2b) Replace all calls to fopen() etc. by cl->DOSBase->hw_FOpen(). This is especially needed if your plugin should be able to load files linked into applets/executables. The standard C lib fopen() won't be able to open them. See: hw_FOpen()
Also read this section in the SDK. It contains an overview of C functions you have to replace:
http://www.hollywood-mal.com/docs/html/ ... SCRT_.html
Functions which don't require constructor/destructor code don't have to be replaced. It's usually only the ones listed in the link above.
1) If you are not targetting any Amiga platforms, you can just use the link libs as they are
2) If you want to target Amiga platforms, you need to compile your own version of the link lib and replace all calls to C functions that need constructor/destructor code. This can be done in one of the following ways:
2a) Replace all calls to fopen() etc. by cl->CRTBase->fopen() etc. where "cl" is a pointer to Hollywood's plugin interface. Hollywood will pass this pointer to your InitPlugin() function.
or
2b) Replace all calls to fopen() etc. by cl->DOSBase->hw_FOpen(). This is especially needed if your plugin should be able to load files linked into applets/executables. The standard C lib fopen() won't be able to open them. See: hw_FOpen()
Also read this section in the SDK. It contains an overview of C functions you have to replace:
http://www.hollywood-mal.com/docs/html/ ... SCRT_.html
Functions which don't require constructor/destructor code don't have to be replaced. It's usually only the ones listed in the link above.