Yeah, so the simplest fix is probably to create a wget-utils.h or
somesuch, and put all globally-useful macros there. I'll try to make
a new patch with that change this weekend.
/Håkan
19 jul 2007 kl. 22.08 skrev Micah Cowan:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Håkan Waara wrote:
Hello all,
I was looking for a small/fast HTML parser and came across wget's.
Since I prefer to not include all of wget's headers just for this, I
patched it to build 100% standalone. All that was needed was to
redefined some macros (that are in wget.h) when compiled as
standalone.
This makes it possible to compile the parser, without the need for
any
other files than html-parse.c and html-parse.h as simple as this:
gcc -DSTANDALONE html-parse.c -o html-parse
Cool! Thanks.
Looking at the patches, I don't think I want to maintain separate
copies
of the same macro definitions, some that are in wget.h, and some that
are in html-parse.h for when STANDALONE is defined. Better to split
them
out to another #include file (whose appropriate name I'm not sure of),
so we can maintain these macros in one place, and still allow for
standalone compilation.
Glad you found wget's parser useful! :)
I also didn't see the point of the PARAMS macro (probably I'm missing
something). If needed, that could be redefined as well, of course.
I believe those are there to allow for K&R C support.
- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGn8Su7M8hyUobTrERCDRQAJ9mXc11DC5KlSQS1qzMkVKaqZGF1ACfbv/y
ZaSTXOW11MK/1g7ZM4NGPDo=
=ibrO
-----END PGP SIGNATURE-----