Method __handle_sscanf_format()


Method __handle_sscanf_format

type __handle_sscanf_format(string attribute_name, string|zero fmt, type arg_type, type(function(:void))|zero cont_type, mapping state)

Description

Type attribute handler for "sscanf_input".

Parameter attr

Attribute to handle, one of "sscanf_input", "sscanf_format" or "sscanf_80_format".

Parameter fmt

Sscanf-style formatting string to generate type information from.

Parameter arg_type

Declared type of the fmt argument (typically string).

Parameter cont_type

Continuation function type after the fmt argument. This is scanned for the type attribute "sscanf_args" to determine where sscanf() will put its extracted values.

Parameter state

State mapping.

This function is typically called from CompilerEnvironment.PikeCompiler()->apply_attribute_constant() and is used to perform stricter compile-time argument checking of sscanf()-style functions.

Returns

Returns cont_type with "sscanf_args" replaced by the arguments required by the fmt formatting string. May return UNDEFINED in case of non-fatal failure (eg when fmt is not a literal string constant).

See also

CompilerEnvironment.PikeCompiler()->apply_attribute_constant(), sprintf(), __handle_sprintf_format()