#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include <stdio.h>
#include "ppport.h"
#include <string.h>
MODULE = Mytest PACKAGE = Mytest
int
print_hello_retval()
CODE:
RETVAL = printf("Hello, world!");
OUTPUT:
RETVAL
int
treble(x)
int x
CODE:
RETVAL = 3*x;
OUTPUT:
RETVAL
int
berechne(y)
int y
CODE:
RETVAL = y+22*5-10/2;
OUTPUT:
RETVAL
char *
strconcat(str1, str2, outstr)
char* str1
char* str2
char* outstr = NO_INIT
PREINIT:
STRLEN length;
CODE:
length = strlen(str1) + strlen (str2) +1;
New(0, outstr, length, char);
RETVAL = strconcat(str1, str2, outstr);
OUTPUT:
outstr
RETVAL
CLEANUP:
Safefree( outstr );