cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 8f36ebe156823f12b0849df6c2207bcbccbaf1b2
parent 73725d271ea81357e91cebdbd08602a2c3d86933
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Fri, 26 Mar 2021 21:16:33 -0500

temp2

Diffstat:
Atest/wide-string-test.c | 242+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atest/wide-string.c | 15+++++++++++++++
2 files changed, 257 insertions(+), 0 deletions(-)

diff --git a/test/wide-string-test.c b/test/wide-string-test.c @@ -0,0 +1,242 @@ +struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; + char int_p_cs_precedes; + char int_p_sep_by_space; + char int_n_cs_precedes; + char int_n_sep_by_space; + char int_p_sign_posn; + char int_n_sign_posn; +}; +char *setlocale (int, const char *); +struct lconv *localeconv(void); +typedef struct __locale_struct * locale_t; +locale_t duplocale(locale_t); +void freelocale(locale_t); +locale_t newlocale(int, const char *, locale_t); +locale_t uselocale(locale_t); +typedef unsigned long size_t; +typedef long ssize_t; +typedef long off_t; +typedef struct _IO_FILE FILE; +typedef __builtin_va_list va_list; +typedef __builtin_va_list __isoc_va_list; +typedef union _G_fpos64_t { + char __opaque[16]; + long long __lldata; + double __align; +} fpos_t; +extern FILE *const stdin; +extern FILE *const stdout; +extern FILE *const stderr; +FILE *fopen(const char *restrict, const char *restrict); +FILE *freopen(const char *restrict, const char *restrict, FILE *restrict); +int fclose(FILE *); +int remove(const char *); +int rename(const char *, const char *); +int feof(FILE *); +int ferror(FILE *); +int fflush(FILE *); +void clearerr(FILE *); +int fseek(FILE *, long, int); +long ftell(FILE *); +void rewind(FILE *); +int fgetpos(FILE *restrict, fpos_t *restrict); +int fsetpos(FILE *, const fpos_t *); +size_t fread(void *restrict, size_t, size_t, FILE *restrict); +size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict); +int fgetc(FILE *); +int getc(FILE *); +int getchar(void); +int ungetc(int, FILE *); +int fputc(int, FILE *); +int putc(int, FILE *); +int putchar(int); +char *fgets(char *restrict, int, FILE *restrict); +int fputs(const char *restrict, FILE *restrict); +int puts(const char *); +int printf(const char *restrict, ...); +int fprintf(FILE *restrict, const char *restrict, ...); +int sprintf(char *restrict, const char *restrict, ...); +int snprintf(char *restrict, size_t, const char *restrict, ...); +int vprintf(const char *restrict, __isoc_va_list); +int vfprintf(FILE *restrict, const char *restrict, __isoc_va_list); +int vsprintf(char *restrict, const char *restrict, __isoc_va_list); +int vsnprintf(char *restrict, size_t, const char *restrict, __isoc_va_list); +int scanf(const char *restrict, ...); +int fscanf(FILE *restrict, const char *restrict, ...); +int sscanf(const char *restrict, const char *restrict, ...); +int vscanf(const char *restrict, __isoc_va_list); +int vfscanf(FILE *restrict, const char *restrict, __isoc_va_list); +int vsscanf(const char *restrict, const char *restrict, __isoc_va_list); +void perror(const char *); +int setvbuf(FILE *restrict, char *restrict, int, size_t); +void setbuf(FILE *restrict, char *restrict); +char *tmpnam(char *); +FILE *tmpfile(void); +FILE *fmemopen(void *restrict, size_t, const char *restrict); +FILE *open_memstream(char **, size_t *); +FILE *fdopen(int, const char *); +FILE *popen(const char *, const char *); +int pclose(FILE *); +int fileno(FILE *); +int fseeko(FILE *, off_t, int); +off_t ftello(FILE *); +int dprintf(int, const char *restrict, ...); +int vdprintf(int, const char *restrict, __isoc_va_list); +void flockfile(FILE *); +int ftrylockfile(FILE *); +void funlockfile(FILE *); +int getc_unlocked(FILE *); +int getchar_unlocked(void); +int putc_unlocked(int, FILE *); +int putchar_unlocked(int); +ssize_t getdelim(char **restrict, size_t *restrict, int, FILE *restrict); +ssize_t getline(char **restrict, size_t *restrict, FILE *restrict); +int renameat(int, const char *, int, const char *); +char *ctermid(char *); +char *tempnam(const char *, const char *); +char *cuserid(char *); +void setlinebuf(FILE *); +void setbuffer(FILE *, char *, size_t); +int fgetc_unlocked(FILE *); +int fputc_unlocked(int, FILE *); +int fflush_unlocked(FILE *); +size_t fread_unlocked(void *, size_t, size_t, FILE *); +size_t fwrite_unlocked(const void *, size_t, size_t, FILE *); +void clearerr_unlocked(FILE *); +int feof_unlocked(FILE *); +int ferror_unlocked(FILE *); +int fileno_unlocked(FILE *); +int getw(FILE *); +int putw(int, FILE *); +char *fgetln(FILE *, size_t *); +int asprintf(char **, const char *, ...); +int vasprintf(char **, const char *, __isoc_va_list); +typedef int wchar_t; +typedef unsigned wint_t; +typedef unsigned long wctype_t; +typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; +wchar_t *wcscpy (wchar_t *restrict, const wchar_t *restrict); +wchar_t *wcsncpy (wchar_t *restrict, const wchar_t *restrict, size_t); +wchar_t *wcscat (wchar_t *restrict, const wchar_t *restrict); +wchar_t *wcsncat (wchar_t *restrict, const wchar_t *restrict, size_t); +int wcscmp (const wchar_t *, const wchar_t *); +int wcsncmp (const wchar_t *, const wchar_t *, size_t); +int wcscoll(const wchar_t *, const wchar_t *); +size_t wcsxfrm (wchar_t *restrict, const wchar_t *restrict, size_t); +wchar_t *wcschr (const wchar_t *, wchar_t); +wchar_t *wcsrchr (const wchar_t *, wchar_t); +size_t wcscspn (const wchar_t *, const wchar_t *); +size_t wcsspn (const wchar_t *, const wchar_t *); +wchar_t *wcspbrk (const wchar_t *, const wchar_t *); +wchar_t *wcstok (wchar_t *restrict, const wchar_t *restrict, wchar_t **restrict); +size_t wcslen (const wchar_t *); +wchar_t *wcsstr (const wchar_t *restrict, const wchar_t *restrict); +wchar_t *wcswcs (const wchar_t *, const wchar_t *); +wchar_t *wmemchr (const wchar_t *, wchar_t, size_t); +int wmemcmp (const wchar_t *, const wchar_t *, size_t); +wchar_t *wmemcpy (wchar_t *restrict, const wchar_t *restrict, size_t); +wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t); +wchar_t *wmemset (wchar_t *, wchar_t, size_t); +wint_t btowc (int); +int wctob (wint_t); +int mbsinit (const mbstate_t *); +size_t mbrtowc (wchar_t *restrict, const char *restrict, size_t, mbstate_t *restrict); +size_t wcrtomb (char *restrict, wchar_t, mbstate_t *restrict); +size_t mbrlen (const char *restrict, size_t, mbstate_t *restrict); +size_t mbsrtowcs (wchar_t *restrict, const char **restrict, size_t, mbstate_t *restrict); +size_t wcsrtombs (char *restrict, const wchar_t **restrict, size_t, mbstate_t *restrict); +float wcstof (const wchar_t *restrict, wchar_t **restrict); +double wcstod (const wchar_t *restrict, wchar_t **restrict); +long double wcstold (const wchar_t *restrict, wchar_t **restrict); +long wcstol (const wchar_t *restrict, wchar_t **restrict, int); +unsigned long wcstoul (const wchar_t *restrict, wchar_t **restrict, int); +long long wcstoll (const wchar_t *restrict, wchar_t **restrict, int); +unsigned long long wcstoull (const wchar_t *restrict, wchar_t **restrict, int); +int fwide (FILE *, int); +int wprintf (const wchar_t *restrict, ...); +int fwprintf (FILE *restrict, const wchar_t *restrict, ...); +int swprintf (wchar_t *restrict, size_t, const wchar_t *restrict, ...); +int vwprintf (const wchar_t *restrict, __isoc_va_list); +int vfwprintf (FILE *restrict, const wchar_t *restrict, __isoc_va_list); +int vswprintf (wchar_t *restrict, size_t, const wchar_t *restrict, __isoc_va_list); +int wscanf (const wchar_t *restrict, ...); +int fwscanf (FILE *restrict, const wchar_t *restrict, ...); +int swscanf (const wchar_t *restrict, const wchar_t *restrict, ...); +int vwscanf (const wchar_t *restrict, __isoc_va_list); +int vfwscanf (FILE *restrict, const wchar_t *restrict, __isoc_va_list); +int vswscanf (const wchar_t *restrict, const wchar_t *restrict, __isoc_va_list); +wint_t fgetwc (FILE *); +wint_t getwc (FILE *); +wint_t getwchar (void); +wint_t fputwc (wchar_t, FILE *); +wint_t putwc (wchar_t, FILE *); +wint_t putwchar (wchar_t); +wchar_t *fgetws (wchar_t *restrict, int, FILE *restrict); +int fputws (const wchar_t *restrict, FILE *restrict); +wint_t ungetwc (wint_t, FILE *); +struct tm; +size_t wcsftime (wchar_t *restrict, size_t, const wchar_t *restrict, const struct tm *restrict); +size_t wcsftime_l (wchar_t *restrict, size_t, const wchar_t *restrict, const struct tm *restrict, locale_t); +FILE *open_wmemstream(wchar_t **, size_t *); +size_t mbsnrtowcs(wchar_t *restrict, const char **restrict, size_t, size_t, mbstate_t *restrict); +size_t wcsnrtombs(char *restrict, const wchar_t **restrict, size_t, size_t, mbstate_t *restrict); +wchar_t *wcsdup(const wchar_t *); +size_t wcsnlen (const wchar_t *, size_t); +wchar_t *wcpcpy (wchar_t *restrict, const wchar_t *restrict); +wchar_t *wcpncpy (wchar_t *restrict, const wchar_t *restrict, size_t); +int wcscasecmp(const wchar_t *, const wchar_t *); +int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t); +int wcsncasecmp(const wchar_t *, const wchar_t *, size_t); +int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t); +int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); +size_t wcsxfrm_l(wchar_t *restrict, const wchar_t *restrict, size_t, locale_t); +int wcwidth (wchar_t); +int wcswidth (const wchar_t *, size_t); +int iswalnum(wint_t); +int iswalpha(wint_t); +int iswblank(wint_t); +int iswcntrl(wint_t); +int iswdigit(wint_t); +int iswgraph(wint_t); +int iswlower(wint_t); +int iswprint(wint_t); +int iswpunct(wint_t); +int iswspace(wint_t); +int iswupper(wint_t); +int iswxdigit(wint_t); +int iswctype(wint_t, wctype_t); +wint_t towlower(wint_t); +wint_t towupper(wint_t); +wctype_t wctype(const char *); +typedef unsigned short char16_t; +typedef unsigned char32_t; +size_t c16rtomb(char *restrict, char16_t, mbstate_t *restrict); +size_t mbrtoc16(char16_t *restrict, const char *restrict, size_t, mbstate_t *restrict); +size_t c32rtomb(char *restrict, char32_t, mbstate_t *restrict); +size_t mbrtoc32(char32_t *restrict, const char *restrict, size_t, mbstate_t *restrict); +wchar_t *a = L"⌷ā½¾"; +char16_t *b = u"å⋄¿ß"; +char32_t *c = U"¸…´¨"; +int main() { + setlocale(6, ""); + wprintf(L"%ls\n", a); + return 0; +} diff --git a/test/wide-string.c b/test/wide-string.c @@ -0,0 +1,15 @@ +#include <locale.h> +#include <stdio.h> +#include <wchar.h> +#include <uchar.h> + +wchar_t *a = L"⌷ā½¾"; +char16_t *b = u"å⋄¿ß"; +char32_t *c = U"¸…´¨"; + +int main() { + setlocale(LC_ALL, ""); + wprintf(L"%ls\n", a); + //wprintf(L"%ls\n", c); + return 0; +}