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

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


#ifndef PARROT_PMC_EXCEPTIONHANDLER_H_GUARD
#define PARROT_PMC_EXCEPTIONHANDLER_H_GUARD

PARROT_EXPORT VTABLE* Parrot_ExceptionHandler_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_ExceptionHandler_ro_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_ExceptionHandler_get_vtable(PARROT_INTERP);
PARROT_EXPORT VTABLE* Parrot_ExceptionHandler_ro_get_vtable(PARROT_INTERP);
PARROT_EXPORT PMC*    Parrot_ExceptionHandler_get_mro(PARROT_INTERP, ARGMOD(PMC* mro));
PARROT_EXPORT Hash*   Parrot_ExceptionHandler_get_isa(PARROT_INTERP, ARGMOD_NULLOK(Hash* isa));

/* ExceptionHandler PMC's underlying struct. */
typedef struct Parrot_ExceptionHandler_attributes {
    PackFile_ByteCode * seg;
    opcode_t          * address;
    PMC               * to_ctx;
    PMC               * to_call_object;
    PMC               * from_ctx;
    int runloop_id;
    int invoked;
    PMC    * handled_types;
    PMC    * handled_types_except;
    INTVAL min_severity;
    INTVAL max_severity;
} Parrot_ExceptionHandler_attributes;

/* Macro to access underlying structure of a ExceptionHandler PMC. */
#define PARROT_EXCEPTIONHANDLER(o) ((Parrot_ExceptionHandler_attributes *) PMC_data(o))


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

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


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

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


/* Generated macro accessors for 'to_ctx' attribute of ExceptionHandler PMC. */
#define GETATTR_ExceptionHandler_to_ctx(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->to_ctx; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "to_ctx")); \
        } \
    } while (0)

#define SETATTR_ExceptionHandler_to_ctx(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "to_ctx"), value); \
        } \
        else \
            ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->to_ctx = (value); \
    } while (0)


/* Generated macro accessors for 'to_call_object' attribute of ExceptionHandler PMC. */
#define GETATTR_ExceptionHandler_to_call_object(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->to_call_object; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "to_call_object")); \
        } \
    } while (0)

#define SETATTR_ExceptionHandler_to_call_object(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "to_call_object"), value); \
        } \
        else \
            ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->to_call_object = (value); \
    } while (0)


/* Generated macro accessors for 'from_ctx' attribute of ExceptionHandler PMC. */
#define GETATTR_ExceptionHandler_from_ctx(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->from_ctx; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "from_ctx")); \
        } \
    } while (0)

#define SETATTR_ExceptionHandler_from_ctx(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "from_ctx"), value); \
        } \
        else \
            ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->from_ctx = (value); \
    } while (0)


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

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


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

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


/* Generated macro accessors for 'handled_types' attribute of ExceptionHandler PMC. */
#define GETATTR_ExceptionHandler_handled_types(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->handled_types; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "handled_types")); \
        } \
    } while (0)

#define SETATTR_ExceptionHandler_handled_types(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "handled_types"), value); \
        } \
        else \
            ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->handled_types = (value); \
    } while (0)


/* Generated macro accessors for 'handled_types_except' attribute of ExceptionHandler PMC. */
#define GETATTR_ExceptionHandler_handled_types_except(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->handled_types_except; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "handled_types_except")); \
        } \
    } while (0)

#define SETATTR_ExceptionHandler_handled_types_except(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "handled_types_except"), value); \
        } \
        else \
            ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->handled_types_except = (value); \
    } while (0)


/* Generated macro accessors for 'min_severity' attribute of ExceptionHandler PMC. */
#define GETATTR_ExceptionHandler_min_severity(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->min_severity; \
        } \
        else { \
            PMC * const attr_value = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "min_severity")); \
            (dest) = (PMC_IS_NULL(attr_value) ? (INTVAL) 0: VTABLE_get_integer(interp, attr_value)); \
        } \
    } while (0)

#define SETATTR_ExceptionHandler_min_severity(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            PMC * const attr_value = Parrot_pmc_new_init_int(interp, enum_class_Integer, value); \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "min_severity"), attr_value); \
        } \
        else \
            ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->min_severity = (value); \
    } while (0)


/* Generated macro accessors for 'max_severity' attribute of ExceptionHandler PMC. */
#define GETATTR_ExceptionHandler_max_severity(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->max_severity; \
        } \
        else { \
            PMC * const attr_value = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "max_severity")); \
            (dest) = (PMC_IS_NULL(attr_value) ? (INTVAL) 0: VTABLE_get_integer(interp, attr_value)); \
        } \
    } while (0)

#define SETATTR_ExceptionHandler_max_severity(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            PMC * const attr_value = Parrot_pmc_new_init_int(interp, enum_class_Integer, value); \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "max_severity"), attr_value); \
        } \
        else \
            ((Parrot_ExceptionHandler_attributes *)PMC_data(pmc))->max_severity = (value); \
    } while (0)


#endif /* PARROT_PMC_EXCEPTIONHANDLER_H_GUARD */

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

