{
    "mode": "perldoc",
    "parameter": "ExtUtils::ParseXS::Utilities",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/ExtUtils%3A%3AParseXS%3A%3AUtilities/json",
    "generated": "2026-10-04T12:03:58Z",
    "synopsis": "use ExtUtils::ParseXS::Utilities qw(\nstandardtypemaplocations\ntrimwhitespace\nCstring\nvalidprotostring\nprocesstypemaps\nmaptype\nstandardXSdefs\nassignfuncargs\nanalyzepreprocessorstatements\nsetcond\nWarn\nblurt\ndeath\ncheckconditionalpreprocessorstatements\nescapefileforlinedirective\nreporttypemapfailure\n);",
    "sections": {
        "NAME": {
            "content": "ExtUtils::ParseXS::Utilities - Subroutines used with ExtUtils::ParseXS\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use ExtUtils::ParseXS::Utilities qw(\nstandardtypemaplocations\ntrimwhitespace\nCstring\nvalidprotostring\nprocesstypemaps\nmaptype\nstandardXSdefs\nassignfuncargs\nanalyzepreprocessorstatements\nsetcond\nWarn\nblurt\ndeath\ncheckconditionalpreprocessorstatements\nescapefileforlinedirective\nreporttypemapfailure\n);\n",
            "subsections": []
        },
        "SUBROUTINES": {
            "content": "The following functions are not considered to be part of the public interface. They are\ndocumented here for the benefit of future maintainers of this module.\n\nstandardtypemaplocations()\n*   Purpose\n\nProvide a list of filepaths where typemap files may be found. The filepaths -- relative\npaths to files (not just directory paths) -- appear in this list in lowest-to-highest\npriority.\n\nThe highest priority is to look in the current directory.\n\n'typemap'\n\nThe second and third highest priorities are to look in the parent of the current directory\nand a directory called lib/ExtUtils underneath the parent directory.\n\n'../typemap',\n'../lib/ExtUtils/typemap',\n\nThe fourth through ninth highest priorities are to look in the corresponding grandparent,\ngreat-grandparent and great-great-grandparent directories.\n\n'../../typemap',\n'../../lib/ExtUtils/typemap',\n'../../../typemap',\n'../../../lib/ExtUtils/typemap',\n'../../../../typemap',\n'../../../../lib/ExtUtils/typemap',\n\nThe tenth and subsequent priorities are to look in directories named ExtUtils which are\nsubdirectories of directories found in @INC -- *provided* a file named typemap actually\nexists in such a directory. Example:\n\n'/usr/local/lib/perl5/5.10.1/ExtUtils/typemap',\n\nHowever, these filepaths appear in the list returned by standardtypemaplocations() in\nreverse order, *i.e.*, lowest-to-highest.\n\n'/usr/local/lib/perl5/5.10.1/ExtUtils/typemap',\n'../../../../lib/ExtUtils/typemap',\n'../../../../typemap',\n'../../../lib/ExtUtils/typemap',\n'../../../typemap',\n'../../lib/ExtUtils/typemap',\n'../../typemap',\n'../lib/ExtUtils/typemap',\n'../typemap',\n'typemap'\n\n*   Arguments\n\nmy @stl = standardtypemaplocations( \\@INC );\n\nReference to @INC.\n\n*   Return Value\n\nArray holding list of directories to be searched for typemap files.\n\ntrimwhitespace()\n*   Purpose\n\nPerform an in-place trimming of leading and trailing whitespace from the first argument\nprovided to the function.\n\n*   Argument\n\ntrimwhitespace($arg);\n\n*   Return Value\n\nNone. Remember: this is an *in-place* modification of the argument.\n\nCstring()\n*   Purpose\n\nEscape backslashes (\"\\\") in prototype strings.\n\n*   Arguments\n\n$ProtoThisXSUB = Cstring($);\n\nString needing escaping.\n\n*   Return Value\n\nProperly escaped string.\n\nvalidprotostring()\n*   Purpose\n\nValidate prototype string.\n\n*   Arguments\n\nString needing checking.\n\n*   Return Value\n\nUpon success, returns the same string passed as argument.\n\nUpon failure, returns 0.\n\nprocesstypemaps()\n*   Purpose\n\nProcess all typemap files.\n\n*   Arguments\n\nmy $typemapsobject = processtypemaps( $args{typemap}, $pwd );\n\nList of two elements: \"typemap\" element from %args; current working directory.\n\n*   Return Value\n\nUpon success, returns an ExtUtils::Typemaps object.\n\nmaptype()\n*   Purpose\n\nPerforms a mapping at several places inside \"PARAGRAPH\" loop.\n\n*   Arguments\n\n$type = maptype($self, $type, $varname);\n\nList of three arguments.\n\n*   Return Value\n\nString holding augmented version of second argument.\n\nstandardXSdefs()\n*   Purpose\n\nWrites to the \".c\" output file certain preprocessor directives and function headers needed\nin all such files.\n\n*   Arguments\n\nNone.\n\n*   Return Value\n\nReturns true.\n\nassignfuncargs()\n*   Purpose\n\nPerform assignment to the \"funcargs\" attribute.\n\n*   Arguments\n\n$string = assignfuncargs($self, $argsref, $class);\n\nList of three elements. Second is an array reference; third is a string.\n\n*   Return Value\n\nString.\n\nanalyzepreprocessorstatements()\n*   Purpose\n\nWithin each function inside each Xsub, print to the .c output file certain preprocessor\nstatements.\n\n*   Arguments\n\n( $self, $XSSworkidx, $BootCoderef ) =\nanalyzepreprocessorstatements(\n$self, $statement, $XSSworkidx, $BootCoderef\n);\n\nList of four elements.\n\n*   Return Value\n\nModifed values of three of the arguments passed to the function. In particular, the\n\"XSStack\" and \"InitFileCode\" attributes are modified.\n\nsetcond()\n*   Purpose\n\n*   Arguments\n\n*   Return Value\n\ncurrentlinenumber()\n*   Purpose\n\nFigures out the current line number in the XS file.\n\n*   Arguments\n\n$self\n\n*   Return Value\n\nThe current line number.\n\nWarn()\n*   Purpose\n\nPrint warnings with line number details at the end.\n\n*   Arguments\n\nList of text to output.\n\n*   Return Value\n\nNone.\n\nWarnHint()\n*   Purpose\n\nPrints warning with line number details. The last argument is assumed to be a hint string.\n\n*   Arguments\n\nList of strings to warn, followed by one argument representing a hint. If that argument is\ndefined then it will be split on newlines and output line by line after the main warning.\n\n*   Return Value\n\nNone.\n\nMsgHint()\n*   Purpose\n\nConstructs an exception message with line number details. The last argument is assumed to be\na hint string.\n\n*   Arguments\n\nList of strings to warn, followed by one argument representing a hint. If that argument is\ndefined then it will be split on newlines and concatenated line by line (parenthesized)\nafter the main message.\n\n*   Return Value\n\nThe constructed string.\n\nblurt()\n*   Purpose\n\n*   Arguments\n\n*   Return Value\n\ndeath()\n*   Purpose\n\n*   Arguments\n\n*   Return Value\n\ncheckconditionalpreprocessorstatements()\n*   Purpose\n\n*   Arguments\n\n*   Return Value\n\nescapefileforlinedirective()\n*   Purpose\n\nEscapes a given code source name (typically a file name but can also be a command that was\nread from) so that double-quotes and backslashes are escaped.\n\n*   Arguments\n\nA string.\n\n*   Return Value\n\nA string with escapes for double-quotes and backslashes.\n\n\"reporttypemapfailure\"\n*   Purpose\n\nDo error reporting for missing typemaps.\n\n*   Arguments\n\nThe \"ExtUtils::ParseXS\" object.\n\nAn \"ExtUtils::Typemaps\" object.\n\nThe string that represents the C type that was not found in the typemap.\n\nOptionally, the string \"death\" or \"blurt\" to choose whether the error is immediately fatal\nor not. Default: \"blurt\"\n\n*   Return Value\n\nReturns nothing. Depending on the arguments, this may call \"death\" or \"blurt\", the former of\nwhich is fatal.\n",
            "subsections": []
        }
    },
    "summary": "ExtUtils::ParseXS::Utilities - Subroutines used with ExtUtils::ParseXS",
    "flags": [],
    "examples": [],
    "see_also": []
}