본문 바로가기

분류 전체보기683

ungetc int ungetc(int c, FILE *fp) #include #include #include #include "local.h" static int __submore(FILE *); /* * Expand the ungetc buffer `in place'. That is, adjust fp->_p when * the buffer moves, so that it points the same distance from the end, * and move the bytes in the buffer around as necessary so that they * are all at the end (stack-style). */ static int __submore(FILE *fp) { int i; unsigne.. 2016. 7. 9.
ungetwc wint_t ungetwc(wint_t wc, FILE *fp) #include #include #include #include "local.h" wint_t ungetwc(wint_t wc, FILE *fp) { struct wchar_io_data *wcio; if (wc == WEOF) return WEOF; flockfile(fp); _SET_ORIENTATION(fp, 1); /* * XXX since we have no way to transform a wchar string to * a char string in reverse order, we can't use ungetc. */ /* XXX should we flush ungetc buffer? */ wcio = WCIO_GET(fp); .. 2016. 7. 9.
tmpfile FILE * tmpfile(void) #include #include #include #include #include #include #include #include #include FILE * tmpfile(void) { sigset_t set, oset; FILE *fp; int fd, sverrno; #defineTRAILER"tmp.XXXXXXXXXX" char buf[sizeof(_PATH_TMP) + sizeof(TRAILER)]; (void)memcpy(buf, _PATH_TMP, sizeof(_PATH_TMP) - 1); (void)memcpy(buf + sizeof(_PATH_TMP) - 1, TRAILER, sizeof(TRAILER)); sigfillset(&set); (void)si.. 2016. 7. 9.
vfprintf int vfprintf(FILE *fp, const char *fmt0, __va_list ap) /* * Actual printf innards. * * This code is large and complicated... */ #include #include #include #include #include #include #include #include #include #include #include #include "local.h" #include "fvwrite.h" static int __find_arguments(const char *fmt0, va_list ap, va_list **argtable, size_t *argtablesiz); static int __grow_type_table(un.. 2016. 7. 9.