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

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


#ifndef PARROT_PMC_SUBPROXY_H_GUARD
#define PARROT_PMC_SUBPROXY_H_GUARD

#define PARROT_IN_EXTENSION
PARROT_DYNEXT_EXPORT VTABLE* Parrot_SubProxy_get_vtable_pointer(PARROT_INTERP);
PARROT_DYNEXT_EXPORT void    Parrot_SubProxy_class_init(PARROT_INTERP, int, int);
PARROT_DYNEXT_EXPORT VTABLE* Parrot_SubProxy_update_vtable(ARGMOD(VTABLE*));
PARROT_DYNEXT_EXPORT VTABLE* Parrot_SubProxy_ro_update_vtable(ARGMOD(VTABLE*));
PARROT_DYNEXT_EXPORT VTABLE* Parrot_SubProxy_get_vtable(PARROT_INTERP);
PARROT_DYNEXT_EXPORT VTABLE* Parrot_SubProxy_ro_get_vtable(PARROT_INTERP);
PARROT_DYNEXT_EXPORT PMC*    Parrot_SubProxy_get_mro(PARROT_INTERP, ARGMOD(PMC* mro));
PARROT_DYNEXT_EXPORT Hash*   Parrot_SubProxy_get_isa(PARROT_INTERP, ARGMOD_NULLOK(Hash* isa));

/* SubProxy PMC's underlying struct. */
typedef struct Parrot_SubProxy_attributes {
    PackFile_ByteCode * seg;
    size_t start_offs;
    size_t end_offs;
    INTVAL HLL_id;
    PMC               * namespace_name;
    PMC               * namespace_stash;
    STRING            * name;
    STRING            * method_name;
    STRING            * ns_entry_name;
    STRING            * subid;
    INTVAL vtable_index;
    PMC               * multi_signature;
    UINTVAL n_regs_used[4];
    PMC               * lex_info;
    PMC               * outer_sub;
    PMC               * ctx;
    UINTVAL comp_flags;
    Parrot_sub_arginfo * arg_info;
    PMC               * outer_ctx;
} Parrot_SubProxy_attributes;

/* Macro to access underlying structure of a SubProxy PMC. */
#define PARROT_SUBPROXY(o) ((Parrot_SubProxy_attributes *) PMC_data(o))


/* Generated macro accessors for 'seg' attribute of SubProxy PMC. */
#define GETATTR_SubProxy_seg(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_SubProxy_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_SubProxy_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_SubProxy_attributes *)PMC_data(pmc))->seg = (value); \
    } while (0)


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

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


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

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


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

#define SETATTR_SubProxy_HLL_id(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, "HLL_id"), attr_value); \
        } \
        else \
            ((Parrot_SubProxy_attributes *)PMC_data(pmc))->HLL_id = (value); \
    } while (0)


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

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


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

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


/* Generated macro accessors for 'name' attribute of SubProxy PMC. */
#define GETATTR_SubProxy_name(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_SubProxy_attributes *)PMC_data(pmc))->name; \
        } \
        else { \
            PMC * const attr_value = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "name")); \
            (dest) =  (PMC_IS_NULL(attr_value) ? (STRING *)NULL : VTABLE_get_string(interp, attr_value)); \
        } \
    } while (0)

#define SETATTR_SubProxy_name(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            PMC * const attr_value = Parrot_pmc_new(interp, enum_class_String); \
            VTABLE_set_string_native(interp, attr_value, value); \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "name"), attr_value); \
        } \
        else \
            ((Parrot_SubProxy_attributes *)PMC_data(pmc))->name = (value); \
    } while (0)


/* Generated macro accessors for 'method_name' attribute of SubProxy PMC. */
#define GETATTR_SubProxy_method_name(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_SubProxy_attributes *)PMC_data(pmc))->method_name; \
        } \
        else { \
            PMC * const attr_value = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "method_name")); \
            (dest) =  (PMC_IS_NULL(attr_value) ? (STRING *)NULL : VTABLE_get_string(interp, attr_value)); \
        } \
    } while (0)

#define SETATTR_SubProxy_method_name(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            PMC * const attr_value = Parrot_pmc_new(interp, enum_class_String); \
            VTABLE_set_string_native(interp, attr_value, value); \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "method_name"), attr_value); \
        } \
        else \
            ((Parrot_SubProxy_attributes *)PMC_data(pmc))->method_name = (value); \
    } while (0)


/* Generated macro accessors for 'ns_entry_name' attribute of SubProxy PMC. */
#define GETATTR_SubProxy_ns_entry_name(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_SubProxy_attributes *)PMC_data(pmc))->ns_entry_name; \
        } \
        else { \
            PMC * const attr_value = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "ns_entry_name")); \
            (dest) =  (PMC_IS_NULL(attr_value) ? (STRING *)NULL : VTABLE_get_string(interp, attr_value)); \
        } \
    } while (0)

#define SETATTR_SubProxy_ns_entry_name(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            PMC * const attr_value = Parrot_pmc_new(interp, enum_class_String); \
            VTABLE_set_string_native(interp, attr_value, value); \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "ns_entry_name"), attr_value); \
        } \
        else \
            ((Parrot_SubProxy_attributes *)PMC_data(pmc))->ns_entry_name = (value); \
    } while (0)


/* Generated macro accessors for 'subid' attribute of SubProxy PMC. */
#define GETATTR_SubProxy_subid(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_SubProxy_attributes *)PMC_data(pmc))->subid; \
        } \
        else { \
            PMC * const attr_value = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "subid")); \
            (dest) =  (PMC_IS_NULL(attr_value) ? (STRING *)NULL : VTABLE_get_string(interp, attr_value)); \
        } \
    } while (0)

#define SETATTR_SubProxy_subid(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            PMC * const attr_value = Parrot_pmc_new(interp, enum_class_String); \
            VTABLE_set_string_native(interp, attr_value, value); \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "subid"), attr_value); \
        } \
        else \
            ((Parrot_SubProxy_attributes *)PMC_data(pmc))->subid = (value); \
    } while (0)


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

#define SETATTR_SubProxy_vtable_index(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, "vtable_index"), attr_value); \
        } \
        else \
            ((Parrot_SubProxy_attributes *)PMC_data(pmc))->vtable_index = (value); \
    } while (0)


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


PARROT_DYNEXT_EXPORT Parrot_PMC Parrot_lib_subproxy_load(PARROT_INTERP);

#ifndef PARROT_DYNPMC_CLASS_LOAD
PARROT_DATA INTVAL dynpmc_class_SubProxy;
#endif

#endif /* PARROT_PMC_SUBPROXY_H_GUARD */

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

