Internationalization and localization tools


ANSI Custom Print Formatting Function

int register_printf_function(int spec, printf_function handler-function, printf_arginfo_function arginfo-function);

Internationalization (I18n) Function Overview

This function defines the conversion specifier character spec. Thus, if spec is 'Y', it defines the conversion %Y. You can redefine the built-in conversions like %s, but flag characters like # and type modifiers like l can never be used as conversions; calling register_printf_function for those characters has no effect. It is advisable not to use lowercase letters, since the ISO C standard warns that additional lowercase letters may be standardized in future editions of the standard.

The handler-function is the function called by printf and friends when this conversion appears in a template string. If you specify a null pointer, any existing handler function for spec is removed.

The arginfo-function is the function called by parse_printf_format when this conversion appears in a template string.

I18n Issues

This function is part of a family of functions that are used to create customized printf-style formatting extensions. See ANSI Custom Print Formatting Functions for further discussion of the issues involved when migrating to UTF-8 multibyte or wide character applications.

There is no ANSI wide character version of this function. The parameters will have to be converted to multibyte UTF-8 characters and then the register_printf_function function can be used.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

ANSI Custom Print Formatting Functions

 

Lingoport internationalization and localization services and software