Home | History | Annotate | Download | only in posix
      1 /*
      2  * Copyright (C) 2017 The Android Open Source Project
      3  * All rights reserved.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions
      7  * are met:
      8  *  * Redistributions of source code must retain the above copyright
      9  *    notice, this list of conditions and the following disclaimer.
     10  *  * Redistributions in binary form must reproduce the above copyright
     11  *    notice, this list of conditions and the following disclaimer in
     12  *    the documentation and/or other materials provided with the
     13  *    distribution.
     14  *
     15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     18  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
     19  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
     20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     21  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
     22  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     23  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     24  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
     25  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26  * SUCH DAMAGE.
     27  */
     28 
     29 #include <wchar.h>
     30 
     31 #include "header_checks.h"
     32 
     33 static void wchar_h() {
     34   TYPE(FILE*);
     35   TYPE(locale_t);
     36   TYPE(mbstate_t);
     37   TYPE(size_t);
     38   TYPE(va_list);
     39   TYPE(wchar_t);
     40   TYPE(wctype_t);
     41   TYPE(wint_t);
     42 
     43   MACRO(WCHAR_MAX);
     44   MACRO(WCHAR_MIN);
     45   MACRO(WEOF);
     46   MACRO(NULL);
     47 
     48   FUNCTION(btowc, wint_t (*f)(int));
     49   FUNCTION(fgetwc, wint_t (*f)(FILE*));
     50   FUNCTION(fgetws, wchar_t* (*f)(wchar_t*, int, FILE*));
     51   FUNCTION(fputwc, wint_t (*f)(wchar_t, FILE*));
     52   FUNCTION(fputws, int (*f)(const wchar_t*, FILE*));
     53   FUNCTION(fwide, int (*f)(FILE*, int));
     54   FUNCTION(fwprintf, int (*f)(FILE*, const wchar_t*, ...));
     55   FUNCTION(fwscanf, int (*f)(FILE*, const wchar_t*, ...));
     56   FUNCTION(getwc, wint_t (*f)(FILE*));
     57   FUNCTION(getwchar, wint_t (*f)(void));
     58   FUNCTION(mbrlen, size_t (*f)(const char*, size_t, mbstate_t*));
     59   FUNCTION(mbrtowc, size_t (*f)(wchar_t*, const char*, size_t, mbstate_t*));
     60   FUNCTION(mbsinit, int (*f)(const mbstate_t*));
     61   FUNCTION(mbsnrtowcs, size_t (*f)(wchar_t*, const char**, size_t, size_t, mbstate_t*));
     62   FUNCTION(mbsrtowcs, size_t (*f)(wchar_t*, const char**, size_t, mbstate_t*));
     63   FUNCTION(open_wmemstream, FILE* (*f)(wchar_t**, size_t*));
     64   FUNCTION(putwc, wint_t (*f)(wchar_t, FILE*));
     65   FUNCTION(putwchar, wint_t (*f)(wchar_t));
     66   FUNCTION(swprintf, int (*f)(wchar_t*, size_t, const wchar_t*, ...));
     67   FUNCTION(swscanf, int (*f)(const wchar_t*, const wchar_t*, ...));
     68   FUNCTION(ungetwc, wint_t (*f)(wint_t, FILE*));
     69   FUNCTION(vfwprintf, int (*f)(FILE*, const wchar_t*, va_list));
     70   FUNCTION(vfwscanf, int (*f)(FILE*, const wchar_t*, va_list));
     71   FUNCTION(vswprintf, int (*f)(wchar_t*, size_t, const wchar_t*, va_list));
     72   FUNCTION(vswscanf, int (*f)(const wchar_t*, const wchar_t*, va_list));
     73   FUNCTION(vwprintf, int (*f)(const wchar_t*, va_list));
     74   FUNCTION(vwscanf, int (*f)(const wchar_t*, va_list));
     75   FUNCTION(wcpcpy, wchar_t* (*f)(wchar_t*, const wchar_t*));
     76   FUNCTION(wcpncpy, wchar_t* (*f)(wchar_t*, const wchar_t*, size_t));
     77   FUNCTION(wcrtomb, size_t (*f)(char*, wchar_t, mbstate_t*));
     78   FUNCTION(wcscasecmp, int (*f)(const wchar_t*, const wchar_t*));
     79   FUNCTION(wcscasecmp_l, int (*f)(const wchar_t*, const wchar_t*, locale_t));
     80   FUNCTION(wcscat, wchar_t* (*f)(wchar_t*, const wchar_t*));
     81   FUNCTION(wcschr, wchar_t* (*f)(const wchar_t*, wchar_t));
     82   FUNCTION(wcscmp, int (*f)(const wchar_t*, const wchar_t*));
     83   FUNCTION(wcscoll, int (*f)(const wchar_t*, const wchar_t*));
     84   FUNCTION(wcscoll_l, int (*f)(const wchar_t*, const wchar_t*, locale_t));
     85   FUNCTION(wcscpy, wchar_t* (*f)(wchar_t*, const wchar_t*));
     86   FUNCTION(wcscspn, size_t (*f)(const wchar_t*, const wchar_t*));
     87   FUNCTION(wcsdup, wchar_t* (*f)(const wchar_t*));
     88   FUNCTION(wcsftime, size_t (*f)(wchar_t*, size_t, const wchar_t*, const struct tm*));
     89   FUNCTION(wcslen, size_t (*f)(const wchar_t*));
     90   FUNCTION(wcsncasecmp, int (*f)(const wchar_t*, const wchar_t*, size_t));
     91   FUNCTION(wcsncasecmp_l, int (*f)(const wchar_t*, const wchar_t*, size_t, locale_t));
     92   FUNCTION(wcsncat, wchar_t* (*f)(wchar_t*, const wchar_t*, size_t));
     93   FUNCTION(wcsncmp, int (*f)(const wchar_t*, const wchar_t*, size_t));
     94   FUNCTION(wcsncpy, wchar_t* (*f)(wchar_t*, const wchar_t*, size_t));
     95   FUNCTION(wcsnlen, size_t (*f)(const wchar_t*, size_t));
     96   FUNCTION(wcsnrtombs, size_t (*f)(char*, const wchar_t**, size_t, size_t, mbstate_t*));
     97   FUNCTION(wcspbrk, wchar_t* (*f)(const wchar_t*, const wchar_t*));
     98   FUNCTION(wcsrchr, wchar_t* (*f)(const wchar_t*, wchar_t));
     99   FUNCTION(wcsrtombs, size_t (*f)(char*, const wchar_t**, size_t, mbstate_t*));
    100   FUNCTION(wcsspn, size_t (*f)(const wchar_t*, const wchar_t*));
    101   FUNCTION(wcsstr, wchar_t* (*f)(const wchar_t*, const wchar_t*));
    102   FUNCTION(wcstod, double (*f)(const wchar_t*, wchar_t**));
    103   FUNCTION(wcstof, float (*f)(const wchar_t*, wchar_t**));
    104   FUNCTION(wcstok, wchar_t* (*f)(wchar_t*, const wchar_t*, wchar_t**));
    105   FUNCTION(wcstol, long (*f)(const wchar_t*, wchar_t**, int));
    106   FUNCTION(wcstold, long double (*f)(const wchar_t*, wchar_t**));
    107   FUNCTION(wcstoll, long long (*f)(const wchar_t*, wchar_t**, int));
    108   FUNCTION(wcstoul, unsigned long (*f)(const wchar_t*, wchar_t**, int));
    109   FUNCTION(wcstoull, unsigned long long (*f)(const wchar_t*, wchar_t**, int));
    110   FUNCTION(wcswidth, int (*f)(const wchar_t*, size_t));
    111   FUNCTION(wcsxfrm, size_t (*f)(wchar_t*, const wchar_t*, size_t));
    112   FUNCTION(wcsxfrm_l, size_t (*f)(wchar_t*, const wchar_t*, size_t, locale_t));
    113   FUNCTION(wctob, int (*f)(wint_t));
    114   FUNCTION(wcwidth, int (*f)(wchar_t));
    115   FUNCTION(wmemchr, wchar_t* (*f)(const wchar_t*, wchar_t, size_t));
    116   FUNCTION(wmemcmp, int (*f)(const wchar_t*, const wchar_t*, size_t));
    117   FUNCTION(wmemcpy, wchar_t* (*f)(wchar_t*, const wchar_t*, size_t));
    118   FUNCTION(wmemmove, wchar_t* (*f)(wchar_t*, const wchar_t*, size_t));
    119   FUNCTION(wmemset, wchar_t* (*f)(wchar_t*, wchar_t, size_t));
    120   FUNCTION(wprintf, int (*f)(const wchar_t*, ...));
    121   FUNCTION(wscanf, int (*f)(const wchar_t*, ...));
    122 }
    123