Code tidy. No functionality changed
[gitmo/Class-MOP.git] / xs / Class.xs
1 #include "mop.h"
2
3
4 AV*
5 mop_class_get_all_attributes(pTHX_ SV* const metaclass){
6     AV* const attrs = newAV();
7     dSP;
8     I32 n;
9
10     PUSHMARK(SP);
11     XPUSHs(metaclass);
12     PUTBACK;
13
14     n = call_method("get_all_attributes", G_ARRAY);
15     SPAGAIN;
16
17     if(n){
18         av_extend(attrs, n - 1);
19         while(n){
20             (void)av_store(attrs, --n, newSVsv(POPs));
21         }
22     }
23
24     PUTBACK;
25
26     return attrs;
27 }
28
29
30 MODULE = Class::MOP::Class    PACKAGE = Class::MOP::Class
31
32 PROTOTYPES: DISABLE
33
34 VERSIONCHECK: DISABLE
35
36 BOOT:
37     INSTALL_SIMPLE_READER_WITH_KEY(Class, get_attribute_map, attributes);
38     INSTALL_SIMPLE_READER(Class, attribute_metaclass);
39     INSTALL_SIMPLE_READER(Class, instance_metaclass);
40     INSTALL_SIMPLE_READER(Class, immutable_trait);
41     INSTALL_SIMPLE_READER(Class, constructor_name);
42     INSTALL_SIMPLE_READER(Class, constructor_class);
43     INSTALL_SIMPLE_READER(Class, destructor_class);