Internationalization and localization tools


File and Path Function

void _searchenv( const char *filename, const char *varname, char *pathname );

void _wsearchenv( const wchar_t *filename, const wchar_t *varname, wchar_t *pathname );

void _tsearchenv( const TCHAR *filename, const TCHAR *varname, TCHAR *pathname );

Internationalization (I18n) Function Overview

The _searchenv function searches for the target file (filename) in the specified domain (varname). The varname variable can be any environment or user-defined variable that specifies a list of directory paths, such as PATH, LIB, and INCLUDE. _searchenv is case sensitive, so varname should match the case of the environment variable.

If the target file is found, the newly created path is copied into pathname. If the file is not found, pathname is set to an empty, null-terminated string. To avoid buffer overrun, the pathname buffer should be at least _MAX_PATH characters long in order to accommodate the full length of the constructed pathname.

_wsearchenv is the wide-character version of _searchenv; its arguments are wide-character strings.

_tsearchenv is the Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _searchenv or _wsearchenv.

I18n Issues

Use the appropriate version of the function as required for internationalization support, ensuring that pathname is large enough to hold the resulting multibyte or wide-character string. See Locale-Sensitive Length Functions for a discussion on multibyte and wide character sizes.

See Pathnames for a discussion of path and filename considerations in an internationalized application.

Recommended Replacements*

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

File and Path Functions

 

Lingoport internationalization and localization services and software