-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpairing.xs
48 lines (36 loc) · 807 Bytes
/
pairing.xs
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
pairing_t *
pairing_init_str(str)
SV * str
PREINIT:
STRLEN len;
char * ptr;
pairing_t * pairing = malloc( sizeof(pairing_t) );
CODE:
ptr = SvPV(str, len);
if( pairing_init_set_buf(*pairing, ptr, len) )
pbc_die("pairing init failed");
RETVAL = pairing;
OUTPUT:
RETVAL
void
pairing_clear(pairing)
pairing_t * pairing
CODE:
// fprintf(stderr, " ... freeing a pairing ... \n");
pairing_clear(*pairing);
free(pairing);
void
pairing_apply(LHS,RHS1,RHS2,pairing)
element_t * LHS
element_t * RHS1
element_t * RHS2
pairing_t * pairing
CODE:
pairing_apply(*LHS, *RHS1, *RHS2, *pairing);
int
pairing_is_symmetric(me)
pairing_t * me
CODE:
RETVAL = pairing_is_symmetric(*me);
OUTPUT:
RETVAL