FS plugins: some questions

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
sadyc
Junior Member
Junior Member
Posts: 18
Joined: 2004-09-10, 07:57 UTC
Location: Bucharest, Romania

FS plugins: some questions

Post by *sadyc »

If I understood correctly from the help, FS plugins are loaded when needed. But when are they unloaded?

Also, if the plugin is used in more 2 panels or more in the same time. It is still loaded only one time? in this case, who is responsible for synchronization, locking, etc ?

--sadyc
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

If I understood correctly from the help, FS plugins are loaded when needed. But when are they unloaded?
Plugins still loaded until TC exits or command cm_UnloadPlugins executed by user.
It is still loaded only one time?
AFAIK yes, plugin loaded once only.
who is responsible for synchronization, locking, etc ?
It is too general question and depend on what you call "synchronization".
If you mean i.e. call sequence for entries enumeration from different panels, it is TC responsibility.
If plugin have to lock/unlock resources in order to achieve it's function - it is plugin author responsibility, as well as thread-safty.

If you mind some specific case ask more specific question.
sadyc
Junior Member
Junior Member
Posts: 18
Joined: 2004-09-10, 07:57 UTC
Location: Bucharest, Romania

Post by *sadyc »

Thanks for your answers.

I also have some more questions.
How can I compile a FS plugin with mingw ?

I'm using the mingw from Dev-C++ 4.9.9.1.
(gcc (GCC) 3.3.1 (mingw special 20030804-1))

The commands I've tried to compile with:

Code: Select all

gcc.exe -D__DEBUG__ -c list_parts.c -o list_parts.o -I"C:/Dev-Cpp/include"  -Wall   -g3
dllwrap.exe --output-def libtest2.def --implib libtest2.a list_parts.o  -L"C:/Dev-Cpp/lib"  -g3  -o test2.dll
then i rename test2.dll to test2.wfx.
However TC 6.03 says it's an invalid plugin.

I have defined the 3 required functions for a FS plugin.
sadyc
Junior Member
Junior Member
Posts: 18
Joined: 2004-09-10, 07:57 UTC
Location: Bucharest, Romania

Post by *sadyc »

sadyc wrote: How can I compile a FS plugin with mingw ?
Seems that I found something about this in another thread:
http://ghisler.ch/board/viewtopic.php?t=1815&highlight=mingw
Sorry for not searching before asking :P

The solution is to declare the functions with __declspec(dllexport)

And change a little the linker options (add --add-stdcall-alias):

Code: Select all

gcc.exe -D__DEBUG__ -c list_parts.c -o list_parts.o -I"C:/Dev-Cpp/include"  -Wall   -g3
dllwrap.exe --output-def libtest2.def --implib libtest2.a list_parts.o  -L"C:/Dev-Cpp/lib" --add-stdcall-alias  -g3  -o test2.wfx
--sadyc
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Post by *VadiMGP »

The solution is to declare the functions with __declspec(dllexport)
Or define EXPORTS in .def file. It is "compiler-independent" method.
Post Reply