|header||A method returning a scalar containing definitions needed, typically for a C header file.|
A method to return a suitable C if statement to check whether name
is equal to the C variable name. If checked_at is defined, then it
is used to avoid memEQ for short names, or to generate a comment to
highlight the position of the character in the switch statement.
If i<checked_at> is a reference to a scalar, then instead it gives the characters pre-checked at the beginning, (and the number of chars by which the C variable name has been advanced. These need to be chopped from the front of name).
|dump_names arg_hashref, ITEM...||An internal function to generate the embedded perl code that will regenerate the constant subroutines. default_type, types and ITEMs are the same as for C_constant. indent is treated as number of spaces to indent by. If declare_types is true a $types is always declared in the perl code generated, if defined and false never declared, and if undefined $types is only declared if the values in types as passed in cannot be inferred from default_types and the ITEMs.|
|assign arg_hashref, VALUE...||A method to return a suitable assignment clause. If type is aggregate (eg PVN expects both pointer and length) then there should be multiple VALUEs for the components. pre and post if defined give snippets of C code to proceed and follow the assignment. pre will be at the start of a block, so variables may be defined in it.|
|return_clause arg_hashref, ITEM||A method to return a suitable #ifdef clause. ITEM is a hashref (as passed to C_constant and match_clause. indent is the number of spaces to indent, defaulting to 6.|
|switch_clause arg_hashref, NAMELEN, ITEMHASH, ITEM...||An internal method to generate a suitable switch clause, called by C_constant ITEMs are in the hash ref format as given in the description of C_constant, and must all have the names of the same length, given by NAMELEN. ITEMHASH is a reference to a hash, keyed by name, values being the hashrefs in the ITEM list. (No parameters are modified, and there can be keys in the ITEMHASH that are not in the list of ITEMs without causing problems - the hash is passed in to save generating it afresh for each call).|
|params WHAT||An internal method, subject to change, currently called to allow an overriding class to cache information that will then be passed into all the *param* calls. (Yes, having to read the source to make sense of this is considered a known bug). WHAT is be a hashref of types the constant function will return. In ExtUtils::Constant::XS this method is used to returns a hashref keyed IV NV PV SV to show which combination of pointers will be needed in the C argument list generated by C_constant_other_params_definition and C_constant_other_params|
|dogfood arg_hashref, ITEM...||
An internal function to generate the embedded perl code that will regenerate
the constant subroutines. Parameters are the same as for C_constant.
Currently the base class does nothing and returns an empty string.
|normalise_items args, default_type, seen_types, seen_items, ITEM...||Convert the items to a normalised form. For 8 bit and Unicode values converts the item to an array of 1 or 2 items, both 8 bit and UTF-8 encoded.|
|C_constant arg_hashref, ITEM...||
A function that returns a <B>listB> of C subroutine definitions that return
the value and type of constants when passed the name by the XS wrapper.
ITEM... gives a list of constant names. Each can either be a string,
which is taken as a C macro name, or a reference to a hash with the following
default_type is the type returned by ITEMs that dont specify their type. It defaults to the value of default_type(). types should be given either as a comma separated list of types that the C subroutine subname will generate or as a reference to a hash. default_type will be added to the list if not present, as will any types given in the list of ITEMs. The resultant list should be the same list of types that XS_constant is given. [Otherwise XS_constant and C_constant may differ in the number of parameters to the constant function. indent is currently unused and ignored. In future it may be used to pass in information used to change the C indentation style used.] The best way to maintain consistency is to pass in a hash reference and let this function update it.
breakout governs when child functions of subname are generated. If there are breakout or more ITEMs with the same length of name, then the code to switch between them is placed into a function named subname_len, for example constant_5 for names 5 characters long. The default breakout is 3. A single ITEM is always inlined.
Not everything is documented yet.
Nicholas Clark <email@example.com> based on the code in h2xs by Larry Wall and others
|perl v5.20.3||EXTUTILS::CONSTANT::BASE (3)||2010-10-24|