Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
2.  General Internationalization Features Changed Interfaces  Previous   Contents   Next 
   
 

This shorter list contains stub entry points in libintl:

bindtextdomain
dcgettext
dgettext
gettext
textdomain

ctype Macros

Character classification and character transformation macros are defined in /usr/include/ctype.h. The Solaris 9 environment provides a set of ctype macros that support character classification and transformation semantics defined by XPG4. For all XPG4 and XPG4.2 applications to automatically access new macros, one of the following conditions must be met:

  • _XPG4_CHAR_CLASS is defined.

  • _XOPEN_SOURCE and _XOPEN_VERSION=4 are defined.

  • _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED=1 are defined.

Because _XOPEN_SOURCE, _XOPEN_VERSION, and _XOPEN_SOURCE_EXTENDED bring in extra XPG4 related features in addition to new ctype macros, non-XPG4 or XPG4.2 applications should use __XPG4_CHAR_CLASS__.

Corresponding ctype functions also exist. The Solaris 9 environment functions also support XPG4 semantics. Refer to the ctype(3C) man page for details.

Internationalization APIs in libc

The Solaris 9 environment offers two sets of APIs:

  • Multibyte (file codes)

  • Wide characters (process code)

Wide-character codes are fixed-width units of logical entities. Therefore, you do not have to keep track of maintaining proper character boundaries when you are using multibyte characters.

When a program takes input from a file, you can convert your file's multibyte data into wide-character process code directly with input functions like fscanf(3S) and fwscanf(3S) or by using conversion functions like mbtowc(3C) and mbsrtowcs(3C) after the input. To convert output data from wide-character format to multibyte character format, use output functions like fwprintf(3S) and fprintf(3S), or apply conversion functions like wctomb(3C) and wcsrtombs(3C) before the output.

The tables in the remainder of this chapter describe the internationalization APIs included in the Solaris 9 product.

The following table describes the messaging function APIs in libc.

Table 2-1 Messaging Functions in libc

Library Routine

Description

catclose()

Close a message catalog

catgets()

Read a program message

catopen()

Open a message catalog

dgettext()

Get a message from a message catalog with domain specified

dcgettext()

Get a message from a message catalog with domain and category specified

textdomain()

Set and query the current domain

bindtextdomain()

Bind the path for a message domain

gettext()

Retrieve text string from message database

The following table describes the code conversion function APIs in libc.

Table 2-2 Code Conversion in libc

Library Routine

Description

iconv()

Convert codes

iconv_close()

Deallocate the conversion descriptor

iconv_open()

Allocate the conversion descriptor

Thise following table describes the regular expression APIs in libc.

Table 2-3 Regular Expressions in libc

Library Routine

Description

regcomp()

Compile the regular expression

regexec()

Execute regular expression matching

regerror()

Provide a mapping from error codes to error messages

regfree()

Free memory allocated by regcomp()

fnmatch()

Match file name or path name

The following table describes the wide character function APIs in libc.

Table 2-4 Wide Character Class in libc

Library Routine

Description

wctype()

Define character class

wctrans()

Define character mapping

The following table lists the modify and query locale in libc.

Table 2-5 Modify and Query Locale in libc

Library Routine

Description

setlocale()

Modify and query a program's locale

The following table lists the query locale data in libc.

Table 2-6 Query Locale Data in libc

Library Routine

Description

nl_langinfo()

Get language and cultural information of current locale

localeconv()

Get monetary and numeric formatting information of current locale

The following table describes the character classification function APIs in libc.

Table 2-7 Character Classification and Transliteration in libc

Library Routine

Description

isalpha()

Is character alphabetic?

isupper()

Is character uppercase?

islower()

Is character lowercase?

isdigit()

Is character a digit?

isxdigit()

Is character a hex digit?

isalnum()

Is character alphabetic or digital?

isspace()

Is character a space?

ispunct()

Is character a punctuation mark?

isprint()

Is character printable?

iscntrl()

Is character a control character?

isascii()

Is character an ASCII character?

isgraph()

Is character a visible character?

isphonogram()

Is wide character a phonogram?

isideogram()

Is wide character an ideogram?

isenglish()

Is wide character in English alphabet from a supplementary codeset?

isnumber()

Is wide character a digit from a supplementary codeset?

isspecial()

Is special wide character from a supplementary codeset?

iswalpha()

Is wide character alphabetic?

iswupper()

Is wide character uppercase?

iswlower()

Is wide character lowercase?

iswdigit()

Is wide-character a digit?

iswxdigit()

Is wide character a hex digit?

iswalnum()

Is wide character an alphabetic character or digit?

iswspace()

Is wide character a white space?

iswpunct()

Is wide character a punctuation mark?

iswprint()

Is wide character a printable character?

iswgraph()

Is wide character a visible character?

iswcntrl()

Is wide character a control character?

iswascii()

Is wide character an ASCII character?

toupper()

Convert a lowercase character to uppercase.

tolower()

Convert an uppercase character to lowercase.

towupper()

Convert a lowercase wide character to uppercase.

towlower()

Convert an uppercase wide character to lowercase.

towctrans()

Wide character mapping.

The following table describes the character collation function APIs in libc.

Table 2-8 Character Collation in libc

Library Routine

Description

strcoll()

Collate character strings

strxfrm()

Transform character strings for comparison

wcscoll()

Collate wide-character strings

wcsxfrm()

Transform wide-character strings for comparison

 
 
 
  Previous   Contents   Next