2 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#Mytest.pl
sub Mypace {
use vars;
@area = (flur, door,küche,zimmer,balkon);
return @area;
}
/// Mytest.c
#include <EXTERN.h>
#include <perl.h>
#include <stdio.h>
#include <string.h>
static PerlInterpreter *my_perl;
static AV*runit()
{
dSP;
char *reserved;
SV *result;
ENTER;
SAVETMPS;
PUSHMARK(SP);
PUTBACK;
perl_call_pv("Myplave", G_ARRAY);
SPAGAIN;
result = POPs;
reversed = SvPV(result,PL_na);
PUTBACK;
FREETMPS;
LEAVE;
}
main()
{
int argc;
AV* test;
char **argv;
char **env;
char *embedding[] = { "", "-e","0"};
char *my_argv[] = {"","Mytest.pl"};
my_perl = perl_alloc();
PERL_SYS_INIT3(&argc, &argv,&env);
perl_construct(my_perl);
perl_parse(my_perl, NULL,2, my_argv,NULL);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_run(my_perl);
test = runit()
perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();
}
2 Einträge, 1 Seite |