Internationalization and localization tools


ANSI Error Message Function

void error_at_line(int status, int errnum, const char *fname, unsigned int lineno, const char *format, ...);

Internationalization (I18n) Function Overview

The error_at_line function is very similar to the error function. The only difference are the additional parameters fname and lineno. The handling of the other parameters is identical to that of error except that between the program name and the string generated by the format string additional text is inserted.

Directly following the program name a colon, followed by the file name pointer to by fname, another colon, and a value of lineno is printed.

I18n Issues

This function should not be relied upon to print error messages in any language other than English, and therefore should be avoided in an internationalized application. However, its worth noting that in some limited instances it still may be useful. For example, for debugging, or for writing to log files that will not be viewed by the end user.

Prior to calling this function, ensure that the current locale is set properly by calling setlocale, as string formatting is dependent on the LC_NUMERIC locale category. See String Formatting in C and C++ for a discussion on locale-sensitive formatting in internationalized 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 error_at_line 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 Error Message Functions

 

Lingoport internationalization and localization services and software