]> git.vpit.fr Git - perl/modules/Sub-Op.git/commitdiff
Add a "flags" parameter to sub_op_register()
authorVincent Pit <vince@profvince.com>
Mon, 19 Apr 2010 22:13:23 +0000 (00:13 +0200)
committerVincent Pit <vince@profvince.com>
Mon, 19 Apr 2010 22:28:29 +0000 (00:28 +0200)
If we're gonna break the API, let's do it with a BANG.

Op.xs
lib/Sub/Op.pm
sub_op.h
t/Sub-Op-LexicalSub/LexicalSub.xs

diff --git a/Op.xs b/Op.xs
index ecdac3a3cbfe578bfd3fc47bab22f6e25c41499a..c5be45bd6f33b60a7fd9bec62dbb217d0a3d29be 100644 (file)
--- a/Op.xs
+++ b/Op.xs
@@ -123,7 +123,7 @@ void sub_op_init(sub_op_config_t *c) {
  return;
 }
 
  return;
 }
 
-void sub_op_register(pTHX_ const sub_op_config_t *c) {
+void sub_op_register(pTHX_ const sub_op_config_t *c, U32 flags) {
  SV *key = newSViv(PTR2IV(c->pp));
 
  if (!PL_custom_op_names)
  SV *key = newSViv(PTR2IV(c->pp));
 
  if (!PL_custom_op_names)
index cf67eac9e5317a8f7f984798d8fb3cbb134ca3e6..20cc912081d5e6f7ea6e7078c90d9f09c2599a09 100644 (file)
@@ -56,7 +56,7 @@ In your XS file :
      c.pp      = scalar_util_reftype;
      c.check   = 0;
      c.ud      = NULL;
      c.pp      = scalar_util_reftype;
      c.check   = 0;
      c.ud      = NULL;
-     sub_op_register(aTHX_ &c);
+     sub_op_register(aTHX_ &c, 0);
     }
 
 In your Perl module file :
     }
 
 In your Perl module file :
@@ -253,7 +253,7 @@ 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.
 
 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)>
+=head2 C<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.
 
 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.
index c594f036e681fb4ad21a9c09d52fed32cf21ef04..5dbb320b3618aa8f31e660076cd114ebe3b7eeb5 100644 (file)
--- a/sub_op.h
+++ b/sub_op.h
@@ -15,7 +15,7 @@ typedef struct {
 } sub_op_config_t;
 
 void             sub_op_init    (sub_op_config_t *c);
 } sub_op_config_t;
 
 void             sub_op_init    (sub_op_config_t *c);
-void             sub_op_register(pTHX_ const sub_op_config_t *c);
+void             sub_op_register(pTHX_ const sub_op_config_t *c, U32 flags);
 sub_op_config_t *sub_op_dup     (pTHX_ const sub_op_config_t *c);
 void             sub_op_free    (pTHX_ sub_op_config_t *c);
 
 sub_op_config_t *sub_op_dup     (pTHX_ const sub_op_config_t *c);
 void             sub_op_free    (pTHX_ sub_op_config_t *c);
 
index c2b7002d11ac6dd00964461bc7b5d1bb4c302bc7..a9b1344bba9b998a7f4033d52f30d7060dfede8f 100644 (file)
@@ -67,7 +67,7 @@ PPCODE:
    c.check = sols_check;
    c.ud    = SvREFCNT_inc(cb);
    c.pp    = sols_pp;
    c.check = sols_check;
    c.ud    = SvREFCNT_inc(cb);
    c.pp    = sols_pp;
-   sub_op_register(aTHX_ &c);
+   sub_op_register(aTHX_ &c, 0);
   }
  }
  XSRETURN(0);
   }
  }
  XSRETURN(0);