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

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


#ifndef PARROT_PMC_PACKFILE_H_GUARD
#define PARROT_PMC_PACKFILE_H_GUARD

PARROT_EXPORT VTABLE* Parrot_Packfile_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_Packfile_ro_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_Packfile_get_vtable(PARROT_INTERP);
PARROT_EXPORT VTABLE* Parrot_Packfile_ro_get_vtable(PARROT_INTERP);
PARROT_EXPORT PMC*    Parrot_Packfile_get_mro(PARROT_INTERP, ARGMOD(PMC* mro));
PARROT_EXPORT Hash*   Parrot_Packfile_get_isa(PARROT_INTERP, ARGMOD_NULLOK(Hash* isa));

/* Packfile PMC's underlying struct. */
typedef struct Parrot_Packfile_attributes {
    INTVAL wordsize;
    INTVAL byteorder;
    INTVAL fptype;
    INTVAL version_major;
    INTVAL version_minor;
    INTVAL version_patch;
    INTVAL bytecode_major;
    INTVAL bytecode_minor;
    INTVAL uuid_type;
    STRING * uuid;
    PMC    * directory;
} Parrot_Packfile_attributes;

/* Macro to access underlying structure of a Packfile PMC. */
#define PARROT_PACKFILE(o) ((Parrot_Packfile_attributes *) PMC_data(o))


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


#endif /* PARROT_PMC_PACKFILE_H_GUARD */

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

