TABLE OF CONTENTS


trish2/wchar_utils [ Modules ]

[ Top ] [ Modules ]

NAME

wchar_utils

SYNOPSIS

 #include <wchar_utils.h>

DESCRIPTION

EXAMPLE

SEE ALSO

wchar_duplicate, get_nonls, char2wcs, tabs_and_nls, ESCAPE_WCHAR


trish2/wchar_duplicate [ Functions ]

[ Top ] [ Functions ]

NAME

wchar_duplicate

SYNOPSIS

 #include <wchar_utils.h>
 wchar_t *wchar_duplicate(const wchar_t *src);

FUNCTION

wchar_duplicate does the same as wcsdup but it is C99 compliant.

INPUTS

RETURN VALUE

A pointer to a freshly allocated wide character string.

SEE ALSO

wchar_utils


trish2/get_nonls [ Functions ]

[ Top ] [ Functions ]

NAME

get_nonls

SYNOPSIS

 #include <wchar_utils.h>
 int get_nonls(wchar_t *s, size_t l);

FUNCTION

get_nonls counts the number of newline characters at the end of the wide character string s, of length l. If l is below 0, then get_nonls will compute the length of the string with wcslen. This function is useful to determine if the end of line is CR or CRLF.

INPUTS

RETURN VALUE

1 if the string is CR, 2 if it is CRLF or 0 otherwise.

SEE ALSO

wchar_utils


trish2/char2wcs [ Functions ]

[ Top ] [ Functions ]

NAME

char2wcs

SYNOPSIS

 #include <wchar_utils.h>
 wchar_t *char2wcs(const char *s);

FUNCTION

char2wcs converts the multi-byte string s into a wide character string according to the current value of LC_CTYPE.

INPUTS

RETURN VALUE

A pointer to a freshly allocated wide character string. NULL if s contains an illegal character sequence in the current locale.

SEE ALSO

wchar_utils


trish2/tabs_and_nls [ Functions ]

[ Top ] [ Functions ]

NAME

tabs_and_nls

SYNOPSIS

 *   #include <wchar_utils.h>
 *   size_t tabs_and_nls(wchar_t *w);

FUNCTION

tabs_and_nls operates an in-place replacement of all "\t" sequences by a tabulation, and all "\n" sequences by a newline in the wide character string w.

INPUTS

RETURN VALUE

The length of the modified string.

SEE ALSO

wchar_utils, ESCAPE_WCHAR


trish2/ESCAPE_WCHAR [ Definitions ]

[ Top ] [ Definitions ]

NAME

ESCAPE_WCHAR

SYNOPSIS

 #include <patricia_node.h>
 #define ESCAPE_WCHAR L'\\'

SEE ALSO

wchar_utils, tabs_and_nls