Commits

Toby Inkster  committed 0cf009f

cleanups

  • Participants
  • Parent commits bf0a10c

Comments (0)

Files changed (2)

File SetLineNumber.xs

 #include "XSUB.h"
 
 #include "ppport.h"
-#include "const-c.inc"
 
 /* libxml2 stuff */
 #include <libxml/xmlversion.h>
 
 MODULE = XML::LibXML::Devel::SetLineNumber		PACKAGE = XML::LibXML::Devel::SetLineNumber		
 
-INCLUDE: const-xs.inc
-
 PROTOTYPES: disable
 
 void
 	PREINIT:
 		xmlNode *node = PmmSvNode(sv);
 	CODE:
+		/* this is stupidly easy ... */
 		node->line = ln;
 

File lib/XML/LibXML/Devel/SetLineNumber.pm

 package XML::LibXML::Devel::SetLineNumber;
 
-use 5.010001;
+use 5.008003;
 use strict;
-use warnings;
-use Carp;
 
 use XML::LibXML;
 use XML::LibXML::Devel;
 
+our $AUTHORITY  = 'cpan:TOBYINK';
+our $VERSION    = '0.091';
+
 require Exporter;
-use AutoLoader;
 
 our @ISA = qw(Exporter);
+our @EXPORT_OK = our @EXPORT = qw(set_line_number);
 
-# Items to export into callers namespace by default. Note: do not export
-# names by default without a very good reason. Use EXPORT_OK instead.
-# Do not simply export all your public functions/methods/constants.
-
-# This allows declaration	use XML::LibXML::Devel::SetLineNumber ':all';
-# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
-# will save memory.
-our %EXPORT_TAGS = ( 'all' => [ qw(
-	set_line_number
-) ] );
-
-our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-our @EXPORT = qw(
-	set_line_number
-);
-
-our $VERSION = '0.01';
-
-sub AUTOLOAD {
-    # This AUTOLOAD is used to 'autoload' constants from the constant()
-    # XS function.
-
-    my $constname;
-    our $AUTOLOAD;
-    ($constname = $AUTOLOAD) =~ s/.*:://;
-    croak "&XML::LibXML::Devel::SetLineNumber::constant not defined" if $constname eq 'constant';
-    my ($error, $val) = constant($constname);
-    if ($error) { croak $error; }
-    {
-	no strict 'refs';
-	# Fixed between 5.005_53 and 5.005_61
-#XXX	if ($] >= 5.00561) {
-#XXX	    *$AUTOLOAD = sub () { $val };
-#XXX	}
-#XXX	else {
-	    *$AUTOLOAD = sub { $val };
-#XXX	}
-    }
-    goto &$AUTOLOAD;
-}
+our %EXPORT_TAGS = (
+	all     => \@EXPORT_OK,
+	default => \@EXPORT,
+	);
 
 require XSLoader;
 XSLoader::load('XML::LibXML::Devel::SetLineNumber', $VERSION);
 
-# Preloaded methods go here.
-
 sub set_line_number
 {
 	my ($node, $line) = @_;
 	_set_line_number($node, $line);
 }
 
-# Autoload methods go after =cut, and are processed by the autosplit program.
-
 1;
 __END__
 # Below is stub documentation for your module. You'd better edit it!
 =head1 SYNOPSIS
 
   use XML::LibXML::Devel::SetLineNumber;
-  blah blah blah
+  
+  my $node = $document->getElementsByTagName('foo')->get_node(1);
+  set_line_number($node, 8);
+  say $node->line_number;  # says "8"
 
 =head1 DESCRIPTION
 
-Stub documentation for XML::LibXML::Devel::SetLineNumber, created by h2xs. It looks like the
-author of the extension was negligent enough to leave the stub
-unedited.
+This module exports one function:
 
-Blah blah blah.
+=over
 
-=head2 EXPORT
+=item C<< set_line_number($node, $number) >>
 
-None by default.
+Sets a node's line number.
 
-
+=back
 
 =head1 SEE ALSO
 
-Mention other useful documentation such as the documentation of
-related modules or operating system documentation (such as man pages
-in UNIX), or any relevant external documentation such as RFCs or
-standards.
-
-If you have a mailing list set up for your module, mention it here.
-
-If you have a web site set up for your module, mention it here.
+L<XML::LibXML::Devel>,
+L<XML::LibXML::Node>.
 
 =head1 AUTHOR
 
-Toby Inkster, E<lt>tai@(none)E<gt>
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
 
-=head1 COPYRIGHT AND LICENSE
+=head1 COPYRIGHT AND LICENCE
 
 Copyright (C) 2012 by Toby Inkster
 
 This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.10.1 or,
-at your option, any later version of Perl 5 you may have available.
+it under the same terms as Perl itself.
 
+=head1 DISCLAIMER OF WARRANTIES
+
+THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
 =cut