I committed the first wave of embedding enhancements.  These changes
focus on two things:

a) Better exposure of certain internal datatypes with good external
names
b) Exposure of subsystems embedders will need to talk to

The three subsystems I'm exposing are strings, PMCs, and vtables.  These
changes take care of strings; PMCs and vtables are more involved, and it
may take some time before I can get them working.

Note that there were no changes necessary in any C files except
test_main.c.  The changes were designed to be easy to cope with--you
won't have to rename types or anything.

NEW TYPES ADDED (and their internal equivalents):

Parrot_Int -- INTVAL
Parrot_UInt -- UINTVAL
Parrot_Float -- FLOATVAL
Parrot_Bool -- BOOLVAL
Parrot_String -- STRING *
Parrot_Encoding -- ENCODING *
Parrot_CharType -- CHARTYPE *
Parrot -- struct Parrot_Interp *
Parrot_PackFile -- struct PackFile *

I'm trying to make sure embedders don't have to worry about if
something's a pointer type or not.

NEW FUNCTIONS ADDED:

Parrot_string_* -- string_*

NEW CONVENTIONS FOR DATA EXPOSED TO EMBEDDERS:

-All structs should have a name of the form parrot_system_t.  This name
should never be directly used outside the subsystem in question.

struct parrot_foo_t {
        ...
};

-Two defines of the struct name should be provided--one for embedders,
and one for internal use.  (Defines are used because typedefs won't
always work if one is a pointer type and the other isn't.)  The one for
embedders should have a pointer type if applicable.

#define Parrot_Foo struct parrot_foo_t *

#ifdef PARROT_IN_CORE

#define FOO struct parrot_foo_t

#endif

-All functions should be of the form Parrot_system_function.  Functions
should only use data type names that are exposed to embedders

Parrot_Foo Parrot_foo_new(Parrot_Int flags);

-Headers should provide defines of the form system_function for each
function--wrapped in PARROT_IN_CORE checks.

#ifdef PARROT_IN_CORE

#define foo_new Parrot_foo_new

#endif

If anyone has problems with any of this, let me know.

--Brent Dax
[EMAIL PROTECTED]
Parrot Configure pumpking and regex hacker
Check out the Parrot FAQ: http://www.panix.com/~ziggy/parrot.html (no,
it's not mine)

<obra> mmmm. hawt sysadmin chx0rs
<lathos> This is sad. I know of *a* hawt sysamin chx0r.
<obra> I know more than a few.
<lathos> obra: There are two? Are you sure it's not the same one?

Reply via email to