Main Page | Modules | Namespace List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

nls_operations Struct Reference
[Native Language Support (NLS)]

Structure of operations for NLS support. More...

#include <nls.h>


Data Fields

int(* mbtowc )(wchar_t *restrict result, const char *restrict string, size_t size)
 Multibyte to wide character.
int(* wctomb )(char *s, wchar_t wc, size_t size)
 Wide character to multibyte.
int(* mblen )(const char *string, size_t size)
 Gets the length of a multibyte character.
int(* toupper )(int ch)
 Converts a single byte character to upper case.
int(* tolower )(int ch)
 Converts a single byte character to lower case.
int(* release )(void)
 Releases the code page structure releasing its reference count.


Detailed Description

Structure of operations for NLS support.

NLS users get a pointer to a structure of this type in order to use the facilities of a code page.


Field Documentation

int(* nls_operations::mblen)(const char *string, size_t size)
 

Gets the length of a multibyte character.

Parameters:
string buffer containing the character (that may be multibyte);
size max number of bytes of string to examine;
Return values:
>0 the length in bytes of the multibyte character;
-EILSEQ invalid byte sequence in the character;
-ENAMETOOLONG size too small to parse the character.
Remarks:
You can use this function to know whether a character is single byte or not. For example, you must be sure a character is single byte before calling the toupper and tolower operations.

int(* nls_operations::mbtowc)(wchar_t *restrict result, const char *restrict string, size_t size)
 

Multibyte to wide character.

Parameters:
result where to store the converted wide character;
string buffer containing the character to convert (that may be multibyte);
size max number of bytes of string to examine;
Return values:
>0 the length in bytes of the processed source character, the wide character is stored in result;
-EILSEQ invalid byte sequence in the source character;
-ENAMETOOLONG size too small to parse the source character.

int(* nls_operations::release)(void)
 

Releases the code page structure releasing its reference count.

Return values:
>=0 the updated reference count;
-EINVAL the reference count was already zero prior this call.
NLS users shall call this operation when they no longer need to use the facilities of the code page. This decreases the internal reference count of the code page. When the reference count is zero, nobody is using the code page, thus the code page may be unregistered and the code page module may be unloaded.

int(* nls_operations::tolower)(int ch)
 

Converts a single byte character to lower case.

This is identical to the toupper operation, except it converts ch to lower case.

int(* nls_operations::toupper)(int ch)
 

Converts a single byte character to upper case.

If the single byte character ch, interpreted as an unsigned char, is a lower case letter, this function converts to its corresponding upper case letter. If ch is a byte that is part of a multibyte character, the result is undefined. You can use the mblen operation to know whether a character is single byte or not.

Returns:
A byte corresponding to the upper case version of ch, if available, otherwise ch is returned unchanged.

int(* nls_operations::wctomb)(char *s, wchar_t wc, size_t size)
 

Wide character to multibyte.

Parameters:
s where to store the converted character (that may be multibyte);
wc the wide character to convert;
size max number of bytes to store in s;
Return values:
>0 the length in bytes of the converted character, stored in s;
-EINVAL invalid wide character (don't know how to convert it);
-ENAMETOOLONG size too small to store the converted character.


The documentation for this struct was generated from the following file:
Generated on Fri Feb 24 14:13:24 2006 for VDK Blacksheep by  doxygen 1.4.1