Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
128 lines (101 sloc) 2.51 KB
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "mop.h"
MODULE = mop PACKAGE = mop
PROTOTYPES: DISABLED
BOOT:
mop_init();
MODULE = mop PACKAGE = mop::class PREFIX=mop_class_
SV *
mop_class_create(char *name, size_t length(name))
SV *
mop_class_get_metaclass_by_name(char *name)
void
mop_class_destroy(c)
mop_class *c;
ALIAS:
DESTROY = 1
INIT:
PERL_UNUSED_VAR(ix);
void
mop_class_associate_metaclass(c, name = NULL)
mop_class *c;
char *name;
void
mop_class_add_method(c, name, cv)
mop_class *c;
char *name;
SV *cv;
void
mop_class_add_attribute(c, attr)
mop_class *c;
mop_attribute *attr;
void
mop_class_remove_method(c, name)
mop_class *c;
char *name;
SV *
mop_class_construct_instance(c, params = NULL)
mop_class *c;
HV *params;
void
mop_class_superclasses(c, ...)
mop_class *c;
PREINIT:
int i;
AV *isa;
PPCODE:
if (items > 1) {
AV *new_isa = newAV();
for(i = 1; i < items; i++) {
av_push(new_isa, ST(i));
}
mop_class_superclasses(c, new_isa);
}
isa = get_av( SvPV_nolen(sv_2mortal(newSVpvf("%s::ISA", c->name))), TRUE );
for(i = 1; i < av_len(isa) + 1; i++)
PUSHs(SvREFCNT_inc(*(av_fetch(isa, i, 0))));
HV *
mop_class_get_method_map(c)
mop_class *c;
void
mop_class_dump(c)
mop_class *c;
MODULE = mop PACKAGE = mop::method PREFIX=mop_method_
mop_method *
mop_method_create(name, package_name, c, cv)
char *name;
char *package_name;
mop_class *c;
SV *cv;
void
mop_method_destroy(method)
mop_method *method;
ALIAS:
DESTROY = 1
INIT:
PERL_UNUSED_VAR(ix);
MODULE = mop PACKAGE = mop::attribute PREFIX=mop_attribute_
mop_attribute *
mop_attribute_create(name, accessor = NULL, reader = NULL, writer = NULL, predicate = NULL, clearer = NULL, builder = NULL, init_arg = NULL, default_value = NULL, associated_class = NULL)
char *name;
char *accessor;
char *reader;
char *writer;
char *predicate;
char *clearer;
char *builder;
char *init_arg;
SV *default_value;
mop_class *associated_class;
void
mop_attribute_destroy(self)
mop_attribute *self;
ALIAS:
DESTROY = 1
INIT:
PERL_UNUSED_VAR(ix);
char *
mop_attribute_name(self)
mop_attribute *self;