1/*
2Copyright (C) 2011-2014, Parrot Foundation.
3
4=head1 NAME
5
6src/pmc/ptrbuf.pmc - PtrBuf PMC
7
8=head1 DESCRIPTION
9
10C<PtrBuf> is a pointer to a buffer. No affordances for memory management have
11been made. It has two things - a pointer and a size.
12
13=head2 VTABLEs
14
15=over 4
16
17=cut
18
19*/
20
21/* HEADERIZER HFILE: none */
22/* HEADERIZER BEGIN: static */
23/* HEADERIZER END: static */
24
25pmclass PtrBuf extends Ptr auto_attrs {
26    ATTR UINTVAL size;
27
28/*
29
30=item C<void init()>
31
32C<PtrBuf> is always C<fat> and manages its own attributes. Let C<Ptr> know about this.
33
34=cut
35
36*/
37
38    VTABLE void init() {
39        PTR_FAT_SET(INTERP, SELF);
40    }
41
42/*
43
44=item C<INTVAL get_integer()>
45
46=item C<void set_integer_native(INTVAL i)>
47
48Get and set the buffer size.
49
50=cut
51
52*/
53
54    VTABLE INTVAL get_integer() :no_wb {
55        INTVAL i;
56        GET_ATTR_size(INTERP, SELF, i);
57        return i;
58    }
59
60    VTABLE void set_integer_native(INTVAL i) {
61        SET_ATTR_size(INTERP, SELF, i);
62    }
63}
64
65/*
66
67=back
68
69=cut
70
71*/
72
73/*
74 * Local variables:
75 *   c-file-style: "parrot"
76 * End:
77 * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
78 */
79