Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <wchar.h>
Link against: libc.lib

WCHAR_MIN

Interface status: externallyDefinedApi

WCHAR_MIN (wchar_t)__INT_MIN

Description

The minimum value representable by an object of type wchar_t.

[Top]


WCHAR_MAX

Interface status: externallyDefinedApi

WCHAR_MAX (wchar_t)__INT_MAX

Description

The maximum value representable by an object of type wchar_t.

[Top]


Typedef mbstate_t

Interface status: externallyDefinedApi

typedef __mbstate_t mbstate_t;

Description

An object type other than an array type that can hold the conversion state information necessary to convert between sequences of (possibly multibyte) characters and wide-characters. If a codeset is being used such that an mbstate_t needs to preserve more than 2 levels of reserved state, the results are unspecified.

[Top]


Typedef wint_t

Interface status: externallyDefinedApi

typedef __wint_t wint_t;

Description

An integral type capable of storing any valid value of wchar_t, or WEOF.

[Top]


btowc(int)

Interface status: externallyDefinedApi

IMPORT_C wint_t btowc(int);

Description

The btowc function converts a single-byte character into a corresponding wide character. If the character is EOF , or not valid in the initial shift state, btowc returns WEOF.

The wctob function converts a wide character into a corresponding single-byte character. If the wide character is WEOF , or not able to be represented as a single byte in the initial shift state, wctob returns WEOF.

Examples:

#include <wchar.h>
// Illustrates how to use btowc API
wint_t example_btowc(int c)
{
 wint_t wc = L'a';
 //  converting single byte to wide-character 
 wc = btowc(c);
 // return the character that was converted 
return (wc);
}
#include <wchar.h>
/* Illustrates how to use wctob API */
int example_wctob(void)
{
 wint_t wc = L'a';
 int c;
  
 /* represent a wide-char in a single byte*/
 c = wctob(wc);
 /* return the single byte */
 return(c);
}

Limitations:

The current implementation of btowc and wctob is not affected by the LC_CTYPE category of the current locale. It works only for UTF8 character set.

Parameters

int

Note: This description also covers the following functions - wctob(wint_t)wctob(wint_t)

Return value

wint_twint_t

The btowc function returns the wide character converted from the single byte c . If c is EOF or not a valid multibyte sequence of length 1 the function returns WEOF.

See also:

[Top]


getwchar(void)

Interface status: externallyDefinedApi

IMPORT_C wint_t getwchar(void);

Description

Refer to fgetwc(struct __sFILE *) for the documentation

Return value

wint_twint_t

See also:

[Top]


mbrlen(const char *,size_t,mbstate_t *)

Interface status: externallyDefinedApi

IMPORT_C size_t mbrlen(const char *, size_t, mbstate_t *);

Description

The mbrlen function inspects at most n bytes pointed to by s to determine the number of bytes needed to complete the next multibyte character.

The mbstate_t argument, ps, is used to keep track of the shift state. If it is NULL, mbrlen uses an internal, static mbstate_t object, which is initialized to the initial conversion state at program startup.

It is equivalent to:

mbrtowc(NULL, s, n, ps); 

Except that when ps is a NULL pointer, mbrlen uses its own static, internal mbstate_t object to keep track of the shift state. The behavior of the mbrlen is affected by LC_CTYPE category of the current locale.

Examples: A function that calculates the number of characters in a multibyte character string:

size_t
nchars(const char *s)
{
        size_t charlen, chars;
        mbstate_t mbs;
        chars = 0;
        memset(&mbs;, 0, sizeof(mbs));
        while ((charlen = mbrlen(s, MB_CUR_MAX, &mbs;)) != 0 &&
            charlen != (size_t)-1 && charlen != (size_t)-2) {
                s += charlen;
                chars++;
        }
        return (chars);
}

Errors:

The mbrlen function will fail if: [EILSEQ] An invalid multibyte sequence was detected. [EINVAL] The conversion state is invalid.

Limitations:

The current implementation of mbrlen is not affected by the LC_CTYPE category of the current locale. It works only for UTF8 character set.

Parameters

const char *

size_tsize_t

_mb_state_t *

Return value

size_tsize_t

The mbrlen functions returns: 0 The next n or fewer bytes represent the null wide character (L'\0') >0 The next n or fewer bytes represent a valid character, mbrlen returns the number of bytes used to complete the multibyte character. ( size_t-2) The next n contribute to, but do not complete, a valid multibyte character sequence, and all n bytes have been processed. ( size_t-1) An encoding error has occurred. The next n or fewer bytes do not contribute to a valid multibyte character.

See also:

[Top]


mbrtowc(wchar_t *,const char *,size_t,mbstate_t *)

Interface status: externallyDefinedApi

IMPORT_C size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);

Description

The mbrtowc function inspects at most n bytes pointed to by s to determine the number of bytes needed to complete the next multibyte character. If a character can be completed, and pwc is not NULL, the wide character which is represented by s is stored in the wchar_t it points to.

If s is NULL, mbrtowc behaves as if pwc was NULL, s was an empty string ("") and n was 1.

The mbstate_t argument, ps, is used to keep track of the shift state. If it is NULL, mbrtowc uses an internal, static mbstate_t object, which is initialized to the initial conversion state at program startup.

The behavior of the mbrtowc is affected by LC_CTYPE category of the current locale.

Examples:

#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
/* Illustrates how to use mbrtowc API */
size_t example_mbrtowc()
{
 size_t len;
 wchar_t wc[100];
 char *s = 'a';
 size_t n = 1;
 mbstate_t ps;
 /* converting multibyte sequence to a wide-char sequence */
 len = mbrtowc(wc,(const char *) s, n, &ps;);
 /* checking for error value */
 if(len < 0)
 {
        wprintf(L"mbrtowc returned error!!
");
 }
 /* returning no of bytes consumed */
 return (len);
}

Errors:

The mbrtowc function will fail if: [ 86 ] An invalid multibyte sequence was detected. [ 22 ]The conversion state is invalid.

Limitations:

The current implementation of mbrtowc is not affected by the LC_CTYPE category of the current locale. It works only for UTF8 character set.

Parameters

wchar_twchar_t *

const char *

size_tsize_t

_mb_state_t *

Return value

size_tsize_t

The mbrtowc functions returns: 0 The next n or fewer bytes represent the null wide character (L'\0') >0 The next n or fewer bytes represent a valid character, mbrtowc returns the number of bytes used to complete the multibyte character. ( size_t-2) The next n contribute to, but do not complete, a valid multibyte character sequence, and all n bytes have been processed. ( size_t-1) An encoding error has occurred. The next n or fewer bytes do not contribute to a valid multibyte character.

See also:

[Top]


mbsinit(const mbstate_t *)

Interface status: externallyDefinedApi

IMPORT_C int mbsinit(const mbstate_t *);

Description

The mbsinit function determines whether the mbstate_t object pointed to by ps describes an initial conversion state.

The behavior of the mbsinit is affected by LC_CTYPE category of the current locale.

Examples:

#include <stdlib.h>
#include <wchar.h>
/* Illustrates how to use mbsinit API */
int example_mbsinit(void)
{
 mbstate_t mbs;
 int state;
 
 /* testing for the initial state */
 state = mbsinit(&mbs;);
 /* return the state */
 return(state);
}

Limitations:

The current implementation of mbsinit is not affected by the LC_CTYPE category of the current locale. It works only for UTF8 character set.

Parameters

const _mb_state_t *

Return value

int

The mbsinit function returns non-zero if ps is NULL or describes an initial conversion state, otherwise it returns zero.

See also:

[Top]


mbsrtowcs(wchar_t *,const char **,size_t,mbstate_t *)

Interface status: externallyDefinedApi

IMPORT_C size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);

Description

The mbsrtowcs function converts a sequence of multibyte characters pointed to indirectly by src into a sequence of corresponding wide characters and stores at most len of them in the wchar_t array pointed to by dst, until it encounters a terminating null character ('\0'.)

If dst is NULL no characters are stored.

If dst is not NULL, the pointer pointed to by src is updated to point to the character after the one that conversion stopped at. If conversion stops because a null character is encountered, *src is set to NULL.

The mbstate_t argument, ps, is used to keep track of the shift state. If it is NULL, mbsrtowcs uses an internal, static mbstate_t object, which is initialized to the initial conversion state at program startup.

The mbsnrtowcs function behaves identically to mbsrtowcs, except that conversion stops after reading at most nms bytes from the buffer pointed to by src.

The behavior of the mbsrtowcs and mbsnrtowcs is affected by LC_CTYPE category of the current locale.

Examples:

