line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#ifndef __DISPATCHOP_H__ |
2
|
|
|
|
|
|
|
#define __DISPATCHOP_H__ |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
struct dispatchop { |
5
|
|
|
|
|
|
|
/* Looks like a LOGOP */ |
6
|
|
|
|
|
|
|
BASEOP |
7
|
|
|
|
|
|
|
OP *op_first; /* Probably not used */ |
8
|
|
|
|
|
|
|
OP *op_other; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
/* Extra fields */ |
11
|
|
|
|
|
|
|
size_t n_cases; |
12
|
|
|
|
|
|
|
SV **values; |
13
|
|
|
|
|
|
|
OP **dispatch; |
14
|
|
|
|
|
|
|
}; |
15
|
|
|
|
|
|
|
typedef struct dispatchop DISPATCHOP; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#define cDISPATCHOP ((DISPATCHOP *)PL_op) |
18
|
|
|
|
|
|
|
#define cDISPATCHOPx(o) ((DISPATCHOP *)o) |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#define alloc_DISPATCHOP() MY_alloc_DISPATCHOP(aTHX) |
21
|
|
|
|
|
|
|
static DISPATCHOP *MY_alloc_DISPATCHOP(pTHX) |
22
|
|
|
|
|
|
|
{ |
23
|
|
|
|
|
|
|
OP *o; |
24
|
8
|
|
|
|
|
|
NewOpSz(1101, o, sizeof(DISPATCHOP)); |
25
|
8
|
|
|
|
|
|
o->op_flags = 0; |
26
|
8
|
|
|
|
|
|
o->op_private = 0; |
27
|
8
|
|
|
|
|
|
o->op_targ = 0; |
28
|
8
|
|
|
|
|
|
o->op_next = NULL; |
29
|
|
|
|
|
|
|
#if HAVE_PERL_VERSION(5,26,0) |
30
|
8
|
|
|
|
|
|
o->op_sibparent = NULL; |
31
|
|
|
|
|
|
|
#else |
32
|
|
|
|
|
|
|
o->op_sibling = NULL; |
33
|
|
|
|
|
|
|
#endif |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
return (DISPATCHOP *)o; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
/* A convenient macro for the start of pp_dispatch_* functions */ |
39
|
|
|
|
|
|
|
#define dDISPATCH \ |
40
|
|
|
|
|
|
|
size_t n_cases = cDISPATCHOP->n_cases; \ |
41
|
|
|
|
|
|
|
SV **values = cDISPATCHOP->values; \ |
42
|
|
|
|
|
|
|
OP **dispatch = cDISPATCHOP->dispatch; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
#endif |