breakout => $breakout}, @items);
}
-=item XS_constant PACKAGE, TYPES, SUBNAME, C_SUBNAME
+=item XS_constant PACKAGE, TYPES, XS_SUBNAME, C_SUBNAME
A function to generate the XS code to implement the perl subroutine
I<PACKAGE>::constant used by I<PACKAGE>::AUTOLOAD to load constants.
the number of parameters passed to the C function C<constant>]
You can call the perl visible subroutine something other than C<constant> if
-you give the parameter I<SUBNAME>. The C subroutine it calls defaults to
+you give the parameter I<XS_SUBNAME>. The C subroutine it calls defaults to
the name of the perl visible subroutine, unless you give the parameter
I<C_SUBNAME>.
sub XS_constant {
my $package = shift;
my $what = shift;
- my $subname = shift;
+ my $XS_subname = shift;
my $C_subname = shift;
- $subname ||= 'constant';
- $C_subname ||= $subname;
+ $XS_subname ||= 'constant';
+ $C_subname ||= $XS_subname;
if (!ref $what) {
# Convert line of the form IV,UV,NV to hash
my $xs = <<"EOT";
void
-$subname(sv)
+$XS_subname(sv)
PREINIT:
#ifdef dXSTARG
dXSTARG; /* Faster if we have it. */
The name of the file to write containing the XS code. The default is
C<const-xs.inc>.
-=item SUBNAME
+=item XS_SUBNAME
The perl visible name of the XS subroutine generated which will return the
constants. The default is C<constant>.
=item C_SUBNAME
The name of the C subroutine generated which will return the constants.
-The default is I<SUBNAME>. Child subroutines have C<_> and the name
+The default is I<XS_SUBNAME>. Child subroutines have C<_> and the name
length appended, so constants with 10 character names would be in
C<constant_10> with the default I<XS_SUBNAME>.
( # defaults
C_FILE => 'const-c.inc',
XS_FILE => 'const-xs.inc',
- SUBNAME => 'constant',
+ XS_SUBNAME => 'constant',
DEFAULT_TYPE => 'IV',
@_);
- $ARGS{C_SUBNAME} ||= $ARGS{SUBNAME}; # No-one sane will have C_SUBNAME eq '0'
+ $ARGS{C_SUBNAME} ||= $ARGS{XS_SUBNAME}; # No-one sane will have C_SUBNAME eq '0'
croak "Module name not specified" unless length $ARGS{NAME};