NLCHAR(3,L) AIX Technical Reference NLCHAR(3,L)
-------------------------------------------------------------------------------
NLchar
PURPOSE
Handles data type NLchar.
LIBRARY
Standard C Library (libc.a)
SYNTAX
#include <NLchar.h>
typedef unsigned short NLchar; int NCencode (x, c)
NLchar *x;
int NCdecode (c, x) unsigned char *c;
unsigned char *c;
NLchar *x; int NCencstr (x, c, len)
NLchar *x;
int NCdecstr (c, x, len) unsigned char *c;
unsigned char *c; int len;
NLchar *x;
int len; int NCenc (x, c)
NLchar *x;
int NCdec (c, x) char *c;
char *c;
NLchar *x; int NLisNLcp (c)
char *c;
int NCdechr (c)
char *c; int NLchrlen (c)
char *c;
int NCchrlen (nlchr)
NLchar nlchr;
DESCRIPTION
Note: In the multibyte environment, these routines which handle the data type
NLchar are provided for backward compatibility. They are only
front-ends to the wcstring and mbstring routines (see "wcstring" and
"mbstring"). Avoid using them if you wish to write portable programs.
There is no wcstring equivalent for NCchrlen, and there is no mbstring
equivalent for NLisNLcp.
Processed November 7, 1990 NLCHAR(3,L) 1
NLCHAR(3,L) AIX Technical Reference NLCHAR(3,L)
Characters for international character support can be either one or two bytes
in length, while all ASCII characters are one byte long. The NLchar data type
represents both ASCII and extended characters as single units of storage. The
NLchar subroutines and macros listed here convert between character types char
and NLchar and provide information about a given character of either type.
The NCdecode subroutine converts a character starting at c into an NLchar at x,
and returns the number of bytes read from c. The NCencode subroutine makes the
inverse translation from type NLchar to type char and returns the number of
bytes written to c.
The NCdecstr subroutine converts a string of characters from type char to type
NLchar, and the NCencstr does the reverse translation. Both subroutines
require the address of the source and destination strings and the total number
of elements available for the destination string. The destination string
terminates with a zero (0) element, which is included in the string length.
The destination length should include space for the terminator. If
insufficient space is left for the destination string, a portion of it is not
converted and the destination string is not terminated with a 0 byte. The
subroutines return the length of the string in elements, including the
terminating 0.
The NCdec and NCenc macros are equivalent to NCdecode and NCencode
respectively. You can use them to avoid the overhead of function calls in
situations where the parameters have no side effects.
The NCdechr macro is like NCdecode except that NCdechr simply returns the value
of NLchar rather than writing the NLchar into memory.
The NLisNLcp, NCchrlen, and NLchrlen macros return information about a given
character. NLisNLcp returns a 0 if the character at c is not an extended
character, but returns the length of the character if it is an extended
character. NCchrlen returns the length in bytes that an NLchar would have if
it were converted into an extended or an ASCII character by NCencode. NLchrlen
returns the length in bytes of the extended or ASCII character starting at c.
RELATED INFORMATION
In this book: "conv," "ctype," "NCctype," "wcstring," and "mbstring."
"Introduction to International Character Support" in Managing the AIX Operating
System.
The axeb, ebxa, and genxlt commands in AIX Operating System Commands.
AIX Guide to Multibyte Character Set (MBCS) Support.
Processed November 7, 1990 NLCHAR(3,L) 2