ExtUtils::Constant - Online Linux Manual PageSection : 3pm
Updated : 2022-03-15
Source : perl v5.34.1
Note : Perl Programmers Reference Guide
NAMEExtUtils::Constant − generate XS code to import C header constants
SYNOPSIS use ExtUtils::Constant qw (WriteConstants);
WriteConstants(
NAME => 'Foo',
NAMES => [qw(FOO BAR BAZ)],
);
# Generates wrapper code to make the values of the constants FOO BAR BAZ
# available to perl
DESCRIPTIONExtUtils::Constant facilitates generating C and XS wrapper code to allow perl modules to AUTOLOAD constants defined in C library header files. It is principally used by the h2xs utility, on which this code is based. It doesn't contain the routines to scan header files to extract these constants.
USAGEGenerally one only needs to call the WriteConstants function, and then #include "const−c.inc"
in the C section of Foo.xs INCLUDE: const−xs.inc
in the XS section of Foo.xs. For greater flexibility use constant_types(), C_constant and XS_constant, with which WriteConstants is implemented. Currently this module understands the following types. h2xs may only know a subset. The sizes of the numeric types are chosen by the Configure script at compile time. IV signed integer, at least 32 bits. UV unsigned integer, the same size as IV NV floating point type, probably double, possibly long double PV NUL terminated string, length will be determined with strlen PVN A fixed length thing, given as a [pointer, length] pair. If you know the length of a string at compile time you may use this instead of PV SV A mortal SV. YES Truth. (PL_sv_yes) The value is not needed (and ignored). NO Defined Falsehood. (PL_sv_no) The value is not needed (and ignored). UNDEF undef. The value of the macro is not needed.
FUNCTIONSconstant_types A function returning a single scalar with #define definitions for the constants used internally between the generated C and XS functions. XS_constant PACKAGE, TYPES, XS_SUBNAME, C_SUBNAME A function to generate the XS code to implement the perl subroutine PACKAGE::constant used by PACKAGE::AUTOLOAD to load constants. This XS code is a wrapper around a C subroutine usually generated by C_constant, and usually named constant. TYPES should be given either as a comma separated list of types that the C subroutine constant will generate or as a reference to a hash. It should be the same list of types as C_constant was given. [Otherwise XS_constant and C_constant may have different ideas about the number of parameters passed to the C function constant] You can call the perl visible subroutine something other than constant if you give the parameter XS_SUBNAME. The C subroutine it calls defaults to the name of the perl visible subroutine, unless you give the parameter C_SUBNAME. autoload PACKAGE, VERSION, AUTOLOADER A function to generate the AUTOLOAD subroutine for the module PACKAGE VERSION is the perl version the code should be backwards compatible with. It defaults to the version of perl running the subroutine. If AUTOLOADER is true, the AUTOLOAD subroutine falls back on AutoLoader::AUTOLOAD for all names that the constant() routine doesn't recognise. WriteMakefileSnippet WriteMakefileSnippet ATTRIBUTE => VALUE [, ...] A function to generate perl code for Makefile.PL that will regenerate the constant subroutines. Parameters are named as passed to WriteConstants, with the addition of INDENT to specify the number of leading spaces (default 2). Currently only INDENT, NAME, DEFAULT_TYPE, NAMES, C_FILE and XS_FILE are recognised. WriteConstants ATTRIBUTE => VALUE [, ...] Writes a file of C code and a file of XS code which you should #include and INCLUDE in the C and XS sections respectively of your module's XS code. You probably want to do this in your Makefile.PL, so that you can easily edit the list of constants without touching the rest of your module. The attributes supported are NAME Name of the module. This must be specified DEFAULT_TYPE The default type for the constants. If not specified IV is assumed. BREAKOUT_AT The names of the constants are grouped by length. Generate child subroutines for each group with this number or more names in. NAMES An array of constants' names, either scalars containing names, or hashrefs as detailed in ‟C_constant”. PROXYSUBS If true, uses proxy subs. See ExtUtils::Constant::ProxySubs. C_FH A filehandle to write the C code to. If not given, then C_FILE is opened for writing. C_FILE The name of the file to write containing the C code. The default is const−c.inc. The − in the name ensures that the file can't be mistaken for anything related to a legitimate perl package name, and not naming the file .c avoids having to override Makefile.PL's .xs to .c rules. XS_FH A filehandle to write the XS code to. If not given, then XS_FILE is opened for writing. XS_FILE The name of the file to write containing the XS code. The default is const−xs.inc. XS_SUBNAME The perl visible name of the XS subroutine generated which will return the constants. The default is constant. C_SUBNAME The name of the C subroutine generated which will return the constants. The default is XS_SUBNAME. Child subroutines have _ and the name length appended, so constants with 10 character names would be in constant_10 with the default XS_SUBNAME.
AUTHORNicholas Clark <nick@ccl4.org> based on the code in h2xs by Larry Wall and others 0
Johanes Gumabo
Data Size : 23,437 byte
man-ExtUtils::Constant.3pmBuild : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 182,398
Visitor ID : :
Visitor IP : 3.139.234.68 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|249|ExtUtils::Constant.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\|
) (htmlprn|149|ExtUtils::Constant.3pm|36/37|.el══─{─══. ds -- — |.el══─{─══. ds -- \|\(em\|
) (parse_manual_page_|249|ExtUtils::Constant.3pm|43|br══─}─══|'br══─}─══
) (htmlprn|149|ExtUtils::Constant.3pm|43|'br══─}─══ |'br══─}─══
)