Hi, Currently there 64 header files in include/parrot. From these 64 header files 36 can be included directly, i.e. #include <parrot/embed.h> will compile, but #include <parrot/chartype.h> will fail with errors. In the case of chartype this can be easily fixed [1]. Other headers are a little bit harder.
Would it be a good idea to fix the other headers the same way? This is not a really hard task. A next step could be not simply include <parrot/parrot.h>, but only the headers, that are really needed. This is currently a real pain because some header files have hidden asumptions to be included only after other header files. A simple src test can enforce this policy [2]. Comments? bö
Index: chartype.h =================================================================== RCS file: /cvs/public/parrot/include/parrot/chartype.h,v retrieving revision 1.19 diff -u -r1.19 chartype.h --- chartype.h 23 Sep 2003 10:19:17 -0000 1.19 +++ chartype.h 27 Oct 2003 16:56:17 -0000 @@ -13,6 +13,8 @@ #if !defined(PARROT_CHARTYPE_H_GUARD) #define PARROT_CHARTYPE_H_GUARD +#include <parrot/config.h> + struct parrot_chartype_t; typedef Parrot_UInt (*Parrot_CharType_Transcoder) (const struct parrot_chartype_t *from, @@ -32,8 +34,8 @@ * Character code to digit value translation map */ struct chartype_digit_map_t { - UINTVAL first_code; - UINTVAL last_code; + Parrot_UInt first_code; + Parrot_UInt last_code; int first_value; }; @@ -54,7 +56,7 @@ struct parrot_chartype_t { - INTVAL index; + Parrot_Int index; const char *name; const char *default_encoding; Parrot_Int (*is_digit)
# perl -w @headers = map { s!^include/!!; $_ } glob "include/parrot/*.h"; require Parrot::Test; import Parrot::Test tests => scalar @headers; for $header ( @headers ) { c_output_is(<<"CODE", '', $header); #include <$header> int main() { return 0; } CODE }