1. Shlomi Fish
  2. perl-XML-LibXML

Commits

ma...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed 4b3a48e

Added callbacks()

  • Participants
  • Parent commits b99f979
  • Branches default

Comments (0)

Files changed (1)

File LibXML.pm

View file
  • Ignore whitespace
     return $self->{XML_LIBXML_OPEN_CB} = shift;
 }
 
+sub callbacks {
+    my $self = shift;
+    if (@_) {
+        my ($match, $open, $read, $close) = @_;
+        @{$self}{qw(XML_LIBXML_MATCH_CB XML_LIBXML_OPEN_CB XML_LIBXML_READ_CB XML_LIBXML_CLOSE_CB)} = ($match, $open, $read, $close);
+    }
+    else {
+        return @{$self}{qw(XML_LIBXML_MATCH_CB XML_LIBXML_OPEN_CB XML_LIBXML_READ_CB XML_LIBXML_CLOSE_CB)};
+    }
+}
 
 sub validation {
     my $self = shift;