summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Markdown/GFM/Node.pm
blob: 934cb40559a6a03ed896ffd71d2e84b18778f039 (plain)
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
package Bugzilla::Markdown::GFM::Node;

use 5.10.1;
use strict;
use warnings;

sub SETUP {
  my ($class, $FFI) = @_;

  $FFI->custom_type(
    markdown_node_t => {
      native_type    => 'opaque',
      native_to_perl => sub {
        bless \$_[0], $class if $_[0];
      },
      perl_to_native => sub { ${$_[0]} },
    }
  );

  $FFI->attach([cmark_node_free => 'DESTROY'], ['markdown_node_t'] => 'void');

  $FFI->attach(
    [cmark_render_html => 'render_html'],
    ['markdown_node_t', 'markdown_options_t',
      'markdown_syntax_extension_list_t'] => 'string',
  );
}

1;

__END__