/* Illustrates how to use mbsrtowcs API */
# 1039 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 1040 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 1041 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
size_t example_mbsrtowcs(wchar_t *wc, char *s, size_t n)
{
 size_t len;
 mbstate_t mbs;
 /* converting multibyte string to a wide-char string */
 len = mbsrtowcs(wc, &s;, n, &mbs;);
 /* checking for error */
 if(len < 0)
 {
        wprintf(L"mbsrtowcs returned error!!
");
 }
 /* returning no of bytes consumed */
 return (len);
}
/* Illustrates how to use mbsrntowcs API */
# 1061 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 1062 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 1063 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
size_t example_mbsnrtowcs(wchar_t *wc, char *s, size_t n, size_t nms)
{
  size_t len;
  mbstate_t mbs;
 /* converting multibyte string to a wide-char string */
  len = mbsnrtowcs(wc, &s;, nms, n, &mbs;);
 /* checking for error */
 if(len < 0)
 {
        wprintf(L"mbsnrtowcs returned error!!
");
 }
  /* returning no of bytes consumed */
  return (len);
}

Errors:

The mbsrtowcs and mbsnrtowcs functions will fail if: [ 86 ]An invalid multibyte character sequence was encountered. [ 22 ] The conversion state is invalid.

Limitations:

The current implementation of mbsrtowcs and mbsnrtowcs is not affected by the LC_CTYPE category of the current locale. It works only for UTF8 character set.

Parameters

wchar_twchar_t *

const char **

size_tsize_t

_mb_state_t *

Note: This description also covers the following functions - mbsnrtowcs(wchar_t *,const char **,size_t,size_t,mbstate_t *)mbsnrtowcs(wchar_t *,const char **,size_t,size_t,mbstate_t *)

Return value

size_tsize_t

The mbsrtowcs and mbsnrtowcs functions return the number of wide characters stored in the array pointed to by dst if successful, otherwise it returns ( size_t)(-1).

See also:

[Top]


putwchar(wchar_t)

Interface status: externallyDefinedApi

IMPORT_C wint_t putwchar(wchar_t);

Description

Parameters

wchar_twchar_t

Refer to fputwc(wchar_t,struct __sFILE *) for the documentation

Return value

wint_twint_t

See also:

[Top]


swprintf(wchar_t *,size_t,const wchar_t *,...)

Interface status: externallyDefinedApi

IMPORT_C int swprintf(wchar_t *, size_t n, const wchar_t *,...);

Description

Parameters

wchar_twchar_t *

size_tsize_t n

const wchar_twchar_t *

...

Return value

int

See also:

[Top]


swscanf(const wchar_t *,const wchar_t *,...)

Interface status: externallyDefinedApi

IMPORT_C int swscanf(const wchar_t *, const wchar_t *,...);

Description

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

...

Return value

int

See also:

[Top]


vswprintf(wchar_t *,size_t,const wchar_t *,va_list)

Interface status: externallyDefinedApi

IMPORT_C int vswprintf(wchar_t *, size_t n, const wchar_t *, va_list);

Description

Parameters

wchar_twchar_t *

size_tsize_t n

const wchar_twchar_t *

va_list

Refer to fwprintf(struct __sFILE *,const wchar_t *,...) for the documentation

Return value

int

See also:

[Top]


vwprintf(const wchar_t *,va_list)

Interface status: externallyDefinedApi

IMPORT_C int vwprintf(const wchar_t *, va_list);

Description

Parameters

const wchar_twchar_t *

va_list

Refer to fwprintf(struct __sFILE *,const wchar_t *,...) for the documentation

Return value

int

See also:

[Top]


wcrtomb(char *,wchar_t,mbstate_t *)

Interface status: externallyDefinedApi

IMPORT_C size_t wcrtomb(char *, wchar_t, mbstate_t *);

Description

The wcrtomb function stores a multibyte sequence representing the wide character wc , including any necessary shift sequences, to the character array s , storing a maximum of MB_CUR_MAX bytes.

If s is NULL , wcrtomb behaves as if s pointed to an internal buffer and wc was a null wide character (L'\0').

The mbstate_t argument, ps , is used to keep track of the shift state. If it is NULL , wcrtomb uses an internal, static mbstate_t object, which is initialized to the initial conversion state at program startup.

The behavior of the wcrtomb is affected by LC_CTYPE category of the current locale.

Examples:

#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
/* Illustrates how to use wcrtomb API */
int example_wcrtomb(wchar_t wc)
{
  char s[MAX_CUR_MAX];
  size_t len;
  mbstate_t mbs;
  
  /* represent a wide-char in a single byte*/
  len = wcrtomb(s, wc, &mbs;);
  /* return the number of bytes */
  return(len);
}

Errors:

The wcrtomb function will fail if: [ 86 ] An invalid wide character code was specified. [ 22 ] The conversion state is invalid.

Limitations:

The current implementation of wcrtomb is not affected by the LC_CTYPE category of the current locale. It works only for UTF8 character set.

Parameters

char *

wchar_twchar_t

_mb_state_t *

Return value

size_tsize_t

The wcrtomb functions returns the length (in bytes) of the multibyte sequence needed to represent wc , or ( size_t-1) if wc is not a valid wide character code.

See also:

[Top]


wcscat(wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcscat(wchar_t *, const wchar_t *);

Description

Parameters

wchar_twchar_t *

const wchar_twchar_t *

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wcschr(const wchar_t *,wchar_t)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcschr(const wchar_t *, wchar_t);

Description

Parameters

const wchar_twchar_t *

wchar_twchar_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wcscmp(const wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C int wcscmp(const wchar_t *, const wchar_t *);

Description

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

int

See also:

[Top]


wcscoll(const wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C int wcscoll(const wchar_t *, const wchar_t *);

Description

The wcscoll function compares the null-terminated strings ws1 and ws2 according to the current locale collation order. In the "C" locale, wcscoll is equivalent to wcscmp .

Examples:

#include <wchar.h>
/* Illustrates how to use wcscoll API */
int example_wcscoll (void)
{  
        /* compares the two strings */
  if( wcscoll(L"abcdef",L"abcdeg") != L'f'-L'g')  
   return -1;
 return 0;
}

Errors:

The wcscoll function will fail if: [ 86 ] An invalid wide character code was specified. [ 12 ] Cannot allocate enough memory for temporary buffers.

Limitations:

The current implementation of wcscoll is not affected by the LC_CTYPE category of the current locale. It is equivalent to wcscmp in this implementation.

Bugs:

The current implementation of wcscoll only works in single-byte LC_CTYPE locales, and falls back to using wcscmp in locales with extended character sets.

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

Return value

int

The wcscoll function returns an integer greater than, equal to, or less than 0, if ws1 is greater than, equal to, or less than ws2 . No return value is reserved to indicate errors; callers should set errno to 0 before calling wcscoll . If it is non-zero upon return from wcscoll , an error has occurred.

See also:

[Top]


wcscpy(wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcscpy(wchar_t *, const wchar_t *);

Description

Parameters

wchar_twchar_t *

const wchar_twchar_t *

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wcscspn(const wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C size_t wcscspn(const wchar_t *, const wchar_t *);

Description

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

size_tsize_t

See also:

[Top]


wcsftime(wchar_t *,size_t,const wchar_t *,const struct tm *)

Interface status: externallyDefinedApi

IMPORT_C size_t wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *);

Description

The wcsftime function is equivalent to the strftime function except for the types of its arguments. Refer to strftime(char *,size_t,const char *,const struct tm *)strftime(char *,size_t,const char *,const struct tm *) for a detailed description.

Examples:

#include <wchar.h>
#include <time.h>
/* Illustatrates how to use wcsftime API */
int example_wcsftime()
{  
  wchar_t datestring[50];
  int retval;
  struct tm *tm;
 
  /* get the current time */
  time_t t = time( 0 );
 
  /* get the local time from the current time */
  tm = localtime(&t;);
  /* convert date and time to a wide-character string */
  retval = wcsftime(datestring,15,L"%A",tm);
 
  /* If the total number of resulting wide-character codes */
  /* including the terminating null wide-character code is */
  /* no more than maxsize, wcsftime() shall return the number */
  /* of wide-character codes placed into the array pointed to */
  /* by wcs, not including the terminating null wide-character */
  /* code. Otherwise, zero is returned and the contents of the */
  /* array are unspecified.*/
  return retval;
}

Parameters

wchar_twchar_t *

size_tsize_t

const wchar_twchar_t *

const struct tmtm *

Return value

size_tsize_t

wcsftime shall return the number of wide-character codes placed into the array pointed to by wcs , not including the terminating null wide-character code. Otherwise, zero is returned and the contents of the array are unspecified.

[Top]


wcslen(const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C size_t wcslen(const wchar_t *);

Description

Parameters

const wchar_twchar_t *

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

size_tsize_t

See also:

[Top]


wcsncat(wchar_t *,const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcsncat(wchar_t *, const wchar_t *, size_t);

Description

Parameters

wchar_twchar_t *

const wchar_twchar_t *

size_tsize_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wcsncmp(const wchar_t *,const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C int wcsncmp(const wchar_t *, const wchar_t *, size_t);

Description

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

size_tsize_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

int

See also:

[Top]


wcsncpy(wchar_t *,const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcsncpy(wchar_t *, const wchar_t *, size_t);

Description

Parameters

wchar_twchar_t *

const wchar_twchar_t *

size_tsize_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wcspbrk(const wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcspbrk(const wchar_t *, const wchar_t *);

Description

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wcsrchr(const wchar_t *,wchar_t)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcsrchr(const wchar_t *, wchar_t);

Description

Parameters

const wchar_twchar_t *

wchar_twchar_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wcsrtombs(char *,const wchar_t **,size_t,mbstate_t *)

Interface status: externallyDefinedApi

IMPORT_C size_t wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);

Description

The wcsrtombs function converts a string of wide characters indirectly pointed to by src to a corresponding multibyte character string stored in the array pointed to by dst . No more than len bytes are written to dst .

If dst is NULL , no characters are stored.

If dst is not NULL , the pointer pointed to by src is updated to point to the character after the one that conversion stopped at. If conversion stops because a null character is encountered, *src is set to NULL .

The mbstate_t argument, ps , is used to keep track of the shift state. If it is NULL , wcsrtombs uses an internal, static mbstate_t object, which is initialized to the initial conversion state at program startup.

The wcsnrtombs function behaves identically to wcsrtombs , except that conversion stops after reading at most nwc characters from the buffer pointed to by src . The behavior of the wcsrtombs and wcsrntombs is affected by LC_CTYPE category of the current locale.

Examples:

#include <stdlib.h>
#include <wchar.h>
/* Illustrates how to use wcsrtombs API */
size_t example_wcsrtombs(wchar_t *wcs, char *s, size_t n)
{
 size_t len;
 mstate_t mbs;
 /* converting multibyte string to a wide-char string */
 len = wcsrtombs(s, &wcs;, n, &mbs;);
 /* returning no of bytes that make up the multibyte sequence */
 return (len;);
}
# 1911 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 1912 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcsnrtombs API */
size_t example_wcsnrtombs(wchar_t *wcs, char *s, size_t n, szie_t nmwc)
{
 size_t len;
 mstate_t mbs;
 /* converting multibyte string to a wide-char string */
 len = wcsrtombs(s, &wcs;, nwc, n, &mbs;);
 /* returning no of bytes that make up the multibyte sequence */
 return (len;);
}

Limitations:

The current implementation of wcsrtombs and wcsnrtombs is not affected by the LC_CTYPE category of the current locale. It works only for UTF8 character set.

Parameters

char *

const wchar_twchar_t **

size_tsize_t

_mb_state_t *

Note: This description also covers the following functions - wcsnrtombs(char *,const wchar_t **,size_t,size_t,mbstate_t *)wcsnrtombs(char *,const wchar_t **,size_t,size_t,mbstate_t *)

Return value

size_tsize_t

The wcsrtombs and wcsnrtombs functions return the number of bytes stored in the array pointed to by dst (not including any terminating null), if successful, otherwise it returns ( size_t-1) .

See also:

[Top]


wcsspn(const wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C size_t wcsspn(const wchar_t *, const wchar_t *);

Description

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

size_tsize_t

See also:

[Top]


wcsstr(const wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcsstr(const wchar_t *, const wchar_t *);

Description

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wcsxfrm(wchar_t *,const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C size_t wcsxfrm(wchar_t *, const wchar_t *, size_t);

Description

The wcsxfrm function transforms a null-terminated wide character string pointed to by src according to the current locale collation order then copies the transformed string into dest . No more than len wide characters are copied into dest , including the terminating null character added. If len is set to 0 (it helps to determine an actual size needed for transformation), dest is permitted to be a NULL pointer.

Comparing two strings using wcscmp after wcsxfrm is equivalent to comparing two original strings with wcscoll .

Examples:

#include <stdlib.h>
#include <wchar.h>
/* Illustrates how to use wcpcpy API */
int example_wcpcpy()

  /* input string for which length to be found */
 wchar_t *src = L"testcase";
  wchar_t *dest =  0 ;
  int      length; 
    
  /* allocate memory for the destination string */
  dest = (wchar_t *)malloc((wcslen(src)+1)*sizeof(wchar_t));
    
  /*  perform the operation */
  if(dest !=  0 )
   length = wcsxfrm(dest,src,9);
  else
  { 
   wprintf(L"ERROR : Cannot allocate memory");
  return -1;
  } 
  return length;
}

Limitations:

The current implementation of wcsxfrm works only for "C" locale.

Bugs:

The current implementation of wcsxfrm only works in single-byte LC_CTYPE locales, and falls back to using wcsncpy in locales with extended character sets. Comparing two strings using wcscmp after wcsxfrm is not always equivalent to comparison with wcscoll ; wcsxfrm only stores information about primary collation weights into dst , whereas wcscoll compares characters using both primary and secondary weights.

Parameters

wchar_twchar_t *

const wchar_twchar_t *

size_tsize_t

Return value

size_tsize_t

Upon successful completion, wcsxfrm returns the length of the transformed string not including the terminating null character. If this value is len or more, the contents of dest are indeterminate.

See also:

[Top]


wctob(wint_t)

Interface status: externallyDefinedApi

IMPORT_C int wctob(wint_t);

Description

Parameters

wint_twint_t

Refer to btowc(int)btowc(int) for the documentation

Return value

int

See also:

[Top]


wcstod(const wchar_t *,wchar_t **)

Interface status: externallyDefinedApi

IMPORT_C double wcstod(const wchar_t *, wchar_t **);

Description

Parameters

const wchar_twchar_t *

wchar_twchar_t **

Refer to wcstof(const wchar_t *,wchar_t **)wcstof(const wchar_t *,wchar_t **) for the documentation

Return value

double

See also:

[Top]


wcstok(wchar_t *,const wchar_t *,wchar_t **)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcstok(wchar_t *, const wchar_t *, wchar_t **);

Description

The wcstok function is used to isolate sequential tokens in a null-terminated wide character string, s. These tokens are separated in the string by at least one of the characters in delim . The first time that wcstok is called, s should be specified; subsequent calls, wishing to obtain further tokens from the same string, should pass a null pointer instead. The separator string, delim , must be supplied each time, and may change between calls. The context pointer last must be provided on each call.

The wcstok function is the wide character counterpart of the strtok_r function.

Examples:

#include <wchar.h>
/* Illustrates how to use wcstok API */
int example_wcstok()
{  
  /* source wide character string */
 const wchar_t *seps = L"onetwhr";
 wchar_t *last, *tok, text[] = L"onetwothree";
              
 tok = wcstok(text, seps, &last;);
 if(tok ==  0 )
   return 0;
 else
    return 1;
}

Examples:

The following code fragment splits a wide character string on ASCII space, tab and newline characters and writes the tokens to standard output:

const wchar_t *seps = L"  
";
wchar_t *last, *tok, text[] = L" 
one two        three  
";
for (tok = wcstok(text, seps, &last;); tok !=  0 ;
    tok = wcstok( 0 , seps, &last;))
        wprintf(L"%ls
", tok);

Some early implementations of wcstok omit the context pointer argument, last, and maintain state across calls in a static variable like strtok does.

Parameters

wchar_twchar_t *

const wchar_twchar_t *

wchar_twchar_t **

Return value

wchar_twchar_t *

The wcstok function returns a pointer to the beginning of each subsequent token in the string, after replacing the token itself with a null wide character (L'//0'). When no more tokens remain, a null pointer is returned.

See also:

[Top]


wcstol(const wchar_t *,wchar_t **,int)

Interface status: externallyDefinedApi

IMPORT_C long wcstol(const wchar_t *, wchar_t **, int);

Description

The wcstol , wcstoul , wcstoll , wcstoull , wcstoimax and wcstoumax functions are wide-character versions of the strtol , strtoul , strtoll , strtoull , strtoimax and strtoumax functions, respectively. Refer to their manual pages (for example strtol ) for details. The wcstoq and wcstouq are respectively equivalent to wcstoll and wcstoull.

Examples:

#include <wchar.h>
/* Illustrates how to use wcstoumax API */
uintmax_t example_wcstoumax()
{  
  /* src string */
 wchar_t *src = L"478";
  uintmax_t longVal;
    
  /* convert the wide character string to uintmax_t */
  longVal = wcstoumax(src, 0 ,10);
  /* return the converted long value */
 return longVal;
}
# 2229 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcstoimax API */
intmax_t example_wcstoimax()
{  
  /* src string */
 wchar_t *src = L"478";
  intmax_t longVal;
    
  /* convert the wide character string to intmax_t */
  longVal = wcstoimax(src, 0 ,10);
  /* return the converted long value */
 return longVal;
}
# 2245 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcstol API */
long example_wcstol()
{  
  /* src string */
 wchar_t *src = L"478";
  long  longVal;
    
  /* call the API to convert src string to long value */
  longVal = wcstol(src, 0 ,10);
  /* return the converted long value */
 return longVal;
}
# 2261 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcstoul API */
unsigned long example_wcstoul()
{  
  /* src string */
  wchar_t *src = L"478";
  unsigned long  longVal;
    
  /* call the API to convert src string to unsigned */
  /* long value */
  longVal = wcstoul(src, 0 ,10);
  /* return the converted long value */
 return longVal;
}
# 2278 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustatrates how to use wcstoll API */
long long example_wcstoll()

  /* input string for which length to be found */
 wchar_t *src = L"478";
 long long  longVal;
    
  /* perform the conversion operation from wide */
  /* char string to long long value */
  longVal = wcstoll(src, 0 ,10);
     
  return longVal;
}
# 2295 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustatrates how to use wcstoull API */
unsigned long long example_wcstoull()

  /* input string for which length to be found */
 wchar_t *src = L"478";
  unsigned long long  longVal;
    
  /* perform the conversion operation from wide */
  /*char string to unsigned long long value */
  longVal = wcstoull(src, 0 ,10);
     
  return longVal;
}
# 2312 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcstoq API */
long long int example_wcstoq()

 /* src string that contains decimal digits */
 wchar_t *src = L"478";
 long long int  longVal;
 /* convert the decimal wide char string to long long int value */
 longVal = wcstoq(src, 0 ,10);
 /* return longVal and its value should be 478 */
 return longVal;
}
# 2327 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcstouq API */
unsigned long long int example_wcstouq()

 /* src string that contains decimal digits */
 wchar_t *src = L"478";
 unsigned long long int  longVal;
 /* convert the decimal wide char string  to unsigned long long int value */
 longVal = wcstouq(src, 0 ,10);
 /* return longVal, which should be 478 */   
 return longVal;
}

Parameters

const wchar_twchar_t *

wchar_twchar_t **

int

Note: This description also covers the following functions - wcstoul(const wchar_t *,wchar_t **,int)wcstoul(const wchar_t *,wchar_t **,int) wcstoll(const wchar_t *,wchar_t **,int)wcstoll(const wchar_t *,wchar_t **,int) wcstoull(const wchar_t *,wchar_t **,int)wcstoull(const wchar_t *,wchar_t **,int) wcstoq(const wchar_t *,wchar_t **,int)wcstoq(const wchar_t *,wchar_t **,int) wcstouq(const wchar_t *,wchar_t **,int)wcstouq(const wchar_t *,wchar_t **,int) wcstoimax(const __wchar_t *,__wchar_t **,int) wcstoumax(const __wchar_t *,__wchar_t **,int)

Return value

long

errno may be set to indicate the error. If the correct value is outside the range of representable values {LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} is returned (according to the sign of the value) and errno set to [ERANGE].

See also:

[Top]


wcstoul(const wchar_t *,wchar_t **,int)

Interface status: externallyDefinedApi

IMPORT_C unsigned long wcstoul(const wchar_t *, wchar_t **, int);

Description

Parameters

const wchar_twchar_t *

wchar_twchar_t **

int

Refer to wcstol(const wchar_t *,wchar_t **,int)wcstol(const wchar_t *,wchar_t **,int) for the documentation

Return value

unsigned long

See also:

[Top]


wmemchr(const wchar_t *,wchar_t,size_t)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wmemchr(const wchar_t *, wchar_t, size_t);

Description

The function wcslcat(wchar_t *,const wchar_t *,size_t)wcslcat(wchar_t *,const wchar_t *,size_t) appends a copy of the wide-character string pointed to by s2 (including the terminating null wide-character code) to the end of the wide-character string pointed to by s1. The initial wide-character code of string pointed to by s2 overwrites the null wide-character code at the end of s1. wcslcat(wchar_t *,const wchar_t *,size_t)wcslcat(wchar_t *,const wchar_t *,size_t) concatenates at most n-1 characters.

The function wcslcpy(wchar_t *,const wchar_t *,size_t)wcslcpy(wchar_t *,const wchar_t *,size_t) copies the wide-character string pointed to by s2 (including the terminating null wide-character code) into the array pointed to by s1. It will copy at most n-1 characters.

The functions implement string manipulation operations over wide character strings. For a detailed description, refer to documents for the respective single-byte counterpart, such as memchr .

Examples:

#include <wchar.h>
/* Illustrates how to use wmemcmp API */
int example_wmemcmp()
{  
  /* source wide character string */
  wchar_t *ws1 = L"test case",*ws2 = L"test case";
  int retval;
 /* comparing the 2 wide-char strings */
 retval = wmemcmp(ws1,ws2,500);
  /* checking for the return value */
  if(retval != 0)
   return 1;
  else
   return 0;
}
# 2423 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wmemcpy API */
int example_wmemcpy()
{  
  /* source wide character string */
  wchar_t ws1[50]=L"abcdefghij",*retval,ws2[50]=L"test";
  /* compare the strings */
  retval = wmemcpy(ws1,ws2,6);
  for(int i=0;i<6;i++)
  {
   if(retval[i] != ws2[i] || ws1[i] != ws2[i])
    return 1;
  }
  return 0;
}
# 2441 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wmemmove API */
int example_wmemmove()
{  
  /* source wide character string */
  wchar_t ws1[50]=L"abcdefghij",*retval,ws2[5] = L"abc";
  int i;
 
  /* move the contents of ws2 to ws1 */
  retval = wmemmove(ws1,ws2,3);
 /* compare the contents */
  for(i=0;i<3;i++)
  {
   if(ws1[i] != ws2[i])
     return 1;
  }
  return 0;
}
# 2462 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wmemset API */
int example_wmemset()
{  
  /* source wide character string */
  wchar_t ws1[50]=L"abcdefghij", *retval;
  int i;
  /* setting the wide-string ws1 */
  retval = wmemset(ws1,L'a',7);
 /* comparing the contents */
  for(i=0;i<7;i++)
  {
   if(ws1[i] != L'a')
     return 1;
  }
  return 0;
}
# 2482 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wmemchr API */
wchar_t *example_wmemchr(void)
{
 wchar_t *wcs = L"lmnopqr";
 size_t n;
 wchar_t wc = L'p';
 wchar_t *res;
 /* number of wide characters to be searched */
 n = wcslen(wcs);
 /* search for the occurence of wchar wc in wide-char string wcs */
 res = wmemchr(wcs, wc, n);
 /* return the pointer */
 return(res);
}
# 2500 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcslen API */
size_t example_wcslen(void)
{
 wchar_t *wcs = L"defqwert";
 size_t len;
 /* compute the length of the wide-char string */
 len = wcslen(wcs);
 /* return the length of the wide-char string */
 return (len);
}
# 2514 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcscat API */
void example_wcscat(void)
{
 wchar_t wcs[100] = L"abc";
 wchar_t *wcs1 = L"def";
 wchar *res;
 /* concatenate the two strings */
 res = wcscat(wcs, wcs1);
 /* print the string that resulted from concatenation */
 wprintf(L"Output wide-char string is : %ls
",res);
}

Output

abcdef
# 2535 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcschr API */
int example_ wcschr ()
{  
  /* source wide character string */
 wchar_t search_char[15] = L"&&&&$%%%%%TTU";
 wchar_t *wstr;
 int i ;
 for(i = 0 ; search_char[i]; i++)
 {
   wstr = wcschr(L"", search_char[i]);
   if(wstr !=  0 )
   {
    return -1;
   }
 }
 return 0;
}
int example_wcscmp()
{  
  /* source wide character string */
 wchar_t *wcs1 = "string1";
 wchar_t *wcs2 = "string2";
 int i ;
 i = wcscmp(wcs1, wcs2);
 if( i == 0)
  return -1;
 
 i = wcscmp(wcs1, L"string1");
 if(i != 0)
  return -1;
 
 return 0;
}
# 2575 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcscpy API */
int example_wcscpy ()
{  
  /* source wide character string */
  wchar_t wcs1[15];
  wchar_t *res;
 
  /* copy the wide-char string into wcs1*/
  res = wcscpy(wcs1, L"Hello world");
 
  if(wcscmp(res, L"Hello world") != 0)
   return -1;
 
  return 0;
}
# 2594 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcslcpy API */
int example_wcslcpy ()
{  
  /* source wide character string */
  wchar_t src[25] = L"Source";
  wchar_t dest[20]= L"Destination";
 
  /* copy the wide-char string into dest*/
 
        size_t t = wcslcpy(dest,src,4);
                
                if(wcscmp(dest,L"Sou")!=0)
    return -1;
 
  return 0;
}
# 2614 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcslcat API */
int example_wcslcat ()
{  
  /* source wide character string */
  wchar_t src[25] = L"Source";
  wchar_t dest[20]= L"Destination";
 
  /* concate the wide-char string into dest*/
 
        size_t t = wcslcat(dest,src,14);
                
                if(wcscmp(dest,"DestinationSo")!=0)
    return -1;
 
  return 0;
}
# 2634 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcscspnAPI */
int example_wcscspn ()
{  
  /* source wide character string */
  wchar_t wcs1[30] = L"1234567890ABCDE!@#$$";
  wchar_t *wcs2[20] = { L"abcdefghijkl",
     L":::?>_)+(|{>",
     L"~*(&IUIJJJ;",
     L"1234567",
     L":::?>",
     L"1",
     L"as1sd2ds3ds48f5fd"
   };
  int i;
 
  for( i = 0; i < 3 ; i ++)
  {
   if( wcslen(wcs1) != wcscspn(wcs1,wcs2[i]))
     return -1;
  }
 
  return 0;
}
# 2661 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcsncat API */
int example_wcsncat ()
{  
  /* source wide character string */
  wchar_t *res;
  wchar_t str[50];
 
  wcscpy(str, L"Hello");
  res = wcsncat(str,L" world",12);
 if(wcscmp(str, L"Hello world") != 0)
  return -1;
 else
  return 0;
}
# 2679 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcsncmp API */
int example_wcsncmp()
{  
  /* source wide character string */
  wchar_t *wcs1 = L"Hello world";
  if(wcsncmp(wcs1,wcs1,wcslen(wcs1))) 
   return -1;
  else
   return 0;
}
# 2693 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcsncpy API */
int example_wcsncpy ()
{  
  /* source wide character string */
  wchar_t wcs1[15] = L"Hello world";
  wchar_t *res;
  res = wcsncpy(wcs1,wcs1,wcslen(wcs1));
  if(wcscmp(res,wcs1))
  return -1;
  return 0;
}
# 2708 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcspbrk API */
int example_wcspbrk ()
{  
  /* source wide character string */
 wchar_t *wcs = L"abcdefghijkl";
  wchar_t *res1 = wcspbrk(wcs, L"");
  if(res1 !=  0 )
   return -1;
 
  return 0;
}
# 2723 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcsrchr API */
int example_wcsrchr ()
{  
  /* source wide character string */
 wchar_t search_char[15] = L"&&&&$%%%%%TTU";
  wchar_t *wstr;
  int i ;
 
  for(i = 0 ; search_char[i]; i++)
  {
   wstr = wcsrchr(L"", search_char[i]);
   if(wstr !=  0 )
   {
     return -1;
   }
  }
  return 0;
}
# 2745 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcsspn API */
int example_wcsspn()
{  
  /* source wide character string */
 wchar_t wcs1[30] = L"1234567890ABCDE!@#$$";
 if(wcslen(wcs1) != wcsspn(wcs1,wcs1)) 
  return -1;
 return 0;
}
# 2758 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcsstr API */
int example_wcsstr()
{  
  /* source wide character string */
 wchar_t *buf[20] = { L"fkhsdf%%38",L"rtti123123", };
 wchar_t *str  = wcsstr(buf[0],L"\0");
 wchar_t *str1 = wcsstr(buf[1],L"\0");
 if(wcscmp(str,buf[0]))
   return 1;
 if(wcscmp(str1,buf[1]))
   return 1
 return 0;
}

Parameters

const wchar_twchar_t *

wchar_twchar_t

size_tsize_t

Note: This description also covers the following functions - wmemcmp(const wchar_t *,const wchar_t *,size_t)wmemcmp(const wchar_t *,const wchar_t *,size_t) wmemcpy(wchar_t *,const wchar_t *,size_t)wmemcpy(wchar_t *,const wchar_t *,size_t) wmemmove(wchar_t *,const wchar_t *,size_t)wmemmove(wchar_t *,const wchar_t *,size_t) wmemset(wchar_t *,wchar_t,size_t)wmemset(wchar_t *,wchar_t,size_t) wcscat(wchar_t *,const wchar_t *)wcscat(wchar_t *,const wchar_t *) wcschr(const wchar_t *,wchar_t)wcschr(const wchar_t *,wchar_t) wcscmp(const wchar_t *,const wchar_t *)wcscmp(const wchar_t *,const wchar_t *) wcscpy(wchar_t *,const wchar_t *)wcscpy(wchar_t *,const wchar_t *) wcscspn(const wchar_t *,const wchar_t *)wcscspn(const wchar_t *,const wchar_t *) wcslcat(wchar_t *,const wchar_t *,size_t)wcslcat(wchar_t *,const wchar_t *,size_t) wcslcpy(wchar_t *,const wchar_t *,size_t)wcslcpy(wchar_t *,const wchar_t *,size_t) wcslen(const wchar_t *)wcslen(const wchar_t *) wcsncat(wchar_t *,const wchar_t *,size_t)wcsncat(wchar_t *,const wchar_t *,size_t) wcsncmp(const wchar_t *,const wchar_t *,size_t)wcsncmp(const wchar_t *,const wchar_t *,size_t) wcsncpy(wchar_t *,const wchar_t *,size_t)wcsncpy(wchar_t *,const wchar_t *,size_t) wcspbrk(const wchar_t *,const wchar_t *)wcspbrk(const wchar_t *,const wchar_t *) wcsrchr(const wchar_t *,wchar_t)wcsrchr(const wchar_t *,wchar_t) wcsspn(const wchar_t *,const wchar_t *)wcsspn(const wchar_t *,const wchar_t *) wcsstr(const wchar_t *,const wchar_t *)wcsstr(const wchar_t *,const wchar_t *)

Return value

wchar_twchar_t *

wmemchr function returns a pointer to the first occurrence of c among the n wide characters starting at s , or NULL if c does not occur among these. wcslcpy function returns wcslen(src); if retval >= siz, truncation occurred wcslcat function returns wcslen(initial dst) + wcslen(src); if retval >= sizet,

See also:

[Top]


wmemcmp(const wchar_t *,const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C int wmemcmp(const wchar_t *, const wchar_t *, size_t);

Description

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

size_tsize_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

int

See also:

[Top]


wmemcpy(wchar_t *,const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wmemcpy(wchar_t *, const wchar_t *, size_t);

Description

Parameters

wchar_twchar_t *

const wchar_twchar_t *

size_tsize_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wmemmove(wchar_t *,const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wmemmove(wchar_t *, const wchar_t *, size_t);

Description

Parameters

wchar_twchar_t *

const wchar_twchar_t *

size_tsize_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wmemset(wchar_t *,wchar_t,size_t)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wmemset(wchar_t *, wchar_t, size_t);

Description

Parameters

wchar_twchar_t *

wchar_twchar_t

size_tsize_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wprintf(const wchar_t *,...)

Interface status: externallyDefinedApi

IMPORT_C int wprintf(const wchar_t *,...);

Description

Parameters

const wchar_twchar_t *

...

Return value

int

See also:

[Top]


wscanf(const wchar_t *,...)

Interface status: externallyDefinedApi

IMPORT_C int wscanf(const wchar_t *,...);

Description

The wscanf family of functions scans input according to a format as described below. This format may contain conversion specifiers ; the results from such conversions, if any, are stored through the pointer arguments. The wscanf function reads input from the standard input stream stdin , fwscanf reads input from the stream pointer stream , and swscanf reads its input from the wide character string pointed to by str . The vfwscanf function is analogous to vfwprintf and reads input from the stream pointer stream using a variable argument list of pointers. The vwscanf function scans a variable argument list from the standard input and the vswscanf function scans it from a wide character string; these are analogous to the vwprintf and vswprintf functions respectively. Each successive pointer argument must correspond properly with each successive conversion specifier (but see the * conversion below). All conversions are introduced by the % (percent sign) character. The format string may also contain other characters. White space (such as blanks, tabs, or newlines) in the format string match any amount of white space, including none, in the input. Everything else matches only itself. Scanning stops when an input character does not match such a format character. Scanning also stops when an input conversion cannot be made (see below).

Conversions:

Following the % character introducing a conversion there may be a number of flag characters, as follows: *  Suppresses assignment. The conversion that follows occurs as usual, but no pointer is used; the result of the conversion is simply discarded.  
hh  Indicates that the conversion will be one of dioux or n and the next pointer is a pointer to a char (rather than int ) .  
h  Indicates that the conversion will be one of dioux or n and the next pointer is a pointer to a short int (rather than int ) .  
l (ell)  Indicates that the conversion will be one of dioux or n and the next pointer is a pointer to a long int (rather than int ) , that the conversion will be one of a, e, f, or g and the next pointer is a pointer to double (rather than float ) , or that the conversion will be one of c or s and the next pointer is a pointer to an array of wchar_t (rather than char ) .  
ll (ell ell)  
  Indicates that the conversion will be one of dioux or n and the next pointer is a pointer to a long long int (rather than int ) .  
L  Indicates that the conversion will be one of a, e, f, or g and the next pointer is a pointer to long double .  
j  Indicates that the conversion will be one of dioux or n and the next pointer is a pointer to a intmax_t (rather than int ) .  
t  Indicates that the conversion will be one of dioux or n and the next pointer is a pointer to a ptrdiff_t (rather than int ) .  
z  Indicates that the conversion will be one of dioux or n and the next pointer is a pointer to a size_t (rather than int ) .  
q  (deprecated.) Indicates that the conversion will be one of dioux or n and the next pointer is a pointer to a long long int (rather than int ) .  


In addition to these flags, there may be an optional maximum field width, expressed as a decimal integer, between the % and the conversion. If no width is given, a default of "infinity" is used (with one exception, below); otherwise at most this many characters are scanned in processing the conversion. Before conversion begins, most conversions skip white space; this white space is not counted against the field width. 

The following conversions are available: %  Matches a literal ‘%’. That is, "%%" in the format string matches a single input ‘%’ character. No conversion is done, and assignment does not occur.  
d  Matches an optionally signed decimal integer; the next pointer must be a pointer to int .  
i  Matches an optionally signed integer; the next pointer must be a pointer to int . The integer is read in base 16 if it begins with ‘0x’ or ‘0X’, in base 8 if it begins with ‘0’, and in base 10 otherwise. Only characters that correspond to the base are used.  
o  Matches an octal integer; the next pointer must be a pointer to unsigned int .  
u  Matches an optionally signed decimal integer; the next pointer must be a pointer to unsigned int .  
x, X  Matches an optionally signed hexadecimal integer; the next pointer must be a pointer to unsigned int .  
a, A, e, E, f, F, g, G  
  Matches a floating-point number in the style of wcstod. The next pointer must be a pointer to float (unless l or L is specified.)  
s  Matches a sequence of non-white-space wide characters; the next pointer must be a pointer to char , and the array must be large enough to accept the multibyte representation of all the sequence and the terminating NUL character. The input string stops at white space or at the maximum field width, whichever occurs first. 
If an l qualifier is present, the next pointer must be a pointer to wchar_t , into which the input will be placed. 
 
S  The same as ls.  
c  Matches a sequence of width count wide characters (default 1); the next pointer must be a pointer to char , and there must be enough room for the multibyte representation of all the characters (no terminating NUL is added). The usual skip of leading white space is suppressed. To skip white space first, use an explicit space in the format. 
If an l qualifier is present, the next pointer must be a pointer to wchar_t , into which the input will be placed. 
 
C  The same as lc.  
[  Matches a nonempty sequence of characters from the specified set of accepted characters; the next pointer must be a pointer to char , and there must be enough room for the multibyte representation of all the characters in the string, plus a terminating NUL character. The usual skip of leading white space is suppressed. The string is to be made up of characters in (or not in) a particular set; the set is defined by the characters between the open bracket [ character and a close bracket ] character. The set excludes those characters if the first character after the open bracket is a circumflex ^. To include a close bracket in the set, make it the first character after the open bracket or the circumflex; any other position will end the set. To include a hyphen in the set, make it the last character before the final close bracket; some implementations of wscanf use "A-Z" to represent the range of characters between ‘A’ and ‘Z’. The string ends with the appearance of a character not in the (or, with a circumflex, in) set or when the field width runs out. 
If an l qualifier is present, the next pointer must be a pointer to wchar_t , into which the input will be placed. 
 
p  Matches a pointer value (as printed by ‘%p’ in wprintf); the next pointer must be a pointer to void .  
n  Nothing is expected; instead, the number of characters consumed thus far from the input is stored through the next pointer, which must be a pointer to int . This is not a conversion, although it can be suppressed with the * flag.  



The decimal point character is defined in the program’s locale (category LC_NUMERIC). 

For backwards compatibility, a "conversion" of ‘%\0’ causes an immediate return of EOF. 

Examples:

#include <stdio.h>
#include <wchar.h>
/* Illustrates how to use wscanf API */
int example_wscanf(void)
{
  int rval;
  int input;
 /* Display a message to the user to input an integer */
 wprintf(L"Enter an integer : ");
  /* Read an integer from the standard input */
  rval = wscanf(L"%d", &input;);
 
  /* return the number of inputs that were read */
  return(rval);
}
# 3086 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3087 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use swscanf API */
int example_swscanf(void)
{
  int rval;
  wchar_t wcs[100];
  wchar_t *bufptr = L"abcdefg";
 /* Read a string from the buffer bufptr*/
  rval = swscanf(bufptr, L"%s", wcs);
 
  /* The string that was read into wcs is printed */
  wprintf(L"%s",wcs);
 
  /* return the number of inputs that were read */
  return(rval);
}
# 3106 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3107 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use fwscanf API */
int example_fwscanf(void)
{
  FILE *fp =  0 ;
  int retval;
  wchar_t wcs[100];
   
  /* open the file for writing*/
  fp = fopen("write.txt","w");
  if(fp ==  0 )
  {
    wprintf(L"Error: File open
");
    return (-1);
  }
 /* Read a string from fp*/
  rval = fwscanf(fp, L"%s", wcs);
 
 /* Close the file that was opened */
  fclose(fp);
 
  /* return the number of inputs that were read */
  return(rval);
}
# 3135 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3136 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use vwscanf API */
int example_vwscanf(va_list arg)
{
  int retval;
    
 /* Read a string from standard input */
  rval = vwscanf(L"%s", arg);
 
  /* return the number of inputs that were read */
  return(rval);
}
# 3151 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3152 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use vswscanf API */
int example_vswscanf(va_list arg)
{
  int retval;
  wchar_t bufptr = L"abc";
    
 /* Read a string from bufptr */
  rval = vswscanf(bufptr, L"%s", arg);
 
  /* return the number of inputs that were read */
  return(rval);
}
# 3168 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3169 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use vfwscanf API */
int example_vfwscanf(va_list arg)
{
  FILE *fp =  0 ;
  int retval;
    
  /* open the file for writing*/
  fp = fopen("write.txt","w");
  if(fp ==  0 )
  {
    wprintf(L"Error: File open
");
    return (-1);
  }
 /* Read a string */
  rval = vfwscanf(fp, L"%s", arg);
 
  /* Close the file that was opened */
  fclose(fp);
 
  /* return the number of inputs that were read */
  return(rval);
}

Examples:

# 3197 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3198 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wscanf API */
int example_wscanf(void)
{
  int rval;
  int input;
 /* Display a message to the user to input an integer */
 wprintf(L"Enter an integer : ");
  /* Read an integer from the standard input */
  rval = wscanf(L"%d", &input;);
 
  /* return the number of inputs that were read */
  return(rval);
}
# 3215 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3216 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use swscanf API */
int example_swscanf(void)
{
  int rval;
  wchar_t wcs[100];
  wchar_t *bufptr = L"abcdefg";
 /* Read a string from the buffer bufptr*/
  rval = swscanf(bufptr, L"%s", wcs);
 
  /* The string that was read into wcs is printed */
  wprintf(L"%s",wcs);
 
  /* return the number of inputs that were read */
  return(rval);
}
# 3235 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3236 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use fwscanf API */
int example_fwscanf(void)
{
  FILE *fp =  0 ;
  int retval;
  wchar_t wcs[100];
   
  /* open the file for writing*/
  fp = fopen("write.txt","w");
  if(fp ==  0 )
  {
    wprintf(L"Error: File open
");
    return (-1);
  }
 /* Read a string from fp*/
  rval = fwscanf(fp, L"%s", wcs);
 
 /* Close the file that was opened */
  fclose(fp);
 
  /* return the number of inputs that were read */
  return(rval);
}
# 3264 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3265 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use vwscanf API */
int example_vwscanf(va_list arg)
{
  int retval;
    
 /* Read a string from standard input */
  rval = vwscanf(L"%s", arg);
 
  /* return the number of inputs that were read */
  return(rval);
}
# 3280 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3281 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use vswscanf API */
int example_vswscanf(va_list arg)
{
  int retval;
  wchar_t bufptr = L"abc";
    
 /* Read a string from bufptr */
  rval = vswscanf(bufptr, L"%s", arg);
 
  /* return the number of inputs that were read */
  return(rval);
}
# 3297 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 3298 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use vfwscanf API */
int example_vfwscanf(va_list arg)
{
  FILE *fp =  0 ;
  int retval;
    
  /* open the file for writing*/
  fp = fopen("write.txt","w");
  if(fp ==  0 )
  {
    wprintf(L"Error: File open
");
    return (-1);
  }
 /* Read a string */
  rval = vfwscanf(fp, L"%s", arg);
 
  /* Close the file that was opened */
  fclose(fp);
 
  /* return the number of inputs that were read */
  return(rval);
}

Limitations:

Long double length modifiers are not supported.

Bugs:

In addition to the bugs documented in scanf , wscanf does not support the "A-Z" notation for specifying character ranges with the character class conversion (' %[ ').

Parameters

const wchar_twchar_t *

...

Return value

int

These functions return the number of input items assigned, which can be fewer than provided for, or even zero, in the event of a matching failure. Zero indicates that, while there was input available, no conversions were assigned; typically this is due to an invalid input character, such as an alphabetic character for a '%d' conversion. The value EOF is returned if an input failure occurs before any conversion such as an end-of-file occurs. If an error or end-of-file occurs after conversion has begun, the number of conversions which were successfully completed is returned.

See also:

[Top]


wcstoq(const wchar_t *,wchar_t **,int)

Interface status: externallyDefinedApi

IMPORT_C long long wcstoq(const wchar_t *, wchar_t **, int);

Description

Parameters

const wchar_twchar_t *

wchar_twchar_t **

int

Refer to wcstol(const wchar_t *,wchar_t **,int)wcstol(const wchar_t *,wchar_t **,int) for the documentation

Return value

long long

See also:

[Top]


wcstouq(const wchar_t *,wchar_t **,int)

Interface status: externallyDefinedApi

IMPORT_C unsigned long long wcstouq(const wchar_t *, wchar_t **, int);

Description

Parameters

const wchar_twchar_t *

wchar_twchar_t **

int

Refer to wcstol(const wchar_t *,wchar_t **,int)wcstol(const wchar_t *,wchar_t **,int) for the documentation

Return value

unsigned long long

See also:

[Top]


wcswcs(const wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcswcs(const wchar_t *s, const wchar_t *find);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wcswcs API */
int example_wcswcs()
{  
  /* source wide character string */
 wchar_t *buf[20] = { L"fkhsdf%%38",L"rtti123123", };
 wchar_t *str  = wcswcs(buf[0],L"\0");
 wchar_t *str1 = wcswcs(buf[1],L"\0");
 if(wcscmp(str,buf[0]))
   return 1;
 if(wcscmp(str1,buf[1]))
   return 1
 return 0;
}

Parameters

const wchar_twchar_t *s

const wchar_twchar_t *find

The wcswcs(const wchar_t *,const wchar_t *)wcswcs(const wchar_t *,const wchar_t *) function locates the first occurrence of the wide-character string pointed by s (excluding the terminating '\0' character) in the wide-character string pointed by find.

Return value

wchar_twchar_t *

The wcswcs(const wchar_t *,const wchar_t *)wcswcs(const wchar_t *,const wchar_t *) on success returns a pointer to the located wide-character string and returns a 0 pointer if the wide-charcter string was not found. If find is a wide-character string with length as zero, the function returns s.

See also:

[Top]


wpopen3(const wchar_t *,const wchar_t *,wchar_t **,int)

IMPORT_C int wpopen3(const wchar_t *file, const wchar_t *cmd, wchar_t **env, int fids[3]);

Description

Examples:

/* Illustrates how to use wpopen3 API */
#include <wchar.h>
int main()
    {
    int fds[3];
    int childid= wpopen3( NULL,NULL, NULL, fds);
    if  (childid == -1 && errno == ENOENT) 
        {        
          printf("wpopen success");
        return 0;
        }
    return -1;
    }
Output:
wpopen success

Parameters

const wchar_twchar_t *file

const wchar_twchar_t *cmd

wchar_twchar_t **env

int fids

Note:wpopen3 is a wide-character version of popen3(const char *,const char *,char **,int)popen3(const char *,const char *,char **,int)

Return value

int

Upon successful completion, it returns pid of the child.

[Top]


vswscanf(const wchar_t *,const wchar_t *,va_list)

Interface status: externallyDefinedApi

IMPORT_C int vswscanf(const wchar_t *, const wchar_t *, va_list);

Description

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

va_list

Refer to wscanf(const wchar_t *,...)wscanf(const wchar_t *,...) for the documentation

Return value

int

See also:

[Top]


vwscanf(const wchar_t *,va_list)

Interface status: externallyDefinedApi

IMPORT_C int vwscanf(const wchar_t *, va_list);

Description

Parameters

const wchar_twchar_t *

va_list

Refer to wscanf(const wchar_t *,...)wscanf(const wchar_t *,...) for the documentation

Return value

int

See also:

[Top]


wcstof(const wchar_t *,wchar_t **)

Interface status: externallyDefinedApi

IMPORT_C float wcstof(const wchar_t *, wchar_t **);

Description

The wcstof , wcstod and wcstold functions are the wide-character versions of the strtof , strtod and strtold functions. Refer to strtod(const char *,char **)strtod(const char *,char **) for details.

Examples:

#include <wchar.h>
/* Illustrates how to use wcstof API */
int example_wcstof()
{  
  /* src string */
  wchar_t wcs1[21] = L"  1.23abcd";
  wchar_t wcs2[5]=L"abcd";
  wchar_t *eptr;
  float d;
  
 /* convert wide-char string to float */  
  d = wcstof(wcs1, &eptr;);
 
  /* compare the result */
  if((d == 1.23F) && !(wcscmp (eptr, wcs2)))
   return 0;
  else
   return 1;
}
# 3618 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcstold API */
int example_wcstold()
{  
  /* src string */
  wchar_t wcs1[21] = L"  1.23abcd";
  wchar_t wcs2[5]=L"abcd";
  wchar_t *eptr;
  double d;
 
  /* convert wide-char string to double */
  d = wcstod(wcs1, &eptr;);
 
  /* compare the result */
  if((d == 1.23) && !(wcscmp (eptr, wcs2)))
   return 0;
  else
   return 1;
}
# 3640 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
/* Illustrates how to use wcstold API */
int example_wcstold()
{  
  /* src string */
  wchar_t wcs1[21] = L"  1.23abcd";
  wchar_t wcs2[5]=L"abcd";
  wchar_t *eptr;
  long double d;
  
  /* convert wide-char string to long double */
  d = wcstold(wcs1, &eptr;);
 
  /* compare the result *
  if((d == 1.23) && !(wcscmp (eptr, wcs2)))
   return 0;
  else
  return 1;
}

Parameters

const wchar_twchar_t *

wchar_twchar_t **

Note: This description also covers the following functions - wcstold(const wchar_t *,wchar_t **)wcstold(const wchar_t *,wchar_t **) wcstod(const wchar_t *,wchar_t **)wcstod(const wchar_t *,wchar_t **)

Return value

float

See also:

[Top]


wcstold(const wchar_t *,wchar_t **)

Interface status: externallyDefinedApi

IMPORT_C long double wcstold(const wchar_t *, wchar_t **);

Description

Parameters

const wchar_twchar_t *

wchar_twchar_t **

Refer to wcstof(const wchar_t *,wchar_t **)wcstof(const wchar_t *,wchar_t **) for the documentation

Return value

long double

See also:

[Top]


wcstoll(const wchar_t *,wchar_t **,int)

Interface status: externallyDefinedApi

IMPORT_C long long wcstoll(const wchar_t *, wchar_t **, int);

Description

Parameters

const wchar_twchar_t *

wchar_twchar_t **

int

Refer to wcstol(const wchar_t *,wchar_t **,int)wcstol(const wchar_t *,wchar_t **,int) for the documentation

Return value

long long

See also:

[Top]


wcstoull(const wchar_t *,wchar_t **,int)

Interface status: externallyDefinedApi

IMPORT_C unsigned long long wcstoull(const wchar_t *, wchar_t **, int);

Description

Parameters

const wchar_twchar_t *

wchar_twchar_t **

int

Refer to wcstol(const wchar_t *,wchar_t **,int)wcstol(const wchar_t *,wchar_t **,int) for the documentation

Return value

unsigned long long

See also:

[Top]


wcswidth(const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C int wcswidth(const wchar_t *, size_t);

Description

The wcswidth function determines the number of column positions required for the first n characters of pwcs , or until a null wide character (L'\0') is encountered.

The behavior of the wcswdith is affected by LC_CTYPE category of the current locale.

Examples:

#include <wchar.h>
/* Illustrates how to use wcswidth API */
int example_wcswidth()
{  
  /* wide character string for which width has to */
  /* determined */
  wchar_t *ws1 = L"test case";
  int retval;
  /* compute the width of the ws1 */
  retval = wcswidth(ws1,50);
 /* return the result */
  return retval;
}

Limitations:

The current implementation of wcswidth is dependent upon locale support in Symbian OS.

Parameters

const wchar_twchar_t *

size_tsize_t

Return value

int

The wcswidth function returns 0 if pwcs is an empty string (L""), -1 if a non-printing wide character is encountered or the number of column positions occupied otherwise.

See also:

[Top]


wcwidth(wchar_t)

Interface status: externallyDefinedApi

IMPORT_C int wcwidth(wchar_t);

Description

The wcwidth function determines the number of column positions required to display the wide character wc .

The behavior of the wcwdith is affected by LC_CTYPE category of the current locale.

Examples:

#include <wchar.h>
/* Illustrates how to use wcwidth API */
int example_wcwidth()
{  
 /* wide character for which width has to be determined */
 wchar_t wc = L'a';
 int retval;
 /* determine the width of wc */
 retval = wcwidth(wc);
 /* return the determined width */
 return retval;
}

Examples:

This code fragment reads text from standard input and breaks lines that are more than 20 column positions wide, similar to the fold utility:

wint_t ch;
int column, w;
column = 0;
while ((ch = getwchar()) !=  ((wint_t)-1) ) {
        w = wcwidth(ch);
        if (w > 0 && column + w >= 20) {
                putwchar(L' \en');
                column = 0;
        }
        putwchar(ch);
        if (ch == L' \en')
                column = 0;
        else if (w > 0)
                column += w;
}

Limitations:

The current implementation of wcwidth is dependent upon the locale support of Symbian OS.

Parameters

wchar_twchar_t

Return value

int

The wcwidth function returns 0 if the wc argument is a null wide character (L'\0'), -1 if wc is not printable or the number of column positions the character occupies otherwise.

See also:

[Top]


mbsnrtowcs(wchar_t *,const char **,size_t,size_t,mbstate_t *)

Interface status: externallyDefinedApi

IMPORT_C size_t mbsnrtowcs(wchar_t *, const char **, size_t, size_t, mbstate_t *);

Description

Parameters

wchar_twchar_t *

const char **

size_tsize_t

size_tsize_t

_mb_state_t *

Refer to mbsrtowcs(wchar_t *,const char **,size_t,mbstate_t *)mbsrtowcs(wchar_t *,const char **,size_t,mbstate_t *) for the documentation

Return value

size_tsize_t

See also:

[Top]


wcsnrtombs(char *,const wchar_t **,size_t,size_t,mbstate_t *)

Interface status: externallyDefinedApi

IMPORT_C size_t wcsnrtombs(char *, const wchar_t **, size_t, size_t, mbstate_t *);

Description

Parameters

char *

const wchar_twchar_t **

size_tsize_t

size_tsize_t

_mb_state_t *

Refer to wcsrtombs(char *,const wchar_t **,size_t,mbstate_t *)wcsrtombs(char *,const wchar_t **,size_t,mbstate_t *) for the documentation

Return value

size_tsize_t

See also:

[Top]


wcpcpy(wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcpcpy(wchar_t *dst, const wchar_t *src);

Description

The wcpcpy(wchar_t *,const wchar_t *)wcpcpy(wchar_t *,const wchar_t *) function copies the wide-character string src to dst (including the terminating '\0' character.)

Examples:

#include <stdlib.h>
#include <wchar.h>
/* Illustrates how to use wcpcpy API */
int example_wcpcpy()

  /* input string for which length to be found */
 wchar_t *src = L"testcase";
  wchar_t *dest =  0 ;
  wchar_t *destEndPtr =  0 ; 
    
  /* allocate memory for the destination string */
  dest = (wchar_t *)malloc((wcslen(src)+1)*sizeof(wchar_t));
    
  /*  perform the operation */
  if(dest !=  0 )
   destEndPtr = (wchar_t *)wcpcpy(dest,src);
  else
   return 1;
  if(!wcscmp(dest,src))
  {
   free(dest);
   return 0;
  }
  else
  {
   free(dest);
   return 1;
  }
}

Parameters

wchar_twchar_t *dst

const wchar_twchar_t *src

Return value

wchar_twchar_t *

The wcpcpy(wchar_t *,const wchar_t *)wcpcpy(wchar_t *,const wchar_t *) function returns a pointer to the end of the wide-character string dest , that is the return pointer points to the terminating '\0'.

[Top]


wcpncpy(wchar_t *,const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcpncpy(wchar_t *dst, const wchar_t *src, size_t n);

Description

The wcpncpy(wchar_t *,const wchar_t *,size_t)wcpncpy(wchar_t *,const wchar_t *,size_t) function copies at most n wide characters from the wide-character string src , including the terminating L'\0' character, to dst . Exactly n wide characters are written at dst . If the length wcslen(src) is less than n , the remaining wide characters in the array dst are filled with L'\0' characters. If the length wcslen(src) is greater than or equal to n , the string dst will not be L'\0' terminated.

Examples:

#include <stdlib.h>
#include <wchar.h>
/* Illustrates how to use wcpncpy API */
int example_wcpncpy(void)

  /* input string for which length to be found */
 wchar_t *src = L"testcase";
  wchar_t *dest =  0 ;
  wchar_t *destEndPtr =  0 ; 
    
  /* allocate memory for the destination string */
  dest = (wchar_t *)malloc((wcslen(src)+1)*sizeof(wchar_t));
    
  /*  perform the operation */
  if(dest !=  0 )
   destEndPtr = (wchar_t *)wcpncpy(dest,src,wcslen(src)+1);
  else
   return -1;
  /* checking for error */
  if(!wcscmp(dest,src))
  {
   wprintf(L"wcpncpy succeeded
");
   free(dest);
   return 0;
  }
  else
  {
   wprintf(L"wcpncpy failed!!
");
   free(dest);
   return -1;
  }
}

Parameters

wchar_twchar_t *dst

const wchar_twchar_t *src

size_tsize_t n

Return value

wchar_twchar_t *

The wcpncpy(wchar_t *,const wchar_t *,size_t)wcpncpy(wchar_t *,const wchar_t *,size_t) function returns a pointer to the wide character one past the last non-null wide character written.

See also:

[Top]


wcscasecmp(const wchar_t *,const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C int wcscasecmp(const wchar_t *s1, const wchar_t *s2);

Description

The wcscasecmp(const wchar_t *,const wchar_t *)wcscasecmp(const wchar_t *,const wchar_t *) function compares the null-terminated wide-character strings s1 and s2 .

Examples:

#include <wchar.h>
/* Illustrates how to use wcscasecmp API */
int example_wcscasecmp(void)

  /* input strings which needs to be compared */
 wchar_t *ws1=L"testcasecmp";
  wchar_t *ws2=L"TESTCASECMP";
    
  /* function call to compare the two strings which */
  /* differ in case */
  int retval = wcscasecmp(ws1,ws2);
  /* returns 0 if they are equal or > 1 */
  /* if first string is greater than second string else -1 */
  return retval;
}

Parameters

const wchar_twchar_t *s1

const wchar_twchar_t *s2

Return value

int

The wcscasecmp(const wchar_t *,const wchar_t *)wcscasecmp(const wchar_t *,const wchar_t *) returns an integer greater than, equal to, or less than 0, according as s1 is lexicographically greater than, equal to, or less than s2 after translation of each corresponding character to lower-case. The strings themselves are not modified.

See also:

[Top]


wcsdup(const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C wchar_t* wcsdup(const wchar_t *srcwcs);

Description

The wcsdup(const wchar_t *)wcsdup(const wchar_t *) function allocates sufficient memory for a copy of the wide-string srcwcs, does the copy, and returns a pointer to it. The pointer may subsequently be used as an argument to the function free .

If insufficient memory is available, NULL is returned and errno is set to ENOMEM.

Examples:

#include <wchar.h>
/* Illustrates how to use wcsdup API */
int example_wcsdup(void)

  /* input string for which length has to be found */
 wchar_t *srcws=L"testwcsdup";
  wchar_t *destws =  0 ;
    
 /* invoke the API wcsdup to duplicate the string */
  destws = wcsdup(srcws);
  /* return no error if src str and dest str are equal else return an error */   
  if(!(wcscmp(srcws,destws)))
  {
    free(destws);
   return 1;
  }
  else
  {
    free(destws);
   return -1;
  }
}

Parameters

const wchar_twchar_t *srcwcs

Return value

wchar_twchar_t *

The wcsdup function returns a pointer to the new wide-character string, or NULL if sufficient memory was not available.

See also:

[Top]


wcsncasecmp(const wchar_t *,const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C int wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n);

Description

The wcsncasecmp(const wchar_t *,const wchar_t *,size_t)wcsncasecmp(const wchar_t *,const wchar_t *,size_t) function compares atmost n wide-characters from the null-terminated wide-character strings s1 and s2 .

Examples:

#include <wchar.h>
/* Illustrates how to use wcsncasecmp API */
int example_wcsncasecmp()

  /* input strings which need to be compared */
 wchar_t *ws1=L"testcasecmp";
  wchar_t *ws2=L"TESTCASECMP";
    
  /* function call to compare the two strings which */
  /* differ in case */
  int retval = wcsncasecmp(ws1,ws2,11);
  /* returns 0 if they are equal except the case or >1 */
  /* if first string is greater than second string else -1 */
  return retval;
}

Parameters

const wchar_twchar_t *s1

const wchar_twchar_t *s2

size_tsize_t n

Return value

int

The wcsncasecmp(const wchar_t *,const wchar_t *,size_t)wcsncasecmp(const wchar_t *,const wchar_t *,size_t) returns an integer greater than, equal to, or less than 0, according as s1 is lexicographically greater than, equal to, or less than s2 after translation of each corresponding character to lower-case. The strings themselves are not modified.

See also:

[Top]


wcsnlen(const wchar_t *,size_t)

Interface status: externallyDefinedApi

IMPORT_C size_t wcsnlen(const wchar_t *s, size_t maxlen);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wcsnlen API */
size_t example_wcsnlen()

  /* input string for which length to be found */
 wchar_t *ws=L"testwcsnlen";
    
  /* find the length of the wide char string by */
  /* calling wcsnlen */
  size_t retval = wcsnlen(ws,14);
 /* return the number of wide chars in the string */
 /* if retval is less than 14 Else return 14 as the */
 /* length of the string */
 return retval;
}

Parameters

const wchar_twchar_t *s

size_tsize_t maxlen

The wcsnlen(const wchar_t *,size_t)wcsnlen(const wchar_t *,size_t) function computes the length of the wide-character string s not including the terminating NUL character. It looks at only first maxlen wide-characters in s and never beyond s+maxlen.

Return value

size_tsize_t

The wcsnlen(const wchar_t *,size_t)wcsnlen(const wchar_t *,size_t) returns the number of wide-characters that precede the terminating NUL character if it is less than maxlen or maxlen if there is a terminating NUL character among maxlen characters pointed by s.

[Top]


wrealpath(const wchar_t *,wchar_t *)

IMPORT_C wchar_t* wrealpath(const wchar_t *, wchar_t *);

Description

  The wrealpath function resolves all extra "/"
characters and references to /./ and /../ in path, and copies the resulting absolute path into
the memory referenced by resolved path. The resolved path argument must refer to a buffer capable of storing at least PATH_MAX characters.

 The wrealpath function will resolve both absolute and relative paths
and return the absolute path corresponding to path. All but the last component of path must exist when wrealpath is called.

Examples:

#include<stdlib.h>
#include<stdio.h> //printf
#include<sys/stat.h> //S_IWUSR
#include<sys/syslimits.h> //PATH_MAX
#include<unistd.h> //chdir
#inlclude<wchar.h>
 
int main()
{
 wchar_t resolvepath[PATH_MAX];
 FILE *fp = NULL;
 wchar_t *rpath = NULL;
  
 fp = wfopen(L"c:\xyz.txt", L"w");
 if(!fp)
 {
     printf("wfopen failed!!");
     return -1;
 }
    
 wmkdir(L"c:\tmdir", S_IWUSR);
  
 int c = wchdir(L"c:\");
 if(c == -1)
 {
     printf("wchdir failed!!");
     return -1;
 }
  
 rpath = wrealpath(L".\tmdir\..\xyz.txt", resolvepath);
 printf("resolvepath: L%s
", resolvepath);
 if(rpath != NULL)
    printf("rpath: L%s

", rpath);
  
 fclose(fp);
 wrmdir(L"c:\tmdir");
 wunlink(L"c:\xyz.txt");
 return 0;
}

Output

resolvepath: C:\xyz.txt
rpath: C:\xyz.txt

Parameters

const wchar_twchar_t *

wchar_twchar_t *

Return value

wchar_twchar_t *

The wrealpath function returns resolved path on success. If an error occurs, wrealpath returns NULL, and resolved path contains the path which caused the problem.

[Top]


wrmdir(const wchar_t *)

IMPORT_C int wrmdir(const wchar_t *);

Description

The wrmdir system call removes a directory file whose name is given by _path. The directory must not have any entries other than '.' and '..'.

Examples:

/* Detailed description: This test code demonstrates usage of wrmdir systemcall, it removes directory
  Example from the current working directory.

  Preconditions: Expects empty directoy "Example" in current working directory.
 */
# 1 "d:/EPOC/epoc32/include/stdapis/wchar.h" 1
/*-
 Copyright (c)1999 Citrus Project,
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.

 $FreeBSD: src/include/wchar.h,v 1.45 2004/08/12 12:19:10 tjr Exp $

 © Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
 © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
 */

/*-
 Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
 All rights reserved.

 This code is derived from software contributed to The NetBSD Foundation
 by Julian Coleman.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of The NetBSD Foundation nor the names of its
    contributors may be used to endorse or promote products derived
    from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.

    $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
 */








































































































































































































































































































 /* !_WCHAR_H_ */
# 4265 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
  if(wrmdir(L"Example") < 0 )  
  {
     printf("wrmdir failed 
");
     return -1;
  }
  printf("Directory Example removed 
");
  return 0;
}

 Output
Directory Example removed

Parameters

const wchar_twchar_t *

Return value

int

The wrmdir(const wchar_t *)wrmdir(const wchar_t *) function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

[Top]


wstat(const wchar_t *,struct stat *)

IMPORT_C int wstat(const wchar_t *name, struct stat *st);

Description

The wstat system call obtains information about the file pointed to by name. Read, write or execute permission of the named file is not required, but all directories listed in the path name leading to the file must be searchable.

The sb argument is a pointer to a stat structure as defined by #include <sys/stat.h> and into which information is placed concerning the file.

The fields of struct stat related to the file system are as follows: st_dev The numeric ID of the device containing the file. st_ino The file's inode number. st_nlink The number of hard links to the file.

The st_dev and st_ino fields together identify the file uniquely within the system.

The time-related fields of struct stat are as follows: st_atime TimeTime when file data last accessed. Changed by the .Xr utimes 2, read and readv system calls. st_mtime TimeTime when file data last modified. st_ctime TimeTime when file status was last changed (inode data modification). st_birthtime TimeTime when the inode was created.

If _POSIX_SOURCE is not defined, the time-related fields are defined as:

#ifndef _POSIX_SOURCE
#define st_atime st_atimespec.tv_sec
#define st_mtime st_mtimespec.tv_sec
#define st_ctime st_ctimespec.tv_sec
#endif

The size-related fields of the struct stat are as follows: st_size The file size in bytes. st_blksize The optimal I/O block size for the file. st_blocks The actual number of blocks allocated for the file in 512-byte units. As short symbolic links are stored in the inode, this number may be zero.

The access-related fields of struct stat are as follows: st_uid The user ID of the file's owner. st_gid The group ID of the file. st_mode Status of the file (see below).

The status information word st_mode has the following bits:

#define S_IFMT   0170000  // type of file 
#define S_IFIFO  0010000  // named pipe (fifo) 
#define S_IFCHR  0020000  // character special 
#define S_IFDIR  0040000  // directory 
#define S_IFBLK  0060000  // block special 
#define S_IFREG  0100000  // regular 
#define S_IFLNK  0120000  // symbolic link 
#define S_IFSOCK 0140000  // socket 
#define S_IFWHT  0160000  // whiteout 
#define S_ISUID  0004000  // set user id on execution 
#define S_ISGID  0002000  // set group id on execution 
#define S_ISVTX  0001000  // save swapped text even after use 
#define S_IRUSR  0000400  // read permission, owner 
#define S_IWUSR  0000200  // write permission, owner 
#define S_IXUSR  0000100  // execute/search permission, owner
For a list of access modes, see #include <sys/stat.h> The following macros are available 
  to test whether a st_mode value passed in the m argument corresponds to a file of the specified type: 
  S_ISBLK (m); Test for a block special file. 
  S_ISCHR (m); Test for a character special file. 
  S_ISDIR (m); Test for a directory. 
  S_ISFIFO (m); Test for a pipe or FIFO special file. 
  S_ISLNK (m); Test for a symbolic link. 
  
  NOTE: Inode structure is not supported by Symbian OS and hence link count updation is not possible.
Check for symbolic link would always fail because of this reason. 

S_ISREG (m); Test for a regular file. 
S_ISSOCK (m); Test for a socket. 
S_ISWHT (m); Test for a whiteout.

The macros evaluate to a non-zero value if the test is true or to the value 0 if the test is false.

 st_dev The numeric ID of the device containing the file.
 st_ino The file's inode number.
 st_nlink
  The number of hard links to the file.
 st_atime Time when file data last accessed.
 Changed by the .Xr utimes 2, read and readv system calls.
 st_mtime Time when file data last modified.
 st_ctime Time when file status was last changed (inode data modification).
 st_birthtime
  Time when the inode was created.
 st_size The file size in bytes.
 st_blksize
  The optimal I/O block size for the file.
 st_blocks The actual number of blocks allocated for the file in 512-byte units.
 As short symbolic links are stored in the inode, this number may
 be zero.
 st_uid The user ID of the file's owner.
 st_gid The group ID of the file.
 st_mode
  Status of the file (see below).
 Test for a block special file.
 Test for a character special file.
 Test for a directory.
 Test for a pipe or FIFO special file.
 Test for a symbolic link. NOTE: Inode structure is not supported by Symbian OS and hence link count updation is not possible.
 Check for symbolic link would always fail because of this reason.
 Test for a regular file.
 Test for a socket.
 Test for a whiteout.

Examples:

/* Detailed description: Sample usage of wstat system call
 Preconditions: Example.txt file should be present in working directory
 */
# 1 "d:/EPOC/epoc32/include/stdapis/fcntl.h" 1
/*-
 © Portions copyright (c) 2005 Nokia Corporation.  All rights reserved.
 © Portions copyright (c) 2006 Symbian Software Ltd. All rights reserved.
 Copyright (c) 1983, 1990, 1993
    The Regents of the University of California.  All rights reserved.
 (c) UNIX System Laboratories, Inc.
 All or some portions of this file are derived from material licensed
 to the University of California by American Telephone and Telegraph
 Co. or Unix System Laboratories, Inc. and are reproduced herein with
 the permission of UNIX System Laboratories, Inc.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of the University nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
 */
 



# 1 "d:/EPOC/epoc32/include/stdapis/sys/fcntl.h" 1
/*-
 © Portions copyright (c) 2005 Nokia Corporation.  All rights reserved.
 © Portions copyright (c) 2006-2007 Symbian Software Ltd. All rights reserved.
 Copyright (c) 1983, 1990, 1993
    The Regents of the University of California.  All rights reserved.
 (c) UNIX System Laboratories, Inc.
 All or some portions of this file are derived from material licensed
 to the University of California by American Telephone and Telegraph
 Co. or Unix System Laboratories, Inc. and are reproduced herein with
 the permission of UNIX System Laboratories, Inc.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of the University nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.

    @(#)fcntl.h 8.3 (Berkeley) 1/21/94
 $FreeBSD: src/sys/sys/fcntl.h,v 1.16 2004/04/07 04:19:49 imp Exp $
 */




/*
 This file includes the definitions for open and fcntl
 described by POSIX for <fcntl.h>; it also includes
 related kernel definitions.
 */

# 1 "d:/EPOC/epoc32/include/stdapis/sys/cdefs.h" 1
/*-
 © Portions copyright (c) 2005 Nokia Corporation.  All rights reserved. 
 Copyright (c) 1991, 1993
    The Regents of the University of California.  All rights reserved.

 This code is derived from software contributed to Berkeley by
 Berkeley Software Design, Inc.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of the University nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
 © Portions copyright (c) 2007-2008 Symbian Software Ltd. All rights reserved.
    @(#)cdefs.h 8.8 (Berkeley) 1/9/95
 $FreeBSD: src/sys/sys/cdefs.h,v 1.88.2.1 2005/10/09 07:48:48 netchild Exp $
 */


















































































































































































































































































































































































































































































































































 /* !_SYS_CDEFS_H_ */
# 49 "d:/EPOC/epoc32/include/stdapis/sys/fcntl.h" 2
# 1 "d:/EPOC/epoc32/include/stdapis/sys/_types.h" 1
/*-
 Copyright (c) 2002 Mike Barcroft <[email protected]>
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.

 $FreeBSD: src/sys/sys/_types.h,v 1.21 2005/03/22 01:19:17 das Exp $
 */




























































































 /* !_SYS__TYPES_H_ */
# 50 "d:/EPOC/epoc32/include/stdapis/sys/fcntl.h" 2
















/*
 File status flags: these are used by open(2), fcntl(2).
 They are also used (indirectly) in the kernel file structure f_flags,
 which is a superset of the open/fcntl flags.  Open flags and f_flags
 are inter-convertible using OFLAGS(fflags) and FFLAGS(oflags).
 Open/fcntl flags begin with O_; kernel-internal flags begin with F.
 */
/* open-only flags */
#define O_RDONLY/* open for reading only */
#define O_WRONLY/* open for writing only */
#define O_RDWR/* open for reading and writing */
#define O_ACCMODE/* mask for above modes */

/*
 Kernel encoding of open mode; separate read and write bits that are
 independently testable: 1 greater than the above.

 XXX
 FREAD and FWRITE are excluded from the #ifdef _KERNEL so that TIOCFLUSH,
 which was documented to use FREAD/FWRITE, continues to work.
 */

#define FREAD
#define FWRITE

#define O_NONBLOCK/* no delay */
#define O_APPEND/* set append mode */

#define O_SHLOCK/* open with shared file lock */
#define O_EXLOCK/* open with exclusive file lock */
#define O_ASYNC/* signal pgrp when data ready */
#define O_FSYNC/* synchronous writes */

#define O_SYNC/* POSIX synonym for O_FSYNC */

#define O_NOFOLLOW/* don't follow symlinks */

#define O_CREAT/* create if nonexistent */
#define O_TRUNC/* truncate to zero length */
#define O_EXCL/* error if already exists */




/* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */
#define O_NOCTTY/* don't assign controlling terminal */


/* Attempt to bypass buffer cache */
#define O_DIRECT


//Copied from MRT1.0 fcntl.h header
#define _FBUFFERED/* buffer at the interface to the file system */
#define _FBINARY
#define _FTEXT
#define O_BINARY
#define O_TEXT
#define O_BUFFERED

/*
 XXX missing O_DSYNC, O_RSYNC.
 */












/*
 The O_* flags used to have only F* names, which were used in the kernel
 and by fcntl.  We retain the F* names for the kernel f_flag field
 and for backward compatibility for fcntl.  These flags are deprecated.
 */

#define FAPPEND/* kernel/compat */
#define FASYNC/* kernel/compat */
#define FFSYNC/* kernel */
#define FNONBLOCK/* kernel */
#define FNDELAY/* compat */
#define O_NDELAY/* compat */


/*
 We are out of bits in f_flag (which is a short).  However,
 the flag bits not set in FMASK are only meaningful in the
 initial open syscall.  Those bits can thus be given a
 different meaning for fcntl(2).
 */


/*
 Set by shm_open(3) to get automatic MAP_ASYNC behavior
 for POSIX shared memory objects (which are otherwise
 implemented as plain files).
 */
#define FPOSIXSHM


/*SYMBIAN Flag for tmpfile removal*/

#define O_TMPFILE/* flag for cleanup of tmpfiles*/
//__SYMBIAN32__

/*
 Constants used for fcntl(2)
 */

/* command values */
#define F_DUPFD/* duplicate file descriptor */
#define F_GETFD/* get file descriptor flags */
#define F_SETFD/* set file descriptor flags */
#define F_GETFL/* get file status flags */
#define F_SETFL/* set file status flags */

#define F_GETOWN/* get SIGIO/SIGURG proc/pgrp */
#define F_SETOWN/* set SIGIO/SIGURG proc/pgrp */

#define F_GETLK/* get record locking information */
#define F_SETLK/* set record locking information */
#define F_SETLKW/* F_SETLK; wait if blocked */

/* file descriptor flags (F_GETFD, F_SETFD) */
#define FD_CLOEXEC/* close-on-exec flag */

/* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */
#define F_RDLCK/* shared or read lock */
#define F_UNLCK/* unlock */
#define F_WRLCK/* exclusive or write lock */






/*
 Advisory file segment locking data type -
 information passed to system by user
 */
struct flock {
    off_t   l_start; /* starting offset */
    off_t   l_len;       /* len = 0 means until end of file */
    pid_t   l_pid;       /* lock owner */
    short   l_type;      /* lock type: read/write, etc. */
    short   l_whence;    /* type of l_start */
};



/* lock operations for flock(2) */
#define LOCK_SH/* shared file lock */
#define LOCK_EX/* exclusive file lock */
#define LOCK_NB/* don't block when locking */
#define LOCK_UN/* unlock file */


/*
 XXX missing posix_fadvise() and posix_fallocate(), and POSIX_FADV_* macros.
 */


 1 
 IMPORT_C  int   open(const char *, int, ...);
 IMPORT_C  int   creat(const char *, mode_t);
 IMPORT_C  int   fcntl(int, int, ...);

int flock(int, int);

 1 


/* !_SYS_FCNTL_H_ */
# 40 "d:/EPOC/epoc32/include/stdapis/fcntl.h" 2

/* _FCNTL_H_ */
# 4425 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/unistd.h" 1
/*-
 © Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
 © Portions copyright (c) 2006 Symbian Software Ltd. All rights reserved.
 Copyright (c) 1991, 1993, 1994
    The Regents of the University of California.  All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of the University nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
 © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
    @(#)unistd.h    8.12 (Berkeley) 4/27/95
 $FreeBSD: src/include/unistd.h,v 1.78 2005/05/13 16:27:30 delphij Exp $
 */




//---

# 1 "d:/EPOC/epoc32/include/e32def.h" 1
/* e32\include\e32def.h

 Copyright (c) Symbian Software Ltd 1994-2005. All rights reserved.

 NOTE: THIS FILE SHOULD BE ACCEPTABLE TO A C COMPILER
 */














































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































 /* __E32DEF_H__ */
# 40 "d:/EPOC/epoc32/include/stdapis/unistd.h" 2

extern "C" {


//---

# 1 "d:/EPOC/epoc32/include/stdapis/sys/cdefs.h" 1
/*-
 © Portions copyright (c) 2005 Nokia Corporation.  All rights reserved. 
 Copyright (c) 1991, 1993
    The Regents of the University of California.  All rights reserved.

 This code is derived from software contributed to Berkeley by
 Berkeley Software Design, Inc.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of the University nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
 © Portions copyright (c) 2007-2008 Symbian Software Ltd. All rights reserved.
    @(#)cdefs.h 8.8 (Berkeley) 1/9/95
 $FreeBSD: src/sys/sys/cdefs.h,v 1.88.2.1 2005/10/09 07:48:48 netchild Exp $
 */


















































































































































































































































































































































































































































































































































 /* !_SYS_CDEFS_H_ */
# 47 "d:/EPOC/epoc32/include/stdapis/unistd.h" 2
# 1 "d:/EPOC/epoc32/include/stdapis/sys/types.h" 1
/*-
 © Portions copyright (c) 2005 Nokia Corporation.  All rights reserved.
 Copyright (c) 1982, 1986, 1991, 1993, 1994
    The Regents of the University of California.  All rights reserved.
 (c) UNIX System Laboratories, Inc.
 All or some portions of this file are derived from material licensed
 to the University of California by American Telephone and Telegraph
 Co. or Unix System Laboratories, Inc. and are reproduced herein with
 the permission of UNIX System Laboratories, Inc.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of the University nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.

    @(#)types.h 8.6 (Berkeley) 2/19/95
 $FreeBSD: src/sys/sys/types.h,v 1.92 2005/05/31 15:18:17 rodrigc Exp $
 */

























































































































































































































































































































 /* !_SYS_TYPES_H_ */
# 48 "d:/EPOC/epoc32/include/stdapis/unistd.h" 2           /* XXX adds too much pollution. */
# 1 "d:/EPOC/epoc32/include/stdapis/sys/unistd.h" 1
/*-
 Copyright (c) 1989, 1993
    The Regents of the University of California.  All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of the University nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
 © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
    @(#)unistd.h    8.2 (Berkeley) 1/7/94
 $FreeBSD: src/sys/sys/unistd.h,v 1.41 2005/01/07 02:29:24 imp Exp $
 */




# 1 "d:/EPOC/epoc32/include/stdapis/sys/cdefs.h" 1
/*-
 © Portions copyright (c) 2005 Nokia Corporation.  All rights reserved. 
 Copyright (c) 1991, 1993
    The Regents of the University of California.  All rights reserved.

 This code is derived from software contributed to Berkeley by
 Berkeley Software Design, Inc.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of the University nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
 © Portions copyright (c) 2007-2008 Symbian Software Ltd. All rights reserved.
    @(#)cdefs.h 8.8 (Berkeley) 1/9/95
 $FreeBSD: src/sys/sys/cdefs.h,v 1.88.2.1 2005/10/09 07:48:48 netchild Exp $
 */


















































































































































































































































































































































































































































































































































 /* !_SYS_CDEFS_H_ */
# 36 "d:/EPOC/epoc32/include/stdapis/sys/unistd.h" 2

/*
 POSIX options and option groups we unconditionally do or don't
 implement.  Those options which are implemented (or not) entirely
 in user mode are defined in <unistd.h>.  Please keep this list in
 alphabetical order.

 Anything which is defined as zero below **must** have an
 implementation for the corresponding sysconf() which is able to
 determine conclusively whether or not the feature is supported.
 Anything which is defined as other than -1 below **must** have
 complete headers, types, and function declarations as specified by
 the POSIX standard; however, if the relevant sysconf() function
 returns -1, the functions may be stubbed out.
 */
#define _POSIX_ADVISORY_INFO
#define _POSIX_ASYNCHRONOUS_IO
#define _POSIX_CHOWN_RESTRICTED
#define _POSIX_CLOCK_SELECTION
#define _POSIX_CPUTIME
#define _POSIX_FSYNC
#define _POSIX_IPV6
#define _POSIX_JOB_CONTROL
#define _POSIX_MAPPED_FILES
#define _POSIX_MEMLOCK
#define _POSIX_MEMLOCK_RANGE
#define _POSIX_MEMORY_PROTECTION
#define _POSIX_MESSAGE_PASSING
#define _POSIX_MONOTONIC_CLOCK
#define _POSIX_NO_TRUNC
#define _POSIX_PRIORITIZED_IO
#define _POSIX_PRIORITY_SCHEDULING
#define _POSIX_RAW_SOCKETS
#define _POSIX_REALTIME_SIGNALS
#define _POSIX_SEMAPHORES
#define _POSIX_SHARED_MEMORY_OBJECTS
#define _POSIX_SPORADIC_SERVER
#define _POSIX_SYNCHRONIZED_IO
#define _POSIX_TIMEOUTS
#define _POSIX_TYPED_MEMORY_OBJECTS
#define _POSIX_VDISABLE


#define _XOPEN_SHM
#define _XOPEN_STREAMS


/*
 Although we have saved user/group IDs, we do not use them in setuid
 as described in POSIX 1003.1, because the feature does not work for
 root.  We use the saved IDs in seteuid/setegid, which are not currently
 part of the POSIX 1003.1 specification.  XXX revisit for 1003.1-2001
 as this is now mandatory.
 */




/* Define the POSIX.1 version we target for compliance. */
#define _POSIX_VERSION

/* access function */
#define F_OK/* test for existence of file */
#define X_OK/* test for execute or search permission */
#define W_OK/* test for write permission */
#define R_OK/* test for read permission */

/* whence values for lseek(2) */







/* whence values for lseek(2); renamed by POSIX 1003.1 */
#define L_SET
#define L_INCR
#define L_XTND


/* configurable pathname variables */
#define _PC_LINK_MAX
#define _PC_MAX_CANON
#define _PC_MAX_INPUT
#define _PC_NAME_MAX
#define _PC_PATH_MAX
#define _PC_PIPE_BUF
#define _PC_CHOWN_RESTRICTED
#define _PC_NO_TRUNC
#define _PC_VDISABLE

/*
#if __POSIX_VISIBLE >= 199309
#define _PC_ASYNC_IO       53
#define _PC_PRIO_IO        54
#define _PC_SYNC_IO        55
#endif


#if __POSIX_VISIBLE >= 200112
#define _PC_ALLOC_SIZE_MIN 10
#define _PC_FILESIZEBITS   12
#define _PC_REC_INCR_XFER_SIZE 14
#define _PC_REC_MAX_XFER_SIZE  15
#define _PC_REC_MIN_XFER_SIZE  16
#define _PC_REC_XFER_ALIGN 17
#define _PC_SYMLINK_MAX        18
#endif

#if __BSD_VISIBLE
#define _PC_ACL_EXTENDED   59
#define _PC_ACL_PATH_MAX   60
#define _PC_CAP_PRESENT        61
#define _PC_INF_PRESENT        62
#define _PC_MAC_PRESENT        63
#endif
*/

/*
 rfork() options.

 XXX currently, some operations without RFPROC set are not supported.
 */
#define RFNAMEG/* UNIMPL new plan9 `name space' */
#define RFENVG/* UNIMPL copy plan9 `env space' */
#define RFFDG/* copy fd table */
#define RFNOTEG/* UNIMPL create new plan9 `note group' */
#define RFPROC/* change child (else changes curproc) */
#define RFMEM/* share `address space' */
#define RFNOWAIT/* give child to init */
#define RFCNAMEG/* UNIMPL zero plan9 `name space' */
#define RFCENVG/* UNIMPL zero plan9 `env space' */
#define RFCFDG/* close all fds, zero fd table */
#define RFTHREAD/* enable kernel thread support */
#define RFSIGSHARE/* share signal handlers */
#define RFLINUXTHPN/* do linux clone exit parent notification */
#define RFSTOPPED/* leave child in a stopped state */
#define RFHIGHPID/* use a pid higher then 10 (idleproc) */
#define RFPPWAIT/* parent sleeps until child exits (vfork) */
#define RFKERNELONLY

/* __BSD_VISIBLE */

/* !_SYS_UNISTD_H_ */
# 49 "d:/EPOC/epoc32/include/stdapis/unistd.h" 2
# 1 "d:/EPOC/epoc32/include/stdapis/sys/_null.h" 1
/*-
 Copyright (c) 2003 Marcel Moolenaar
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:

 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 $FreeBSD: src/sys/sys/_null.h,v 1.7 2005/01/07 02:29:23 imp Exp $
 */













# 50 "d:/EPOC/epoc32/include/stdapis/unistd.h" 2
# 1 "d:/EPOC/epoc32/include/stdapis/sys/_types.h" 1
/*-
 Copyright (c) 2002 Mike Barcroft <[email protected]>
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.

 $FreeBSD: src/sys/sys/_types.h,v 1.21 2005/03/22 01:19:17 das Exp $
 */




























































































 /* !_SYS__TYPES_H_ */
# 51 "d:/EPOC/epoc32/include/stdapis/unistd.h" 2


# 1 "d:/EPOC/epoc32/include/stdapis/_ansi.h" 1
/* _ANSI.H
 © Portions copyright (c) 2008 Nokia Corporation.  All rights reserved.
 Copyright (c) 1997-2008 Symbian Ltd.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without 
    modification, are permitted provided that the following conditions are met:
 Redistributions of source code must retain the above copyright notice, this 
  list of conditions and the following disclaimer. 
 Redistributions in binary form must reproduce the above copyright notice, 
  this list of conditions and the following disclaimer in the documentation 
  and/or other materials provided with the distribution. 
 Neither the name of the <ORGANIZATION> nor the names of its contributors 
  may be used to endorse or promote products derived from this software 
  without specific prior written permission. 
  
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ============================================================================
    
    */




 /* _ANSIDECL_H_ */
# 54 "d:/EPOC/epoc32/include/stdapis/unistd.h" 2
//__SYMBIAN32__


 1 
 IMPORT_C  char ***__environ(void);
 1 
#define environ
//__SYMBIAN32__




































#define STDIN_FILENO/* standard input file descriptor */
#define STDOUT_FILENO/* standard output file descriptor */
#define STDERR_FILENO/* standard error file descriptor */


#define F_ULOCK/* unlock locked section */
#define F_LOCK/* lock a section for exclusive use */
#define F_TLOCK/* test and lock a section for exclusive use */
#define F_TEST/* test a section for locks by other procs */


/*
 POSIX options and option groups we unconditionally do or don't
 implement.  This list includes those options which are exclusively
 implemented (or not) in user mode.  Please keep this list in
 alphabetical order.

 Anything which is defined as zero below **must** have an
 implementation for the corresponding sysconf() which is able to
 determine conclusively whether or not the feature is supported.
 Anything which is defined as other than -1 below **must** have
 complete headers, types, and function declarations as specified by
 the POSIX standard; however, if the relevant sysconf() function
 returns -1, the functions may be stubbed out.
 */
#define _POSIX_BARRIERS
#define _POSIX_READER_WRITER_LOCKS
#define _POSIX_REGEXP
#define _POSIX_SHELL
#define _POSIX_SPAWN
#define _POSIX_SPIN_LOCKS
#define _POSIX_THREAD_ATTR_STACKADDR
#define _POSIX_THREAD_ATTR_STACKSIZE
#define _POSIX_THREAD_CPUTIME
#define _POSIX_THREAD_PRIO_INHERIT
#define _POSIX_THREAD_PRIO_PROTECT
#define _POSIX_THREAD_PRIORITY_SCHEDULING
#define _POSIX_THREAD_PROCESS_SHARED
#define _POSIX_THREAD_SAFE_FUNCTIONS
#define _POSIX_THREAD_SPORADIC_SERVER
#define _POSIX_THREADS
#define _POSIX_TRACE
#define _POSIX_TRACE_EVENT_FILTER
#define _POSIX_TRACE_INHERIT
#define _POSIX_TRACE_LOG
#define _POSIX2_C_BIND/* mandatory */
#define _POSIX2_C_DEV/* need c99 utility */
#define _POSIX2_CHAR_TERM
#define _POSIX2_FORT_DEV/* need fort77 utility */
#define _POSIX2_FORT_RUN
#define _POSIX2_LOCALEDEF
#define _POSIX2_PBS
#define _POSIX2_PBS_ACCOUNTING
#define _POSIX2_PBS_CHECKPOINT
#define _POSIX2_PBS_LOCATE
#define _POSIX2_PBS_MESSAGE
#define _POSIX2_PBS_TRACK
#define _POSIX2_SW_DEV/* XXX ??? */
#define _POSIX2_UPE
#define _V6_ILP32_OFF32
#define _V6_ILP32_OFFBIG
#define _V6_LP64_OFF64
#define _V6_LPBIG_OFFBIG


#define _XOPEN_CRYPT/* XXX ??? */
#define _XOPEN_ENH_I18N/* mandatory in XSI */
#define _XOPEN_LEGACY
#define _XOPEN_REALTIME
#define _XOPEN_REALTIME_THREADS
#define _XOPEN_UNIX


/* Define the POSIX.2 version we target for compliance. */
#define _POSIX2_VERSION

/*
 POSIX-style system configuration variable accessors (for the
 sysconf function).  The kernel does not directly implement the
 sysconf() interface; rather, a C library stub translates references
 to sysconf() into calls to sysctl() using a giant switch statement.
 Those that are marked `user' are implemented entirely in the C
 library and never query the kernel.  pathconf() is implemented
 directly by the kernel so those are not defined here.
 */
#define _SC_ARG_MAX
#define _SC_CHILD_MAX
#define _SC_CLK_TCK
#define _SC_NGROUPS_MAX
#define _SC_OPEN_MAX
#define _SC_JOB_CONTROL
#define _SC_SAVED_IDS
#define _SC_VERSION
#define _SC_BC_BASE_MAX/* user */
#define _SC_BC_DIM_MAX/* user */
#define _SC_BC_SCALE_MAX/* user */
#define _SC_BC_STRING_MAX/* user */
#define _SC_COLL_WEIGHTS_MAX/* user */
#define _SC_EXPR_NEST_MAX/* user */
#define _SC_LINE_MAX/* user */
#define _SC_RE_DUP_MAX/* user */
#define _SC_2_VERSION/* user */
#define _SC_2_C_BIND/* user */
#define _SC_2_C_DEV/* user */
#define _SC_2_CHAR_TERM/* user */
#define _SC_2_FORT_DEV/* user */
#define _SC_2_FORT_RUN/* user */
#define _SC_2_LOCALEDEF/* user */
#define _SC_2_SW_DEV/* user */
#define _SC_2_UPE/* user */
#define _SC_STREAM_MAX/* user */
#define _SC_TZNAME_MAX/* user */


#define _SC_ASYNCHRONOUS_IO
#define _SC_MAPPED_FILES
#define _SC_MEMLOCK
#define _SC_MEMLOCK_RANGE
#define _SC_MEMORY_PROTECTION
#define _SC_MESSAGE_PASSING
#define _SC_PRIORITIZED_IO
#define _SC_PRIORITY_SCHEDULING
#define _SC_REALTIME_SIGNALS
#define _SC_SEMAPHORES
#define _SC_FSYNC
#define _SC_SHARED_MEMORY_OBJECTS
#define _SC_SYNCHRONIZED_IO
#define _SC_TIMERS
#define _SC_AIO_LISTIO_MAX
#define _SC_AIO_MAX
#define _SC_AIO_PRIO_DELTA_MAX
#define _SC_DELAYTIMER_MAX
#define _SC_MQ_OPEN_MAX
#define _SC_PAGESIZE
#define _SC_RTSIG_MAX
#define _SC_SEM_NSEMS_MAX
#define _SC_SEM_VALUE_MAX
#define _SC_SIGQUEUE_MAX
#define _SC_TIMER_MAX



#define _SC_2_PBS/* user */
#define _SC_2_PBS_ACCOUNTING/* user */
#define _SC_2_PBS_CHECKPOINT/* user */
#define _SC_2_PBS_LOCATE/* user */
#define _SC_2_PBS_MESSAGE/* user */
#define _SC_2_PBS_TRACK/* user */
#define _SC_ADVISORY_INFO
#define _SC_BARRIERS/* user */
#define _SC_CLOCK_SELECTION
#define _SC_CPUTIME
#define _SC_FILE_LOCKING
#define _SC_GETGR_R_SIZE_MAX/* user */
#define _SC_GETPW_R_SIZE_MAX/* user */
#define _SC_HOST_NAME_MAX
#define _SC_LOGIN_NAME_MAX
#define _SC_MONOTONIC_CLOCK
#define _SC_MQ_PRIO_MAX
#define _SC_READER_WRITER_LOCKS/* user */
#define _SC_REGEXP/* user */
#define _SC_SHELL/* user */
#define _SC_SPAWN/* user */
#define _SC_SPIN_LOCKS/* user */
#define _SC_SPORADIC_SERVER
#define _SC_THREAD_ATTR_STACKADDR/* user */
#define _SC_THREAD_ATTR_STACKSIZE/* user */
#define _SC_THREAD_CPUTIME/* user */
#define _SC_THREAD_DESTRUCTOR_ITERATIONS/* user */
#define _SC_THREAD_KEYS_MAX/* user */
#define _SC_THREAD_PRIO_INHERIT/* user */
#define _SC_THREAD_PRIO_PROTECT/* user */
#define _SC_THREAD_PRIORITY_SCHEDULING/* user */
#define _SC_THREAD_PROCESS_SHARED/* user */
#define _SC_THREAD_SAFE_FUNCTIONS/* user */
#define _SC_THREAD_SPORADIC_SERVER/* user */
#define _SC_THREAD_STACK_MIN/* user */
#define _SC_THREAD_THREADS_MAX/* user */
#define _SC_TIMEOUTS/* user */
#define _SC_THREADS/* user */
#define _SC_TRACE/* user */
#define _SC_TRACE_EVENT_FILTER/* user */
#define _SC_TRACE_INHERIT/* user */
#define _SC_TRACE_LOG/* user */
#define _SC_TTY_NAME_MAX/* user */
#define _SC_TYPED_MEMORY_OBJECTS
#define _SC_V6_ILP32_OFF32/* user */
#define _SC_V6_ILP32_OFFBIG/* user */
#define _SC_V6_LP64_OFF64/* user */
#define _SC_V6_LPBIG_OFFBIG/* user */
#define _SC_IPV6
#define _SC_RAW_SOCKETS
#define _SC_SYMLOOP_MAX



#define _SC_ATEXIT_MAX/* user */
#define _SC_IOV_MAX
#define _SC_PAGE_SIZE
#define _SC_XOPEN_CRYPT/* user */
#define _SC_XOPEN_ENH_I18N/* user */
#define _SC_XOPEN_LEGACY/* user */
#define _SC_XOPEN_REALTIME
#define _SC_XOPEN_REALTIME_THREADS
#define _SC_XOPEN_SHM
#define _SC_XOPEN_STREAMS
#define _SC_XOPEN_UNIX
#define _SC_XOPEN_VERSION
#define _SC_XOPEN_XCU_VERSION/* user */



#define _SC_NPROCESSORS_CONF
#define _SC_NPROCESSORS_ONLN


/* Keys for the confstr(3) function. */

#define _CS_PATH/* default value of PATH */



#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS
#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
#define _CS_POSIX_V6_ILP32_OFF32_LIBS
#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS
#define _CS_POSIX_V6_LP64_OFF64_CFLAGS
#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS
#define _CS_POSIX_V6_LP64_OFF64_LIBS
#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS


 1 
/* 1003.1-1990 */
 IMPORT_C  void   _exit(int)   ;
 IMPORT_C  int    access(const char *, int);
 IMPORT_C  int    chdir(const char *);
 IMPORT_C  int    chown(const char *, uid_t, gid_t);
 IMPORT_C  int    close(int);
 IMPORT_C  int    dup(int);
 IMPORT_C  int    dup2(int, int);
int  eaccess(const char *, int);
 IMPORT_C  long   fpathconf(int, int);
 IMPORT_C  char  *getcwd(char *, size_t);
 IMPORT_C  gid_t  getegid(void);
 IMPORT_C  uid_t  geteuid(void);
 IMPORT_C  gid_t  getgid(void);
 IMPORT_C  int    getgroups(int, gid_t []);
char    *getlogin(void);
 IMPORT_C  pid_t  getpgrp(void);
 IMPORT_C  pid_t  getpid(void);
 IMPORT_C  pid_t  getppid(void);
 IMPORT_C  uid_t  getuid(void);
 IMPORT_C  int    isatty(int);
 IMPORT_C  int    link(const char *, const char *);




 IMPORT_C  long   pathconf(const char *, int);
 IMPORT_C  int pipe(int *);
 IMPORT_C  ssize_t    read(int, void *, size_t);
 IMPORT_C  int    rmdir(const char *);
 IMPORT_C  int    setgid(gid_t);
 IMPORT_C  int    setpgid(pid_t, pid_t);
void     setproctitle(const char *_fmt, ...) ;
 IMPORT_C  pid_t  setsid(void);
 IMPORT_C  int    setuid(uid_t);
 IMPORT_C  unsigned int  sleep(unsigned int);
 IMPORT_C  
long     sysconf(int);
 IMPORT_C  int    unlink(const char *);
 IMPORT_C  ssize_t    write(int, const void *, size_t);
/* 1003.2-1992 */

 IMPORT_C  size_t     confstr(int, char *, size_t);


 IMPORT_C  int    getopt(int, char * const [], const char *);





 IMPORT_C  int *__optopt(void);
 IMPORT_C  int *__opterr(void);
 IMPORT_C  int *__optind(void);
 IMPORT_C  char **__optarg(void);
#define optopt
#define opterr
#define optind
#define optarg
/* __SYMBIAN32__ */

/* _GETOPT_DECLARED */


/* ISO/IEC 9945-1: 1996 */

 IMPORT_C  int    fsync(int);
 IMPORT_C  int fdatasync(int);
/*
 ftruncate() was in the POSIX Realtime Extension (it's used for shared
 memory), but truncate() was not.
 */










 //__SYMBIAN32__



/* 1003.1-2001 */

 IMPORT_C  int    readlink(const char *, char *, int);


 IMPORT_C  int    gethostname(char *, size_t);
 IMPORT_C  int    setegid(gid_t);
 IMPORT_C  int    seteuid(uid_t);


/*
 symlink() was originally in POSIX.1a, which was withdrawn after
 being overtaken by events (1003.1-2001).  It was in XPG4.2, and of
 course has been in BSD since 4.2.
 */

 IMPORT_C  int    symlink(const char *   , const char *   );


/* X/Open System Interfaces */

char    *crypt(const char *, const char *);
/* char    *ctermid(char *); */      /* XXX ??? */
int  encrypt(char *, int);
 IMPORT_C  int    fchdir(int);
 IMPORT_C  int    getpgid(pid_t _pid);
 IMPORT_C  int    lchown(const char *, uid_t, gid_t);
 IMPORT_C  int    nice(int);
 IMPORT_C  int    setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */
 IMPORT_C  int    setregid(gid_t, gid_t);
 IMPORT_C  int    setreuid(uid_t, uid_t);



 IMPORT_C  
void     swab(const void *   , void *   , ssize_t);
/* _SWAB_DECLARED */

void     sync(void);
 IMPORT_C  int    usleep(useconds_t);

/* See comment at ftruncate() above. */




/* __XSI_VISIBLE */


 IMPORT_C  int    brk(const void *);
 IMPORT_C  int    getdtablesize(void);
 IMPORT_C  int    getpagesize(void)   ;



struct timeval;                /* select(2) */
 IMPORT_C  int    initgroups(const char *, gid_t);
 IMPORT_C  int    issetugid(void);






int  mknod(const char *, mode_t, dev_t);

















#define _MKTEMP_DECLARED

int  nfssvc(int, void *);







 // __SYMBIAN32__
// __BSD_VISIBLE

 IMPORT_C  int    setgroups(int, const gid_t *);










 IMPORT_C  int *__optreset(void);
#define optreset
/* __SYMBIAN32__ */





 /* ifdef __SYMBIAN32__ */
/* ifndef __XSI_VISIBLE */

/* _OPTRESET_DECLARED */
/* __BSD_VISIBLE */
 1 

//---

}

//---

/* !_UNISTD_H_ */
# 4426 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/sys/types.h" 1
/*-
 © Portions copyright (c) 2005 Nokia Corporation.  All rights reserved.
 Copyright (c) 1982, 1986, 1991, 1993, 1994
    The Regents of the University of California.  All rights reserved.
 (c) UNIX System Laboratories, Inc.
 All or some portions of this file are derived from material licensed
 to the University of California by American Telephone and Telegraph
 Co. or Unix System Laboratories, Inc. and are reproduced herein with
 the permission of UNIX System Laboratories, Inc.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of the University nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.

    @(#)types.h 8.6 (Berkeley) 2/19/95
 $FreeBSD: src/sys/sys/types.h,v 1.92 2005/05/31 15:18:17 rodrigc Exp $
 */

























































































































































































































































































































 /* !_SYS_TYPES_H_ */
# 4427 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/sys/stat.h" 1
/*-
 Copyright (c) 1982, 1986, 1989, 1993
    The Regents of the University of California.  All rights reserved.
 (c) UNIX System Laboratories, Inc.
 All or some portions of this file are derived from material licensed
 to the University of California by American Telephone and Telegraph
 Co. or Unix System Laboratories, Inc. and are reproduced herein with
 the permission of UNIX System Laboratories, Inc.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of the University nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.
 © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
    @(#)stat.h  8.12 (Berkeley) 6/16/95
 $FreeBSD: src/sys/sys/stat.h,v 1.41 2005/03/22 01:19:18 das Exp $
 */





































































































































































































































































































 /* !_SYS_STAT_H_ */
# 4428 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/wchar.h" 1
/*-
 Copyright (c)1999 Citrus Project,
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.

 $FreeBSD: src/include/wchar.h,v 1.45 2004/08/12 12:19:10 tjr Exp $

 © Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
 © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
 */

/*-
 Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
 All rights reserved.

 This code is derived from software contributed to The NetBSD Foundation
 by Julian Coleman.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.
 4. Neither the name of The NetBSD Foundation nor the names of its
    contributors may be used to endorse or promote products derived
    from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.

    $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
 */








































































































































































































































































































 /* !_WCHAR_H_ */
# 4429 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
  struct stat buf;
   if(wstat(L"Example.txt"  , &buf;) < 0 )
   {
      printf("Failed to wstat Example.txt 
");
      return -1;
   }
   printf("wstat system call succeded 
");
   return 0;
 }

Output

wstat system call succeded

Parameters

const wchar_twchar_t *name

struct statstat *st

Return value

int

Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

See also:

[Top]


wsystem(const wchar_t *)

IMPORT_C int wsystem(const wchar_t *);

Description

The wsystem function spawns another process with the argument cmd. The calling process waits for the child process to finish executing.

If cmd is a NULL pointer, wsystem will return non-zero to indicate that wsystem is suporrted and zero if it is not supported.

Examples:

#include <stdlib.h>
#include <stdio.h> //printf
#include <wchar.h>
 
int main( void )
{
   int retVal = -1;
  
   printf( "Calling wsystem()...
" );
  
   /* helloworld.exe is an executable that just prints
 "Hello world!" and it should be created before
 executing this example code.
    */
   retVal = wsystem(L"c:\sys\bin\helloworld.exe");
   
   /* Print the return value of wsystem() */
   printf( "wsystem() returned: %d", retVal );
   
   return 0;
}

Output

Calling wsystem()...
wsystem() returned: -1

Parameters

const wchar_twchar_t *

Return value

int

The wsystem function returns the exit status of the child process as returned by process' exit reason or -1 if an error occurred when spawning a new process.

See also:

[Top]


wunlink(const wchar_t *)

IMPORT_C int wunlink(const wchar_t *);

Description

The wunlink system call removes the link named by _path from its file system.

Symbian OS simulates links so there is no reference count and files are unaware of links. Calling unlink on a file will always close the file, regardless of whether there is another link.

The _path argument may not be a directory.

Examples:

/*
 Detailed description: Example to wunlink a link file
 Precondition: A file by name "Link" should exist in
                c: drive.
*/
# 4542 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 4543 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main(void)
{
    if(wunlink(L"C:\Link"))
    {
         printf("wunlink on link file failed");
    }
    printf("wunlink on link file succeeded");
}

Output

wunlink on link file succeeded.

Parameters

const wchar_twchar_t *

Return value

int

Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno set to indicate the error.

See also:

[Top]


wpopen(const wchar_t *,const wchar_t *)

IMPORT_C FILE* wpopen(const wchar_t *command, const wchar_t *mode);

Description

The wpopen function opens a process by creating a pipe and invoking the shell (creating a process). Since a pipe is by definition unidirectional, The wmode argument may specify only reading or writing, not both; the resulting stream is correspondingly read-only ("r") or write-only "w". If type is anything other than this, then the behavior is undefined.

The command argument is a pointer to a null-terminated wide character string containing a shell command line. This command is passed to /bin/sh using the - c flag; interpretation, if any, is performed by the shell.

The return value from wpopen is a normal standard I/O stream in all respects save that it must be closed with pclose rather than fclose. Writing to such a stream writes to the standard input of the command; the command's standard output is the same as that of the process that called wpopen, unless this is altered by the command itself. Conversely, reading from a "wpopened" stream reads the command's standard output, and the command's standard input is the same as that of the process that called wpopen.

Note that output wpopen streams are fully buffered by default.

Bugs:

Since the standard input of a command opened for reading shares its seek offset with the process that called wpopen, if the original process has done a buffered read, the command's input position may not be as expected. Similarly, the output from a command opened for writing may become intermingled with that of the original process. The latter can be avoided by calling fflush before wpopen. Failure to execute the shell is indistinguishable from the shell's failure to execute command, or an immediate exit of the command. The only hint is an exit status of 127. The wpopen function always calls sh, never calls csh.

Parameters

const wchar_twchar_t *command

const wchar_twchar_t *mode

Return value

__sFILE__sFILE *

The wpopen function returns NULL if the fork or pipe calls fail, or if it cannot allocate memory. And returns stream pointer on success.

See also:

[Top]


wopen(const wchar_t *,int,...)

IMPORT_C int wopen(const wchar_t *, int,...);

Description

The wide character file-name specified by the wide character string file is opened for reading and/or writing as specified by the argument flags and the file descriptor returned to the calling process. The flags argument may indicate the file is to be created if it does not exist (by specifying the O_CREAT flag). In this case wopen requires a third argument mode_t mode , and the file is created with mode mode as described in chmod and modified by the process' umask value (see umask

The flags specified are formed by or 'ing the following values

 O_RDONLYopen for reading only
O_WRONLYopen for writing only
O_RDWRopen for reading and writing
O_APPENDappend on each write
O_CREATcreate file if it does not exist
O_TRUNCtruncate size to 0
O_EXCLerror if create and file exists

Opening a file with O_APPEND set causes each write on the file to be appended to the end. If O_TRUNC is specified and the file exists, the file is truncated to zero length. If O_EXCL is set with O_CREAT and the file already exists, wopen returns an error. This may be used to implement a simple exclusive access locking mechanism. If O_EXCL is set and the last component of the path is a symbolic link, wopen will fail even if the symbolic link points to a non-existent name.

If successful, wopen returns a non-negative integer, termed a file descriptor. It returns -1 on failure. The file pointer used to mark the current position within the file is set to the beginning of the file.

When a new file is created it is given the group of the directory which contains it.

The new descriptor is set to remain wopen across execve system calls; see close and fcntl .

The system imposes a limit on the number of file descriptors wopen simultaneously by one process. The getdtablesize system call returns the current system limit.

Notes:

1) Mode values for group and others are ignored

 2) Execute bit and setuid on exec bit are ignored.

 3) The default working directory of a process is initalized to C: \p rivate \U ID 
  (UID of the calling application) and any data written into this directory persists 
  between phone resets.

 4) If the specified file is a symbolic link and the file it is pointing to 
  is invalid, the symbolic link file will be automatically removed.

 5) A file in cannot be created with write-only permissions. Attempting to create 
  a file with write-only permissions will result in a file with read-write permission.

 6) Creating a new file with the O_CREAT flag does not alter the time stamp 
  of the parent directory.

 7) A file has only two time stamps: access and modification. Creation time 
  stamp of the file is not supported and access time stamp is initially set equal 
  to modification time stamp.

Examples:

/*This example creates a file in the current working directory and
 opens it in read-write mode.
 */
# 4717 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 4718 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 4719 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
  int fd = 0 ;
   fd = wopen(L"Example.txt" ,  0x0200  |  0x0800  , 0666) ;
   if(fd < 0 ) 
   {
      printf("Failed to create and wopen file in current working directory 
") ;
      return -1 ;
   }
   printf("File created and opened in current working directory 
"  ) ;
   return 0 ;
}

Output

File created and opened in current working directory

Parameters

const wchar_twchar_t *

int

...

Return value

int

If successful, wopen returns a non-negative integer, termed a file descriptor. It returns -1 on failure, and sets errno to indicate the error.

See also:

[Top]


wfopen(const wchar_t *,const wchar_t *)

IMPORT_C FILE* wfopen(const wchar_t *, const wchar_t *);

Description

 "r" Open text file for reading.
 The stream is positioned at the beginning of the file.
 "r+" Open for reading and writing.
 The stream is positioned at the beginning of the file.
 "w" Truncate to zero length or create text file for writing.
 The stream is positioned at the beginning of the file.
 "w+" Open for reading and writing.
 The file is created if it does not exist, otherwise it is truncated.
 The stream is positioned at the beginning of the file.
 "a" Open for writing.
 The file is created if it does not exist.
 The stream is positioned at the end of the file.
 Subsequent writes to the file will always end up at the then current
 end of file, irrespective of any intervening fseek or similar.
 "a+" Open for reading and writing.
 The file is created if it does not exist.
 The stream is positioned at the end of the file.
 Subsequent writes to the file will always end up at the then current
 end of file, irrespective of any intervening fseek or similar.

The mode string can also include the letter "b" either as a third character or as a character between the characters in any of the two-character strings described above. This is strictly for compatibility with -isoC and has no effect; the "b" is ignored.

Reads and writes may be intermixed on read/write streams in any order, and do not require an intermediate seek as in previous versions of stdio. This is not portable to other systems, however; ANSI C requires that a file positioning function intervene between output and input, unless an input operation encounters end-of-file.

Examples:

/* this program shows opening  in write mode,write data and close */
/* again open in append mode and write data */
/* Check file c:\wfopen.txt */
# 4807 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main(void)
        {
        FILE *fp;       
        wchar_t* name = L"c:\wfopen.txt";
        if ((fp = wfopen (name, L"wb")) ==  0 )
                {
                printf("Error creating file");
                return -1;
                }
        printf("Opened file 
");
        fprintf(fp, "This is the first line
");
        printf("Wrote to file
");
        fclose (fp);
        printf("Closed file
");
        if ((fp = wfopen (name, L"a")) ==  0 )
                {
                printf("Error opening file");
                return -1;
                }
        printf("Opened file for appending
");
        fprintf(fp, "This is the second line
");
        fclose (fp);
        printf("closed file, check output in c:\ wfopen.txt file
");
        wunlink(name);
        return 0;
}

Output

Opened file
Wrote to file
Closed file
Opened file for appending
closed file, check output in c:\ wfopen.txt file

Errors:

[ 22 ] The mode argument to wfopen, was invalid. The wfopen, functions may also fail and set (*__errno()) for any of the errors specified for the routine malloc. The wfopen function may also fail and set (*__errno()) for any of the errors specified for the routine wopen.

Note:

 1) Mode values for group and others will be ignored for file creation,execute bit and setuid on exec bit on an file don't have any effect while file creation.
 Default working directory of a process is initialized to C:\private\UID (UID of the calling application) and any data written into this directory persists between phone resets. 

 2) If the specified file is a symbolic link and the file it is pointing to 
 is invalid the symbolic link file will be automatically removed.

Limitations:

A file in cannot be created with write-only permission and attempting to create one will result in a file with read-write permission. Creating a new file with the 0x0200 flag does not alter the time stamp of its parent directory. The newly created entry has only two time stamps: access and modification. Creation time stamp is not supported and access time stamp is initially equal to modification time stamp. open, fclose and fflush.

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

Return value

__sFILE__sFILE *

Upon successful completion wfopen returns a FILE pointer. Otherwise, NULL is returned and the global variable errno is set to indicate the error.

See also:

[Top]


wrename(const wchar_t *,const wchar_t *)

IMPORT_C int wrename(const wchar_t *oldpath, const wchar_t *newpath);

Description

The wrename system call causes the link with the wide character name oldpath to be renamed with the wide character name newpath. If newpath exists, it is first removed. Both oldpath and newpath must be of the same type (that is, both directories or both non-directories), and must reside on the same file system.

If the final component of from is a symbolic link the symbolic link is renamed, not the file or directory to which it points.

If a file with a symbolic link pointing to it is renamed, then a subsequent open call on the symbolic link file would automatically remove the link file, i.e consider a symbolic file link.x pointing to a file abc.x. If the file abc.x is renamed to abcd.x then, a subsequent open call on link.x file would automatically remove link.x file.

Notes:

wrename fails if from and to are files and are in use (i.e. if any either of the files is open).

Parent directory time stamps are uneffected.

The new entry has only two time stamps: modification and access. The access time stamp is initially equal to modification time stamp.

Examples:

/* Detailed description  : This sample code demonstrates usage of wrename system call.
 Preconditions : Example.cfg file should be present in the current working directory.
 */
# 4928 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 4929 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
  if(wrename(L"Example.txt" , L"Example2.txt") < 0 )  {
     printf("Failed to wrename Example.txt
");
     return -1;
  }
  printf("wrename successful 
");
  return 0;
}

Output:

wrename successful

Errors:

The wrename system call will fail and neither of the argument files will be affected if: [ 22 ] Invalid argument. [ 63 ] A component of a path exceeded 255 characters. [ 2 ] The named file does not exist. [ 13 ] Search permission is denied for a component of the path prefix. [ 13 ] The from argument is a parent directory of to, or an attempt is made to wrename ‘.’ or ‘..’.

Parameters

const wchar_twchar_t *oldpath

const wchar_twchar_t *newpath

Return value

int

The wrename(const wchar_t *,const wchar_t *)wrename(const wchar_t *,const wchar_t *) function returns the value 0 if successful; otherwise it returns -1 and sets the global variable errno to indicate the error.

See also:

[Top]


wchdir(const wchar_t *)

IMPORT_C int wchdir(const wchar_t *_path);

Description

The _path argument points to the pathname of a directory which is a wide character string. The wchdir system call causes the named directory to become the current working directory, that is, the starting point for _path searches of pathnames not beginning with a slash, '/.'

Examples:

#include<wchar.h>                       /* wmkdir, wrmdir */
# 4995 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2                   /* S_IRWXU */
# 4996 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2                      /* printf */
int main()
{
        int ret_wmkdir = wmkdir(L"dirName",  0000700 );                   /* create directory */
        if(ret_wmkdir < 0)
                {
                printf("error creating directory");
                return -1;
                }
        else
                {
                int ret_wchdir = wchdir(L"dirName");                    /* change directory */
                if(ret_wchdir < 0)
                        {
                        printf("error changing directory");
                        return -1;
                        }
                else
                        {
                        printf("working directory changed");
                        }
                        wrmdir(L"dirname");                             /* remove directory */                  
                }
        return 0;                       
}

Output

working directory changed

Parameters

const wchar_twchar_t *_path

Return value

int

Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

See also:

[Top]


wchmod(const wchar_t *,mode_t)

IMPORT_C int wchmod(const wchar_t *_path, mode_t _mode);

Description

The file permission bits of the wide character file-name specified by _path are changed to _mode. The wchmod system call verifies that the process owner (user) either owns the file specified by _path is the super-user. A mode is created from or’d permission bit masks defined in #include <sys/stat.h>:

#define S_IRWXU 0000700    // RWX mask for owner
#define S_IRUSR 0000400    // R for owner 
#define S_IWUSR 0000200    // W for owner 
#define S_IXUSR 0000100    // X for owner 
#define S_IRWXG 0000070    // RWX mask for group 
#define S_IRGRP 0000040    // R for group 
#define S_IWGRP 0000020    // W for group 
#define S_IXGRP 0000010    // X for group 
#define S_IRWXO 0000007    // RWX mask for other 
#define S_IROTH 0000004    // R for other 
#define S_IWOTH 0000002    // W for other 
#define S_IXOTH 0000001    // X for other 
#define S_ISUID 0004000    // set user id on execution 
#define S_ISGID 0002000    // set group id on execution 
#ifndef __BSD_VISIBLE
#define S_ISTXT 0001000    // sticky bit 
#endif

Note : sticky bit and setuid on exec bit are not supported, permission values for users is considered while premissions values for group and others are ignored(As there is no concept of group and others). An attempt to change file permission to write-only changes the file permission to read-write. Permissions for directory will be ignored.

Examples:

#include <wchar.h>              /* wchmode, wfopen */
# 5077 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2           /* S_IWUSR */
# 5078 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2              /* printf */
int main()
{
        FILE * wfp = wfopen(L"fileName.txt", L"wb");            /* create file */
        if(wfp)
                {
                fclose(wfp);                                    /* close file */
                int ret = wchmod(L"fileName",  0000200 );         /* change mode */
                if(ret < 0)
                        {
                        printf("error changing mode");
                        return -1;
                        }
                else
                        {
                        printf("mode changed");
                        }
                }
        else
        {
        printf("error creating file");
        return -1;
        }
        return 0;
}

Output

mode changed

Parameters

const wchar_twchar_t *_path

mode_tmode_t _mode

Return value

int

Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

See also:

[Top]


wgetcwd(wchar_t *,size_t)

IMPORT_C wchar_t* wgetcwd(wchar_t *_buf, size_t _size);

Description

The wgetcwd function copies the absolute pathname of the current working directory into the memory referenced by _buf which is a wchar_t pointer and returns a pointer to _buf. The size argument is the _size, in bytes, of the array referenced by _buf.

If _buf is NULL, space is allocated as indicated by size to store the pathname and the current working directory is returned as long as the _size bytes are sufficient to hold the working directory name. This space may later be free'd.

This routine has traditionally been used by programs to save the name of a working directory for the purpose of returning to it. A much faster and less error-prone method of accomplishing this is to open the current directory ('.') and use the fchdir function to return.

Examples:

#include<wchar.h>
#include<stdio.h>
#include <stdlib.h>
#define BUF_SIZE 100
  
int main()
{
 int c;                 
 long size = BUF_SIZE;
 wchar_t *buf = NULL;
 wchar_t *ptr = NULL;
  
 c = wchdir("c:\");            /* change directory to c: */
  
 buf = (wchar_t *)malloc((size_t)size);
  
 if (buf !=  0  && c == 0)
        {
        ptr = wgetcwd(buf, (size_t)size);               /* call wgetcwd to fetch the current directory */
        printf("wgetcwd returned: %s
", ptr);
        }
 free(buf);
 return 0;
}

Output

wgetcwd returned: c:\

Notes:

The wgetcwd function returns the default working directory as c:\private\XXXXXXXX (where XXXXXXXX is the UID of the process) as the default session path is initialised to c:\private\current_process'_UID in Symbian OS.

Parameters

wchar_twchar_t *_buf

size_tsize_t _size

Return value

wchar_twchar_t *

Upon successful completion, a pointer to the pathname is returned. Otherwise a NULL pointer is returned and the global variable errno is set to indicate the error. In addition, wgetcwd copies the error message associated with errno into the memory referenced by _buf.

See also:

[Top]


wmkdir(const wchar_t *,mode_t)

IMPORT_C int wmkdir(const wchar_t *_path, mode_t _mode);

Description

The directory with the wide character name _path is created with the access permissions specified by _mode.

Notes:

mode is ignored.

Parent directory time stamps are not updated.

Examples:

#include <sys/stat.h>
#include <wchar.h>
#include <stdio.h>
int main()
{
  if(wmkdir(L"Example" , 0666) < 0 )  
  {
      printf("Directory creation failed 
");
      return -1;
  }
  printf("Directory Example created 
");
  return 0;
}

Output

Directory Example created

Parameters

const wchar_twchar_t *_path

mode_tmode_t _mode

Return value

int

The wmkdir(const wchar_t *,mode_t)wmkdir(const wchar_t *,mode_t) function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

See also:

[Top]


wclosedir(WDIR *)

IMPORT_C int wclosedir(WDIR *dp);

Description

The wclosedir function closes the named directory stream and frees the structure associated with the dirp pointer.

Examples:

/* Detailed description: This test code demonstrates usage of wclose  system call.*
 Preconditions: Expects Test directory to be present in current working directory.
 */
# 5269 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 5270 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
  WDIR *DirHandle;
  if(!(DirHandle = wopendir(L"Test") ) )
  {
     printf("Failed to open directoy Test 
");
     return -1;
  }
  if(wclosedir(DirHandle) < 0 ) 
  {
     printf("Close dir failed 
");
     return -1;
  }
  printf("Directory Test closed 
");
  return 0;
}

Output

Directory Test closed

Parameters

__EPOC32_WDIR *dp

Return value

int

The wclosedir function returns 0 on success and on failure -1 is returned and the global variable errno is set to indicate the error..

See also:

[Top]


wreaddir(WDIR *)

IMPORT_C struct wdirent* wreaddir(WDIR *dp);

Description

The wreaddir function returns a wdirent pointer to the next directory entry. It returns NULL upon reaching the end of the directory or detecting an invalid wreaddir operation on the directory stream. The new position reverts to the one associated with the directory stream when the wtelldir operation was performed.

Note: wreaddir operates on a static directory structure created by wopendir . Asynchronous operations on the directory itself will not be reflected in calls to wreaddir .

Examples:

 /* Detailed description: Sample usage of wreaddir call
 Preconditions:  Example Directory should be present in current working directory and should contain atleast one file/directory.
  */
# 5334 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 5335 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 5336 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
  WDIR *dirName;
  struct wdirent *Dir;
  dirName = wopendir(L"Example");
  if(dirName ==  0  )  {
     printf("Failed to open directory 
");
     return -1;
  }
  if(!(Dir = wreaddir(dirName))  )  {
    printf("Read dir failed  
");
    return -1;
  }
 printf("Directory Example read 
");
 wclosedir(dirName);
 return 0;
}

Output

Directory Example read

Parameters

__EPOC32_WDIR *dp

Return value

struct wdirentwdirent *

The wreaddir function returns a pointer to a wdirent structure, or NULL if an error occurs or end-of-file is reached.

See also:

[Top]


wrewinddir(WDIR *)

IMPORT_C void wrewinddir(WDIR *dp);

Description

The wrewinddir function function resets the position of the named directory stream pointed by 'dirp' to the beginning of the directory.

Examples:

 /* Detailed description: Sample usage of wreaddir call
 Preconditions:  Example Directory should be present in current working directory and should contain say 4 files/directories.
  */
# 5406 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 5407 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 5408 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
  WDIR *dirName;
  off_t offset;
  struct wdirent *Dir;
  dirName = wopendir(L"Example");
  if(dirName ==  0  )  {
     printf("Failed to open directory 
");
     return -1;
  }
  wseekdir(dirName, 3)
  if((offset = wtelldir(dirName))!= 3)  {
    printf("failed  
");
    return -1;
  }
  wrewindir(dirName);
  if((offset = wtelldir(dirName))!= 0)  {
    printf("failed  
");
    return -1;
  }
 printf("Successful
");
 wclosedir(dirName);
 return 0;
}

Output

Successful

Parameters

__EPOC32_WDIR *dp

See also:

[Top]


waccess(const wchar_t *,int)

IMPORT_C int waccess(const wchar_t *fn, int flags);

Description

The waccess system call checks the accessibility of the file named by the fn argument for the access permissions indicated by the flags argument. The value of flags is either the bitwise-inclusive OR of the access permissions to be checked (R_OK for read permission, W_OK for write permission, and X_OK for execute/search permission), or the existence test ( F_OK. )

For additional information, see the File access Permission section of intro . X_OK, the file may not actually have execute permission bits set. Likewise for R_OK and W_OK.

Note that as execute-bit for files is not supported waccess system call for X_OK is undefined.

Examples:

/* Detailed description: This sample code checks read-ok accessibility of file Example.c
 Precondtions: Example.txt file should be present in working directory.
 */
# 5485 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 5486 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
  if(waccess("Example.c" , 0x04 )  < 0)  
  {
    printf("Read operation on the file is not permitted 
") ;
    return -1 ;
  }
  printf("Read operation permitted on Example.c file 
") ;
  return 0 ;
}

Output

Read operation permitted on Example.c file

Parameters

const wchar_twchar_t *fn

int flags

Return value

int

Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

See also:

[Top]


wcreat(const wchar_t *,mode_t)

IMPORT_C int wcreat(const wchar_t *file, mode_t mode);

Description

This interface is made obsolete by: wopen

The wcreat function is the same as: wopen(path, O_CREAT | O_TRUNC | O_WRONLY, mode);

Notes:

Creating a new file doesn't alter the time stamp of the parent directory.

The newly created entry has two time stamps: access and modification. Both are initially the same.

Symbian OS does not support a creation time stamp.

Examples:

/*
 Detailed description   : This test code demonstrates wcreat api usage, it creates a
 in current working directory(if file exists then it is truncated.
 *Preconditions : None
 */
# 5548 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 5549 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 5550 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 5551 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
 int fd = 0;
  fd = wcreat(L"Example.txt" , 0666);
  if(fd < 0 )  
  {
    printf("File creation failed 
");
    return -1;
  }
  printf("Example.txt file created 
");
  return 0;
}

Output

Example.txt file created

Parameters

const wchar_twchar_t *file

mode_tmode_t mode

Return value

int

wopen and wcreat return the new file descriptor, or -1 if an error occurred (in which case errno is set appropriately).

See also:

[Top]


wseekdir(WDIR *,off_t)

IMPORT_C void wseekdir(WDIR *dp, off_t index);

Description

Parameters

__EPOC32_WDIR *dp

off_toff_t index

Refer to wtelldir(const WDIR *)wtelldir(const WDIR *) for the documentation

See also:

[Top]


wtelldir(const WDIR *)

IMPORT_C off_t wtelldir(const WDIR *dp);

Description

The wtelldir function returns the current location associated with the named directory stream . Values returned by wtelldir are good only for the lifetime of the DIR pointer, dirp , from which they are derived. If the directory is closed and then reopened, prior values returned by wtelldir will no longer be valid.

The wseekdir function sets the position of the next wreaddir operation on the directory stream . The new position reverts to the one associated with the directory stream when the wtelldir operation was performed.

Examples:

#include <dirent.h>
#include<wchar.h>
#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
void  wTest()
    {
      //declare the variables for dir pointer and dir position.
      wchar_t *dirName  =L"c: est_wseekdir";
      off_t dirpos;
        // Open the directory
        WDIR *dirp = wopendir (dirName);
        
        if(dirp != NULL)
        {
                //read the directory.
                wreaddir(dirp);
                wreaddir(dirp);
                //get the dirp pointer position by calling telldir API.
                dirpos = wtelldir(dirp);
                //print the position of the dirp pointer.
                printf("dirp is pointing at position %ld.",dirpos);
                
                wseekdir(dirp , 0) ;
                wreaddir(dirp);
                dirpos = wtelldir(dirp);
                //print the position of the dirp pointer.
                printf("dirp is pointing at position %ld.",dirpos);
        }
    }

Output

Dirp is pointing at position 2.
Dirp is pointing at position 1.

Parameters

const __EPOC32_WDIR *dp

Note: This description also covers the following functions - wseekdir(WDIR *,off_t)wseekdir(WDIR *,off_t)

Return value

off_toff_t

wtelldir function returns current location associated with the named directory stream on success or -1 on failure.

See also:

[Top]


wopendir(const wchar_t *)

Interface status: externallyDefinedApi

IMPORT_C WDIR* wopendir(const wchar_t *_path);

Description

The wopendir function opens the directory given by the wide-character name _wpath, associates a directory stream with it and positions it at the first entry and returns a pointer to be used to identify the directory stream in subsequent operations. The pointer NULL is returned if _wpath cannot be accessed, or if it cannot malloc enough memory to hold the whole thing.

Examples:

/* Detailed description: This test code demonstrates usage of wopendir system call, open directory wide name "test".
 Preconditions: Expects "test" directory to be present in the current working directory.
 */
# 6370 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 6371 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 6372 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
  WDIR *WDirHandle;
  if(!(WDirHandle = wopendir(L"test") ) ) 
  {
     printf("Failed to open directory test
");
     return -1;
  }
  printf("Directory test opened 
");
  wclosedir(WDirHandle);
  return 0;
}

Output

Directory test opened

Parameters

const wchar_twchar_t *_path

Return value

__EPOC32_WDIR *

The wopendir function returns a pointer to the directory stream or NULL if an error occurred.

See also:

[Top]


wcsupr(wchar_t *)

IMPORT_C wchar_t* wcsupr(wchar_t *wcs);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wcsupr API */
int example_wcsupr(void)

  /* input string which needs to be converted to upper-case */
  wchar_t src[9]=L"testcase";
 
  /* expected result string */
  wchar_t *exp=L"TESTCASE";
 
  wchar_t *res =  0 ;
    
  /* function call to convert the src to upper-case */
  res = wcsupr(src);
  /* compare res string with exp string, if they are equal then return 0, else return -1 */
  if( res !=  0  && !wcscmp(res,exp))
        return 0;
  else
        return -1;
}

Parameters

wchar_twchar_t *wcs

The wcsupr(wchar_t *)wcsupr(wchar_t *) function converts each letter from the wide-character string wcs to upper-case. The conversion is determined by the LC_CTYPE category setting of the locale. Other characters are not affected. It returns a pointer to the altered string. Because the modification is done in place, the pointer returned is the same as the pointer passed as the input argument.

Return value

wchar_twchar_t *

The wcsupr(wchar_t *)wcsupr(wchar_t *) returns a pointer to the altered string, on successful conversion of wcs, else it returns NULL pointer.

See also:

[Top]


wcslwr(wchar_t *)

IMPORT_C wchar_t* wcslwr(wchar_t *wcs);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wcslwr API */
int example_wcslwr(void)

  /* input string which needs to be converted to lower-case */
  wchar_t src[9]=L"TESTCASE";
 
  /* expected result string */
  wchar_t *exp=L"testcase";
 
  wchar_t *res =  0 ;
    
  /* function call to convert the src to lower-case */
  res = wcslwr(src);
  /* compare res string with exp string, if they are equal then return 0, else return -1 */
  if( res !=  0  && !wcscmp(res,exp))
        return 0;
  else
        return -1;
}

Parameters

wchar_twchar_t *wcs

The wcslwr(wchar_t *)wcslwr(wchar_t *) function converts each letter from the wide-character string wcs to lower-case. The conversion is determined by the LC_CTYPE category setting of the locale. Other characters are not affected. It returns a pointer to the altered string. Because the modification is done in place, the pointer returned is the same as the pointer passed as the input argument.

Return value

wchar_twchar_t *

The wcslwr(wchar_t *)wcslwr(wchar_t *) returns a pointer to the altered string, on successful conversion of wcs, else it returns NULL pointer.

See also:

[Top]


wcsset(wchar_t *,wchar_t)

IMPORT_C wchar_t* wcsset(wchar_t *wcs, wchar_t wc);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wcsset API */
int example_wcsset(void)

  /* input string which needs to be set to the character specified by wc. */
  wchar_t wcs[9]=L"kohinoor";
  wcgar_t wc = L'K';
 
  /* expected result string */
  wchar_t *exp=L"KKKKKKKK";
 
  wchar_t *res =  0 ;
    
  /* function call to set all the chars in wcs to wc*/
  res = wcsset(wcs, wc);
  /* compare res string with exp string, if they are equal then return 0, else return -1 */
  if( res !=  0  && !wcscmp(res,exp))
        return 0;
  else
        return -1;
}

Parameters

wchar_twchar_t *wcs

wchar_twchar_t wc

The wcsset(wchar_t *,wchar_t)wcsset(wchar_t *,wchar_t) function sets all the characters of the wide-character string wcs to the wide-character specified by wc, except the terminating null character. It returns a pointer to the altered string, which is same as the source string passed to wcsset as it is modified in place.

Return value

wchar_twchar_t *

The wcsset(wchar_t *,wchar_t)wcsset(wchar_t *,wchar_t) returns a pointer to the altered string, on success, else it returns NULL pointer.

[Top]


wcsnset(wchar_t *,wchar_t,size_t)

IMPORT_C wchar_t* wcsnset(wchar_t *wcs, wchar_t wc, size_t maxSize);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wcsnset API */
int example_wcsnset(void)

  /* input string which needs to be set to the character specified by wc. */
  wchar_t wcs[9]=L"kohinoor";
  wcgar_t wc = L'K';
  int n = 3;
 
  /* expected result string */
  wchar_t *exp=L"KKKinoor";
 
  wchar_t *res =  0 ;
    
  /* function call to set first n chars in wcs to wc*/
  res = wcsnset(wcs, wc, n);
  /* compare res string with exp string, if they are equal then return 0, else return -1 */
  if( res !=  0  && !wcscmp(res,exp))
        return 0;
  else
        return -1;
}

Parameters

wchar_twchar_t *wcs

wchar_twchar_t wc

size_tsize_t maxSize

The wcsnset(wchar_t *,wchar_t,size_t)wcsnset(wchar_t *,wchar_t,size_t) function sets first maxSize characters of the wide-character string wcs to the wide-character specified by wc. If maxSize is greater than the length of wcs, then length of wcs is used instead of maxSize. It returns a pointer to the altered string, which is same as the source string passed to wcsnset as it is modified in place.

Return value

wchar_twchar_t *

The wcsnset(wchar_t *,wchar_t,size_t)wcsnset(wchar_t *,wchar_t,size_t) returns a pointer to the altered string, on success, else it returns NULL pointer.

[Top]


wcsrev(wchar_t *)

IMPORT_C wchar_t* wcsrev(wchar_t *wcs);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wcsrev API */
int example_wcsrev(void)

  /* input string which needs to be reverted. */
  wchar_t src[9]=L"kohinoor";
 
  /* expected result string */
  wchar_t *exp=L"roonihok";
 
  wchar_t *res =  0 ;
    
  /* function call to revert the src */
  res = wcsrev(src);
  /* compare res string with exp string, if they are equal then return 0, else return -1 */
  if( res !=  0  && !wcscmp(res,exp))
        return 0;
  else
        return -1;
}

Parameters

wchar_twchar_t *wcs

The wcsrev(wchar_t *)wcsrev(wchar_t *) function reverses the order of the characters in the wide-character string wcs. The terminating null character remains in place.The arguments and return value of wcsrev are wide-character strings; It returns a pointer to the altered string. the pointer returned is the same as the pointer passed as the input argument.

Return value

wchar_twchar_t *

The wcsrev(wchar_t *)wcsrev(wchar_t *) returns a pointer to the reverted string, on success, else it returns NULL pointer.

[Top]


wcsicmp(const wchar_t *,const wchar_t *)

IMPORT_C int wcsicmp(const wchar_t *wcs1, const wchar_t *wcs2);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wcsicmp API */
int example_wcsicmp(void)

  /* input strings which needs to be compared */
  wchar_t *ws1=L"testcasecmp";
  wchar_t *ws2=L"TESTCASECMP";
    
  /* function call to compare the two strings which */
  /* differ in case */
  int retval = wcsicmp(ws1,ws2);
  /* returns 0 if they are equal or > 1 */
  /* if first string is greater than second string else -1 */
  return retval;
}

Parameters

const wchar_twchar_t *wcs1

const wchar_twchar_t *wcs2

The wcsicmp(const wchar_t *,const wchar_t *)wcsicmp(const wchar_t *,const wchar_t *) function compares the two null-terminated wide-character strings wcs1 and wcs2, by converting them into lower-case. It returns an integer value indicating the status of the comparision.

Return value

int

The wcsicmp(const wchar_t *,const wchar_t *)wcsicmp(const wchar_t *,const wchar_t *) returns an integer greater than, equal to, or less than 0, according as wcs1 is lexicographically greater than, equal to, or less than wcs2 after translation of each corresponding character to lower-case. The strings themselves are not modified.

See also:

[Top]


wstrdate(const wchar_t *)

IMPORT_C wchar_t* wstrdate(const wchar_t *dateStr);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wstrdate API */
int example_wstrdate(void)

  /* input string which is updated with the system date. */
  wchar_t datestr[20];
 
  wchar_t *res =  0 ;
    
  /* function call to get the system date in wide-char format */
  res = wstrdate(datestr);
  if( !res && !datestr)
  {
        printf(" res - %s and datestr - %s",res, datestr);
        return 0;
  }
  else
        return -1;
}

Output

 res - 21/11/2006 and datestr - 21/11/2006

Errors:

The wstrdate function will fail if: [ 14 ] The supplied argument datestr is invalid.

Parameters

const wchar_twchar_t *dateStr

The wstrdate(const wchar_t *)wstrdate(const wchar_t *) function gets the system date and converts it into wide-character string. This copies the current system date into the string pointed by datestr in the format dd/mm/yyyy, the datestr buffer must be atleast 11 bytes long. It returns a pointer to the datestr string. Because the modification is done in place, the pointer returned is the same as the pointer passed as the input argument.

Return value

wchar_twchar_t *

The wstrdate(const wchar_t *)wstrdate(const wchar_t *) returns a pointer to the date string on succes, otherwise it returns a NULL pointer and sets the errno accordingly.

See also:

[Top]


wstrtime(const wchar_t *)

IMPORT_C wchar_t* wstrtime(const wchar_t *timeStr);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wstrtime API */
int example_wstrtime(void)

  /* input string which is updated with the system time. */
  wchar_t timestr[20];
 
  wchar_t *res =  0 ;
    
  /* function call to get the system time in wide-char format */
  res = wstrtime(timestr);
  if( !res && !timestr)
  {
        printf(" res - %s and timestr - %s",res, timestr);
        return 0;
  }
  else
        return -1;
}

Output

 res - 15:46:36 and timestr - 15:46:36

Parameters

const wchar_twchar_t *timeStr

The wstrtime(const wchar_t *)wstrtime(const wchar_t *) function gets the system time and converts it into wide-character string. This copies the current system time into the string pointed by timestr in the format hh:mm:ss. The timestr buffer must be at least 9 bytes long. The function returns a pointer to the timestr string. Because the modification is done in place, the pointer returned is the same as the pointer passed as the input argument.

Return value

wchar_twchar_t *

The wstrtime(const wchar_t *)wstrtime(const wchar_t *) returns a pointer to the time string on success, otherwise it returns a NULL pointer and sets the errno accordingly.

See also:

[Top]


wfdopen(int,const wchar_t *)

IMPORT_C FILE* wfdopen(int fd, const wchar_t *mode);

Description

The wfdopen function associates a stream with the existing file descriptor, fd. The mode argument is used just as in the function wfopen .

The mode of the stream must be compatible with the mode of the file descriptor. In other words the type specified by the stream must be allowed by the file access mode of the open file. When the stream is closed via fclose, fd is also closed.

Errors:

[EINVAL] The mode argument to wfdopen, was invalid. The function wfdopen may also fail and set errno for any of the errors specified for the routine wopen.

Limitations:

All the limitations that apply to wfopen apply to wfdopen also.

Parameters

int fd

const wchar_twchar_t *mode

Return value

__sFILE__sFILE *

Upon successful completion wfdopen returns a FILE pointer. Otherwise, NULL is returned and the global variable errno is set to indicate the error.

See also:

[Top]


wfreopen(const wchar_t *,const wchar_t *,FILE *)

IMPORT_C FILE* wfreopen(const wchar_t *file, const wchar_t *mode, FILE *fp);

Description

The wfreopen function opens the file whose name is the string pointed to by file and associates the stream pointed to by fp with it. The original stream (if it exists) is closed. The mode argument is used just as in the wfopen function.

If the file argument is NULL, wfreopen attempts to re-open the file associated with fp with a new mode. The new mode must be compatible with the mode that the stream was originally opened with: Streams originally opened with mode "r" can only be reopened with that same mode. Streams originally opened with mode "a" can be reopened with the same mode, or mode "w." Streams originally opened with mode "w" can be reopened with the same mode, or mode "a." Streams originally opened with mode "r+," "w+," or "a+" can be reopened with any mode.

The primary use of the wfreopen function is to change the file associated with a standard text stream (stderr, stdin, or stdout).

Examples:

/* wfreopen example: redirecting stdout */
# 6056 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 6057 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main ()
{
  wfreopen (L"c:\myfile.txt",L"w", (__stdout()) );
  printf ("This sentence is redirected to a file.");
  fclose ( (__stdout()) );
  return 0;
}

Output:

Contents of myfile.txt:This sentence is redirected to a file.
The output here is redirected from  (__stdout())  to file myfile.txt

Limitations:

All the limitations that apply to wfopen apply to wfreopen also.

Parameters

const wchar_twchar_t *file

const wchar_twchar_t *mode

__sFILE__sFILE *fp

Return value

__sFILE__sFILE *

Upon successful completion wfreopen returns a FILE pointer. Otherwise, NULL is returned and the global variable errno is set to indicate the error.

See also:

[Top]


getws(wchar_t *)

IMPORT_C wchar_t* getws(wchar_t *str);

Description

The getws function is equivalent to fgetws with an infinite size and a stream of stdin, except that the wide character newline(if any) is not stored in the string. It is the caller's responsibility to ensure that the input line, if any, is sufficiently short to fit in the string.

Examples:

#include <stdio.h>
#include <wchar.h>
/* Illustrates how to use getws API */
int example_getws()
        {
        FILE* stdop = freopen("c:\stdop","w+", (__stdout()) );
        FILE* stdip = freopen("c:\stdip","w+", (__stdin()) );
        FILE* stder = freopen("c:\stder","w+", (__stderr()) );
        wchar_t* buf = (wchar_t*)malloc(sizeof(wchar_t)*50);
        wchar_t s[100];
        int ret = 0;
        size_t size = fwrite("abdcef
", 1, 6, stdip);          //write to stdin
        fclose(stdip);
        stdip = freopen("c:\stdip","r",  (__stdin()) );
        getws(s);               // read a line (from stdin)
        putws(s);               //write to stdout
        fclose(stdop);
        stdop = freopen("c:\stdop","r",  (__stdout()) );
        fgetws(buf,7,stdop);            //read from stdout
        if(wcsncmp(s, buf,6))
                {
                ret = -1;
                }
        fclose( (__stdin()) );
        fclose(stder);
        fclose(stdop);
        remove("c:\stdop");
        remove("c:\stdip");
        remove("c:\stder");
        return ret;
        }

Output

abcdef
abcdef

Security considerations:

The getws function cannot be used securely. Because of its lack of bounds checking, and the inability for the calling program to determine reliably the length of the next incoming line, the use of this function enables malicious users to arbitrarily change a running program's functionality through a buffer overflow attack. It is strongly suggested that the fgetws function be used in all cases.

Parameters

wchar_twchar_t *str

Return value

wchar_twchar_t *

Upon successful completion, getws returns str. The getws function does not distinguish between end-of-file and error: Callers must use feof and ferror to determine which occurred.

See also:

[Top]


wremove(const wchar_t *)

IMPORT_C int wremove(const wchar_t *file);

Description

The wremove function removes the file or directory specified by the wide character name referred by file.

If file specifies a directory, wremove (file); is the equivalent of wrmdir (file); Otherwise, it is the equivalent of wunlink (file);

Examples:

/* this program shows deleting a file using wremove */
# 6179 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main()
{
        wchar_t* name = L"C:\input.txt";
        FILE *fp = wfopen(name, L"w+");
        if (fp ==  0 )
                {
                printf ("fopen failed
");
                return -1;
                }
        fprintf(fp,"hello world");
        fclose(fp);
        
        wremove(name);
        fp=wfopen(name,L"r");
        if (fp ==  0 )
                {
                printf ("file has been deleted already
");
                }
        else
                {
                printf("wremove failed
");
                return -1;
                }
        return 0;
}

Output

file has been deleted already

Parameters

const wchar_twchar_t *file

Return value

int

Upon successful completion, wremove returns 0. Otherwise, it returns -1 is and sets the global variable errno to indicate the error.

See also:

[Top]


putws(wchar_t *)

IMPORT_C int putws(wchar_t *str);

Description

The putws function writes the wide character string pointed to by str to the stdout stream.

Examples:

#include <stdio.h>
#include <wchar.h>
/* Illustrates how to use putws API */
int example_putws()
{
        wchar_t buf[12];
        FILE* op;
        FILE* stdop = freopen("c:\stdop","w+", (__stdout()) );
                
        putws(L"Hello World");          //write to stdout
        
        fclose(stdop);
                
        op = freopen("c:\stdop","r", (__stdout()) );
                
        fgetws(buf, 12, op);            //read from stdout
                
        fclose(stdop);
                
        remove("c:\stdop");
        
        if(!(wcsncmp(L"Hello World", buf, 11)))
                {                       
                return 0;
                }       
        return -1;
}
}

Parameters

wchar_twchar_t *str

Return value

int

The putws function returns 0 on success and -1 on error.

See also:

[Top]


wcslcat(wchar_t *,const wchar_t *,size_t)

IMPORT_C size_t wcslcat(wchar_t *, const wchar_t *, size_t);

Description

Parameters

wchar_twchar_t *

const wchar_twchar_t *

size_tsize_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

size_tsize_t

See also:

[Top]


wcslcpy(wchar_t *,const wchar_t *,size_t)

IMPORT_C size_t wcslcpy(wchar_t *, const wchar_t *, size_t);

Description

Parameters

wchar_twchar_t *

const wchar_twchar_t *

size_tsize_t

Refer to wmemchr(const wchar_t *,wchar_t,size_t)wmemchr(const wchar_t *,wchar_t,size_t) for the documentation

Return value

size_tsize_t

See also:

[Top]


wasctime(const struct tm *)

IMPORT_C wchar_t* wasctime(const struct tm *);

Description

Parameters

const struct tmtm *

Refer to wctime(const time_t *)wctime(const time_t *) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wctime(const time_t *)

IMPORT_C wchar_t* wctime(const time_t *);

Description

The function wctime takes a time value representing the time in seconds since the Epoch (00:00:00 UTC, January 1, 1970) as an argument. See time

The function wctime adjusts the time value for the current time zone in the same manner as localtime and returns a pointer to a 26-wide character string of the form: Thu Nov 24 18:22:48 1986 \0 All the fields have constant width.

The function wasctime converts the broken down time in the structure tm , pointed at by *tm , to the form shown in the example above.

 External declarations as well as the tm structure definition are in the #include <time.h> include file. The tm structure includes 
  at least the following fields: 

int tm_sec;/* seconds (0 - 60) */
int tm_min;/* minutes (0 - 59) */
int tm_hour;/* hours (0 - 23) */
int tm_mday;/* day of month (1 - 31) */
int tm_mon;/* month of year (0 - 11) */
int tm_year;/* year - 1900 */
int tm_wday;/* day of week (Sunday = 0) */
int tm_yday;/* day of year (0 - 365) */
int tm_isdst;/* is summer time in effect? */
char *tm_zone;/* abbreviation of timezone name */
long tm_gmtoff;/* offset from UTC in seconds */

The field tm_isdst is non-zero if summer time is in effect.

The field tm_gmtoff is the offset (in seconds) of the time represented from UTC, with positive values indicating east of the Prime Meridian.

Examples:

//Example usage of wasctime and wctime:
# 6535 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
# 6536 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wchar.dosc" 2
int main(){
        time_t t;
        struct tm *timeptr;
        wchar_t* wasc_time;
        t = time ( 0 ); //Get current time in seconds from Epoc
        //Fill tm struct w.r.t localtime using localtime
        timeptr = localtime (&t;);
        //Use this to convert it to a string indicating time w.r.t localtime
        wasc_time = wasctime (timeptr);
        wprintf (L"Time from wasctime w.r.t localtime : %s", wasc_time);
                wprintf(L"Time from wctime w.r.t localtime : %s0, wctime(&t;) );
         return 0;
}

Output

Time from wasctime w.r.t localtime : Thu Jun 22 10:42:27 2006
Time from wctime w.r.t localtime : Thu Jun 22 10:42:27 2006

Bugs:

These functions leave their result in an internal static object and return a pointer to that object. Subsequent calls to these functions will modify the same object. The C Standard provides no mechanism for a program to modify its current local timezone setting and the POSIX -standard method is not reentrant. (However, thread-safe implementations are provided in the POSIX threaded environment.) The tm_zone field of a returned tm structure points to a static array of characters which will also be overwritten by any subsequent calls (as well as by subsequent call to tzset )

Parameters

const time_ttime_t *

Note: This description also covers the following functions - wasctime(const struct tm *)wasctime(const struct tm *)

Return value

wchar_twchar_t *

The functions wasctime and wctime return a pointer to the resulting wide-character string.

See also:

[Top]


wsetlocale(int,const wchar_t *)

IMPORT_C wchar_t* wsetlocale(int, const wchar_t *);

Description

The wsetlocale function sets the C library's notion of natural language formatting style for particular sets of routines. Each such style is called a 'locale' and is invoked using an appropriate name passed as a wide char string.

The wsetlocale function can recognise several categories of routines. The categories and the sets of routines recognised by wsetlocale are listed below:

 LC_ALL Set the entire locale generically.
 LC_COLLATE Set a locale for string collation routines. Currently locale setting does not have effect on
 this category.
 LC_CTYPE This controls recognition of upper and lower case,
 alphabetic or non-alphabetic characters,
 and so on. Currently locale setting does not have effect on this category.
 LC_MESSAGES
  Set a locale for message catalogs. Currently this category is not supported.
 LC_MONETARY
  Set a locale for formatting monetary values;
 this affects the localeconv function.
 LC_NUMERIC Set a locale for formatting numbers.
 This controls the formatting of decimal points
 in input and output of floating point numbers
 in functions such as printf and scanf, as well as values returned by localeconv.
 LC_TIME Set a locale for formatting dates and times using the strftime function.

Only three locales are defined by default, the empty string which denotes the native environment, the C and the POSIX locales, which denote the C language environment. A locale argument of NULL causes wsetlocale to return the current locale. By default, C programs start in the C locale. The only functions in the library that set the locale are wsetlocale and setlocale; the locale is never changed as a side effect of some other routine.

Examples:

#include<stdio.h>
#include<wchar.h>
int main()
{
        //Set the locale to UK English
        wchar_t* locale = wsetlocale(LC_ALL,L"en_GB.ISO-8859-1");
        //Check whether locale setting is succesful or not
        if(NULL != locale)
        {
                wprintf(L"Locale setting is successful
");
                wprintf(L"Locale is set to %s
", locale);
        }
        else
        {
                wprintf(L"Locale setting failed
");
        }
        return 0;
}

Output

Locale setting is successful
Locale is set to en_GB.ISO-8859-1

Parameters

int

const wchar_twchar_t *

Return value

wchar_twchar_t *

Upon successful completion, wsetlocale returns the wide char string associated with the specified category for the requested locale. The wsetlocale function returns NULL and fails to change the locale if the given combination of category and locale make no sense.

See also:

[Top]


wperror(const wchar_t *)

IMPORT_C void wperror(const wchar_t *);

Description

The functions wcserror and wperror look up the error message string corresponding to an error number.

The function wcserror function accepts an error number argument errnum (error number) and returns a pointer to the corresponding message string.

The function wperror finds the error message corresponding to the current value of the global variable errno and writes it, followed by a newline, to the standard error file descriptor. If the argument s is non- NULL and does not point to the null character, this wide char string is prepended to the message string and separated from it by a colon and space (": "); otherwise, only the error message string is printed.

If the error number is not recognized, these functions return an error message string containing "Unknown error: " followed by the error number in decimal. The wcserror function returns EINVAL as a warning. Error numbers recognized by this implementation fall in the range 0 <errnum <sys_nerr .

If insufficient storage is provided in strerrbuf (as specified in buflen ) to contain the error string, wcserror returns ERANGE and strerrbuf will contain an error message that has been truncated and NUL terminated to fit the length specified by buflen .

Examples:

#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <wchar.h>
int main()
{
    wchar_t *ptr = wcserror(ERANGE);
    wprintf(L"wcserror( 34 ) = %s
",ptr);
    return 0;
}

Output

wcserror(ERANGE) = Numerical result out of range

Bugs:

For unknown error numbers, the function wcserror will return its result in a static buffer which may be overwritten by subsequent calls. The return type for wcserror is missing a type-qualifier. The type-qualifier must be const wchar_t * .

Parameters

const wchar_twchar_t *

Note: This description also covers the following functions - wcserror(int)wcserror(int)

See also:

[Top]


wcserror(int)

IMPORT_C wchar_t* wcserror(int num);

Description

Parameters

int num

Refer to wperror(const wchar_t *)wperror(const wchar_t *) for the documentation

Return value

wchar_twchar_t *

See also:

[Top]


wfindnext(intptr_t,struct _wfinddata_t *)

IMPORT_C int wfindnext(intptr_t, struct _wfinddata_t *);

Description

Parameters

intptr_tintptr_t

struct _wfinddata_t *

Refer to wfindfirst(const wchar_t *,struct _wfinddata_t *)wfindfirst(const wchar_t *,struct _wfinddata_t *) for the documentation

Return value

int

[Top]


wfindfirst(const wchar_t *,struct _wfinddata_t *)

IMPORT_C intptr_t wfindfirst(const wchar_t *, struct _wfinddata_t *);

Description

Errors:

[EINVAL] Invalid parameter: filespec or fileinfo was NULL. Or, the operating system returned an unexpected error. [ENOENT] File specification that could not be matched.

The wfindfirst function provides information about the first instance of a file name that matches the file specified in the filespec argument. Any wildcard combination supported by the host operating system can be used in filespec. File information is returned in a _wfinddata_t structure, defined in wchar.h. The _wfinddata_t structure includes the following elements.

 unsigned attrib File attribute

time_t time_create TimeTime of file creation (-1L for Symbian OS)

time_t time_access TimeTime of the last file access (-1L for Symbian OS)

time_t time_write TimeTime of the last write to file

size_t size Length of the file in bytes

wchar_t name[260] Null-terminated name of matched file/directory, without the path

This attribute is returned in the attrib field of the _wfinddata_t structure and can have the following values (defined in wchar.h).

 _A_ARCH Archive.
 _A_HIDDEN
  Hidden file.
 _A_NORMAL
  Normal.
 _A_RDONLY
  Read-only.
 _A_SYSTEM
  System file.

The wfindnext finds the next name, if any, that matches the filespec argument in a previous call to wfindfirst and then alters the fileinfo structure contents accordingly.

The findclose closes the specified search handle and releases the associated resources.

Examples:

#include <wchar.h>
int main( void )
{
   struct _wfinddata_t c_file;
   intptr_t hFile;
   // Find  .txt file in current directory
   if( (hFile = wfindfirst( L"*.txt", &c;_file )) == -1L )
      printf( "No *.txt files in current directory" );
   else
   {
        int i = 1;
      do {
             wprintf( L" File %d = %s ",i,c_file.name);
             i++;
                     } while( wfindnext( hFile, &c;_file ) == 0 );
      findclose( hFile );
   }
   return 0 ;
}  

Output

File 1 = test1.txt
File 2 = test2.txt

Bugs:

Does not support any attribute to find out the sub-directories (i.e., attribute _A_SUBDIR not supported).

Parameters

const wchar_twchar_t *

struct _wfinddata_t *

Note: This description also covers the following functions - wfindnext(intptr_t,struct _wfinddata_t *)wfindnext(intptr_t,struct _wfinddata_t *) findclose(intptr_t)findclose(intptr_t)

Return value

intptr_tintptr_t

If successful, wfindfirst return a unique search handle identifying the file or group of files matching the filespec specification. The handle can be used in a subsequent call to wfindnext or to findclose. Otherwise, wfindfirst returns -1 and sets errno accordingly. If successful, wfindnext returns 0. Otherwise, returns -1 and sets errno to a value indicating the nature of the failure. If successful, findclose returns 0. Otherwise, it returns -1 and sets errno to ENOENT

[Top]


findclose(intptr_t)

IMPORT_C int findclose(intptr_t handle);

Description

Parameters

intptr_tintptr_t handle

Refer to wfindfirst(const wchar_t *,struct _wfinddata_t *)wfindfirst(const wchar_t *,struct _wfinddata_t *) for the documentation

Return value

int

[Top]


wcsnicmp(const wchar_t *,const wchar_t *,size_t)

IMPORT_C int wcsnicmp(const wchar_t *wcs1, const wchar_t *wcs2, size_t n);

Description

Examples:

#include <wchar.h>
/* Illustrates how to use wcsnicmp API */
int example_wcsnicmp(void)

  /* input strings which needs to be compared */
  wchar_t *ws1=L"testcasecmp";
  wchar_t *ws2=L"TESTCASECMP";
    
  /* function call to compare the two strings which */
  /* differ in case */
  int retval = wcsnicmp(ws1,ws2,12);
  /* returns 0 if they are equal or > 1 */
  /* if first string is greater than second string else -1 */
  return retval;
}

Parameters

const wchar_twchar_t *wcs1

const wchar_twchar_t *wcs2

size_tsize_t n

The wcsnicmp(const wchar_t *,const wchar_t *,size_t)wcsnicmp(const wchar_t *,const wchar_t *,size_t) function compares the first n characters from two null-terminated wide-character strings wcs1 and wcs2, by converting them into lower-case. It returns an integer value indicating the status of the comparision.

Return value

int

The wcsnicmp(const wchar_t *,const wchar_t *,size_t)wcsnicmp(const wchar_t *,const wchar_t *,size_t) returns an integer greater than, equal to, or less than 0, according as wcs1 is lexicographically greater than, equal to, or less than wcs2 after translation of each corresponding character to lower-case. The strings themselves are not modified.

See also:

[Top]


wcsicoll(const wchar_t *,const wchar_t *)

IMPORT_C int wcsicoll(const wchar_t *wcs1, const wchar_t *wcs2);

Description

The wcsicoll function compares the null-terminated strings wcs1 and wcs2 according to the current locale collation order, by ignoring the case. In the "C" locale, wcsicoll is equivalent to wcsicmp .

Examples:

#include <wchar.h>
/* Illustrates how to use wcsicoll API */
int example_wcsicoll (void)
{  
        /* compares the two strings */
  if( wcsicoll(L"abcdef",L"abcdeg") != L'f'-L'g')  
   return -1;
 return 0;
}

Limitations:

The current implementation of wcsicoll is not affected by the LC_CTYPE category of the current locale. It is equivalent to wcsicmp in this implementation.

Bugs:

The current implementation of wcsicoll only works in single-byte LC_CTYPE locales, and falls back to using wcsicmp in locales with extended character sets.

Parameters

const wchar_twchar_t *wcs1

const wchar_twchar_t *wcs2

Return value

int

The wcsicoll function returns an integer greater than, equal to, or less than 0, if wcs1 is greater than, equal to, or less than wcs2. No return value is reserved to indicate errors; callers should set errno to 0 before calling wcsicoll . If it is non-zero upon return from wcsicoll , an error has occurred.

See also:

[Top]


wcsncoll(const wchar_t *,const wchar_t *,size_t)

IMPORT_C int wcsncoll(const wchar_t *wcs1, const wchar_t *wcs2, size_t n);

Description

The wcsncoll function compares the first n chars from the two null-terminated strings wcs1 and wcs2 according to the current locale collation order. In the "C" locale, wcsncoll is equivalent to wcscmp .

Examples:

#include <wchar.h>
/* Illustrates how to use wcsncoll API */
int example_wcsncoll (void)
{  
        /* compares the two strings */
  if( wcsncoll(L"abcdef",L"abcdeg",7) != L'f'-L'g')  
   return -1;
 return 0;
}

Limitations:

The current implementation of wcsncoll is not affected by the LC_CTYPE category of the current locale. It is equivalent to wcscoll in this implementation.

Bugs:

The current implementation of wcsncoll only works in single-byte LC_CTYPE locales, and falls back to using wcscoll in locales with extended character sets.

Parameters

const wchar_twchar_t *wcs1

const wchar_twchar_t *wcs2

size_tsize_t n

Return value

int

The wcsncoll function returns an integer greater than, equal to, or less than 0, if wcs1 is greater than, equal to, or less than wcs2 . No return value is reserved to indicate errors; callers should set errno to 0 before calling wcsncoll . If it is non-zero upon return from wcsncoll , an error has occurred.

See also:

[Top]


wcsnicoll(const wchar_t *,const wchar_t *,size_t)

IMPORT_C int wcsnicoll(const wchar_t *wcs1, const wchar_t *wcs2, size_t n);

Description

The wcsnicoll function compares the null-terminated strings wcs1 and wcs2 according to the current locale collation order. In the "C" locale, wcsnicoll is equivalent to wcsncasecmp .

Examples:

#include <wchar.h>
/* Illustrates how to use wcsnicoll API */
int example_wcsnicoll (void)
{  
        /* compares the two strings */
  if( wcsnicoll(L"abcdef",L"abcdeg",7) != L'f'-L'g')  
   return -1;
 return 0;
}

Limitations:

The current implementation of wcsnicoll is not affected by the LC_CTYPE category of the current locale. It is equivalent to wcsncasecmp in this implementation.

Bugs:

The current implementation of wcsnicoll only works in single-byte LC_CTYPE locales, and falls back to using wcsncoll in locales with extended character sets.

Parameters

const wchar_twchar_t *wcs1

const wchar_twchar_t *wcs2

size_tsize_t n

Return value

int

The wcsnicoll function returns an integer greater than, equal to, or less than 0, if wcs1 is greater than, equal to, or less than wcs2 . No return value is reserved to indicate errors; callers should set errno to 0 before calling wcsnicoll . If it is non-zero upon return from wcsnicoll , an error has occurred.

See also:

[Top]


wtmpnam(wchar_t *)

IMPORT_C wchar_t* wtmpnam(wchar_t *s);

Description

The wtmpnam function returns a pointer to a file name in the P_tmpdir directory which did not reference an existing file at some indeterminate point in the past. P_tmpdir is defined in the include file stdio.h . If the argument s is non-NULL, the file name is copied to the buffer it references. Otherwise, the file name is copied to a static buffer. In either case, wtmpnam returns a pointer to the file name.

The buffer referenced by s is expected to be at least L_tmpnam bytes in length. L_tmpnam is defined in the include file stdio.h .

The environment variable TMPDIR (if set), the argument tmpdir (if non-NULL), the directory P_tmpdir , and the directory /tmp are tried in that order as directories in which to store the temporary file.

Examples:

#include<stdio.h> //wtmpnam
#include<sys/stat.h> //S_IWUSR
#include<errno.h> //errno
  
int main()
{
 //create a directory c:\system emp
 wmkdir(L"c:\system\temp", S_IWUSR);
  
 wchar_t wbuf[L_tmpnam];
 wchar_t rbuf[10];
  
 //call wtmpnam() to create a file
 wchar_t *rval = wtmpnam(wbuf);
  
 errno = 0;
 //open the file with the name returned by wtmpnam()
 FILE *fp = wfopen(buf, L"w");
  
 if (fp == NULL)
 {
     printf("fopen of file returned by wtmpnam() failed -  (*__errno())  %d ", errno);
     return -1;
 }
    
 if(fp)
 {
    fwprintf(fp, L"%ls", L"check");
    fclose(fp);
 }
   
 fp = wfopen(buf, L"r");
  
 if(fp)
 {
     fwscanf(fp, L"%ls", rbuf);
     fclose(fp);
 }
  
 printf("read from file: %ls
", rbuf);
 printf("argument buf: %ls
", buf);
 printf("return value: %ls
", rval);
  
 return 0;
}

Output

read from file: check
argument buf: /System/temp/tmp.0.U9UPTx
return value: /System/temp/tmp.0.U9UPTx

Parameters

wchar_twchar_t *s

Return value

wchar_twchar_t *

The wtmpnam function returns a pointer to a file name on success and a NULL pointer on error.

See also: