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

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


#ifndef PARROT_PMC_SELECT_H_GUARD
#define PARROT_PMC_SELECT_H_GUARD

#define PARROT_IN_EXTENSION
PARROT_DYNEXT_EXPORT VTABLE* Parrot_Select_get_vtable_pointer(PARROT_INTERP);
PARROT_DYNEXT_EXPORT void    Parrot_Select_class_init(PARROT_INTERP, int, int);
PARROT_DYNEXT_EXPORT VTABLE* Parrot_Select_update_vtable(ARGMOD(VTABLE*));
PARROT_DYNEXT_EXPORT VTABLE* Parrot_Select_ro_update_vtable(ARGMOD(VTABLE*));
PARROT_DYNEXT_EXPORT VTABLE* Parrot_Select_get_vtable(PARROT_INTERP);
PARROT_DYNEXT_EXPORT VTABLE* Parrot_Select_ro_get_vtable(PARROT_INTERP);
PARROT_DYNEXT_EXPORT PMC*    Parrot_Select_get_mro(PARROT_INTERP, ARGMOD(PMC* mro));
PARROT_DYNEXT_EXPORT Hash*   Parrot_Select_get_isa(PARROT_INTERP, ARGMOD_NULLOK(Hash* isa));

/* Select PMC's underlying struct. */
typedef struct Parrot_Select_attributes {
    PMC    * fd_map;
    fd_set rb_array;
    fd_set wb_array;
    fd_set eb_array;
    INTVAL max_fd;
} Parrot_Select_attributes;

/* Macro to access underlying structure of a Select PMC. */
#define PARROT_SELECT(o) ((Parrot_Select_attributes *) PMC_data(o))


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

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


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

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


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

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


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

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


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

#define SETATTR_Select_max_fd(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_fd"), attr_value); \
        } \
        else \
            ((Parrot_Select_attributes *)PMC_data(pmc))->max_fd = (value); \
    } while (0)


PARROT_DYNEXT_EXPORT Parrot_PMC Parrot_lib_select_load(PARROT_INTERP);

#ifndef PARROT_DYNPMC_CLASS_LOAD
PARROT_DATA INTVAL dynpmc_class_Select;
#endif

#endif /* PARROT_PMC_SELECT_H_GUARD */

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

