Hello Chow,<br><br>Thanks for your feedback :-) I've fixed the issues you mentionned (I hope) and upgraded a little bit my code. Since now I always used my small compile script which is very simple :<br><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">#!/bin/sh</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">source="src/Plugin.c"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">output="XMLPrettyPrinter"</span><br><br><span style="font-family: courier new,monospace;">gcc -std=c99 -o "$output.o" -Wall -c -fpic "$source" `pkg-config --cflags geany libxml-2.0`</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">gcc -shared -o "$output.so" "$output.o" `pkg-config --libs geany libxml-2.0`</span><br><br>And so far there was no compile error. Can you explain me how to use the automatic build so I won't commit unbuildable code ?<br>
One more question : in my Plugin.c file, I #include the PrettyPrinter.c file because at if I use PrettyPrinter.h, at runtime Geany said me that it was unable to find the reference to my PrettyPrinter options... Maybe something wrong in my compilation script ? That's a problem of linking isn't it ?<br>
<br>I you have any other comment, please let me know :-)<br><br>Best regards,<br>Cedric<br><br><div class="gmail_quote">On Mon, Aug 10, 2009 at 5:46 PM, Chow Loong Jin <span dir="ltr"><<a href="mailto:hyperair@gmail.com">hyperair@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Monday 10,August,2009 05:56 PM, Cédric Tabin wrote:<br>
> Hi Franck,<br>
><br>
> I put my plugin where you said already =><br>
> <a href="http://geany-plugins.svn.sourceforge.net/viewvc/geany-plugins/trunk/pretty-printer/" target="_blank">http://geany-plugins.svn.sourceforge.net/viewvc/geany-plugins/trunk/pretty-printer/</a><br>
> I'll wait for your commit of the build system, so I can try it on my<br>
> computer :-)<br>
<br>
</div>Hi Cédric,<br>
<br>
I've just integrated your plugin into the Autotools build system.<br>
However, your plugin still does not compile. Here are the issues<br>
preventing it from compiling:<br>
1. Declaration of variables inside a for loop<br>
In C++, we like this:<br>
for (int i = 0; ...<br>
<br>
In C, we don't. We do this:<br>
int i;<br>
for (i = 0; ...<br>
<br>
2. Bad #include.<br>
We don't like to #include .c files. I suspect this is a typo, which<br>
causes multiple definitions of a function, resulting in problems<br>
linking. See line 27 of pretty-printer/src/Plugin.c: #include<br>
"PrettyPrinter.c".<br>
<br>
3. Missing decls for TRUE and FALSE.<br>
TRUE and FALSE are defined in the header "glib/gmacros.h", found in<br>
/usr/include/glib-2.0 on Debian and its derivatives. I suspect you<br>
forgot to include this in PrettyPrinter.c<br>
<br>
A minor issue that should be fixed anyway:<br>
1. Usage of the "boolean" type<br>
Rather than #define boolean int, how about using the gboolean datatype,<br>
found in the header "glib/gtypes.h", found in /usr/include/glib-2.0?<br>
<br>
Now for some cosmetic issues:<br>
1. Long lines<br>
Long lines are a pain to read and destroy the entire purpose of<br>
indentation if they wrap. I believe the general consensus is 80<br>
characters per line. I'd suggest reducing your lines to fit that length,<br>
and chopping some lines up into smaller lines.<br>
<br>
Trivia: A dot matrix printer can only have 80 characters in a line<br>
before they get wrapped!<br>
<br>
2. Copyright headers<br>
Your files have a license header, which is good. However, for GPL files,<br>
it is generally customary to have something like this:<br>
<br>
Copyright (C) <year> <name of author><br>
<br>
This program is free software; you can redistribute it and/or modify<br>
it under the terms of the GNU General Public License as published by<br>
the Free Software Foundation; either version 2 of the License, or<br>
(at your option) any later version.<br>
<br>
This program is distributed in the hope that it will be useful,<br>
but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
GNU General Public License for more details.<br>
<br>
You should have received a copy of the GNU General Public License along<br>
with this program; if not, write to the Free Software Foundation, Inc.,<br>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.<br>
<br>
This block is found near the end of the GPL license text. A copy can be<br>
found in /usr/share/common-licenses/GPL-2 on Debian and its derivatives.<br>
<br>
<br>
<br>
I would have fixed the compilation issues for you, but I figured that<br>
since you mentioned you'd like to hear suggestions so you can learn, it<br>
would be good for you to fix these yourself. :-)<br>
<br>
--<br>
Kind regards,<br>
<font color="#888888">Chow Loong Jin<br>
<br>
</font><br>_______________________________________________<br>
Geany-devel mailing list<br>
<a href="mailto:Geany-devel@uvena.de">Geany-devel@uvena.de</a><br>
<a href="http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel" target="_blank">http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel</a><br>
<br></blockquote></div><br>