]> git.vpit.fr Git - perl/modules/Sub-Op.git/blobdiff - lib/Sub/Op.pm
POD verbatim paragraphs should fit into a terminal
[perl/modules/Sub-Op.git] / lib / Sub / Op.pm
index c7b705de91d83b91b608ddade95ea24de38f9767..a3334428a1b9a0885b1cc02736530884746d31cc 100644 (file)
@@ -50,7 +50,8 @@ In your XS file :
      refgen   = pushmark->op_sibling;
      gvop     = sub_op_study(o, &last_arg, &rv2cv);
 
      refgen   = pushmark->op_sibling;
      gvop     = sub_op_study(o, &last_arg, &rv2cv);
 
-     /* Replace the function name by the refgen that contains the anon sub */
+     /* Replace the function name by the refgen that contains
+        the anon sub */
      op_free(rv2cv);
      last_arg->op_sibling = refgen;
      pushmark->op_sibling = refgen->op_sibling;
      op_free(rv2cv);
      last_arg->op_sibling = refgen;
      pushmark->op_sibling = refgen->op_sibling;
@@ -275,27 +276,37 @@ An optional user data passed to the C<call> and C<ref> callbacks.
 
 =back
 
 
 =back
 
-=head2 C<void sub_op_init(sub_op_config_t *c)>
+=head2 C<sub_op_init>
+
+    void sub_op_init(sub_op_config_t *c);
 
 Initializes the fields of the C<sub_op_config_t> object.
 For future compatibility, it is required to call this function with your config object before storing your actual values.
 It will store safe defaults for members you won't set.
 
 
 Initializes the fields of the C<sub_op_config_t> object.
 For future compatibility, it is required to call this function with your config object before storing your actual values.
 It will store safe defaults for members you won't set.
 
-=head2 C<void sub_op_register(pTHX_ const sub_op_config_t *c, U32 flags)>
+=head2 C<sub_op_register>
+
+    void sub_op_register(pTHX_ const sub_op_config_t *c, U32 flags);
 
 Registers a name and its configuration into L<Sub::Op>.
 The caller is responsible for allocating and freeing the C<sub_op_config_t> object.
 No pointer to it or to its members is kept, except if you pass the flag C<SUB_OP_REGISTER_STEAL> in which case the configuration object will be stolen to be stored into L<Sub::Op>'s internal datastructure.
 
 
 Registers a name and its configuration into L<Sub::Op>.
 The caller is responsible for allocating and freeing the C<sub_op_config_t> object.
 No pointer to it or to its members is kept, except if you pass the flag C<SUB_OP_REGISTER_STEAL> in which case the configuration object will be stolen to be stored into L<Sub::Op>'s internal datastructure.
 
-=head2 C<sub_op_config_t *sub_op_dup(pTHX_ const sub_op_config_t *orig)>
+=head2 C<sub_op_dup>
+
+    sub_op_config_t *sub_op_dup(pTHX_ const sub_op_config_t *orig);
 
 Deeply clones the specified C<sub_op_config_t> object.
 
 
 Deeply clones the specified C<sub_op_config_t> object.
 
-=head2 C<void sub_op_free(pTHX_ sub_op_config_t *c)>
+=head2 C<sub_op_free>
+
+    void sub_op_free(pTHX_ sub_op_config_t *c);
 
 Free the memory associated with the specified C<sub_op_config_t> object.
 
 
 Free the memory associated with the specified C<sub_op_config_t> object.
 
-=head2 C<OP *sub_op_study(OP *o, OP **last_arg_p, OP **rv2cv_p)>
+=head2 C<sub_op_study>
+
+    OP *sub_op_study(OP *o, OP **last_arg_p, OP **rv2cv_p);
 
 Studies the subset of the optree based on C<o>, expecting it to be an C<entersub> or C<rv2cv> op (the ones you get in the C<call> and C<ref> callbacks).
 If the tree is well-formed, C<*last_arg_p> will be set to the last argument of the call, C<*rv2cv_p> to the C<rv2cv> op that resolves the function name, and the C<gv> op will be returned.
 
 Studies the subset of the optree based on C<o>, expecting it to be an C<entersub> or C<rv2cv> op (the ones you get in the C<call> and C<ref> callbacks).
 If the tree is well-formed, C<*last_arg_p> will be set to the last argument of the call, C<*rv2cv_p> to the C<rv2cv> op that resolves the function name, and the C<gv> op will be returned.
@@ -303,7 +314,10 @@ Otherwise, this function returns C<NULL>.
 
 =head1 PERL API
 
 
 =head1 PERL API
 
-=head2 C<enable $name, [ $pkg ]>
+=head2 C<enable>
+
+    enable($name);
+    enable($name, $pkg);
 
 Enable the capture of function calls and references constructors to C<$name> in the C<$pkg> package in the current lexical scope.
 You must have registered an appropriate C<sub_op_config_t> configuration by calling the C function C<sub_op_register> in the XS section of your module.
 
 Enable the capture of function calls and references constructors to C<$name> in the C<$pkg> package in the current lexical scope.
 You must have registered an appropriate C<sub_op_config_t> configuration by calling the C function C<sub_op_register> in the XS section of your module.
@@ -338,7 +352,10 @@ sub enable {
  return;
 }
 
  return;
 }
 
-=head2 C<disable $name, [ $pkg ]>
+=head2 C<disable>
+
+    disable($name);
+    disable($name, $pkg);
 
 Disable the capture of function calls and reference constructors to C<$name> in the package C<$pkg>.
 
 
 Disable the capture of function calls and reference constructors to C<$name> in the package C<$pkg>.