/*
Copyright (C) 2001-2003, The Perl Foundation.
$Id: csub.pmc 16275 2006-12-28 01:20:44Z particle $

=head1 NAME

src/pmc/csub.pmc - C Subroutine PMC

=head1 DESCRIPTION

This class has been superseded by C<NCI>.

=cut

*/

#include "parrot/parrot.h"

pmclass CSub {
    void init() {
        PMC_struct_val(SELF) = PMC_pmc_val(SELF) = NULL;
    }

    PMC* clone() {
        PMC* dest = pmc_new(INTERP, SELF->vtable->base_type);
        PMC_struct_val(dest) = PMC_struct_val(SELF);
        return dest;
    }

    void* get_pointer() {
        return PMC_struct_val(SELF);
    }

    void set_pointer(void* p) {
        PMC_struct_val(SELF) = p;
    }

    INTVAL is_same(PMC* value) {
        return SELF == value;
    }

    INTVAL is_equal(PMC* value) {
        return (SELF->vtable == value->vtable
                && PMC_struct_val(SELF) == PMC_struct_val(value));
    }

    INTVAL defined() {
        return PMC_struct_val(SELF) != NULL;
    }
}

/*

=head1 HISTORY

Initial revision by sean 2002/08/04.

=cut

*/

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