]> git.vpit.fr Git - perl/modules/re-engine-Hooks.git/blobdiff - lib/re/engine/Hooks.pm
This is 0.05
[perl/modules/re-engine-Hooks.git] / lib / re / engine / Hooks.pm
index 50ba58e63d8f294e18204e001403bd0c971e5b5a..365df477d63737db3c930dc2ae02551a6bee3292 100644 (file)
@@ -1,6 +1,6 @@
 package re::engine::Hooks;
 
-use 5.010001;
+use 5.010_001;
 
 use strict;
 use warnings;
@@ -11,7 +11,7 @@ re::engine::Hooks - Hookable variant of the Perl core regular expression engine.
 
 =head1 VERSION
 
-Version 0.01
+Version 0.05
 
 =cut
 
@@ -20,7 +20,7 @@ our ($VERSION, @ISA);
 sub dl_load_flags { 0x01 }
 
 BEGIN {
- $VERSION = '0.01';
+ $VERSION = '0.05';
  require DynaLoader;
  push @ISA, qw<Regexp DynaLoader>;
  __PACKAGE__->bootstrap($VERSION);
@@ -32,12 +32,12 @@ In your XS file :
 
     #include "re_engine_hooks.h"
 
-    STATIC void dri_comp_hook(pTHX_ regexp *rx, regnode *node) {
+    STATIC void dri_comp_node_hook(pTHX_ regexp *rx, regnode *node) {
      ...
     }
 
-    STATIC void dri_exec_hook(pTHX_ regexp *rx, regnode *node,
-                              regmatch_info *info, regmatch_state *state) {
+    STATIC void dri_exec_node_hook(pTHX_
+       regexp *rx, regnode *node, regmatch_info *info, regmatch_state *state) {
      ...
     }
 
@@ -46,8 +46,8 @@ In your XS file :
     BOOT:
     {
      reh_config cfg;
-     cfg.comp = dri_comp_hook;
-     cfg.exec = dri_exec_hook;
+     cfg.comp_node = dri_comp_node_hook;
+     cfg.exec_node = dri_exec_node_hook;
      reh_register("Devel::Regexp::Instrument", &cfg);
     }
 
@@ -96,19 +96,19 @@ This module provides a version of the perl regexp engine that can call user-defi
 
 The C API is made available through the F<re_engine_hooks.h> header file.
 
-=head2 C<reh_comp_hook>
+=head2 C<reh_comp_node_hook>
 
-The typedef for the regexp compilation phase hook.
+The typedef for the regexp node compilation phase hook.
 Currently evaluates to :
 
-    typedef void (*reh_comp_hook)(pTHX_ regexp *, regnode *);
+    typedef void (*reh_comp_node_hook)(pTHX_ regexp *, regnode *);
 
-=head2 C<reh_exec_hook>
+=head2 C<reh_exec_node_hook>
 
-The typedef for the regexp execution phase hook.
+The typedef for the regexp node_execution phase hook.
 Currently evaluates to :
 
-    typedef void (*reh_exec_hook)(pTHX_ regexp *, regnode *, regmatch_info *, regmatch_state *);
+    typedef void (*reh_exec_node_hook)(pTHX_ regexp *, regnode *, regmatch_info *, regmatch_state *);
 
 =head2 C<reh_config>
 
@@ -119,16 +119,16 @@ It has the following members :
 
 =item *
 
-C<comp>
+C<comp_node>
 
-A function pointer of type C<reh_comp_hook> that will be called each time a regnode is compiled.
+A function pointer of type C<reh_comp_node_hook> that will be called each time a regnode is compiled.
 Allowed to be C<NULL> if you don't want to call anything for this phase.
 
 =item *
 
-C<exec>
+C<exec_node>
 
-A function pointer of type C<reh_exec_hook> that will be called each time a regnode is executed.
+A function pointer of type C<reh_exec_node_hook> that will be called each time a regnode is executed.
 Allowed to be C<NULL> if you don't want to call anything for this phase.
 
 =back
@@ -139,7 +139,7 @@ Allowed to be C<NULL> if you don't want to call anything for this phase.
 
 Registers the callbacks specified by the C<reh_config *> object C<cfg> under the given name C<key>.
 C<cfg> can be a pointer to a static object of type C<reh_config>.
-C<key> should match with the argument passed to L</enable> and L</disable> in Perl land.
+C<key> is expected to be a nul-terminated string and should match the argument passed to L</enable> and L</disable> in Perl land.
 An exception will be thrown if C<key> has already been used to register callbacks.
 
 =cut
@@ -157,13 +157,13 @@ my $croak = sub {
 
     enable $key;
 
-Lexically enables the hooks associated with the key C<$key>
+Lexically enables the hooks associated with the key C<$key>.
 
 =head2 C<disable>
 
     disable $key;
 
-Lexically disables the hooks associated with the key C<$key>
+Lexically disables the hooks associated with the key C<$key>.
 
 =cut
 
@@ -205,12 +205,15 @@ sub disable {
 
 =head1 EXAMPLES
 
-See the F<t/re-engine-Hooks-TestDist/> directory in the distribution.
+Please refer to the F<t/re-engine-Hooks-TestDist/> directory in the distribution.
 It implements a couple of simple examples.
 
 =head1 DEPENDENCIES
 
-L<perl> 5.10.1.
+Any stable release of L<perl> since 5.10.1, or a development release of L<perl> from the 5.19 branch.
+
+A C compiler.
+This module may happen to build with a C++ compiler as well, but don't rely on it, as no guarantee is made in this regard.
 
 L<ExtUtils::Depends>.
 
@@ -237,7 +240,7 @@ You can find documentation for this module with the perldoc command :
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2012 Vincent Pit, all rights reserved.
+Copyright 2012,2013 Vincent Pit, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.