Debian Codegraph @

modules/scripting/perl/api/internal_list.xs

raw
1 # Wrapper around a mowgli_list_t to implement a tied array.
2
3 MODULE = Atheme PACKAGE = Atheme::Internal::List
4
5 SV *
6 FETCH(Atheme_Internal_List self, int index)
7 CODE:
8 void *data = mowgli_node_nth_data(self->list, index);
9 RETVAL = bless_pointer_to_package(data, self->package_name);
10 OUTPUT:
11 RETVAL
12
13 void
14 STORE(Atheme_Internal_List self, int index, SV *value)
15 CODE:
16 Perl_croak(aTHX_ "Direct modification of lists not supported");
17
18 int
19 FETCHSIZE(Atheme_Internal_List self)
20 CODE:
21 RETVAL = self->list->count;
22 OUTPUT:
23 RETVAL
24
25 void
26 STORESIZE(Atheme_Internal_List self, int count)
27 CODE:
28 Perl_croak(aTHX_ "Direct modification of lists not supported");
29
30 void
31 DELETE(Atheme_Internal_List self)
32 CODE:
33 free((void*)self->package_name);
34 free(self);