File: PPerl.xs

package info (click to toggle)
pperl 0.25-5
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 296 kB
  • ctags: 40
  • sloc: perl: 868; ansic: 666; makefile: 60; sh: 23
file content (58 lines) | stat: -rw-r--r-- 736 bytes parent folder | download | duplicates (3)
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
56
57
58
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include "pass_fd.c"

MODULE = PPerl	PACKAGE = PPerl

PROTOTYPES: DISABLE

void
setreadonly(name, value)
  char * name
  int  value
  CODE:
    GV *tmpgv;
    if ((tmpgv = gv_fetchpv(name, TRUE, SVt_PV))) {
        SvREADONLY_off(GvSV(tmpgv));
	sv_setiv(GvSV(tmpgv), value);
        SvREADONLY_on(GvSV(tmpgv));
    }


int
s_pipe(in, out)
  SV * in
  SV * out
  CODE:
    int fd[2];

    RETVAL = s_pipe(fd);
    sv_setiv(in,  fd[0]);
    sv_setiv(out, fd[1]);
  OUTPUT:
    RETVAL


int
send_fd(over, this)
  int over
  int this


int
recv_fd(on)
  int on


int
read_int(fd)
  int fd
  CODE:
    int foo;

    read(fd, &foo, sizeof(foo));
    RETVAL = foo;
  OUTPUT:
    RETVAL