/*
Copyright (C) 2001-2006, The Perl Foundation.
$Id: perlint.pmc 16836 2007-01-30 04:30:52Z coke $

=head1 NAME

src/dynpmc/perlint.pmc - Perl Integer

=head1 DESCRIPTION

C<PerlInt> extends C<Integer> to provide a Perl integer.

=head2 Methods

=over 4

=cut

*/

#include "parrot/parrot.h"

void Parrot_perlscalar_morph(Interp* , PMC* pmc, INTVAL type);

/* TODO extends PerlAny or perlscalar or whatever */
pmclass PerlInt
    extends Integer
    does integer
    does scalar
    dynpmc
    group perl_group
    hll Perl
    maps Integer {


/*

=item C<void set_number_native(FLOATVAL value)>

Morphs the integer to a C<PerlNum> and sets the value from C<value>.

=cut

*/
    void set_number_native(FLOATVAL value) {
        INTVAL dynpmc_PerlNum;

        dynpmc_PerlNum = pmc_type(interp,
            string_from_const_cstring(interp, "PerlNum", 0));
        DYNSELF.morph(dynpmc_PerlNum);
        DYNSELF.set_number_native(value);
    }


/*

=item C<void set_string_native(STRING *value)>

Sets the value of the integer to C<*value>.

=cut

*/
    void set_string_native(STRING* value) {
        INTVAL dynpmc_PerlString;

        dynpmc_PerlString = pmc_type(interp,
            string_from_const_cstring(interp, "PerlString", 0));
        DYNSELF.morph(dynpmc_PerlString);
        DYNSELF.set_string_native(value);
    }

/*

=item C<void morph(INTVAL type)>

Morphs the scalar to the specified type.

=cut

*/

    void morph(INTVAL type) {
        perlscalar.SELF.morph(type);
    }
}

/*

=back

=cut

*/

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