Help with compiling plugins

A place where plug-in developers can share their knowledge and experience.
Locked
pepak
Posts: 44
Joined: Wed May 03, 2006 5:10 pm

Help with compiling plugins

Post by pepak »

Hi!

If there is anyone patient enough, I need help compiling FAR plugins. First a little background:

I want to modify the Advanced Compare plugin to 1) display a progress indicator (I use A.C. to verify my burned DVDs) and 2) to display a list of files that don't match (as opposed to the default behavior of just selecting those files - which is rather less useful if those files are in subdirectories).

The problem is that I have never programmed in C/C++. During my computer life I managed to learn enough of C to be able to read the code and even perform such minor modifications as those that I intend to do with A.C., but I have never actually written anything in C and I am having problems compiling the plugins - I just don't know how to deal with error messages that show up (I mean, I can fix the usual syntax errors, but not things like missing headers or libraries).

Curiously enough, all C programming guides I have found deal with writing the code (you know, stuff like "int is a 32bit integer number from -2^31 to 2^31-1" and "to print variables use printf()") but not with compiling it. I would appreciate if someone could point me to some place where I could learn about these things.

A guide to what programs the developers use to compile the standard FAR plugins and their set up would be welcome, too.
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

pepak
The AdvCompare plugin compiles flawlessly with the latest Mingw and MSYS - http://www.mingw.org/ with the supplied makefile.

I use those packeges:

mingw32-make-3.80.0-3.exe
MSYS-1.0.11-2004.04.30-1.exe
binutils-2.16.91-20060119-1.tar.gz
gcc-core-3.4.5-20051220-1.tar.gz
"gcc-g++-3.4.5-20051220-1.tar.gz"
mingw-runtime-3.9.tar.gz
mingw-utils-0.3.tar.gz
w32api-3.7.tar.gz

Before you make any changes you beter contact me as the plugin was updated a bit and the code has changed (it still is beeing updated).
pepak
Posts: 44
Joined: Wed May 03, 2006 5:10 pm

Post by pepak »

Thanks, I will give it a try.

The main thing I want to add is a progress indicator for the current file and for all files (just like a copy progress indicator).
pepak
Posts: 44
Joined: Wed May 03, 2006 5:10 pm

Post by pepak »

Great! Even with my read-only knowledge of C I managed to add the progress bar to the compare plugin. It certainly isn't as efficient as it could be, I prefered to go for certainty rather than for the top speed, but it works. I have a few questions though:

1) I am using FARINT64 for filesizes. Is it necessary? Wouldn't __int64 suffice? It would at least allow me to set the Progress and Maximum parameters of ShowMessage as optional. I am also not quite sure if it is actually safe to use __int64 for calculations - judging by its name it is a proprietary extension - can I count on the fact that it will always be supported?

2) Is there some standard way to get the progress bar characters from FAR or do I have to use 0xb0 and 0xdb directly?

3) On a related note - I have a faint recollection of reading about FAR having a standard function for creating a progress bar. I can't find where I read about it, though - or even, if I really did. Anyway, even if there is no such function if FAR yet, it might be worth it to include it among the standard functions.

If anyone is interested, here is the modified source as well as the compiled DLL.
You do not have the required permissions to view the files attached to this post.
rola
Posts: 2
Joined: Thu Jan 17, 2008 5:47 am

Post by rola »

WOW, I just want to say I come right place. :roll:
Locked