/* ex: set ro ft=c:
 * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
 *
 * This file is generated automatically from './src/pmc/pointer.pmc'
 * by tools/build/pmc2c.pl.
 *
 * Any changes made here will be lost!
 *
 */

/* HEADERIZER HFILE: none */
/* HEADERIZER STOP */


#ifndef PARROT_PMC_POINTER_H_GUARD
#define PARROT_PMC_POINTER_H_GUARD

PARROT_EXPORT VTABLE* Parrot_Pointer_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_Pointer_ro_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_Pointer_get_vtable(PARROT_INTERP);
PARROT_EXPORT VTABLE* Parrot_Pointer_ro_get_vtable(PARROT_INTERP);
PARROT_EXPORT PMC*    Parrot_Pointer_get_mro(PARROT_INTERP, ARGIN_NULLOK(PMC* mro));
PARROT_EXPORT Hash*   Parrot_Pointer_get_isa(PARROT_INTERP, ARGIN_NULLOK(Hash* isa));

/* Pointer PMC's underlying struct. */
typedef struct Parrot_Pointer_attributes {
    void * mark_function;
    void * pointer;
} Parrot_Pointer_attributes;

/* Macro to access underlying structure of a Pointer PMC. */
#define PARROT_POINTER(o) ((Parrot_Pointer_attributes *) PMC_data(o))


/* Generated macro accessors for 'mark_function' attribute of Pointer PMC. */
#define GETATTR_Pointer_mark_function(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Pointer_attributes *)PMC_data(pmc))->mark_function; \
        } \
        else { \
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'void *' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
    } while (0)

#define SETATTR_Pointer_mark_function(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'void *' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
        else \
            ((Parrot_Pointer_attributes *)PMC_data(pmc))->mark_function = (value); \
    } while (0)


/* Generated macro accessors for 'pointer' attribute of Pointer PMC. */
#define GETATTR_Pointer_pointer(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Pointer_attributes *)PMC_data(pmc))->pointer; \
        } \
        else { \
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'void *' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
    } while (0)

#define SETATTR_Pointer_pointer(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'void *' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
        else \
            ((Parrot_Pointer_attributes *)PMC_data(pmc))->pointer = (value); \
    } while (0)


#endif /* PARROT_PMC_POINTER_H_GUARD */

/*
 * Local variables:
 *   c-file-style: "parrot"
 * End:
 * vim: expandtab shiftwidth=4:
 */

