Upskirt.xs

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 18 / 18 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« const-xs.inc ↑ Summary
1 #include "EXTERN.h"
2 #include "perl.h"
3 #include "XSUB.h"
4  
5 #include "ppport.h"
6  
7 #include "markdown.h"
8 #include "html.h"
9 #include "buffer.h"
10  
11 #include "const-c.inc"
12  
13 MODULE = Text::Upskirt PACKAGE = Text::Upskirt
14  
15 INCLUDE: const-xs.inc
16  
17 SV *markdown(input, extens = 0, html = 0)
18 char *input
19 unsigned int extens
20 unsigned int html
21 CODE:
22 struct mkd_renderer renderer;
23 struct buf *ib, *ob;
24 SV *out;
25  
26 1 ib = bufnew(1024);
27 1 ob = bufnew(64);
28 1 bufputs(ib, input);
29 1 upshtml_renderer(&renderer, html);
30 1 ups_markdown(ob, ib, &renderer, extens);
31 1 upshtml_free_renderer(&renderer);
32 1 out = newSVpv(ob->data, ob->size);
33 1 bufrelease(ib);
34 1 bufrelease(ob);
35 1 RETVAL = out;
36  
37 OUTPUT:
38 RETVAL
39  
40 SV *smartypants(input)
41 char *input
42 CODE:
43 struct buf *ib, *ob;
44 SV *out;
45  
46 1 ib = bufnew(1024);
47 1 ob = bufnew(64);
48 1 bufputs(ib, input);
49 1 upshtml_smartypants(ob, ib);
50 1 out = newSVpv(ob->data, ob->size);
51 1 bufrelease(ib);
52 1 bufrelease(ob);
53 1 RETVAL = out;
54  
55 OUTPUT:
56 RETVAL
« const-xs.inc ↑ Summary