w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

io.c
Go to the documentation of this file.
1 /*
2 ** io.c - IO class
3 */
4 
5 #include "mruby.h"
6 #include "mruby/array.h"
7 #include "mruby/class.h"
8 #include "mruby/data.h"
9 #include "mruby/hash.h"
10 #include "mruby/string.h"
11 #include "mruby/variable.h"
12 #include "mruby/ext/io.h"
13 #include "mruby/error.h"
14 #include "mruby/presym.h"
15 
16 #include <sys/types.h>
17 #include <sys/stat.h>
18 
19 #if defined(_WIN32) || defined(_WIN64)
20  #include <winsock.h>
21  #include <io.h>
22  #include <basetsd.h>
23  #define open _open
24  #define close _close
25  #define dup _dup
26  #define dup2 _dup2
27  #define read _read
28  #define write _write
29  #define lseek _lseek
30  #define isatty _isatty
31  #define WEXITSTATUS(x) (x)
32  typedef int fsize_t;
33  typedef long ftime_t;
34  typedef long fsuseconds_t;
35  typedef int fmode_t;
36  typedef int mrb_io_read_write_size;
37  #ifndef MRB_MINGW32_LEGACY
38  #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) && \
39  !defined(__have_typedef_ssize_t)
40  typedef SSIZE_T ssize_t;
41  #endif
42  #endif
43 
44  #ifndef O_TMPFILE
45  #define O_TMPFILE O_TEMPORARY
46  #endif
47 
48 #else
49  #include <sys/wait.h>
50  #include <sys/time.h>
51  #include <unistd.h>
52  typedef size_t fsize_t;
53  typedef time_t ftime_t;
54  typedef suseconds_t fsuseconds_t;
55  typedef mode_t fmode_t;
57 #endif
58 
59 #ifdef _MSC_VER
60 typedef mrb_int pid_t;
61 #endif
62 
63 #include <fcntl.h>
64 
65 #include <errno.h>
66 #include <string.h>
67 
68 #define OPEN_ACCESS_MODE_FLAGS (O_RDONLY | O_WRONLY | O_RDWR)
69 #define OPEN_RDONLY_P(f) ((mrb_bool)(((f) & OPEN_ACCESS_MODE_FLAGS) == O_RDONLY))
70 #define OPEN_WRONLY_P(f) ((mrb_bool)(((f) & OPEN_ACCESS_MODE_FLAGS) == O_WRONLY))
71 #define OPEN_RDWR_P(f) ((mrb_bool)(((f) & OPEN_ACCESS_MODE_FLAGS) == O_RDWR))
72 #define OPEN_READABLE_P(f) ((mrb_bool)(OPEN_RDONLY_P(f) || OPEN_RDWR_P(f)))
73 #define OPEN_WRITABLE_P(f) ((mrb_bool)(OPEN_WRONLY_P(f) || OPEN_RDWR_P(f)))
74 
75 static void mrb_io_free(mrb_state *mrb, void *ptr);
76 struct mrb_data_type mrb_io_type = { "IO", mrb_io_free };
77 
78 
79 static struct mrb_io *io_get_open_fptr(mrb_state *mrb, mrb_value self);
80 static int mrb_io_modestr_to_flags(mrb_state *mrb, const char *modestr);
82 static void fptr_finalize(mrb_state *mrb, struct mrb_io *fptr, int quiet);
83 
84 static struct mrb_io *
86 {
87  struct mrb_io *fptr;
88 
89  fptr = (struct mrb_io *)mrb_data_get_ptr(mrb, self, &mrb_io_type);
90  if (fptr == NULL) {
91  mrb_raise(mrb, E_IO_ERROR, "uninitialized stream.");
92  }
93  if (fptr->fd < 0) {
94  mrb_raise(mrb, E_IO_ERROR, "closed stream.");
95  }
96  return fptr;
97 }
98 
99 static void
101 {
102  struct RClass *c_process, *c_status;
103  mrb_value v;
104 
105  c_status = NULL;
106  if (mrb_class_defined_id(mrb, MRB_SYM(Process))) {
107  c_process = mrb_module_get_id(mrb, MRB_SYM(Process));
108  if (mrb_const_defined(mrb, mrb_obj_value(c_process), MRB_SYM(Status))) {
109  c_status = mrb_class_get_under_id(mrb, c_process, MRB_SYM(Status));
110  }
111  }
112  if (c_status != NULL) {
114  } else {
116  }
117  mrb_gv_set(mrb, mrb_intern_lit(mrb, "$?"), v);
118 }
119 
120 static int
122 {
123  int flags;
124  const char *m = mode;
125 
126  switch (*m++) {
127  case 'r':
128  flags = O_RDONLY;
129  break;
130  case 'w':
132  break;
133  case 'a':
135  break;
136  default:
137  mrb_raisef(mrb, E_ARGUMENT_ERROR, "illegal access mode %s", mode);
138  flags = 0; /* not reached */
139  }
140 
141  while (*m) {
142  switch (*m++) {
143  case 'b':
144 #ifdef O_BINARY
145  flags |= O_BINARY;
146 #endif
147  break;
148  case '+':
149  flags = (flags & ~~OPEN_ACCESS_MODE_FLAGS) | O_RDWR;
150  break;
151  case ':':
152  /* XXX: PASSTHROUGH*/
153  default:
154  mrb_raisef(mrb, E_ARGUMENT_ERROR, "illegal access mode %s", mode);
155  }
156  }
157 
158  return flags;
159 }
160 
161 static int
163 {
164  if (mrb_nil_p(mode)) {
165  return mrb_io_modestr_to_flags(mrb, "r");
166  }
167  else if (mrb_string_p(mode)) {
168  return mrb_io_modestr_to_flags(mrb, RSTRING_CSTR(mrb, mode));
169  }
170  else {
171  int flags = 0;
172  mrb_int flags0 = mrb_int(mrb, mode);
173 
174  switch (flags0 & MRB_O_ACCMODE) {
175  case MRB_O_RDONLY:
176  flags |= O_RDONLY;
177  break;
178  case MRB_O_WRONLY:
179  flags |= O_WRONLY;
180  break;
181  case MRB_O_RDWR:
182  flags |= O_RDWR;
183  break;
184  default:
185  mrb_raisef(mrb, E_ARGUMENT_ERROR, "illegal access mode %v", mode);
186  }
187 
188  if (flags0 & MRB_O_APPEND) flags |= O_APPEND;
189  if (flags0 & MRB_O_CREAT) flags |= O_CREAT;
190  if (flags0 & MRB_O_EXCL) flags |= O_EXCL;
191  if (flags0 & MRB_O_TRUNC) flags |= O_TRUNC;
192 #ifdef O_NONBLOCK
193  if (flags0 & MRB_O_NONBLOCK) flags |= O_NONBLOCK;
194 #endif
195 #ifdef O_NOCTTY
196  if (flags0 & MRB_O_NOCTTY) flags |= O_NOCTTY;
197 #endif
198 #ifdef O_BINARY
199  if (flags0 & MRB_O_BINARY) flags |= O_BINARY;
200 #endif
201 #ifdef O_SHARE_DELETE
202  if (flags0 & MRB_O_SHARE_DELETE) flags |= O_SHARE_DELETE;
203 #endif
204 #ifdef O_SYNC
205  if (flags0 & MRB_O_SYNC) flags |= O_SYNC;
206 #endif
207 #ifdef O_DSYNC
208  if (flags0 & MRB_O_DSYNC) flags |= O_DSYNC;
209 #endif
210 #ifdef O_RSYNC
211  if (flags0 & MRB_O_RSYNC) flags |= O_RSYNC;
212 #endif
213 #ifdef O_NOFOLLOW
214  if (flags0 & MRB_O_NOFOLLOW) flags |= O_NOFOLLOW;
215 #endif
216 #ifdef O_NOATIME
217  if (flags0 & MRB_O_NOATIME) flags |= O_NOATIME;
218 #endif
219 #ifdef O_DIRECT
220  if (flags0 & MRB_O_DIRECT) flags |= O_DIRECT;
221 #endif
222 #ifdef O_TMPFILE
223  if (flags0 & MRB_O_TMPFILE) flags |= O_TMPFILE;
224 #endif
225 
226  return flags;
227  }
228 }
229 
230 static void
232 {
233 #if defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC)
234  int flags, flags2;
235 
236  flags = fcntl(fd, F_GETFD);
237  if (flags == -1) {
238  mrb_bug(mrb, "mrb_fd_cloexec: fcntl(%d, F_GETFD) failed: %d", fd, errno);
239  }
240  if (fd <= 2) {
241  flags2 = flags & ~~FD_CLOEXEC; /* Clear CLOEXEC for standard file descriptors: 0, 1, 2. */
242  }
243  else {
244  flags2 = flags | FD_CLOEXEC; /* Set CLOEXEC for non-standard file descriptors: 3, 4, 5, ... */
245  }
246  if (flags != flags2) {
247  if (fcntl(fd, F_SETFD, flags2) == -1) {
248  mrb_bug(mrb, "mrb_fd_cloexec: fcntl(%d, F_SETFD, %d) failed: %d", fd, flags2, errno);
249  }
250  }
251 #endif
252 }
253 
254 #if !defined(_WIN32) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
255 static int
256 mrb_cloexec_pipe(mrb_state *mrb, int fildes[2])
257 {
258  int ret;
259  ret = pipe(fildes);
260  if (ret == -1)
261  return -1;
262  mrb_fd_cloexec(mrb, fildes[0]);
263  mrb_fd_cloexec(mrb, fildes[1]);
264  return ret;
265 }
266 
267 static int
268 mrb_pipe(mrb_state *mrb, int pipes[2])
269 {
270  int ret;
271  ret = mrb_cloexec_pipe(mrb, pipes);
272  if (ret == -1) {
273  if (errno == EMFILE || errno == ENFILE) {
274  mrb_garbage_collect(mrb);
275  ret = mrb_cloexec_pipe(mrb, pipes);
276  }
277  }
278  return ret;
279 }
280 
281 static int
282 mrb_proc_exec(const char *pname)
283 {
284  const char *s;
285  s = pname;
286 
287  while (*s == ' ' || *s == '\t' || *s == '\n')
288  s++;
289 
290  if (!*s) {
291  errno = ENOENT;
292  return -1;
293  }
294 
295  execl("/bin/sh", "sh", "-c", pname, (char *)NULL);
296  return -1;
297 }
298 #endif
299 
300 static void
302 {
303  struct mrb_io *io = (struct mrb_io *)ptr;
304  if (io != NULL) {
305  fptr_finalize(mrb, io, TRUE);
306  mrb_free(mrb, io);
307  }
308 }
309 
310 static struct mrb_io *
312 {
313  struct mrb_io *fptr;
314 
315  fptr = (struct mrb_io *)mrb_malloc(mrb, sizeof(struct mrb_io));
316  fptr->fd = -1;
317  fptr->fd2 = -1;
318  fptr->pid = 0;
319  fptr->readable = 0;
320  fptr->writable = 0;
321  fptr->sync = 0;
322  fptr->is_socket = 0;
323  return fptr;
324 }
325 
326 #ifndef NOFILE
327 #define NOFILE 64
328 #endif
329 
330 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
331 # define mrb_io_s_popen mrb_notimplement_m
332 #else
333 static int
335 {
336  if (mrb_undef_p(v)) return -1;
337  if (mrb_nil_p(v)) return -1;
338 
339  switch (mrb_type(v)) {
340  case MRB_TT_DATA: /* IO */
341  return mrb_io_fileno(mrb, v);
342  case MRB_TT_INTEGER:
343  return (int)mrb_integer(v);
344  default:
345  mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong exec redirect action");
346  break;
347  }
348  return -1; /* never reached */
349 }
350 
351 static mrb_value
353  const char **cmd, int *flags, int *doexec,
354  int *opt_in, int *opt_out, int *opt_err)
355 {
357  struct { mrb_value opt_in, opt_out, opt_err; } kv;
358  mrb_sym knames[3] = {MRB_SYM(in), MRB_SYM(out), MRB_SYM(err)};
359  const mrb_kwargs kw = {
360  3, 0,
361  knames,
362  &kv.opt_in,
363  NULL,
364  };
365 
366  mrb_get_args(mrb, "z|o:", cmd, &mode, &kw);
367 
369  *doexec = (strcmp("-", *cmd) != 0);
370  *opt_in = option_to_fd(mrb, kv.opt_in);
371  *opt_out = option_to_fd(mrb, kv.opt_out);
372  *opt_err = option_to_fd(mrb, kv.opt_err);
373 
375 }
376 
377 #ifdef _WIN32
378 static mrb_value
380 {
381  mrb_value io;
382  int doexec;
383  int opt_in, opt_out, opt_err;
384  const char *cmd;
385 
386  struct mrb_io *fptr;
387  int pid = 0, flags;
388  STARTUPINFO si;
389  PROCESS_INFORMATION pi;
390  SECURITY_ATTRIBUTES saAttr;
391 
392  HANDLE ifd[2];
393  HANDLE ofd[2];
394 
395  ifd[0] = INVALID_HANDLE_VALUE;
396  ifd[1] = INVALID_HANDLE_VALUE;
397  ofd[0] = INVALID_HANDLE_VALUE;
398  ofd[1] = INVALID_HANDLE_VALUE;
399 
400  io = mrb_io_s_popen_args(mrb, klass, &cmd, &flags, &doexec,
401  &opt_in, &opt_out, &opt_err);
402 
403  saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
404  saAttr.bInheritHandle = TRUE;
405  saAttr.lpSecurityDescriptor = NULL;
406 
407  if (OPEN_READABLE_P(flags)) {
408  if (!CreatePipe(&ofd[0], &ofd[1], &saAttr, 0)
409  || !SetHandleInformation(ofd[0], HANDLE_FLAG_INHERIT, 0)) {
410  mrb_sys_fail(mrb, "pipe");
411  }
412  }
413 
414  if (OPEN_WRITABLE_P(flags)) {
415  if (!CreatePipe(&ifd[0], &ifd[1], &saAttr, 0)
416  || !SetHandleInformation(ifd[1], HANDLE_FLAG_INHERIT, 0)) {
417  mrb_sys_fail(mrb, "pipe");
418  }
419  }
420 
421  if (doexec) {
422  ZeroMemory(&pi, sizeof(pi));
423  ZeroMemory(&si, sizeof(si));
424  si.cb = sizeof(si);
425  si.dwFlags |= STARTF_USESHOWWINDOW;
426  si.wShowWindow = SW_HIDE;
427  si.dwFlags |= STARTF_USESTDHANDLES;
428  if (OPEN_READABLE_P(flags)) {
429  si.hStdOutput = ofd[1];
430  si.hStdError = ofd[1];
431  }
432  if (OPEN_WRITABLE_P(flags)) {
433  si.hStdInput = ifd[0];
434  }
435  if (!CreateProcess(
436  NULL, (char*)cmd, NULL, NULL,
437  TRUE, CREATE_NEW_PROCESS_GROUP, NULL, NULL, &si, &pi)) {
438  CloseHandle(ifd[0]);
439  CloseHandle(ifd[1]);
440  CloseHandle(ofd[0]);
441  CloseHandle(ofd[1]);
442  mrb_raisef(mrb, E_IO_ERROR, "command not found: %s", cmd);
443  }
444  CloseHandle(pi.hThread);
445  CloseHandle(ifd[0]);
446  CloseHandle(ofd[1]);
447  pid = pi.dwProcessId;
448  }
449 
450  mrb_iv_set(mrb, io, mrb_intern_lit(mrb, "@buf"), mrb_str_new_cstr(mrb, ""));
451 
452  fptr = mrb_io_alloc(mrb);
453  fptr->fd = _open_osfhandle((intptr_t)ofd[0], 0);
454  fptr->fd2 = _open_osfhandle((intptr_t)ifd[1], 0);
455  fptr->pid = pid;
456  fptr->readable = OPEN_READABLE_P(flags);
457  fptr->writable = OPEN_WRITABLE_P(flags);
458  fptr->sync = 0;
459 
461  DATA_PTR(io) = fptr;
462  return io;
463 }
464 #else
465 static mrb_value
467 {
469  int doexec;
470  int opt_in, opt_out, opt_err;
471  const char *cmd;
472 
473  struct mrb_io *fptr;
474  int pid, flags, fd, write_fd = -1;
475  int pr[2] = { -1, -1 };
476  int pw[2] = { -1, -1 };
477  int saved_errno;
478 
479  io = mrb_io_s_popen_args(mrb, klass, &cmd, &flags, &doexec,
480  &opt_in, &opt_out, &opt_err);
481 
482  if (OPEN_READABLE_P(flags)) {
483  if (pipe(pr) == -1) {
484  mrb_sys_fail(mrb, "pipe");
485  }
486  mrb_fd_cloexec(mrb, pr[0]);
487  mrb_fd_cloexec(mrb, pr[1]);
488  }
489 
490  if (OPEN_WRITABLE_P(flags)) {
491  if (pipe(pw) == -1) {
492  if (pr[0] != -1) close(pr[0]);
493  if (pr[1] != -1) close(pr[1]);
494  mrb_sys_fail(mrb, "pipe");
495  }
496  mrb_fd_cloexec(mrb, pw[0]);
497  mrb_fd_cloexec(mrb, pw[1]);
498  }
499 
500  if (!doexec) {
501  // XXX
502  fflush(stdin);
503  fflush(stdout);
504  fflush(stderr);
505  }
506 
507  result = mrb_nil_value();
508  switch (pid = fork()) {
509  case 0: /* child */
510  if (opt_in != -1) {
511  dup2(opt_in, 0);
512  }
513  if (opt_out != -1) {
514  dup2(opt_out, 1);
515  }
516  if (opt_err != -1) {
517  dup2(opt_err, 2);
518  }
519  if (OPEN_READABLE_P(flags)) {
520  close(pr[0]);
521  if (pr[1] != 1) {
522  dup2(pr[1], 1);
523  close(pr[1]);
524  }
525  }
526  if (OPEN_WRITABLE_P(flags)) {
527  close(pw[1]);
528  if (pw[0] != 0) {
529  dup2(pw[0], 0);
530  close(pw[0]);
531  }
532  }
533  if (doexec) {
534  for (fd = 3; fd < NOFILE; fd++) {
535  close(fd);
536  }
538  mrb_raisef(mrb, E_IO_ERROR, "command not found: %s", cmd);
539  _exit(127);
540  }
541  result = mrb_nil_value();
542  break;
543 
544  default: /* parent */
545  if (OPEN_RDWR_P(flags)) {
546  close(pr[1]);
547  fd = pr[0];
548  close(pw[0]);
549  write_fd = pw[1];
550  } else if (OPEN_RDONLY_P(flags)) {
551  close(pr[1]);
552  fd = pr[0];
553  } else {
554  close(pw[0]);
555  fd = pw[1];
556  }
557 
558  mrb_iv_set(mrb, io, mrb_intern_lit(mrb, "@buf"), mrb_str_new_cstr(mrb, ""));
559 
560  fptr = mrb_io_alloc(mrb);
561  fptr->fd = fd;
562  fptr->fd2 = write_fd;
563  fptr->pid = pid;
564  fptr->readable = OPEN_READABLE_P(flags);
565  fptr->writable = OPEN_WRITABLE_P(flags);
566  fptr->sync = 0;
567 
569  DATA_PTR(io) = fptr;
570  result = io;
571  break;
572 
573  case -1: /* error */
574  saved_errno = errno;
575  if (OPEN_READABLE_P(flags)) {
576  close(pr[0]);
577  close(pr[1]);
578  }
579  if (OPEN_WRITABLE_P(flags)) {
580  close(pw[0]);
581  close(pw[1]);
582  }
583  errno = saved_errno;
584  mrb_sys_fail(mrb, "pipe_open failed.");
585  break;
586  }
587  return result;
588 }
589 #endif /* _WIN32 */
590 #endif /* TARGET_OS_IPHONE */
591 
592 static int
593 mrb_dup(mrb_state *mrb, int fd, mrb_bool *failed)
594 {
595  int new_fd;
596 
597  *failed = TRUE;
598  if (fd < 0)
599  return fd;
600 
601  new_fd = dup(fd);
602  if (new_fd > 0) *failed = FALSE;
603  return new_fd;
604 }
605 
606 static mrb_value
608 {
609  mrb_value orig = mrb_get_arg1(mrb);
610  mrb_value buf;
611  struct mrb_io *fptr_copy;
612  struct mrb_io *fptr_orig;
613  mrb_bool failed = TRUE;
614 
615  fptr_orig = io_get_open_fptr(mrb, orig);
616  fptr_copy = (struct mrb_io *)DATA_PTR(copy);
617  if (fptr_orig == fptr_copy) return copy;
618  if (fptr_copy != NULL) {
619  fptr_finalize(mrb, fptr_copy, FALSE);
620  mrb_free(mrb, fptr_copy);
621  }
622  fptr_copy = (struct mrb_io *)mrb_io_alloc(mrb);
623 
625  DATA_PTR(copy) = fptr_copy;
626 
627  buf = mrb_iv_get(mrb, orig, mrb_intern_lit(mrb, "@buf"));
628  mrb_iv_set(mrb, copy, mrb_intern_lit(mrb, "@buf"), buf);
629 
630  fptr_copy->fd = mrb_dup(mrb, fptr_orig->fd, &failed);
631  if (failed) {
632  mrb_sys_fail(mrb, 0);
633  }
634  mrb_fd_cloexec(mrb, fptr_copy->fd);
635 
636  if (fptr_orig->fd2 != -1) {
637  fptr_copy->fd2 = mrb_dup(mrb, fptr_orig->fd2, &failed);
638  if (failed) {
639  close(fptr_copy->fd);
640  mrb_sys_fail(mrb, 0);
641  }
642  mrb_fd_cloexec(mrb, fptr_copy->fd2);
643  }
644 
645  fptr_copy->pid = fptr_orig->pid;
646  fptr_copy->readable = fptr_orig->readable;
647  fptr_copy->writable = fptr_orig->writable;
648  fptr_copy->sync = fptr_orig->sync;
649  fptr_copy->is_socket = fptr_orig->is_socket;
650 
651  return copy;
652 }
653 
654 static void
656 {
657  struct stat sb;
658  int fdi = (int)fd;
659 
660 #if MRB_INT_MIN < INT_MIN || MRB_INT_MAX > INT_MAX
661  if (fdi != fd) {
662  goto badfd;
663  }
664 #endif
665 
666 #ifdef _WIN32
667  {
668  DWORD err;
669  int len = sizeof(err);
670 
671  if (getsockopt(fdi, SOL_SOCKET, SO_ERROR, (char*)&err, &len) == 0) {
672  return;
673  }
674  }
675 
676  if (fdi < 0 || fdi > _getmaxstdio()) {
677  goto badfd;
678  }
679 #endif /* _WIN32 */
680 
681  if (fstat(fdi, &sb) != 0) {
682  goto badfd;
683  }
684 
685  return;
686 
687 badfd:
688  mrb_sys_fail(mrb, "bad file descriptor");
689 }
690 
691 static mrb_value
693 {
694  struct mrb_io *fptr;
695  mrb_int fd;
696  mrb_value mode, opt;
697  int flags;
698 
699  mode = opt = mrb_nil_value();
700 
701  mrb_get_args(mrb, "i|oo", &fd, &mode, &opt);
702  switch (fd) {
703  case 0: /* STDIN_FILENO */
704  case 1: /* STDOUT_FILENO */
705  case 2: /* STDERR_FILENO */
706  break;
707  default:
708  check_file_descriptor(mrb, fd);
709  break;
710  }
711  if (mrb_nil_p(mode)) {
712  mode = mrb_str_new_cstr(mrb, "r");
713  }
714  if (mrb_nil_p(opt)) {
715  opt = mrb_hash_new(mrb);
716  }
717 
719 
720  mrb_iv_set(mrb, io, mrb_intern_lit(mrb, "@buf"), mrb_str_new_cstr(mrb, ""));
721 
722  fptr = (struct mrb_io *)DATA_PTR(io);
723  if (fptr != NULL) {
724  fptr_finalize(mrb, fptr, TRUE);
725  mrb_free(mrb, fptr);
726  }
727  fptr = mrb_io_alloc(mrb);
728 
730  DATA_PTR(io) = fptr;
731 
732  fptr->fd = (int)fd;
733  fptr->readable = OPEN_READABLE_P(flags);
734  fptr->writable = OPEN_WRITABLE_P(flags);
735  fptr->sync = 0;
736  return io;
737 }
738 
739 static void
740 fptr_finalize(mrb_state *mrb, struct mrb_io *fptr, int quiet)
741 {
742  int saved_errno = 0;
743 
744  if (fptr == NULL) {
745  return;
746  }
747 
748  if (fptr->fd > 2) {
749 #ifdef _WIN32
750  if (fptr->is_socket) {
751  if (closesocket(fptr->fd) != 0) {
752  saved_errno = WSAGetLastError();
753  }
754  fptr->fd = -1;
755  }
756 #endif
757  if (fptr->fd != -1) {
758  if (close(fptr->fd) == -1) {
759  saved_errno = errno;
760  }
761  }
762  fptr->fd = -1;
763  }
764 
765  if (fptr->fd2 > 2) {
766  if (close(fptr->fd2) == -1) {
767  if (saved_errno == 0) {
768  saved_errno = errno;
769  }
770  }
771  fptr->fd2 = -1;
772  }
773 
774  if (fptr->pid != 0) {
775 #if !defined(_WIN32) && !defined(_WIN64)
776  pid_t pid;
777  int status;
778  do {
779  pid = waitpid(fptr->pid, &status, 0);
780  } while (pid == -1 && errno == EINTR);
781  if (!quiet && pid == fptr->pid) {
783  }
784 #else
785  HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, fptr->pid);
786  DWORD status;
787  if (WaitForSingleObject(h, INFINITE) && GetExitCodeProcess(h, &status))
788  if (!quiet)
789  io_set_process_status(mrb, fptr->pid, (int)status);
790  CloseHandle(h);
791 #endif
792  fptr->pid = 0;
793  /* Note: we don't raise an exception when waitpid(3) fails */
794  }
795 
796  if (!quiet && saved_errno != 0) {
797  errno = saved_errno;
798  mrb_sys_fail(mrb, "fptr_finalize failed.");
799  }
800 }
801 
802 static mrb_value
804 {
805  struct mrb_io *fptr = io_get_open_fptr(mrb, self);
806  if (! fptr->readable) {
807  mrb_raise(mrb, E_IO_ERROR, "not opened for reading");
808  }
809  return mrb_nil_value();
810 }
811 
812 static mrb_value
814 {
815  struct mrb_io *fptr;
816 
817  fptr = io_get_open_fptr(mrb, self);
818  if (isatty(fptr->fd) == 0)
819  return mrb_false_value();
820  return mrb_true_value();
821 }
822 
823 static mrb_value
825 {
826  struct RClass *c = mrb_class_ptr(klass);
828  mrb_value obj;
829 
830  /* copied from mrb_instance_alloc() */
831  if (ttype == 0) ttype = MRB_TT_OBJECT;
832  obj = mrb_obj_value((struct RObject*)mrb_obj_alloc(mrb, ttype, c));
833  return mrb_io_initialize(mrb, obj);
834 }
835 
836 static mrb_value
838 {
839  mrb_int fd;
840  mrb_get_args(mrb, "i", &fd);
841  if (close((int)fd) == -1) {
842  mrb_sys_fail(mrb, "close");
843  }
844  return mrb_fixnum_value(0);
845 }
846 
847 static int
848 mrb_cloexec_open(mrb_state *mrb, const char *pathname, mrb_int flags, mrb_int mode)
849 {
850  int fd, retry = FALSE;
851  char* fname = mrb_locale_from_utf8(pathname, -1);
852 
853 #ifdef O_CLOEXEC
854  /* O_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */
855  flags |= O_CLOEXEC;
856 #elif defined O_NOINHERIT
857  flags |= O_NOINHERIT;
858 #endif
859 reopen:
860  fd = open(fname, (int)flags, (fmode_t)mode);
861  if (fd == -1) {
862  if (!retry) {
863  switch (errno) {
864  case ENFILE:
865  case EMFILE:
866  mrb_garbage_collect(mrb);
867  retry = TRUE;
868  goto reopen;
869  }
870  }
871 
872  mrb_sys_fail(mrb, RSTRING_CSTR(mrb, mrb_format(mrb, "open %s", pathname)));
873  }
875 
876  if (fd <= 2) {
877  mrb_fd_cloexec(mrb, fd);
878  }
879  return fd;
880 }
881 
882 static mrb_value
884 {
887  mrb_int fd, perm = -1;
888  const char *pat;
889  int flags;
890 
891  mrb_get_args(mrb, "S|oi", &path, &mode, &perm);
892  if (perm < 0) {
893  perm = 0666;
894  }
895 
896  pat = RSTRING_CSTR(mrb, path);
898  fd = mrb_cloexec_open(mrb, pat, flags, perm);
899  return mrb_fixnum_value(fd);
900 }
901 
903  mrb_io_read_write_size (*readfunc)(int, void *, fsize_t, off_t),
905 
908 {
909  return (mrb_io_read_write_size)read(fd, buf, nbytes);
910 }
911 
912 static mrb_value
914 {
916  mrb_int maxlen;
917 
918  mrb_get_args(mrb, "i|S", &maxlen, &buf);
919 
920  return mrb_io_sysread_common(mrb, mrb_sysread_dummy, io, buf, maxlen, 0);
921 }
922 
923 static mrb_value
925  mrb_io_read_write_size (*readfunc)(int, void *, fsize_t, off_t),
927 {
928  struct mrb_io *fptr;
929  int ret;
930 
931  if (maxlen < 0) {
932  mrb_raise(mrb, E_ARGUMENT_ERROR, "negative expanding string size");
933  }
934  else if (maxlen == 0) {
935  return mrb_str_new(mrb, NULL, maxlen);
936  }
937 
938  if (mrb_nil_p(buf)) {
939  buf = mrb_str_new(mrb, NULL, maxlen);
940  }
941 
942  if (RSTRING_LEN(buf) != maxlen) {
943  buf = mrb_str_resize(mrb, buf, maxlen);
944  }
945  else {
946  mrb_str_modify(mrb, RSTRING(buf));
947  }
948 
949  fptr = (struct mrb_io *)io_get_open_fptr(mrb, io);
950  if (!fptr->readable) {
951  mrb_raise(mrb, E_IO_ERROR, "not opened for reading");
952  }
953  ret = readfunc(fptr->fd, RSTRING_PTR(buf), (fsize_t)maxlen, offset);
954  if (ret < 0) {
955  mrb_sys_fail(mrb, "sysread failed");
956  }
957  if (RSTRING_LEN(buf) != ret) {
958  buf = mrb_str_resize(mrb, buf, ret);
959  }
960  if (ret == 0 && maxlen > 0) {
961  mrb_raise(mrb, E_EOF_ERROR, "sysread failed: End of File");
962  }
963  return buf;
964 }
965 
966 static mrb_value
968 {
969  struct mrb_io *fptr;
970  off_t pos;
971  mrb_int offset, whence = -1;
972 
973  mrb_get_args(mrb, "i|i", &offset, &whence);
974  if (whence < 0) {
975  whence = 0;
976  }
977 
978  fptr = io_get_open_fptr(mrb, io);
979  pos = lseek(fptr->fd, (off_t)offset, (int)whence);
980  if (pos == -1) {
981  mrb_sys_fail(mrb, "sysseek");
982  }
983  if (pos > MRB_INT_MAX) {
984 #ifndef MRB_NO_FLOAT
985  return mrb_float_value(mrb, (mrb_float)pos);
986 #else
987  mrb_raise(mrb, E_IO_ERROR, "sysseek reached too far for MRB_NO_FLOAT");
988 #endif
989  } else {
990  return mrb_int_value(mrb, pos);
991  }
992 }
993 
994 static mrb_value
996  mrb_io_read_write_size (*writefunc)(int, const void *, fsize_t, off_t),
998 {
999  struct mrb_io *fptr;
1000  int fd, length;
1001 
1002  fptr = io_get_open_fptr(mrb, io);
1003  if (! fptr->writable) {
1004  mrb_raise(mrb, E_IO_ERROR, "not opened for writing");
1005  }
1006 
1007  if (fptr->fd2 == -1) {
1008  fd = fptr->fd;
1009  } else {
1010  fd = fptr->fd2;
1011  }
1012  length = writefunc(fd, RSTRING_PTR(buf), (fsize_t)RSTRING_LEN(buf), offset);
1013  if (length == -1) {
1014  mrb_sys_fail(mrb, 0);
1015  }
1016 
1017  return mrb_int_value(mrb, (mrb_int)length);
1018 }
1019 
1022 {
1023  return (mrb_io_read_write_size)write(fd, buf, nbytes);
1024 }
1025 
1026 static mrb_value
1028 {
1029  mrb_value buf;
1030 
1031  mrb_get_args(mrb, "S", &buf);
1032 
1033  return mrb_io_syswrite_common(mrb, mrb_syswrite_dummy, io, buf, 0);
1034 }
1035 
1036 static mrb_value
1038 {
1039  struct mrb_io *fptr;
1040  fptr = io_get_open_fptr(mrb, self);
1041  fptr_finalize(mrb, fptr, FALSE);
1042  return mrb_nil_value();
1043 }
1044 
1045 static mrb_value
1047 {
1048  struct mrb_io *fptr;
1049  fptr = io_get_open_fptr(mrb, self);
1050  if (close((int)fptr->fd2) == -1) {
1051  mrb_sys_fail(mrb, "close");
1052  }
1053  return mrb_nil_value();
1054 }
1055 
1056 static mrb_value
1058 {
1059  struct mrb_io *fptr;
1060  fptr = (struct mrb_io *)mrb_data_get_ptr(mrb, io, &mrb_io_type);
1061  if (fptr == NULL || fptr->fd >= 0) {
1062  return mrb_false_value();
1063  }
1064 
1065  return mrb_true_value();
1066 }
1067 
1068 static mrb_value
1070 {
1071  struct mrb_io *fptr;
1072  fptr = io_get_open_fptr(mrb, io);
1073 
1074  if (fptr->pid > 0) {
1075  return mrb_fixnum_value(fptr->pid);
1076  }
1077 
1078  return mrb_nil_value();
1079 }
1080 
1081 static struct timeval
1083 {
1084  struct timeval t = { 0, 0 };
1085 
1086  switch (mrb_type(time)) {
1087  case MRB_TT_INTEGER:
1088  t.tv_sec = (ftime_t)mrb_integer(time);
1089  t.tv_usec = 0;
1090  break;
1091 
1092 #ifndef MRB_NO_FLOAT
1093  case MRB_TT_FLOAT:
1094  t.tv_sec = (ftime_t)mrb_float(time);
1095  t.tv_usec = (fsuseconds_t)((mrb_float(time) - t.tv_sec) * 1000000.0);
1096  break;
1097 #endif
1098 
1099  default:
1100  mrb_raise(mrb, E_TYPE_ERROR, "wrong argument class");
1101  }
1102 
1103  return t;
1104 }
1105 
1106 static int
1108 {
1109  mrb_value buf = mrb_iv_get(mrb, io, mrb_intern_lit(mrb, "@buf"));
1110  if (mrb_string_p(buf) && RSTRING_LEN(buf) > 0) {
1111  return 1;
1112  }
1113  return 0;
1114 }
1115 
1116 #if !defined(_WIN32) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
1117 static mrb_value
1119 {
1122  struct mrb_io *fptr_r;
1123  struct mrb_io *fptr_w;
1124  int pipes[2];
1125 
1126  if (mrb_pipe(mrb, pipes) == -1) {
1127  mrb_sys_fail(mrb, "pipe");
1128  }
1129 
1131  mrb_iv_set(mrb, r, mrb_intern_lit(mrb, "@buf"), mrb_str_new_cstr(mrb, ""));
1132  fptr_r = mrb_io_alloc(mrb);
1133  fptr_r->fd = pipes[0];
1134  fptr_r->readable = 1;
1135  fptr_r->writable = 0;
1136  fptr_r->sync = 0;
1137  DATA_TYPE(r) = &mrb_io_type;
1138  DATA_PTR(r) = fptr_r;
1139 
1141  mrb_iv_set(mrb, w, mrb_intern_lit(mrb, "@buf"), mrb_str_new_cstr(mrb, ""));
1142  fptr_w = mrb_io_alloc(mrb);
1143  fptr_w->fd = pipes[1];
1144  fptr_w->readable = 0;
1145  fptr_w->writable = 1;
1146  fptr_w->sync = 1;
1147  DATA_TYPE(w) = &mrb_io_type;
1148  DATA_PTR(w) = fptr_w;
1149 
1150  return mrb_assoc_new(mrb, r, w);
1151 }
1152 #endif
1153 
1154 static mrb_value
1156 {
1157  const mrb_value *argv;
1158  mrb_int argc;
1159  mrb_value read, read_io, write, except, timeout, list;
1160  struct timeval *tp, timerec;
1161  fd_set pset, rset, wset, eset;
1162  fd_set *rp, *wp, *ep;
1163  struct mrb_io *fptr;
1164  int pending = 0;
1165  mrb_value result;
1166  int max = 0;
1167  int interrupt_flag = 0;
1168  int i, n;
1169 
1170  mrb_get_args(mrb, "*", &argv, &argc);
1171 
1172  if (argc < 1 || argc > 4) {
1173  mrb_argnum_error(mrb, argc, 1, 4);
1174  }
1175 
1176  timeout = mrb_nil_value();
1177  except = mrb_nil_value();
1178  write = mrb_nil_value();
1179  if (argc > 3)
1180  timeout = argv[3];
1181  if (argc > 2)
1182  except = argv[2];
1183  if (argc > 1)
1184  write = argv[1];
1185  read = argv[0];
1186 
1187  if (mrb_nil_p(timeout)) {
1188  tp = NULL;
1189  } else {
1190  timerec = time2timeval(mrb, timeout);
1191  tp = &timerec;
1192  }
1193 
1194  FD_ZERO(&pset);
1195  if (!mrb_nil_p(read)) {
1197  rp = &rset;
1198  FD_ZERO(rp);
1199  for (i = 0; i < RARRAY_LEN(read); i++) {
1200  read_io = RARRAY_PTR(read)[i];
1201  fptr = io_get_open_fptr(mrb, read_io);
1202  if (fptr->fd >= FD_SETSIZE) continue;
1203  FD_SET(fptr->fd, rp);
1204  if (mrb_io_read_data_pending(mrb, read_io)) {
1205  pending++;
1206  FD_SET(fptr->fd, &pset);
1207  }
1208  if (max < fptr->fd)
1209  max = fptr->fd;
1210  }
1211  if (pending) {
1212  timerec.tv_sec = timerec.tv_usec = 0;
1213  tp = &timerec;
1214  }
1215  } else {
1216  rp = NULL;
1217  }
1218 
1219  if (!mrb_nil_p(write)) {
1221  wp = &wset;
1222  FD_ZERO(wp);
1223  for (i = 0; i < RARRAY_LEN(write); i++) {
1225  if (fptr->fd >= FD_SETSIZE) continue;
1226  FD_SET(fptr->fd, wp);
1227  if (max < fptr->fd)
1228  max = fptr->fd;
1229  if (fptr->fd2 >= 0) {
1230  FD_SET(fptr->fd2, wp);
1231  if (max < fptr->fd2)
1232  max = fptr->fd2;
1233  }
1234  }
1235  } else {
1236  wp = NULL;
1237  }
1238 
1239  if (!mrb_nil_p(except)) {
1240  mrb_check_type(mrb, except, MRB_TT_ARRAY);
1241  ep = &eset;
1242  FD_ZERO(ep);
1243  for (i = 0; i < RARRAY_LEN(except); i++) {
1244  fptr = io_get_open_fptr(mrb, RARRAY_PTR(except)[i]);
1245  if (fptr->fd >= FD_SETSIZE) continue;
1246  FD_SET(fptr->fd, ep);
1247  if (max < fptr->fd)
1248  max = fptr->fd;
1249  if (fptr->fd2 >= 0) {
1250  FD_SET(fptr->fd2, ep);
1251  if (max < fptr->fd2)
1252  max = fptr->fd2;
1253  }
1254  }
1255  } else {
1256  ep = NULL;
1257  }
1258 
1259  max++;
1260 
1261 retry:
1262  n = select(max, rp, wp, ep, tp);
1263  if (n < 0) {
1264  if (errno != EINTR)
1265  mrb_sys_fail(mrb, "select failed");
1266  if (tp == NULL)
1267  goto retry;
1268  interrupt_flag = 1;
1269  }
1270 
1271  if (!pending && n == 0)
1272  return mrb_nil_value();
1273 
1274  result = mrb_ary_new_capa(mrb, 3);
1275  mrb_ary_push(mrb, result, rp? mrb_ary_new(mrb) : mrb_ary_new_capa(mrb, 0));
1276  mrb_ary_push(mrb, result, wp? mrb_ary_new(mrb) : mrb_ary_new_capa(mrb, 0));
1277  mrb_ary_push(mrb, result, ep? mrb_ary_new(mrb) : mrb_ary_new_capa(mrb, 0));
1278 
1279  if (interrupt_flag == 0) {
1280  if (rp) {
1281  list = RARRAY_PTR(result)[0];
1282  for (i = 0; i < RARRAY_LEN(read); i++) {
1284  if (FD_ISSET(fptr->fd, rp) ||
1285  FD_ISSET(fptr->fd, &pset)) {
1286  mrb_ary_push(mrb, list, RARRAY_PTR(read)[i]);
1287  }
1288  }
1289  }
1290 
1291  if (wp) {
1292  list = RARRAY_PTR(result)[1];
1293  for (i = 0; i < RARRAY_LEN(write); i++) {
1295  if (FD_ISSET(fptr->fd, wp)) {
1296  mrb_ary_push(mrb, list, RARRAY_PTR(write)[i]);
1297  } else if (fptr->fd2 >= 0 && FD_ISSET(fptr->fd2, wp)) {
1298  mrb_ary_push(mrb, list, RARRAY_PTR(write)[i]);
1299  }
1300  }
1301  }
1302 
1303  if (ep) {
1304  list = RARRAY_PTR(result)[2];
1305  for (i = 0; i < RARRAY_LEN(except); i++) {
1306  fptr = io_get_open_fptr(mrb, RARRAY_PTR(except)[i]);
1307  if (FD_ISSET(fptr->fd, ep)) {
1308  mrb_ary_push(mrb, list, RARRAY_PTR(except)[i]);
1309  } else if (fptr->fd2 >= 0 && FD_ISSET(fptr->fd2, ep)) {
1310  mrb_ary_push(mrb, list, RARRAY_PTR(except)[i]);
1311  }
1312  }
1313  }
1314  }
1315 
1316  return result;
1317 }
1318 
1319 int
1321 {
1322  struct mrb_io *fptr;
1323  fptr = io_get_open_fptr(mrb, io);
1324  return fptr->fd;
1325 }
1326 
1327 static mrb_value
1329 {
1330  int fd = mrb_io_fileno(mrb, io);
1331  return mrb_fixnum_value(fd);
1332 }
1333 
1334 #if defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC)
1335 static mrb_value
1337 {
1338  struct mrb_io *fptr;
1339  int ret;
1340 
1341  fptr = io_get_open_fptr(mrb, self);
1342 
1343  if (fptr->fd2 >= 0) {
1344  if ((ret = fcntl(fptr->fd2, F_GETFD)) == -1) mrb_sys_fail(mrb, "F_GETFD failed");
1345  if (!(ret & FD_CLOEXEC)) return mrb_false_value();
1346  }
1347 
1348  if ((ret = fcntl(fptr->fd, F_GETFD)) == -1) mrb_sys_fail(mrb, "F_GETFD failed");
1349  if (!(ret & FD_CLOEXEC)) return mrb_false_value();
1350  return mrb_true_value();
1351 }
1352 #else
1353 # define mrb_io_close_on_exec_p mrb_notimplement_m
1354 #endif
1355 
1356 #if defined(F_GETFD) && defined(F_SETFD) && defined(FD_CLOEXEC)
1357 static mrb_value
1359 {
1360  struct mrb_io *fptr;
1361  int flag, ret;
1362  mrb_bool b;
1363 
1364  fptr = io_get_open_fptr(mrb, self);
1365  mrb_get_args(mrb, "b", &b);
1366  flag = b ? FD_CLOEXEC : 0;
1367 
1368  if (fptr->fd2 >= 0) {
1369  if ((ret = fcntl(fptr->fd2, F_GETFD)) == -1) mrb_sys_fail(mrb, "F_GETFD failed");
1370  if ((ret & FD_CLOEXEC) != flag) {
1371  ret = (ret & ~~FD_CLOEXEC) | flag;
1372  ret = fcntl(fptr->fd2, F_SETFD, ret);
1373 
1374  if (ret == -1) mrb_sys_fail(mrb, "F_SETFD failed");
1375  }
1376  }
1377 
1378  if ((ret = fcntl(fptr->fd, F_GETFD)) == -1) mrb_sys_fail(mrb, "F_GETFD failed");
1379  if ((ret & FD_CLOEXEC) != flag) {
1380  ret = (ret & ~~FD_CLOEXEC) | flag;
1381  ret = fcntl(fptr->fd, F_SETFD, ret);
1382  if (ret == -1) mrb_sys_fail(mrb, "F_SETFD failed");
1383  }
1384 
1385  return mrb_bool_value(b);
1386 }
1387 #else
1388 # define mrb_io_set_close_on_exec mrb_notimplement_m
1389 #endif
1390 
1391 static mrb_value
1393 {
1394  struct mrb_io *fptr;
1395  mrb_bool b;
1396 
1397  fptr = io_get_open_fptr(mrb, self);
1398  mrb_get_args(mrb, "b", &b);
1399  fptr->sync = b;
1400  return mrb_bool_value(b);
1401 }
1402 
1403 static mrb_value
1405 {
1406  struct mrb_io *fptr;
1407  fptr = io_get_open_fptr(mrb, self);
1408  return mrb_bool_value(fptr->sync);
1409 }
1410 
1411 #ifndef MRB_WITH_IO_PREAD_PWRITE
1412 # define mrb_io_pread mrb_notimplement_m
1413 # define mrb_io_pwrite mrb_notimplement_m
1414 #else
1415 static off_t
1416 value2off(mrb_state *mrb, mrb_value offv)
1417 {
1418  return (off_t)mrb_int(mrb, offv);
1419 }
1420 
1421 /*
1422  * call-seq:
1423  * pread(maxlen, offset, outbuf = "") -> outbuf
1424  */
1425 static mrb_value
1427 {
1429  mrb_value off;
1430  mrb_int maxlen;
1431 
1432  mrb_get_args(mrb, "io|S!", &maxlen, &off, &buf);
1433 
1434  return mrb_io_sysread_common(mrb, pread, io, buf, maxlen, value2off(mrb, off));
1435 }
1436 
1437 /*
1438  * call-seq:
1439  * pwrite(buffer, offset) -> wrote_bytes
1440  */
1441 static mrb_value
1443 {
1444  mrb_value buf, off;
1445 
1446  mrb_get_args(mrb, "So", &buf, &off);
1447 
1448  return mrb_io_syswrite_common(mrb, pwrite, io, buf, value2off(mrb, off));
1449 }
1450 #endif /* MRB_WITH_IO_PREAD_PWRITE */
1451 
1452 static mrb_value
1454 {
1455  mrb_value str2;
1456  mrb_int newlen;
1457  struct RString *s;
1458  char *p;
1459 
1460  s = RSTRING(str);
1461  mrb_str_modify(mrb, s);
1462  p = RSTR_PTR(s);
1463  str2 = mrb_str_new(mrb, p, len);
1464  newlen = RSTR_LEN(s)-len;
1465  memmove(p, p+len, newlen);
1466  p[newlen] = '\0';
1467  RSTR_SET_LEN(s, newlen);
1468 
1469  return str2;
1470 }
1471 
1472 static mrb_value
1474 {
1475  mrb_value str;
1476  mrb_int len;
1477 
1478  mrb_get_args(mrb, "Si", &str, &len);
1479  return io_bufread(mrb, str, len);
1480 }
1481 
1482 static mrb_value
1484 {
1485  mrb_value buf;
1486  mrb_int len = 1;
1487 #ifdef MRB_UTF8_STRING
1488  unsigned char c;
1489 #endif
1490 
1491  mrb_get_args(mrb, "S", &buf);
1492  mrb_assert(RSTRING_LEN(buf) > 0);
1494  mrb_str_modify(mrb, RSTRING(buf));
1495 #ifdef MRB_UTF8_STRING
1496  c = RSTRING_PTR(buf)[0];
1497  if (c & 0x80) {
1498  len = mrb_utf8len(RSTRING_PTR(buf), RSTRING_END(buf));
1499  if (len == 1 && RSTRING_LEN(buf) < 4) { /* partial UTF-8 */
1500  mrb_int blen = RSTRING_LEN(buf);
1501  ssize_t n;
1502 
1503  struct mrb_io *fptr = (struct mrb_io*)io_get_open_fptr(mrb, self);
1504 
1505  if (!fptr->readable) {
1506  mrb_raise(mrb, E_IO_ERROR, "not opened for reading");
1507  }
1508  /* refill the buffer */
1509  mrb_str_resize(mrb, buf, 4096);
1510  n = read(fptr->fd, RSTRING_PTR(buf)+blen, 4096-blen);
1511  if (n < 0) mrb_sys_fail(mrb, "sysread failed");
1512  mrb_str_resize(mrb, buf, blen+n);
1513  }
1514  len = mrb_utf8len(RSTRING_PTR(buf), RSTRING_END(buf));
1515  }
1516 #endif
1517  return io_bufread(mrb, buf, len);
1518 }
1519 
1520 void
1522 {
1523  struct RClass *io;
1524 
1525  io = mrb_define_class(mrb, "IO", mrb->object_class);
1527 
1528  mrb_include_module(mrb, io, mrb_module_get(mrb, "Enumerable")); /* 15.2.20.3 */
1529  mrb_define_class_method(mrb, io, "_popen", mrb_io_s_popen, MRB_ARGS_ARG(1,2));
1530  mrb_define_class_method(mrb, io, "_sysclose", mrb_io_s_sysclose, MRB_ARGS_REQ(1));
1531  mrb_define_class_method(mrb, io, "for_fd", mrb_io_s_for_fd, MRB_ARGS_ARG(1,2));
1532  mrb_define_class_method(mrb, io, "select", mrb_io_s_select, MRB_ARGS_ARG(1,3));
1533  mrb_define_class_method(mrb, io, "sysopen", mrb_io_s_sysopen, MRB_ARGS_ARG(1,2));
1534 #if !defined(_WIN32) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
1536 #endif
1537 
1538  mrb_define_method(mrb, io, "initialize", mrb_io_initialize, MRB_ARGS_ARG(1,2)); /* 15.2.20.5.21 (x)*/
1539  mrb_define_method(mrb, io, "initialize_copy", mrb_io_initialize_copy, MRB_ARGS_REQ(1));
1540  mrb_define_method(mrb, io, "_check_readable", mrb_io_check_readable, MRB_ARGS_NONE());
1541  mrb_define_method(mrb, io, "isatty", mrb_io_isatty, MRB_ARGS_NONE());
1542  mrb_define_method(mrb, io, "sync", mrb_io_sync, MRB_ARGS_NONE());
1543  mrb_define_method(mrb, io, "sync=", mrb_io_set_sync, MRB_ARGS_REQ(1));
1544  mrb_define_method(mrb, io, "sysread", mrb_io_sysread, MRB_ARGS_ARG(1,1));
1545  mrb_define_method(mrb, io, "sysseek", mrb_io_sysseek, MRB_ARGS_ARG(1,1));
1546  mrb_define_method(mrb, io, "syswrite", mrb_io_syswrite, MRB_ARGS_REQ(1));
1547  mrb_define_method(mrb, io, "close", mrb_io_close, MRB_ARGS_NONE()); /* 15.2.20.5.1 */
1548  mrb_define_method(mrb, io, "close_write", mrb_io_close_write, MRB_ARGS_NONE());
1549  mrb_define_method(mrb, io, "close_on_exec=", mrb_io_set_close_on_exec, MRB_ARGS_REQ(1));
1550  mrb_define_method(mrb, io, "close_on_exec?", mrb_io_close_on_exec_p, MRB_ARGS_NONE());
1551  mrb_define_method(mrb, io, "closed?", mrb_io_closed, MRB_ARGS_NONE()); /* 15.2.20.5.2 */
1552  mrb_define_method(mrb, io, "pid", mrb_io_pid, MRB_ARGS_NONE()); /* 15.2.20.5.2 */
1553  mrb_define_method(mrb, io, "fileno", mrb_io_fileno_m, MRB_ARGS_NONE());
1554  mrb_define_method(mrb, io, "pread", mrb_io_pread, MRB_ARGS_ANY()); /* ruby 2.5 feature */
1555  mrb_define_method(mrb, io, "pwrite", mrb_io_pwrite, MRB_ARGS_ANY()); /* ruby 2.5 feature */
1556 
1557  mrb_define_method(mrb, io, "_readchar", mrb_io_readchar, MRB_ARGS_REQ(1));
1558  mrb_define_class_method(mrb, io, "_bufread", mrb_io_bufread, MRB_ARGS_REQ(2));
1559 }
return _Result< 0 ? -1 :_Result;} #line 1069 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnwprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1091 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, va_list _ArgList) { return _vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1108 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _ArgList) { return _vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1133 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1179 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1196 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __vswprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1212 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf(wchar_t *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1227 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1243 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1264 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1281 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1283 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1312 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1347 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_l(_Format,((void *) 0), _ArgList);} #line 1361 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1380 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1394 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __swprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1414 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1435 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf(wchar_t *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1454 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1474 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "__swprintf_l_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __swprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vswprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __vswprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "swprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swprintf(wchar_t *_Buffer, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vswprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vswprintf(wchar_t *_Buffer, wchar_t const *_Format, va_list _Args);__inline int __cdecl _swprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1511 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1532 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1534 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1562 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1582 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1603 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1623 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1646 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1668 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1711 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1737 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1755 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1774 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1792 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #pragma warning(push) #pragma warning(disable:4141 6054) #pragma warning(pop) #line 1856 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" int __cdecl __stdio_common_vswscanf(unsigned __int64 _Options, wchar_t const *_Buffer, size_t _BufferCount, wchar_t const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vswscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1897 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf(wchar_t const *_Buffer, wchar_t const *_Format, va_list _ArgList) { return _vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1947 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1949 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1976 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1995 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_swscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2015 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "swscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl swscanf(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2034 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2054 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 2077 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2100 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2122 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2143 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) typedef __int64 fpos_t;errno_t __cdecl _get_stream_buffer_pointers(FILE *_Stream, char ***_Base, char ***_Pointer, int **_Count);errno_t __cdecl clearerr_s(FILE *_Stream);errno_t __cdecl fopen_s(FILE **_Stream, char const *_FileName, char const *_Mode);size_t __cdecl fread_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);errno_t __cdecl freopen_s(FILE **_Stream, char const *_FileName, char const *_Mode, FILE *_OldStream);char *__cdecl gets_s(char *_Buffer, rsize_t _Size);errno_t __cdecl tmpfile_s(FILE **_Stream);errno_t __cdecl tmpnam_s(char *_Buffer, rsize_t _Size);#line 145 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl clearerr(FILE *_Stream);int __cdecl fclose(FILE *_Stream);int __cdecl _fcloseall(void);FILE *__cdecl _fdopen(int _FileHandle, char const *_Mode);int __cdecl feof(FILE *_Stream);int __cdecl ferror(FILE *_Stream);int __cdecl fflush(FILE *_Stream);int __cdecl fgetc(FILE *_Stream);int __cdecl _fgetchar(void);int __cdecl fgetpos(FILE *_Stream, fpos_t *_Position);char *__cdecl fgets(char *_Buffer, int _MaxCount, FILE *_Stream);int __cdecl _fileno(FILE *_Stream);int __cdecl _flushall(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "fopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl fopen(char const *_FileName, char const *_Mode);int __cdecl fputc(int _Character, FILE *_Stream);int __cdecl _fputchar(int _Character);int __cdecl fputs(char const *_Buffer, FILE *_Stream);size_t __cdecl fread(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);__declspec(deprecated("This function or variable may be unsafe. Consider using " "freopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl freopen(char const *_FileName, char const *_Mode, FILE *_Stream);FILE *__cdecl _fsopen(char const *_FileName, char const *_Mode, int _ShFlag);int __cdecl fsetpos(FILE *_Stream, fpos_t const *_Position);int __cdecl fseek(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl ftell(FILE *_Stream);__int64 __cdecl _ftelli64(FILE *_Stream);size_t __cdecl fwrite(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl getc(FILE *_Stream);int __cdecl getchar(void);int __cdecl _getmaxstdio(void);int __cdecl _getw(FILE *_Stream);void __cdecl perror(char const *_ErrorMessage);int __cdecl _pclose(FILE *_Stream);FILE *__cdecl _popen(char const *_Command, char const *_Mode);#line 344 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl putc(int _Character, FILE *_Stream);int __cdecl putchar(int _Character);int __cdecl puts(char const *_Buffer);int __cdecl _putw(int _Word, FILE *_Stream);int __cdecl remove(char const *_FileName);int __cdecl rename(char const *_OldFileName, char const *_NewFileName);int __cdecl _unlink(char const *_FileName);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_unlink" ". See online help for details.")) int __cdecl unlink(char const *_FileName);#line 391 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl rewind(FILE *_Stream);int __cdecl _rmtmp(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "setvbuf" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) void __cdecl setbuf(FILE *_Stream, char *_Buffer);int __cdecl _setmaxstdio(int _Maximum);int __cdecl setvbuf(FILE *_Stream, char *_Buffer, int _Mode, size_t _Size);__declspec(allocator) char *__cdecl _tempnam(char const *_DirectoryName, char const *_FilePrefix);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpfile_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl tmpfile(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpnam_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl tmpnam(char *_Buffer);int __cdecl ungetc(int _Character, FILE *_Stream);void __cdecl _lock_file(FILE *_Stream);void __cdecl _unlock_file(FILE *_Stream);int __cdecl _fclose_nolock(FILE *_Stream);int __cdecl _fflush_nolock(FILE *_Stream);int __cdecl _fgetc_nolock(FILE *_Stream);int __cdecl _fputc_nolock(int _Character, FILE *_Stream);size_t __cdecl _fread_nolock(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);size_t __cdecl _fread_nolock_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _fseek_nolock(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64_nolock(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl _ftell_nolock(FILE *_Stream);__int64 __cdecl _ftelli64_nolock(FILE *_Stream);size_t __cdecl _fwrite_nolock(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _getc_nolock(FILE *_Stream);int __cdecl _putc_nolock(int _Character, FILE *_Stream);int __cdecl _ungetc_nolock(int _Character, FILE *_Stream);int *__cdecl __p__commode(void);#line 596 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfprintf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_s(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_p(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vfprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 648 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 662 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_s((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 677 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 693 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 695 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_p((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 710 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);} #line 724 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 738 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf(char const *const _Format, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 751 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 765 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf_s(char const *const _Format, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 780 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 796 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p(char const *const _Format, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 809 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 828 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 846 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl _set_printf_count_output(int _Value);int __cdecl _get_printf_count_output(void);__inline int __cdecl _fprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 871 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 891 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 893 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 948 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 965 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 983 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1002 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1004 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1022 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1039 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfscanf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _Arglist);__inline int __cdecl _vfscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options()), _Stream, _Format, _Locale, _ArgList);} #line 1070 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1084 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Stream, _Format, _Locale, _ArgList);} #line 1101 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1118 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1120 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1134 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf(char const *const _Format, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1147 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1161 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf_s(char const *const _Format, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1176 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1178 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_fscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _fscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1197 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "fscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl fscanf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1215 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1234 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fscanf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1254 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_scanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _scanf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1274 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "scanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl scanf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1291 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scanf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1309 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl scanf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1330 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsprintf(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsnprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, size_t _MaxCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_p(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1399 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1415 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);return _Result< 0 ? -1 :_Result;} #line 1446 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1462 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl vsprintf(char *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1477 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1498 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1516 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1526 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1547 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1563 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1585 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1602 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1630 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1641 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1659 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf(char const *const _Format, va_list _ArgList) { return _vscprintf_l(_Format,((void *) 0), _ArgList);} #line 1672 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p(char const *const _Format, va_list _ArgList) { return _vscprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1703 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1723 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1739 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1761 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf(char *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl sprintf(char *_Buffer, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl vsprintf(char *_Buffer, char const *_Format, va_list _Args);__inline int __cdecl _sprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1810 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1832 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1834 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1862 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1882 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1905 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1936 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1956 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _snprintf(char *_Buffer, size_t _BufferCount, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _vsnprintf(char *_Buffer, size_t _BufferCount, char const *_Format, va_list _Args);__inline int __cdecl _snprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1986 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2006 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2028 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2049 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2092 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2110 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p(_Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2127 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsscanf(unsigned __int64 _Options, char const *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vsscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2158 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsscanf(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2172 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2189 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __inline int __cdecl vsscanf_s(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2208 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) #line 2219 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2238 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl sscanf(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2275 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sscanf_s(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsscanf_s(_Buffer, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2297 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 2299 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2326 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2349 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2374 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2397 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) __declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_tempnam" ". See online help for details.")) char *__cdecl tempnam(char const *_Directory, char const *_FilePrefix);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fcloseall" ". See online help for details.")) int __cdecl fcloseall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fdopen" ". See online help for details.")) FILE *__cdecl fdopen(int _FileHandle, char const *_Format);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fgetchar" ". See online help for details.")) int __cdecl fgetchar(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fileno" ". See online help for details.")) int __cdecl fileno(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_flushall" ". See online help for details.")) int __cdecl flushall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fputchar" ". See online help for details.")) int __cdecl fputchar(int _Ch);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_getw" ". See online help for details.")) int __cdecl getw(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_putw" ". See online help for details.")) int __cdecl putw(int _Ch, FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_rmtmp" ". See online help for details.")) int __cdecl rmtmp(void);#line 2441 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h"__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma once#pragma once#pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int *__cdecl _errno(void);errno_t __cdecl _set_errno(int _Value);errno_t __cdecl _get_errno(int *_Value);unsigned long *__cdecl __doserrno(void);errno_t __cdecl _set_doserrno(unsigned long _Value);errno_t __cdecl _get_doserrno(unsigned long *_Value);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) void *__cdecl memchr(void const *_Buf, int _Val, size_t _MaxCount);int __cdecl memcmp(void const *_Buf1, void const *_Buf2, size_t _Size);void *__cdecl memcpy(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memmove(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memset(void *_Dst, int _Val, size_t _Size);char *__cdecl strchr(char const *_Str, int _Val);char *__cdecl strrchr(char const *_Str, int _Ch);char *__cdecl strstr(char const *_Str, char const *_SubStr);wchar_t *__cdecl wcschr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsrchr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsstr(wchar_t const *_Str, wchar_t const *_SubStr);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) static __inline errno_t __cdecl memcpy_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;if(_Source==((void *) 0)||_DestinationSize< _SourceSize) { memset(_Destination, 0, _DestinationSize);{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;return 22 ;} memcpy(_Destination, _Source, _SourceSize);return 0;} static __inline errno_t __cdecl memmove_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;memmove(_Destination, _Source, _SourceSize);return 0;}#pragma warning(pop) __pragma(pack(pop))#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int __cdecl _memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);int __cdecl _memicmp_l(void const *_Buf1, void const *_Buf2, size_t _Size, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memccpy" ". See online help for details.")) void *__cdecl memccpy(void *_Dst, void const *_Src, int _Val, size_t _Size);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memicmp" ". See online help for details.")) int __cdecl memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl wcscat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcscpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcsncat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);errno_t __cdecl wcsncpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);wchar_t *__cdecl wcstok_s(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);__declspec(allocator) wchar_t *__cdecl _wcsdup(wchar_t const *_String);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscat(wchar_t *_Destination, wchar_t const *_Source);int __cdecl wcscmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscpy(wchar_t *_Destination, wchar_t const *_Source);size_t __cdecl wcscspn(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcslen(wchar_t const *_String);size_t __cdecl wcsnlen(wchar_t const *_Source, size_t _MaxCount);static __inline size_t __cdecl wcsnlen_s(wchar_t const *_Source, size_t _MaxCount) { return(_Source==0) ? 0 :wcsnlen(_Source, _MaxCount);}__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncat(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);int __cdecl wcsncmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncpy(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);wchar_t *__cdecl wcspbrk(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcsspn(wchar_t const *_String, wchar_t const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcstok(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);#line 237 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstring.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) static __inline wchar_t *__cdecl _wcstok(wchar_t *const _String, wchar_t const *const _Delimiter) { return wcstok(_String, _Delimiter, 0);} __declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcserror(int _ErrorNumber);errno_t __cdecl _wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, int _ErrorNumber);__declspec(deprecated("This function or variable may be unsafe. Consider using " "__wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl __wcserror(wchar_t const *_String);errno_t __cdecl __wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, wchar_t const *_ErrorMessage);int __cdecl _wcsicmp(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicmp_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicmp_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);errno_t __cdecl _wcsnset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);wchar_t *__cdecl _wcsrev(wchar_t *_String);errno_t __cdecl _wcsset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsset(wchar_t *_String, wchar_t _Value);errno_t __cdecl _wcslwr_s(wchar_t *_String, size_t _SizeInWords);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr(wchar_t *_String);errno_t __cdecl _wcslwr_s_l(wchar_t *_String, size_t _SizeInWords, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr_l(wchar_t *_String, _locale_t _Locale);errno_t __cdecl _wcsupr_s(wchar_t *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr(wchar_t *_String);errno_t __cdecl _wcsupr_s_l(wchar_t *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr_l(wchar_t *_String, _locale_t _Locale);size_t __cdecl wcsxfrm(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount);size_t __cdecl _wcsxfrm_l(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount, _locale_t _Locale);int __cdecl wcscoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcscoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsicoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsncoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsncoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _wcsnicoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsdup" ". See online help for details.")) wchar_t *__cdecl wcsdup(wchar_t const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicmp" ". See online help for details.")) int __cdecl wcsicmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnicmp" ". See online help for details.")) int __cdecl wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnset" ". See online help for details.")) wchar_t *__cdecl wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsrev" ". See online help for details.")) wchar_t *__cdecl wcsrev(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsset" ". See online help for details.")) wchar_t *__cdecl wcsset(wchar_t *_String, wchar_t _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcslwr" ". See online help for details.")) wchar_t *__cdecl wcslwr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsupr" ". See online help for details.")) wchar_t *__cdecl wcsupr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicoll" ". See online help for details.")) int __cdecl wcsicoll(wchar_t const *_String1, wchar_t const *_String2);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl strcpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strcat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strerror_s(char *_Buffer, size_t _SizeInBytes, int _ErrorNumber);errno_t __cdecl strncat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);errno_t __cdecl strncpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);char *__cdecl strtok_s(char *_String, char const *_Delimiter, char **_Context);void *__cdecl _memccpy(void *_Dst, void const *_Src, int _Val, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcat(char *_Destination, char const *_Source);int __cdecl strcmp(char const *_Str1, char const *_Str2);int __cdecl _strcmpi(char const *_String1, char const *_String2);int __cdecl strcoll(char const *_String1, char const *_String2);int __cdecl _strcoll_l(char const *_String1, char const *_String2, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcpy(char *_Destination, char const *_Source);size_t __cdecl strcspn(char const *_Str, char const *_Control);__declspec(allocator) char *__cdecl _strdup(char const *_Source);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strerror(char const *_ErrorMessage);errno_t __cdecl _strerror_s(char *_Buffer, size_t _SizeInBytes, char const *_ErrorMessage);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strerror(int _ErrorMessage);int __cdecl _stricmp(char const *_String1, char const *_String2);int __cdecl _stricoll(char const *_String1, char const *_String2);int __cdecl _stricoll_l(char const *_String1, char const *_String2, _locale_t _Locale);int __cdecl _stricmp_l(char const *_String1, char const *_String2, _locale_t _Locale);size_t __cdecl strlen(char const *_Str);errno_t __cdecl _strlwr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr(char *_String);errno_t __cdecl _strlwr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr_l(char *_String, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncat(char *_Destination, char const *_Source, size_t _Count);int __cdecl strncmp(char const *_Str1, char const *_Str2, size_t _MaxCount);int __cdecl _strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicmp_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strnicoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strncoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strncoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);size_t __cdecl __strncnt(char const *_String, size_t _Count);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncpy(char *_Destination, char const *_Source, size_t _Count);size_t __cdecl strnlen(char const *_String, size_t _MaxCount);static __inline size_t __cdecl strnlen_s(char const *_String, size_t _MaxCount) { return _String==0 ? 0 :strnlen(_String, _MaxCount);} errno_t __cdecl _strnset_s(char *_String, size_t _SizeInBytes, int _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strnset(char *_Destination, int _Value, size_t _Count);char *__cdecl strpbrk(char const *_Str, char const *_Control);char *__cdecl _strrev(char *_Str);errno_t __cdecl _strset_s(char *_Destination, size_t _DestinationSize, int _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strset(char *_Destination, int _Value);size_t __cdecl strspn(char const *_Str, char const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strtok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strtok(char *_String, char const *_Delimiter);errno_t __cdecl _strupr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr(char *_String);errno_t __cdecl _strupr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr_l(char *_String, _locale_t _Locale);size_t __cdecl strxfrm(char *_Destination, char const *_Source, size_t _MaxCount);size_t __cdecl _strxfrm_l(char *_Destination, char const *_Source, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strdup" ". See online help for details.")) char *__cdecl strdup(char const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strcmpi" ". See online help for details.")) int __cdecl strcmpi(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_stricmp" ". See online help for details.")) int __cdecl stricmp(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strlwr" ". See online help for details.")) char *__cdecl strlwr(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnicmp" ". See online help for details.")) int __cdecl strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnset" ". See online help for details.")) char *__cdecl strnset(char *_String, int _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strrev" ". See online help for details.")) char *__cdecl strrev(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strset" ". See online help for details.")) char *__cdecl strset(char *_String, int _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strupr" ". See online help for details.")) char *__cdecl strupr(char *_String);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) __pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) typedef unsigned short _ino_t;typedef _ino_t ino_t;#line 24 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef unsigned int _dev_t;typedef _dev_t dev_t;#line 36 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef long _off_t;typedef _off_t off_t;#line 48 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h"#pragma warning(pop) typedef char *sds;#pragma pack(push, 1) struct sdshdr5 { unsigned char flags;char buf[];};struct sdshdr8 { uint8_t len;uint8_t alloc;unsigned char flags;char buf[];};struct sdshdr16 { uint16_t len;uint16_t alloc;unsigned char flags;char buf[];};struct sdshdr32 { uint32_t len;uint32_t alloc;unsigned char flags;char buf[];};struct sdshdr64 { uint64_t len;uint64_t alloc;unsigned char flags;char buf[];};#pragma pack(pop) static inline size_t sdslen(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :return((flags) >> 3) ;case 1 :return((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len;case 2 :return((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len;case 3 :return((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) ->len;case 4 :return((struct sdshdr64 *)((s) -(sizeof(struct sdshdr64)))) ->len;} return 0;}static inline size_t sdsavail(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ return 0;} case 1 :{ struct sdshdr8 *sh=(void *)((s) -(sizeof(struct sdshdr8)));;return sh->alloc - sh->len;} case 2 :{ struct sdshdr16 *sh=(void *)((s) -(sizeof(struct sdshdr16)));;return sh->alloc - sh->len;} case 3 :{ struct sdshdr32 *sh=(void *)((s) -(sizeof(struct sdshdr32)));;return sh->alloc - sh->len;} case 4 :{ struct sdshdr64 *sh=(void *)((s) -(sizeof(struct sdshdr64)));;return sh->alloc - sh->len;} } return 0;}static inline void sdssetlen(sds s, size_t newlen) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ unsigned char *fp=((unsigned char *) s) - 1;*fp=0|(newlen<< 3);} break;case 1 :((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len=(uint8_t) newlen;break;case 2 :((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len=(uint16_t) newlen;break;case 3 :((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) -> len
Definition: CPAL.d:15583
static int pr(int(*writeFunc)(void *stream, const char *data, int size), void *stream, const char *data)
Definition: HTMLGen.cc:249
rp
Definition: action.c:992
#define mode
Definition: aptex-macros.h:510
#define mrb_integer(o)
Definition: boxing_nan.h:71
#define mrb_string_p(o)
Definition: boxing_word.h:153
#define mrb_undef_p(o)
Definition: boxing_word.h:145
#define mrb_nil_p(o)
Definition: boxing_word.h:146
MRB_INLINE enum mrb_vtype mrb_type(mrb_value o)
Definition: boxing_word.h:195
int(* fptr)(const void *, const void *)
Definition: cfg.h:16
#define MRB_SET_INSTANCE_TT(c, tt)
Definition: class.h:73
#define mrb_class_ptr(v)
Definition: class.h:24
#define MRB_INSTANCE_TT(c)
Definition: class.h:74
#define n
Definition: t4ht.c:1290
#define b
Definition: jpegint.h:372
struct RData * mrb_data_object_alloc(mrb_state *mrb, struct RClass *klass, void *datap, const mrb_data_type *type)
Definition: etc.c:14
#define DATA_PTR(d)
Definition: data.h:50
void * mrb_data_get_ptr(mrb_state *mrb, mrb_value, const mrb_data_type *)
Definition: etc.c:58
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
int ssize_t
Definition: defines.h:155
#define MRB_SYM(name)
Definition: disable.h:20
int w
Definition: dviconv.c:26
int v
Definition: dviconv.c:10
int h
Definition: dviconv.c:9
#define fflush
Definition: xxstdio.h:24
int strcmp()
Definition: coll.cpp:143
long int flag
Definition: f2c.h:53
int fcntl(int fd, int action,...)
Definition: fcntl.c:202
#define O_NOCTTY
Definition: fcntl.in.h:294
#define O_NONBLOCK
Definition: fcntl.in.h:277
#define O_NOATIME
Definition: fcntl.in.h:273
#define FD_CLOEXEC
Definition: fcntl.in.h:191
#define O_NOFOLLOW
Definition: fcntl.in.h:298
#define O_SYNC
Definition: fcntl.in.h:322
#define F_GETFD
Definition: fcntl.in.h:210
#define O_RSYNC
Definition: fcntl.in.h:314
#define O_DIRECT
Definition: fcntl.in.h:249
#define O_CLOEXEC
Definition: fcntl.in.h:242
#define O_DSYNC
Definition: fcntl.in.h:257
static void copy(GlyphCachePtr *root)
Definition: gcache.c:378
#define tp
#define s
Definition: afcover.h:80
#define t
Definition: afcover.h:96
#define c(n)
Definition: gpos-common.c:150
#define memmove(d, s, n)
Definition: gsftopk.c:65
FILE * out
Definition: hbf2gf.c:286
unsigned nbytes
Definition: in_pcx.cpp:355
void _exit()
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
signed int intptr_t
Definition: stdint.h:118
static GBool quiet
Definition: pdfimages.cc:38
int errno
static unsigned char pat[8]
Definition: pkfont.c:194
#define O_BINARY
Definition: config.h:393
#define WEXITSTATUS(val)
Definition: dpxfile.c:58
#define buf
#define O_WRONLY
Definition: win32lib.h:179
#define lseek
Definition: win32lib.h:83
#define O_CREAT
Definition: win32lib.h:170
#define dup2
Definition: win32lib.h:67
#define read
Definition: win32lib.h:88
#define O_RDONLY
Definition: win32lib.h:176
#define open
Definition: win32lib.h:86
#define close
Definition: win32lib.h:63
#define O_EXCL
Definition: win32lib.h:191
#define fstat
Definition: win32lib.h:74
#define O_RDWR
Definition: win32lib.h:167
#define write
Definition: win32lib.h:103
#define O_TRUNC
Definition: win32lib.h:173
#define O_APPEND
Definition: win32lib.h:182
#define isatty
Definition: win32lib.h:80
static int ret
Definition: convert.c:72
#define length(c)
Definition: ctangleboot.c:65
ushort mode_t
Definition: types.h:80
int pid_t
Definition: types.h:81
long time_t
Definition: types.h:18
long off_t
Definition: types.h:34
pid_t fork()
int dup()
int pipe()
int execl()
cell * list
Definition: list_routines.h:30
const int * pos
Definition: combiners.h:905
unsigned long flags2[65536]
Definition: makeutype.c:128
#define cmd(arg)
Definition: mitsu.h:44
unsigned int DWORD
Definition: mktexlib.h:49
void mrb_garbage_collect(mrb_state *)
Definition: gc.c:1334
#define E_TYPE_ERROR
Definition: mruby.h:1308
struct RBasic * mrb_obj_alloc(mrb_state *, enum mrb_vtype, struct RClass *)
Definition: gc.c:535
void mrb_argnum_error(mrb_state *mrb, mrb_int argc, int min, int max)
Definition: error.c:547
void mrb_raisef(mrb_state *mrb, struct RClass *c, const char *fmt,...)
Definition: error.c:400
mrb_value mrb_funcall_id(mrb_state *mrb, mrb_value val, mrb_sym mid, mrb_int argc,...)
Definition: vm.c:337
void mrb_check_type(mrb_state *mrb, mrb_value x, enum mrb_vtype t)
Definition: object.c:400
#define mrb_intern_lit(mrb, lit)
Definition: mruby.h:1102
#define MRB_ARGS_ARG(n1, n2)
Definition: mruby.h:855
struct RClass * mrb_module_get_id(mrb_state *mrb, mrb_sym name)
Definition: class.c:682
mrb_value mrb_format(mrb_state *mrb, const char *format,...)
Definition: error.c:372
mrb_value mrb_get_arg1(mrb_state *mrb)
Definition: class.c:840
void mrb_bug(mrb_state *mrb, const char *fmt,...)
Definition: error.c:438
#define mrb_assert(p)
Definition: mruby.h:65
mrb_int mrb_get_args(mrb_state *mrb, mrb_args_format format,...)
Definition: class.c:891
void mrb_raise(mrb_state *mrb, struct RClass *c, const char *msg)
Definition: error.c:214
#define MRB_ARGS_ANY()
Definition: mruby.h:874
mrb_bool mrb_class_defined_id(mrb_state *mrb, mrb_sym name)
Definition: class.c:601
void mrb_include_module(mrb_state *mrb, struct RClass *cla, struct RClass *included)
Definition: class.c:1440
mrb_value mrb_str_new_cstr(mrb_state *, const char *)
Definition: string.c:203
struct RClass * mrb_class_get_under_id(mrb_state *mrb, struct RClass *outer, mrb_sym name)
Definition: class.c:627
mrb_value mrb_str_new(mrb_state *mrb, const char *p, size_t len)
Definition: string.c:197
struct RClass * mrb_module_get(mrb_state *mrb, const char *name)
Definition: class.c:676
#define mrb_locale_free(p)
Definition: mruby.h:1152
#define mrb_locale_from_utf8(p, l)
Definition: mruby.h:1151
void mrb_free(mrb_state *, void *)
Definition: gc.c:288
#define MRB_ARGS_NONE()
Definition: mruby.h:879
#define MRB_ARGS_REQ(n)
Definition: mruby.h:837
void * mrb_malloc(mrb_state *, size_t)
Definition: gc.c:256
#define E_ARGUMENT_ERROR
Definition: mruby.h:1310
@ err
Definition: mtxline.h:24
static double const pi
Definition: clipper.cpp:53
UnicodeString select(const PluralRules &rules, const Formattable &obj, const NumberFormat &fmt, UErrorCode &status)
dictionary off
Definition: fc-lang.py:226
#define max(a, b)
Definition: pbmto4425.c:11
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF ptr
char * fname
Definition: plain2.c:121
int r
Definition: ppmqvga.c:68
int perm[256]
Definition: ppmtogif.c:50
static int offset
Definition: ppmtogif.c:642
time_t time()
#define status
#define flags
#define RARRAY_LEN(a)
Definition: array.h:70
mrb_value mrb_ary_new(mrb_state *mrb)
Definition: array.c:53
#define RARRAY_PTR(a)
Definition: array.h:71
mrb_value mrb_ary_new_capa(mrb_state *, mrb_int)
Definition: array.c:46
void mrb_ary_push(mrb_state *mrb, mrb_value array, mrb_value value)
Definition: array.c:495
mrb_value mrb_assoc_new(mrb_state *mrb, mrb_value car, mrb_value cdr)
Definition: array.c:101
void mrb_sys_fail(mrb_state *mrb, const char *mesg)
Definition: error.c:504
mrb_value mrb_hash_new(mrb_state *mrb)
Definition: hash.c:1071
#define mrb_define_class_method(mrb, c, name, f, a)
Definition: scanning.h:16
#define mrb_define_method(mrb, c, name, f, a)
Definition: scanning.h:15
#define mrb_define_class(mrb, name, s)
Definition: scanning.h:18
mrb_bool mrb_const_defined(mrb_state *, mrb_value, mrb_sym)
Definition: variable.c:1012
mrb_value mrb_iv_get(mrb_state *mrb, mrb_value obj, mrb_sym sym)
Definition: variable.c:320
void mrb_gv_set(mrb_state *mrb, mrb_sym sym, mrb_value val)
Definition: variable.c:940
void mrb_iv_set(mrb_state *mrb, mrb_value obj, mrb_sym sym, mrb_value v)
Definition: variable.c:389
#define mrb_io_set_close_on_exec
Definition: io.c:1388
static struct timeval time2timeval(mrb_state *mrb, mrb_value time)
Definition: io.c:1082
static mrb_value mrb_io_syswrite(mrb_state *mrb, mrb_value io)
Definition: io.c:1027
static struct mrb_io * mrb_io_alloc(mrb_state *mrb)
Definition: io.c:311
static mrb_value mrb_io_fileno_m(mrb_state *mrb, mrb_value io)
Definition: io.c:1328
static int mrb_io_mode_to_flags(mrb_state *mrb, mrb_value mode)
Definition: io.c:162
static mrb_value mrb_io_isatty(mrb_state *mrb, mrb_value self)
Definition: io.c:813
static mrb_value mrb_io_sync(mrb_state *mrb, mrb_value self)
Definition: io.c:1404
static int mrb_cloexec_pipe(mrb_state *mrb, int fildes[2])
Definition: io.c:256
static mrb_value mrb_io_bufread(mrb_state *mrb, mrb_value self)
Definition: io.c:1473
static mrb_value mrb_io_sysread_common(mrb_state *mrb, mrb_io_read_write_size(*readfunc)(int, void *, fsize_t, off_t), mrb_value io, mrb_value buf, mrb_int maxlen, off_t offset)
Definition: io.c:924
static void fptr_finalize(mrb_state *mrb, struct mrb_io *fptr, int quiet)
Definition: io.c:740
static mrb_value mrb_io_set_sync(mrb_state *mrb, mrb_value self)
Definition: io.c:1392
#define mrb_io_close_on_exec_p
Definition: io.c:1353
struct mrb_data_type mrb_io_type
Definition: io.c:76
static mrb_value mrb_io_initialize(mrb_state *mrb, mrb_value io)
Definition: io.c:692
static int mrb_io_read_data_pending(mrb_state *mrb, mrb_value io)
Definition: io.c:1107
static mrb_value mrb_io_initialize_copy(mrb_state *mrb, mrb_value copy)
Definition: io.c:607
static void check_file_descriptor(mrb_state *mrb, mrb_int fd)
Definition: io.c:655
#define mrb_io_pread
Definition: io.c:1412
static void mrb_io_free(mrb_state *mrb, void *ptr)
Definition: io.c:301
static mrb_value mrb_io_s_pipe(mrb_state *mrb, mrb_value klass)
Definition: io.c:1118
static mrb_value mrb_io_close_write(mrb_state *mrb, mrb_value self)
Definition: io.c:1046
#define OPEN_WRITABLE_P(f)
Definition: io.c:73
static mrb_value mrb_io_close(mrb_state *mrb, mrb_value self)
Definition: io.c:1037
#define OPEN_RDONLY_P(f)
Definition: io.c:69
static mrb_value mrb_io_s_for_fd(mrb_state *mrb, mrb_value klass)
Definition: io.c:824
static int mrb_dup(mrb_state *mrb, int fd, mrb_bool *failed)
Definition: io.c:593
static mrb_io_read_write_size mrb_syswrite_dummy(int fd, const void *buf, fsize_t nbytes, off_t offset)
Definition: io.c:1021
void mrb_init_io(mrb_state *mrb)
Definition: io.c:1521
suseconds_t fsuseconds_t
Definition: io.c:54
mode_t fmode_t
Definition: io.c:55
static int option_to_fd(mrb_state *mrb, mrb_value v)
Definition: io.c:334
static int mrb_pipe(mrb_state *mrb, int pipes[2])
Definition: io.c:268
static int mrb_cloexec_open(mrb_state *mrb, const char *pathname, mrb_int flags, mrb_int mode)
Definition: io.c:848
#define NOFILE
Definition: io.c:327
static int mrb_proc_exec(const char *pname)
Definition: io.c:282
ssize_t mrb_io_read_write_size
Definition: io.c:56
static mrb_value mrb_io_s_popen(mrb_state *mrb, mrb_value klass)
Definition: io.c:466
static mrb_value mrb_io_syswrite_common(mrb_state *mrb, mrb_io_read_write_size(*writefunc)(int, const void *, fsize_t, off_t), mrb_value io, mrb_value buf, off_t offset)
Definition: io.c:995
static mrb_value mrb_io_sysseek(mrb_state *mrb, mrb_value io)
Definition: io.c:967
static mrb_value mrb_io_s_select(mrb_state *mrb, mrb_value klass)
Definition: io.c:1155
static mrb_value mrb_io_sysread(mrb_state *mrb, mrb_value io)
Definition: io.c:913
time_t ftime_t
Definition: io.c:53
static void io_set_process_status(mrb_state *mrb, pid_t pid, int status)
Definition: io.c:100
static mrb_io_read_write_size mrb_sysread_dummy(int fd, void *buf, fsize_t nbytes, off_t offset)
Definition: io.c:907
static mrb_value io_bufread(mrb_state *mrb, mrb_value str, mrb_int len)
Definition: io.c:1453
#define mrb_io_pwrite
Definition: io.c:1413
static mrb_value mrb_io_s_popen_args(mrb_state *mrb, mrb_value klass, const char **cmd, int *flags, int *doexec, int *opt_in, int *opt_out, int *opt_err)
Definition: io.c:352
static mrb_value mrb_io_check_readable(mrb_state *mrb, mrb_value self)
Definition: io.c:803
size_t fsize_t
Definition: io.c:52
static mrb_value mrb_io_pid(mrb_state *mrb, mrb_value io)
Definition: io.c:1069
int mrb_io_fileno(mrb_state *mrb, mrb_value io)
Definition: io.c:1320
static void mrb_fd_cloexec(mrb_state *mrb, int fd)
Definition: io.c:231
#define OPEN_READABLE_P(f)
Definition: io.c:72
#define OPEN_RDWR_P(f)
Definition: io.c:71
static int mrb_io_modestr_to_flags(mrb_state *mrb, const char *modestr)
Definition: io.c:121
static mrb_value mrb_io_closed(mrb_state *mrb, mrb_value io)
Definition: io.c:1057
static mrb_value mrb_io_s_sysopen(mrb_state *mrb, mrb_value klass)
Definition: io.c:883
static struct mrb_io * io_get_open_fptr(mrb_state *mrb, mrb_value self)
Definition: io.c:85
static mrb_value mrb_io_s_sysclose(mrb_state *mrb, mrb_value klass)
Definition: io.c:837
static mrb_value mrb_io_readchar(mrb_state *mrb, mrb_value self)
Definition: io.c:1483
#define ttype(o)
Definition: lobject.h:133
#define DATA_TYPE
Definition: putil.cpp:168
#define flag
Definition: round_prec.c:45
#define str(s)
Definition: sh6.c:399
#define O_NOINHERIT
Definition: sh.h:435
int doexec(C_Op *)
Definition: sh7.c:2127
static FILE * in
Definition: squeeze.c:36
#define RSTR_SET_LEN(s, n)
Definition: string.h:52
mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len)
Definition: string.c:832
#define RSTRING_CSTR(mrb, s)
Definition: string.h:106
void mrb_str_modify(mrb_state *mrb, struct RString *s)
Definition: string.c:825
#define RSTR_LEN(s)
Definition: string.h:66
#define RSTRING_LEN(s)
Definition: string.h:102
#define RSTRING_PTR(s)
Definition: string.h:100
#define RSTRING_END(s)
Definition: string.h:104
#define RSTRING(s)
Definition: string.h:99
#define RSTR_PTR(s)
Definition: string.h:65
Definition: class.h:17
Definition: object.h:30
Definition: string.h:22
Definition: psread.c:42
struct RClass * object_class
Definition: mruby.h:242
Definition: tpic.c:45
Definition: dvips.h:235
const char * str2
Definition: t4ht.c:1410
m
Definition: tex4ht.c:3990
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
static FILE * pipes[16]
Definition: texfileio.c:1421
int pid
Definition: ttf2pfb.c:129
static mrb_value mrb_true_value(void)
Definition: value.h:352
int32_t mrb_int
Definition: value.h:35
static mrb_value mrb_false_value(void)
Definition: value.h:342
static mrb_value mrb_nil_value(void)
Definition: value.h:332
static mrb_value mrb_bool_value(mrb_bool boolean)
Definition: value.h:360
static mrb_value mrb_float_value(struct mrb_state *mrb, mrb_float f)
Definition: value.h:273
double mrb_float
Definition: value.h:85
mrb_vtype
Definition: value.h:107
@ MRB_TT_DATA
Definition: value.h:128
@ MRB_TT_OBJECT
Definition: value.h:116
@ MRB_TT_ARRAY
Definition: value.h:122
@ MRB_TT_FLOAT
Definition: value.h:110
@ MRB_TT_INTEGER
Definition: value.h:111
static mrb_value mrb_fixnum_value(mrb_int i)
Definition: value.h:301
#define MRB_INT_MAX
Definition: value.h:68
static mrb_value mrb_int_value(struct mrb_state *mrb, mrb_int i)
Definition: value.h:294
static mrb_value mrb_obj_value(void *p)
Definition: value.h:317
#define argv
Definition: xmain.c:270
#define argc
Definition: xmain.c:269