8 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include <stdio.h>
#include <string.h>
MODULE = Mytest PACKAGE = Mytest
AV*
hello(test)
AV* test;
CODE:
RETVAL = newAV();
sv_2mortal((SV*)RETVAL);
OUTPUT:
RETVAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
AV *frobnicate(AV *foo)
INIT:
int i;
CODE:
RETVAL = newAV();
sv_2mortal((SV *)RETVAL);
for (i = 0; i < av_len(foo); i += 2) {
SV **cell = av_fetch(foo, i, 0);
if (cell && *cell)
av_push(RETVAL, SvREFCNT_inc(*cell));
}
OUTPUT:
RETVAL
$test = Mytest::frobnicate(\@tester);
8 Einträge, 1 Seite |