Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
149 lines (95 sloc) 2.25 KB
/*
Copyright (C) 2001-2014, Parrot Foundation.
=head1 NAME
src/pmc/packfilesegment.pmc - PackfileSegment PMC
=head1 DESCRIPTION
This class implements a PackfileSegment class, an abstract class defining a
couple of methods which all Packfile segments will implement. The stub methods
found here explode when called.
See Packfile PMC for the toplevel Packfile interface; see PDD13 for the design
spec.
=head2 Methods
=over 4
=cut
*/
/* HEADERIZER HFILE: none */
/* HEADERIZER BEGIN: static */
/* HEADERIZER END: static */
pmclass PackfileSegment auto_attrs {
/*
Directory which owns this segment. Required for correct pack/unpack
Annotations.
*/
ATTR PMC *directory;
/*
=item C<void init()>
Initialize PackfileSegment.
=cut
*/
VTABLE void init() {
Parrot_PackfileSegment_attributes * const attrs =
PMC_data_typed(SELF, Parrot_PackfileSegment_attributes*);
attrs->directory = PMCNULL;
PObj_custom_mark_SET(SELF);
}
/*
=item C<void mark()>
Marks the object as live.
=cut
*/
VTABLE void mark() :no_wb {
Parrot_PackfileSegment_attributes * const attrs =
PARROT_PACKFILESEGMENT(SELF);
Parrot_gc_mark_PMC_alive(INTERP, attrs->directory);
}
/*
=item C<void set_pointer(void *ptr)>
Initialize PMC internals.
The C<ptr> argument is ignored.
=cut
*/
VTABLE void set_pointer(void *ptr) :no_wb {
UNUSED(ptr)
UNUSED(SELF)
UNUSED(INTERP)
}
/*
=item C<void *get_pointer()>
Initialize PMC internals.
=cut
*/
VTABLE void *get_pointer() :no_wb {
UNUSED(INTERP)
UNUSED(SELF)
return NULL;
}
/*
=item C<void set_directory(PMC *directory)>
Set owning directory.
=cut
*/
METHOD set_directory(PMC *directory) :manual_wb {
PARROT_PACKFILESEGMENT(SELF)->directory = directory;
}
/*
=item C<void get_directory(PMC *directory)>
Get owning directory.
=cut
*/
METHOD get_directory() :no_wb {
PMC * directory = PARROT_PACKFILESEGMENT(SELF)->directory;
if (!directory)
directory = PMCNULL;
RETURN(PMC* directory);
}
}
/*
=back
=cut
*/
/*
* Local variables:
* c-file-style: "parrot"
* End:
* vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
*/