ExtUti...nction(3pm)
π¦ ExtUtils::XSpp::Node::Function π¦
okay so bestie, welcome to the manual page for ExtUtils::XSpp::Node::Function β that's the Perl module in the User Contributed Perl Documentation crew, and it's literally the node representing a function. yes queen, we're doing object-oriented parsing today π
β¨ NAME β¨
ExtUtils::XSpp::Node::Function β a Node representing a function π«Ά
πΈ DESCRIPTION πΈ
so this is an ExtUtils::XSpp::Node subclass, and what it does is represent a single function declaration. like, one (1) function. for example:
int foo();
that's it. that's the vibe. π
but here's the part that's giving main character energy: ExtUtils::XSpp::Node::Method inherits from this class. so everything you read in here? applies equally to method nodes. no cap. every single thing. β
π METHODS π
new
Creates a new ExtUtils::XSpp::Node::Function. fresh out the box, iconic, brand new β¨
here are the named parameters you can pass:
cpp_nameβ the C++ name of the functionperl_nameβ the Perl name of the function (defaults to the same ascpp_name)argumentsβ can be a reference to an array ofExtUtils::XSpp::Node::Argumentobjectsret_typeβ the (C++) return type of the function
and additionally, there are several optional decorators for a function declaration (go peek at ExtUtils::XSpp for a whole list of them, iykyk). you can pass these to the constructor as:
codecleanuppostcallcatchβ β οΈ this one is special: it must be a reference to an array of class names. not optional, not negotiable, it's just how she is π
resolve_typemaps
Fetches the ExtUtils::XSpp::Typemap object for the return type and for the arguments, from the typemap registry, and stores a reference to those objects. collecting her little typemap babies π§Ί
resolve_exceptions
Fetches the ExtUtils::XSpp::Exception object for the %catch directives associated with this function. catching exceptions like catching feelings π
add_exception_handlers
Adds a list of exception names to the list of exception handlers. this is mainly called by a class' add_methods method. important caveat bestie: if the function is hard-wired to have no exception handlers, then any extra handlers from the class are ignored. periodt. π
print_declaration
Returns a string with a C++ method declaration for the node. yes, she prints. we love a productive queen π
perl_function_name
Returns the name of the Perl function to generate.
is_method
Returns whether the object at hand is a method. for an ExtUtils::XSpp::Node::Function object this is hard-wired to be false β nope, not a method, sorry β but it gets overridden in the ExtUtils::XSpp::Node::Method sub-class. glow up π
has_argument_with_length
Returns true if the function has any argument that uses the XS length feature. length check passed, slay β
π ACCESSORS π
cpp_name
Returns the C++ name of the function.
perl_name
Returns the Perl name of the function (defaults to same as C++).
set_perl_name
Sets the Perl name of the function. little rename moment π
arguments
Returns the internal array reference of ExtUtils::XSpp::Node::Argument objects that represent the function arguments.
ret_type
Returns the C++ return type.
code
Returns the %code decorator if any.
set_code
Sets the implementation for the method call (equivalent to using %code); takes the code as an array reference containing the lines.
cleanup
Returns the %cleanup decorator if any.
postcall
Returns the %postcall decorator if any.
catch
Returns the set of exception types that were associated with the function via %catch. (that's an array reference, for the record)
aliases
Returns a hashref of name => position function name aliases (see %alias and the perlxs ALIAS keyword). π¨ does not include the main function name β that one is the main character, she's above aliases fr fr.
set_static
Sets the "static"-ness attribute of the function. can be either:
undef(i.e. not static)package_staticclass_static
pick your fighter π₯
package_static
Returns whether the function is package static. a package static function can be invoked as:
My::Package::Function( ... );
class_static
Returns whether the function is class static. a class static function can be invoked as:
My::Package->Function( ... );
ret_typemap
Returns the typemap for the return value of the function.
set_ret_typemap( typemap )
Sets the typemap for the return value of the function.
arg_typemap( index )
Returns the typemap for one function arguments.
set_arg_typemap( index, typemap )
Sets the typemap for one function argument.
π reminder bestie: ExtUtils::XSpp::Node::Method inherits all of this. every accessor, every method, all of it. so if you're here for methods, you're in the right place, you didn't take a wrong turn π«Ά
and that's the whole page!! π this was written by the User Contributed Perl Documentation girlies over at perl v5.40.1, dated 2026-07-03 β yes the future, yes she's ahead of her time, and she ate. π bye bestie, go build something iconic π
π¦ where this page comes from
- ubuntu stonking: libextutils-xspp-perl 0.1900-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms