line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include "src/xh_config.h" |
2
|
|
|
|
|
|
|
#include "src/xh_core.h" |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
MODULE = XML::Hash::XS PACKAGE = XML::Hash::XS |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
xh_opts_t * |
9
|
|
|
|
|
|
|
new(CLASS,...) |
10
|
|
|
|
|
|
|
PREINIT: |
11
|
|
|
|
|
|
|
xh_opts_t *opts; |
12
|
|
|
|
|
|
|
CODE: |
13
|
3
|
|
|
|
|
|
dXCPT; |
14
|
|
|
|
|
|
|
|
15
|
3
|
50
|
|
|
|
|
if ((opts = xh_create_opts()) == NULL) |
16
|
0
|
|
|
|
|
|
croak("Malloc error in new()"); |
17
|
|
|
|
|
|
|
|
18
|
5
|
100
|
|
|
|
|
XCPT_TRY_START |
19
|
|
|
|
|
|
|
{ |
20
|
3
|
|
|
|
|
|
xh_parse_param(opts, 1, ax, items); |
21
|
3
|
|
|
|
|
|
} XCPT_TRY_END |
22
|
|
|
|
|
|
|
|
23
|
3
|
100
|
|
|
|
|
XCPT_CATCH |
24
|
|
|
|
|
|
|
{ |
25
|
2
|
|
|
|
|
|
xh_destroy_opts(opts); |
26
|
2
|
50
|
|
|
|
|
XCPT_RETHROW; |
|
|
0
|
|
|
|
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
|
RETVAL = opts; |
30
|
|
|
|
|
|
|
OUTPUT: |
31
|
|
|
|
|
|
|
RETVAL |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
SV * |
34
|
|
|
|
|
|
|
hash2xml(...) |
35
|
|
|
|
|
|
|
PREINIT: |
36
|
|
|
|
|
|
|
xh_h2x_ctx_t ctx; |
37
|
|
|
|
|
|
|
SV *result; |
38
|
|
|
|
|
|
|
CODE: |
39
|
41
|
|
|
|
|
|
dXCPT; |
40
|
41
|
50
|
|
|
|
|
XCPT_TRY_START |
41
|
|
|
|
|
|
|
{ |
42
|
41
|
|
|
|
|
|
xh_h2x_init_ctx(&ctx, ax, items); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
/* hack */ |
45
|
|
|
|
|
|
|
#ifdef XH_HAVE_DOM |
46
|
|
|
|
|
|
|
if (ctx.opts.doc) { |
47
|
|
|
|
|
|
|
result = xh_h2d(&ctx); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
else { |
50
|
|
|
|
|
|
|
result = xh_h2x(&ctx); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
#else |
53
|
41
|
|
|
|
|
|
result = xh_h2x(&ctx); |
54
|
|
|
|
|
|
|
#endif |
55
|
41
|
|
|
|
|
|
} XCPT_TRY_END |
56
|
|
|
|
|
|
|
|
57
|
41
|
50
|
|
|
|
|
XCPT_CATCH |
58
|
|
|
|
|
|
|
{ |
59
|
0
|
|
|
|
|
|
xh_h2x_destroy_ctx(&ctx); |
60
|
0
|
0
|
|
|
|
|
XCPT_RETHROW; |
|
|
0
|
|
|
|
|
|
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
41
|
100
|
|
|
|
|
if (ctx.opts.output != NULL) result = NULL; |
64
|
|
|
|
|
|
|
|
65
|
41
|
|
|
|
|
|
xh_h2x_destroy_ctx(&ctx); |
66
|
|
|
|
|
|
|
|
67
|
41
|
100
|
|
|
|
|
if (result == NULL) XSRETURN_UNDEF; |
68
|
|
|
|
|
|
|
|
69
|
39
|
|
|
|
|
|
RETVAL = result; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
OUTPUT: |
72
|
|
|
|
|
|
|
RETVAL |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
SV * |
75
|
|
|
|
|
|
|
xml2hash(...) |
76
|
|
|
|
|
|
|
PREINIT: |
77
|
|
|
|
|
|
|
xh_x2h_ctx_t ctx; |
78
|
|
|
|
|
|
|
SV *result; |
79
|
|
|
|
|
|
|
CODE: |
80
|
16
|
|
|
|
|
|
dXCPT; |
81
|
20
|
100
|
|
|
|
|
XCPT_TRY_START |
82
|
|
|
|
|
|
|
{ |
83
|
16
|
|
|
|
|
|
xh_x2h_init_ctx(&ctx, ax, items); |
84
|
|
|
|
|
|
|
|
85
|
16
|
|
|
|
|
|
result = xh_x2h(&ctx); |
86
|
16
|
|
|
|
|
|
} XCPT_TRY_END |
87
|
|
|
|
|
|
|
|
88
|
16
|
100
|
|
|
|
|
XCPT_CATCH |
89
|
|
|
|
|
|
|
{ |
90
|
4
|
|
|
|
|
|
xh_x2h_destroy_ctx(&ctx); |
91
|
4
|
50
|
|
|
|
|
XCPT_RETHROW; |
|
|
0
|
|
|
|
|
|
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
12
|
100
|
|
|
|
|
if (ctx.opts.cb != NULL) result = NULL; |
95
|
|
|
|
|
|
|
|
96
|
12
|
|
|
|
|
|
xh_x2h_destroy_ctx(&ctx); |
97
|
|
|
|
|
|
|
|
98
|
12
|
100
|
|
|
|
|
if (result == NULL) XSRETURN_UNDEF; |
99
|
|
|
|
|
|
|
|
100
|
11
|
|
|
|
|
|
RETVAL = result; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
OUTPUT: |
103
|
|
|
|
|
|
|
RETVAL |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
void |
106
|
|
|
|
|
|
|
DESTROY(opts) |
107
|
|
|
|
|
|
|
xh_opts_t *opts; |
108
|
|
|
|
|
|
|
CODE: |
109
|
1
|
|
|
|
|
|
xh_destroy_opts(opts); |
110
|
1
|
|
|
|
|
|
free(opts); |