Re: [AD] Makedoc patch (was: 4.0.x branch)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> > I think we could merge it (but I won't do it myself).  Grzegorz, do
> > you agree ?
> 
> Of course. The compiled help looks really nice with css and Elias' patch
> has been sitting in my mail inbox for some time. I was going to merge
> it myself after the first patch was commited, but Elias was faster than me.

Heh, I guess I should have waited then, your code would probably have been
nicer :) (I just copied the TOC generation from makehtml.c and left out the
parts I didn't understand..)

[..]
> I won't be doing this myself due to lack of time, but Elias, if you are
> willing to modify your patch, create a wrapper like write_chm for this
> which calls write_html (maybe in a custom chm directory to not overwrite
> the html one if this is considered harmful), write_hhp, write_hhk and
> write_hhc (which then could be made static internal). The first thing
> to do in the wrapper is to check for the existance of hhc.exe and exit
> if it's not found.

Done.
 
> You proposed doing this with the makefile, but it's safer if you use
> getenv, strtok and fstat to check in a loop the presence of the binary
> somewhere in the PATH environment variable.  A refinement would be to even
> run "hhc -v" or something like that to check the output for a specific
> string, but I haven't tried if hhc supports such a 'friendly' feature. In
> any case, makedoc should report a verbose error message with instructions
> of what to do (where to get the hhc compiler) in case hhc.exe isn't found.

I did the checking for hhc by issuing a system("hhc > tempfile") and then
opening tempfile and looking for the string "HTML Help". If it's not found,
hhc is assumed to be missing. On my Windows ME this seems to work. For some
reason, system("hhc allegro.hhp") can't be executed though (probably because
it's not a "real" console program), so I had to put it into the makefile.

--
Elias Pschernig

Attachment: chm.diff.gz
Description: GNU Zip compressed data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/