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)  

clp.c
Go to the documentation of this file.
1 /* -*- related-file-name: "../include/lcdf/clp.h" -*- */
2 /* clp.c - Complete source code for CLP.
3  * This file is part of CLP, the command line parser package.
4  *
5  * Copyright (c) 1997-2019 Eddie Kohler, ekohler@gmail.com
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a
8  * copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, subject to the conditions
10  * listed in the Click LICENSE file, which is available in full at
11  * http://www.pdos.lcs.mit.edu/click/license.html. The conditions include: you
12  * must preserve this copyright notice, and you cannot mention the copyright
13  * holders in advertising related to the Software without their permission.
14  * The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This
15  * notice is a summary of the Click LICENSE file; the license in that file is
16  * legally binding. */
17 
18 #ifdef HAVE_CONFIG_H
19 # include <config.h>
20 #endif
21 #include <lcdf/clp.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <stdio.h>
25 #include <assert.h>
26 #include <stdarg.h>
27 #include <ctype.h>
28 
29 /* By default, assume we have strtoul. */
30 #if !defined(HAVE_STRTOUL) && !defined(HAVE_CONFIG_H)
31 # define HAVE_STRTOUL 1
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 
39 /** @file clp.h
40  * @brief Functions for parsing command line options.
41  *
42  * The CLP functions are used to parse command line arugments into options.
43  * It automatically handles value parsing, error messages, long options with
44  * minimum prefix matching, short options, and negated options.
45  *
46  * The CLP model works like this.
47  *
48  * <ol>
49  * <li>The user declares an array of Clp_Option structures that define the
50  * options their program accepts.</li>
51  * <li>The user creates a Clp_Parser object using Clp_NewParser(), passing in
52  * the command line arguments to parse and the Clp_Option structures.</li>
53  * <li>A loop repeatedly calls Clp_Next() to parse the arguments.</li>
54  * </ol>
55  *
56  * Unlike many command line parsing libraries, CLP steps through all arguments
57  * one at a time, rather than slurping up all options at once. This makes it
58  * meaningful to give an option more than once.
59  *
60  * Here's an example.
61  *
62  * @code
63  * #define ANIMAL_OPT 1
64  * #define VEGETABLE_OPT 2
65  * #define MINERALS_OPT 3
66  * #define USAGE_OPT 4
67  *
68  * static const Clp_Option options[] = {
69  * { "animal", 'a', ANIMAL_OPT, Clp_ValString, 0 },
70  * { "vegetable", 'v', VEGETABLE_OPT, Clp_ValString, Clp_Negate | Clp_Optional },
71  * { "minerals", 'm', MINERALS_OPT, Clp_ValInt, 0 },
72  * { "usage", 0, USAGE_OPT, 0, 0 }
73  * };
74  *
75  * int main(int argc, char *argv[]) {
76  * Clp_Parser *clp = Clp_NewParser(argc, argv,
77  * sizeof(options) / sizeof(options[0]), options);
78  * int opt;
79  * while ((opt = Clp_Next(clp)) != Clp_Done)
80  * switch (opt) {
81  * case ANIMAL_OPT:
82  * fprintf(stderr, "animal is %s\n", clp->val.s);
83  * break;
84  * case VEGETABLE_OPT:
85  * if (clp->negated)
86  * fprintf(stderr, "no vegetables!\n");
87  * else if (clp->have_val)
88  * fprintf(stderr, "vegetable is %s\n", clp->val.s);
89  * else
90  * fprintf(stderr, "vegetables OK\n");
91  * break;
92  * case MINERALS_OPT:
93  * fprintf(stderr, "%d minerals\n", clp->val.i);
94  * break;
95  * case USAGE_OPT:
96  * fprintf(stderr, "Usage: 20q [--animal=ANIMAL] [--vegetable[=VEGETABLE]] [--minerals=N]\n");
97  * break;
98  * case Clp_NotOption:
99  * fprintf(stderr, "non-option %s\n", clp->vstr);
100  * break;
101  * }
102  * }
103  * }
104  * @endcode
105  *
106  * Here are a couple of executions.
107  *
108  * <pre>
109  * % ./20q --animal=cat
110  * animal is cat
111  * % ./20q --animal=cat -a dog -afish --animal bird --an=snake
112  * animal is cat
113  * animal is dog
114  * animal is fish
115  * animal is bird
116  * animal is snake
117  * % ./20q --no-vegetables
118  * no vegetables!
119  * % ./20q -v
120  * vegetables OK
121  * % ./20q -vkale
122  * vegetable is kale
123  * % ./20q -m10
124  * 10 minerals
125  * % ./20q -m foo
126  * '-m' expects an integer, not 'foo'
127  * </pre>
128  */
129 
130 
131 /* Option types for Clp_SetOptionChar */
132 #define Clp_DoubledLong (Clp_LongImplicit * 2)
133 
134 #define Clp_InitialValType 8
135 #define MAX_AMBIGUOUS_VALUES 4
136 
137 typedef struct {
138  int val_type;
140  int flags;
141  void *user_data;
142 } Clp_ValType;
143 
144 typedef struct {
145  unsigned ilong : 1;
146  unsigned ishort : 1;
147  unsigned imandatory : 1;
148  unsigned ioptional : 1;
149  unsigned ipos : 1;
150  unsigned ineg : 1;
151  unsigned iprefmatch : 1;
152  unsigned lmmpos_short : 1;
153  unsigned lmmneg_short : 1;
154  unsigned char ilongoff;
155  int lmmpos;
156  int lmmneg;
158 
159 
160 #define Clp_OptionCharsSize 5
161 
162 typedef struct {
163  int c;
164  int type;
165 } Clp_Oclass;
166 #define Clp_OclassSize 10
167 
168 typedef struct Clp_Internal {
169  const Clp_Option *opt;
171  int nopt;
172  unsigned opt_generation;
173 
175  int nvaltype;
176 
177  const char * const *argv;
178  int argc;
179 
181  int noclass;
182  int long1pos;
183  int long1neg;
184  int utf8;
185 
187  const char *xtext;
188 
189  const char *program_name;
190  void (*error_handler)(Clp_Parser *, const char *);
191 
192  int option_processing;
193  int current_option;
194 
195  unsigned char is_short;
196  unsigned char whole_negated; /* true if negated by an option character */
197  unsigned char could_be_short;
198  unsigned char current_short;
199  unsigned char negated_by_no;
200 
201  int ambiguous;
204 
205 
206 struct Clp_ParserState {
207  const char * const *argv;
208  int argc;
209 
211  const char *xtext;
212 
213  int option_processing;
214 
215  unsigned opt_generation;
216  int current_option;
217  unsigned char is_short;
218  unsigned char whole_negated;
219  unsigned char current_short;
220  unsigned char negated_by_no;
221 };
222 
223 
224 typedef struct Clp_StringList {
225 
226  Clp_Option *items;
228  int nitems;
229 
232 
234 
235 
236 static const Clp_Option clp_option_sentinel[] = {
237  {"", 0, Clp_NotOption, 0, 0},
238  {"", 0, Clp_Done, 0, 0},
239  {"", 0, Clp_BadOption, 0, 0},
240  {"", 0, Clp_Error, 0, 0}
241 };
242 
243 
244 static int parse_string(Clp_Parser *, const char *, int, void *);
245 static int parse_int(Clp_Parser *, const char *, int, void *);
246 static int parse_bool(Clp_Parser *, const char *, int, void *);
247 static int parse_double(Clp_Parser *, const char *, int, void *);
248 static int parse_string_list(Clp_Parser *, const char *, int, void *);
249 
250 static int ambiguity_error(Clp_Parser *, int, int *, const Clp_Option *,
251  const Clp_InternOption *, const char *, const char *,
252  ...);
253 
254 
255 /*******
256  * utf8
257  **/
258 
259 #define U_REPLACEMENT 0xFFFD
260 
261 static char *
262 encode_utf8(char *s, int n, int c)
263 {
264  if (c < 0 || c >= 0x110000 || (c >= 0xD800 && c <= 0xDFFF))
265  c = U_REPLACEMENT;
266  if (c <= 0x7F && n >= 1)
267  *s++ = c;
268  else if (c <= 0x7FF && n >= 2) {
269  *s++ = 0xC0 | (c >> 6);
270  goto char1;
271  } else if (c <= 0xFFFF && n >= 3) {
272  *s++ = 0xE0 | (c >> 12);
273  goto char2;
274  } else if (n >= 4) {
275  *s++ = 0xF0 | (c >> 18);
276  *s++ = 0x80 | ((c >> 12) & 0x3F);
277  char2:
278  *s++ = 0x80 | ((c >> 6) & 0x3F);
279  char1:
280  *s++ = 0x80 | (c & 0x3F);
281  }
282  return s;
283 }
284 
285 static int
286 decode_utf8(const char *s, const char **cp)
287 {
288  int c;
289  if ((unsigned char) *s <= 0x7F) /* 1 byte: 0x000000-0x00007F */
290  c = *s++;
291  else if ((unsigned char) *s <= 0xC1) /* bad/overlong encoding */
292  goto replacement;
293  else if ((unsigned char) *s <= 0xDF) { /* 2 bytes: 0x000080-0x0007FF */
294  if ((s[1] & 0xC0) != 0x80) /* bad encoding */
295  goto replacement;
296  c = (*s++ & 0x1F) << 6;
297  goto char1;
298  } else if ((unsigned char) *s <= 0xEF) { /* 3 bytes: 0x000800-0x00FFFF */
299  if ((s[1] & 0xC0) != 0x80 /* bad encoding */
300  || (s[2] & 0xC0) != 0x80 /* bad encoding */
301  || ((unsigned char) *s == 0xE0 /* overlong encoding */
302  && (s[1] & 0xE0) == 0x80)
303  || ((unsigned char) *s == 0xED /* encoded surrogate */
304  && (s[1] & 0xE0) == 0xA0))
305  goto replacement;
306  c = (*s++ & 0x0F) << 12;
307  goto char2;
308  } else if ((unsigned char) *s <= 0xF4) { /* 4 bytes: 0x010000-0x10FFFF */
309  if ((s[1] & 0xC0) != 0x80 /* bad encoding */
310  || (s[2] & 0xC0) != 0x80 /* bad encoding */
311  || (s[3] & 0xC0) != 0x80 /* bad encoding */
312  || ((unsigned char) *s == 0xF0 /* overlong encoding */
313  && (s[1] & 0xF0) == 0x80)
314  || ((unsigned char) *s == 0xF4 /* encoded value > 0x10FFFF */
315  && (unsigned char) s[1] >= 0x90))
316  goto replacement;
317  c = (*s++ & 0x07) << 18;
318  c += (*s++ & 0x3F) << 12;
319  char2:
320  c += (*s++ & 0x3F) << 6;
321  char1:
322  c += (*s++ & 0x3F);
323  } else {
324  replacement:
325  c = U_REPLACEMENT;
326  for (s++; (*s & 0xC0) == 0x80; s++)
327  /* nothing */;
328  }
329  if (cp)
330  *cp = s;
331  return c;
332 }
333 
334 static int
335 utf8_charlen(const char *s)
336 {
337  const char *sout;
338  (void) decode_utf8(s, &sout);
339  return sout - s;
340 }
341 
342 static int
343 clp_utf8_charlen(const Clp_Internal *cli, const char *s)
344 {
345  return (cli->utf8 ? utf8_charlen(s) : 1);
346 }
347 
348 
349 /*******
350  * Clp_NewParser, etc.
351  **/
352 
353 static int
354 min_different_chars(const char *s, const char *t)
355  /* Returns the minimum number of bytes required to distinguish
356  s from t.
357  If s is shorter than t, returns strlen(s). */
358 {
359  const char *sfirst = s;
360  while (*s && *t && *s == *t)
361  s++, t++;
362  if (!*s)
363  return s - sfirst;
364  else
365  return s - sfirst + 1;
366 }
367 
368 static int
369 long_as_short(const Clp_Internal *cli, const Clp_Option *o,
370  Clp_InternOption *io, int failure)
371 {
372  if ((cli->long1pos || cli->long1neg) && io->ilong) {
373  const char *name = o->long_name + io->ilongoff;
374  if (cli->utf8) {
375  int c = decode_utf8(name, &name);
376  if (!*name && c && c != U_REPLACEMENT)
377  return c;
378  } else if (name[0] && !name[1])
379  return (unsigned char) name[0];
380  }
381  return failure;
382 }
383 
384 static void
386  const Clp_Option *o2, Clp_InternOption *io2)
387 {
388  Clp_Internal *cli = clp->internal;
389  int short1, shortx1;
390 
391  /* ignore meaningless combinations */
392  if ((!io1->ishort && !io1->ilong) || (!io2->ishort && !io2->ilong)
393  || !((io1->ipos && io2->ipos) || (io1->ineg && io2->ineg))
394  || o1->option_id == o2->option_id)
395  return;
396 
397  /* look for duplication of short options */
398  short1 = (io1->ishort ? o1->short_name : -1);
399  shortx1 = long_as_short(cli, o1, io1, -2);
400  if (short1 >= 0 || shortx1 >= 0) {
401  int short2 = (io2->ishort ? o2->short_name : -3);
402  int shortx2 = long_as_short(cli, o2, io2, -4);
403  if (short1 == short2)
404  Clp_OptionError(clp, "CLP internal error: more than 1 option has short name %<%c%>", short1);
405  else if ((short1 == shortx2 || shortx1 == short2 || shortx1 == shortx2)
406  && ((io1->ipos && io2->ipos && cli->long1pos)
407  || (io1->ineg && io2->ineg && cli->long1neg)))
408  Clp_OptionError(clp, "CLP internal error: 1-char long name conflicts with short name %<%c%>", (short1 == shortx2 ? shortx2 : shortx1));
409  }
410 
411  /* analyze longest minimum match */
412  if (io1->ilong) {
413  const char *name1 = o1->long_name + io1->ilongoff;
414 
415  /* long name's first character matches short name */
416  if (io2->ishort && !io1->iprefmatch) {
417  int name1char = (cli->utf8 ? decode_utf8(name1, 0) : (unsigned char) *name1);
418  if (name1char == o2->short_name) {
419  if (io1->ipos && io2->ipos)
420  io1->lmmpos_short = 1;
421  if (io1->ineg && io2->ineg)
422  io1->lmmneg_short = 1;
423  }
424  }
425 
426  /* match long name to long name */
427  if (io2->ilong) {
428  const char *name2 = o2->long_name + io2->ilongoff;
429  if (strcmp(name1, name2) == 0)
430  Clp_OptionError(clp, "CLP internal error: duplicate long name %<%s%>", name1);
431  if (io1->ipos && io2->ipos && !strncmp(name1, name2, io1->lmmpos)
432  && (!io1->iprefmatch || strncmp(name1, name2, strlen(name1))))
433  io1->lmmpos = min_different_chars(name1, name2);
434  if (io1->ineg && io2->ineg && !strncmp(name1, name2, io1->lmmneg)
435  && (!io1->iprefmatch || strncmp(name1, name2, strlen(name1))))
436  io1->lmmneg = min_different_chars(name1, name2);
437  }
438  }
439 }
440 
441 static void
442 calculate_lmm(Clp_Parser *clp, const Clp_Option *opt, Clp_InternOption *iopt, int nopt)
443 {
444  int i, j;
445  for (i = 0; i < nopt; ++i) {
446  iopt[i].lmmpos = iopt[i].lmmneg = 1;
447  iopt[i].lmmpos_short = iopt[i].lmmneg_short = 0;
448  for (j = 0; j < nopt; ++j)
449  compare_options(clp, &opt[i], &iopt[i], &opt[j], &iopt[j]);
450  }
451 }
452 
453 /** @param argc number of arguments
454  * @param argv argument array
455  * @param nopt number of option definitions
456  * @param opt option definition array
457  * @return the parser
458  *
459  * The new Clp_Parser that will parse the arguments in @a argv according to
460  * the option definitions in @a opt.
461  *
462  * The Clp_Parser is created with the following characteristics:
463  *
464  * <ul>
465  * <li>The "-" character introduces short options (<tt>Clp_SetOptionChar(clp,
466  * '-', Clp_Short)</tt>).</li>
467  * <li>Clp_ProgramName is set from the first argument in @a argv, if any. The
468  * first argument returned by Clp_Next() will be the second argument in @a
469  * argv. Note that this behavior differs from Clp_SetArguments.</li>
470  * <li>UTF-8 support is on iff the <tt>LANG</tt> environment variable contains
471  * one of the substrings "UTF-8", "UTF8", or "utf8". Override this with
472  * Clp_SetUTF8().</li>
473  * <li>The Clp_ValString, Clp_ValStringNotOption, Clp_ValInt, Clp_ValUnsigned,
474  * Clp_ValBool, and Clp_ValDouble types are installed.</li>
475  * <li>Errors are reported to standard error.</li>
476  * </ul>
477  *
478  * You may also create a Clp_Parser with no arguments or options
479  * (<tt>Clp_NewParser(0, 0, 0, 0)</tt>) and set the arguments and options
480  * later.
481  *
482  * Returns NULL if there isn't enough memory to construct the parser.
483  *
484  * @note The CLP library will not modify the contents of @a argv or @a opt.
485  * The calling program must not modify @a opt. It may modify @a argv in
486  * limited cases.
487  */
488 Clp_Parser *
489 Clp_NewParser(int argc, const char * const *argv, int nopt, const Clp_Option *opt)
490 {
491  Clp_Parser *clp = (Clp_Parser *)malloc(sizeof(Clp_Parser));
492  Clp_Internal *cli = (Clp_Internal *)malloc(sizeof(Clp_Internal));
493  Clp_InternOption *iopt = (Clp_InternOption *)malloc(sizeof(Clp_InternOption) * nopt);
494  if (cli)
496  if (!clp || !cli || !iopt || !cli->valtype)
497  goto failed;
498 
500  clp->negated = 0;
501  clp->have_val = 0;
502  clp->vstr = 0;
503  clp->user_data = 0;
504  clp->internal = cli;
505 
506  cli->opt = opt;
507  cli->nopt = nopt;
508  cli->iopt = iopt;
509  cli->opt_generation = 0;
510  cli->error_handler = 0;
511 
512  /* Assign program name (now so we can call Clp_OptionError) */
513  if (argc > 0) {
514  const char *slash = strrchr(argv[0], '/');
515  cli->program_name = slash ? slash + 1 : argv[0];
516  } else
517  cli->program_name = 0;
518 
519  /* Assign arguments, skipping program name */
520  Clp_SetArguments(clp, argc - 1, argv + 1);
521 
522  /* Initialize UTF-8 status and option classes */
523  {
524  char *s = getenv("LANG");
525  cli->utf8 = (s && (strstr(s, "UTF-8") != 0 || strstr(s, "UTF8") != 0
526  || strstr(s, "utf8") != 0));
527  }
528  cli->oclass[0].c = '-';
529  cli->oclass[0].type = Clp_Short;
530  cli->noclass = 1;
531  cli->long1pos = cli->long1neg = 0;
532 
533  /* Add default type parsers */
534  cli->nvaltype = 0;
537  Clp_AddType(clp, Clp_ValInt, 0, parse_int, 0);
538  Clp_AddType(clp, Clp_ValUnsigned, 0, parse_int, (void *)cli);
539  Clp_AddType(clp, Clp_ValBool, 0, parse_bool, 0);
541 
542  /* Set options */
543  Clp_SetOptions(clp, nopt, opt);
544 
545  return clp;
546 
547  failed:
548  if (cli && cli->valtype)
549  free(cli->valtype);
550  if (cli)
551  free(cli);
552  if (clp)
553  free(clp);
554  if (iopt)
555  free(iopt);
556  return 0;
557 }
558 
559 /** @param clp the parser
560  *
561  * All memory associated with @a clp is freed. */
562 void
564 {
565  int i;
566  Clp_Internal *cli;
567  if (!clp)
568  return;
569 
570  cli = clp->internal;
571 
572  /* get rid of any string list types */
573  for (i = 0; i < cli->nvaltype; i++)
574  if (cli->valtype[i].func == parse_string_list) {
576  free(clsl->items);
577  free(clsl->iopt);
578  free(clsl);
579  }
580 
581  free(cli->valtype);
582  free(cli->iopt);
583  free(cli);
584  free(clp);
585 }
586 
587 
588 /** @param clp the parser
589  * @param errh error handler function
590  * @return previous error handler function
591  *
592  * The error handler function is called when CLP encounters an error while
593  * parsing the command line. It is called with the arguments "<tt>(*errh)(@a
594  * clp, s)</tt>", where <tt>s</tt> is a description of the error terminated by
595  * a newline. The <tt>s</tt> descriptions produced by CLP itself are prefixed
596  * by the program name, if any. */
598 Clp_SetErrorHandler(Clp_Parser *clp, void (*errh)(Clp_Parser *, const char *))
599 {
600  Clp_Internal *cli = clp->internal;
601  Clp_ErrorHandler old = cli->error_handler;
602  cli->error_handler = errh;
603  return old;
604 }
605 
606 /** @param clp the parser
607  * @param utf8 does the parser support UTF-8?
608  * @return previous UTF-8 mode
609  *
610  * In UTF-8 mode, all input strings (arguments and long names for options) are
611  * assumed to be encoded via UTF-8, and all character names
612  * (Clp_SetOptionChar() and short names for options) may cover the whole
613  * Unicode range. Out of UTF-8 mode, all input strings are treated as binary,
614  * and all character names must be unsigned char values.
615  *
616  * Furthermore, error messages in UTF-8 mode may contain Unicode quote
617  * characters. */
618 int
620 {
621  Clp_Internal *cli = clp->internal;
622  int old_utf8 = cli->utf8;
623  cli->utf8 = utf8;
624  calculate_lmm(clp, cli->opt, cli->iopt, cli->nopt);
625  return old_utf8;
626 }
627 
628 /** @param clp the parser
629  * @param c character
630  * @return option character treatment
631  *
632  * Returns an integer specifying how CLP treats arguments that begin
633  * with character @a c. See Clp_SetOptionChar for possibilities.
634  */
635 int
637 {
638  Clp_Internal *cli = clp->internal;
639  int i, oclass = 0;
640  if (cli->noclass > 0 && cli->oclass[0].c == 0)
641  oclass = cli->oclass[0].type;
642  for (i = 0; i < cli->noclass; ++i)
643  if (cli->oclass[i].c == c)
644  oclass = cli->oclass[i].type;
645  return oclass;
646 }
647 
648 /** @param clp the parser
649  * @param c character
650  * @param type option character treatment
651  * @return previous option character treatment, or -1 on error
652  *
653  * @a type specifies how CLP treats arguments that begin with character @a c.
654  * Possibilities are:
655  *
656  * <dl>
657  * <dt>Clp_NotOption (or 0)</dt>
658  * <dd>The argument cannot be an option.</dd>
659  * <dt>Clp_Long</dt>
660  * <dd>The argument is a long option.</dd>
661  * <dt>Clp_Short</dt>
662  * <dd>The argument is a set of short options.</dd>
663  * <dt>Clp_Short|Clp_Long</dt>
664  * <dd>The argument is either a long option or, if no matching long option is
665  * found, a set of short options.</dd>
666  * <dt>Clp_LongNegated</dt>
667  * <dd>The argument is a negated long option. For example, after
668  * Clp_SetOptionChar(@a clp, '^', Clp_LongNegated), the argument "^foo" is
669  * equivalent to "--no-foo".</dd>
670  * <dt>Clp_ShortNegated</dt>
671  * <dd>The argument is a set of negated short options.</dd>
672  * <dt>Clp_ShortNegated|Clp_LongNegated</dt>
673  * <dd>The argument is either a negated long option or, if no matching long
674  * option is found, a set of negated short options.</dd>
675  * <dt>Clp_LongImplicit</dt>
676  * <dd>The argument may be a long option, where the character @a c is actually
677  * part of the long option name. For example, after Clp_SetOptionChar(@a clp,
678  * 'f', Clp_LongImplicit), the argument "foo" may be equivalent to
679  * "--foo".</dd>
680  * </dl>
681  *
682  * In UTF-8 mode, @a c may be any Unicode character. Otherwise, @a c must be
683  * an unsigned char value. The special character 0 assigns @a type to @em
684  * every character.
685  *
686  * It is an error if @a c is out of range, @a type is illegal, or there are
687  * too many character definitions stored in @a clp already. The function
688  * returns -1 on error.
689  *
690  * A double hyphen "--" always introduces a long option. This behavior cannot
691  * currently be changed with Clp_SetOptionChar().
692  */
693 int
695 {
696  int i, long1pos, long1neg;
697  int old = Clp_OptionChar(clp, c);
698  Clp_Internal *cli = clp->internal;
699 
700  if (type != Clp_NotOption && type != Clp_Short && type != Clp_Long
704  return -1;
705  if (c < 0 || c >= (cli->utf8 ? 0x110000 : 256))
706  return -1;
707 
708  if (c == 0)
709  cli->noclass = 0;
710  for (i = 0; i < cli->noclass; ++i)
711  if (cli->oclass[i].c == c)
712  break;
713  if (i == Clp_OclassSize)
714  return -1;
715 
716  cli->oclass[i].c = c;
717  cli->oclass[i].type = type;
718  if (cli->noclass == i)
719  cli->noclass = i + 1;
720 
721  long1pos = long1neg = 0;
722  for (i = 0; i < cli->noclass; ++i) {
723  if ((cli->oclass[i].type & Clp_Short)
724  && (cli->oclass[i].type & Clp_Long))
725  long1pos = 1;
726  if ((cli->oclass[i].type & Clp_ShortNegated)
727  && (cli->oclass[i].type & Clp_LongNegated))
728  long1neg = 1;
729  }
730 
731  if (long1pos != cli->long1pos || long1neg != cli->long1neg) {
732  /* Must recheck option set */
733  cli->long1pos = long1pos;
734  cli->long1neg = long1neg;
735  calculate_lmm(clp, cli->opt, cli->iopt, cli->nopt);
736  }
737 
738  return old;
739 }
740 
741 /** @param clp the parser
742  * @param nopt number of option definitions
743  * @param opt option definition array
744  * @return 0 on success, -1 on failure
745  *
746  * Installs the option definitions in @a opt. Future option parsing will
747  * use @a opt to search for options.
748  *
749  * Also checks @a opt's option definitions for validity. "CLP internal
750  * errors" are reported via Clp_OptionError() if:
751  *
752  * <ul>
753  * <li>An option has a negative ID.</li>
754  * <li>Two different short options have the same name.</li>
755  * <li>Two different long options have the same name.</li>
756  * <li>A short and a long option are ambiguous, in that some option character
757  * might introduce either a short or a long option (e.g., Clp_SetOptionChar(@a
758  * clp, '-', Clp_Long|Clp_Short)), and a short name equals a long name.</li>
759  * </ul>
760  *
761  * If necessary memory cannot be allocated, this function returns -1 without
762  * modifying the parser.
763  *
764  * @note The CLP library will not modify the contents of @a argv or @a opt.
765  * The calling program must not modify @a opt either until another call to
766  * Clp_SetOptions() or the parser is destroyed.
767  */
768 int
769 Clp_SetOptions(Clp_Parser *clp, int nopt, const Clp_Option *opt)
770 {
771  Clp_Internal *cli = clp->internal;
772  Clp_InternOption *iopt;
773  int i;
774  static unsigned opt_generation = 0;
775 
776  if (nopt > cli->nopt) {
777  iopt = (Clp_InternOption *)malloc(sizeof(Clp_InternOption) * nopt);
778  if (!iopt)
779  return -1;
780  free(cli->iopt);
781  cli->iopt = iopt;
782  }
783 
784  cli->opt = opt;
785  cli->nopt = nopt;
786  cli->opt_generation = ++opt_generation;
787  iopt = cli->iopt;
788  cli->current_option = -1;
789 
790  /* Massage the options to make them usable */
791  for (i = 0; i < nopt; i++) {
792  /* Ignore negative option_ids, which are internal to CLP */
793  if (opt[i].option_id < 0) {
794  Clp_OptionError(clp, "CLP internal error: option %d has negative option_id", i);
795  iopt[i].ilong = iopt[i].ishort = iopt[i].ipos = iopt[i].ineg = 0;
796  continue;
797  }
798 
799  /* Set flags based on input flags */
800  iopt[i].ilong = (opt[i].long_name != 0 && opt[i].long_name[0] != 0);
801  iopt[i].ishort = (opt[i].short_name > 0
802  && opt[i].short_name < (cli->utf8 ? 0x110000 : 256));
803  iopt[i].ipos = 1;
804  iopt[i].ineg = (opt[i].flags & Clp_Negate) != 0;
805  iopt[i].imandatory = (opt[i].flags & Clp_Mandatory) != 0;
806  iopt[i].ioptional = (opt[i].flags & Clp_Optional) != 0;
807  iopt[i].iprefmatch = (opt[i].flags & Clp_PreferredMatch) != 0;
808  iopt[i].ilongoff = 0;
809 
810  /* Enforce invariants */
811  if (opt[i].val_type <= 0)
812  iopt[i].imandatory = iopt[i].ioptional = 0;
813  if (opt[i].val_type > 0 && !iopt[i].ioptional)
814  iopt[i].imandatory = 1;
815 
816  /* Options that start with 'no-' should be changed to OnlyNegated */
817  if (iopt[i].ilong && strncmp(opt[i].long_name, "no-", 3) == 0) {
818  iopt[i].ipos = 0;
819  iopt[i].ineg = 1;
820  iopt[i].ilongoff = 3;
821  if (strncmp(opt[i].long_name + 3, "no-", 3) == 0)
822  Clp_OptionError(clp, "CLP internal error: option %d begins with \"no-no-\"", i);
823  } else if (opt[i].flags & Clp_OnlyNegated) {
824  iopt[i].ipos = 0;
825  iopt[i].ineg = 1;
826  }
827  }
828 
829  /* Check option set */
830  calculate_lmm(clp, opt, iopt, nopt);
831 
832  return 0;
833 }
834 
835 /** @param clp the parser
836  * @param argc number of arguments
837  * @param argv argument array
838  *
839  * Installs the arguments in @a argv for parsing. Future option parsing will
840  * analyze @a argv.
841  *
842  * Unlike Clp_NewParser(), this function does not treat @a argv[0] specially.
843  * The first subsequent call to Clp_Next() will analyze @a argv[0].
844  *
845  * This function also sets option processing to on, as by
846  * Clp_SetOptionProcessing(@a clp, 1).
847  *
848  * @note The CLP library will not modify the contents of @a argv. The calling
849  * program should not generally modify the element of @a argv that CLP is
850  * currently analyzing.
851  */
852 void
853 Clp_SetArguments(Clp_Parser *clp, int argc, const char * const *argv)
854 {
855  Clp_Internal *cli = clp->internal;
856 
857  cli->argc = argc + 1;
858  cli->argv = argv - 1;
859 
860  cli->is_short = 0;
861  cli->whole_negated = 0;
862  cli->option_processing = 1;
863  cli->current_option = -1;
864 }
865 
866 
867 /** @param clp the parser
868  * @param on whether to search for options
869  * @return previous option processing setting
870  *
871  * When option processing is off, every call to Clp_Next() returns
872  * Clp_NotOption. By default the option <tt>"--"</tt> turns off option
873  * processing and is otherwise ignored.
874  */
875 int
877 {
878  Clp_Internal *cli = clp->internal;
879  int old = cli->option_processing;
880  cli->option_processing = on;
881  return old;
882 }
883 
884 
885 /*******
886  * functions for Clp_Option lists
887  **/
888 
889 /* the ever-glorious argcmp */
890 
891 static int
892 argcmp(const char *ref, const char *arg, int min_match, int fewer_dashes)
893  /* Returns 0 if ref and arg don't match.
894  Returns -1 if ref and arg match, but fewer than min_match characters.
895  Returns len if ref and arg match min_match or more characters;
896  len is the number of characters that matched in arg.
897  Allows arg to contain fewer dashes than ref iff fewer_dashes != 0.
898 
899  Examples:
900  argcmp("x", "y", 1, 0) --> 0 / just plain wrong
901  argcmp("a", "ax", 1, 0) --> 0 / ...even though min_match == 1
902  and the 1st chars match
903  argcmp("box", "bo", 3, 0) --> -1 / ambiguous
904  argcmp("cat", "c=3", 1, 0) --> 1 / handles = arguments
905  */
906 {
907  const char *refstart = ref;
908  const char *argstart = arg;
909  assert(min_match > 0);
910 
911  compare:
912  while (*ref && *arg && *arg != '=' && *ref == *arg)
913  ref++, arg++;
914 
915  /* Allow arg to contain fewer dashes than ref */
916  if (fewer_dashes && *ref == '-' && ref[1] && ref[1] == *arg) {
917  ref++;
918  goto compare;
919  }
920 
921  if (*arg && *arg != '=')
922  return 0;
923  else if (ref - refstart < min_match)
924  return -1;
925  else
926  return arg - argstart;
927 }
928 
929 static int
930 find_prefix_opt(Clp_Parser *clp, const char *arg,
931  int nopt, const Clp_Option *opt,
932  const Clp_InternOption *iopt,
933  int *ambiguous, int *ambiguous_values)
934  /* Looks for an unambiguous match of 'arg' against one of the long
935  options in 'opt'. Returns positive if it finds one; otherwise, returns
936  -1 and possibly changes 'ambiguous' and 'ambiguous_values' to keep
937  track of at most MAX_AMBIGUOUS_VALUES possibilities. */
938 {
939  int i, fewer_dashes = 0, first_ambiguous = *ambiguous;
940  int negated = clp && clp->negated;
941  int first_charlen = (clp ? clp_utf8_charlen(clp->internal, arg) : 1);
942 
943  retry:
944  for (i = 0; i < nopt; i++) {
945  int len, lmm;
946  if (!iopt[i].ilong || (negated ? !iopt[i].ineg : !iopt[i].ipos))
947  continue;
948 
949  lmm = (negated ? iopt[i].lmmneg : iopt[i].lmmpos);
950  if (clp && clp->internal->could_be_short
951  && (negated ? iopt[i].lmmneg_short : iopt[i].lmmpos_short))
952  lmm = (first_charlen >= lmm ? first_charlen + 1 : lmm);
953  len = argcmp(opt[i].long_name + iopt[i].ilongoff, arg, lmm, fewer_dashes);
954  if (len > 0)
955  return i;
956  else if (len < 0) {
958  ambiguous_values[*ambiguous] = i;
959  (*ambiguous)++;
960  }
961  }
962 
963  /* If there were no partial matches, try again with fewer_dashes true */
964  if (*ambiguous == first_ambiguous && !fewer_dashes) {
965  fewer_dashes = 1;
966  goto retry;
967  }
968 
969  return -1;
970 }
971 
972 
973 /*****
974  * Argument parsing
975  **/
976 
977 static int
979 {
980  unsigned l = 0, r = cli->nvaltype;
981  while (l < r) {
982  unsigned m = l + (r - l) / 2;
983  if (cli->valtype[m].val_type == val_type)
984  return m;
985  else if (cli->valtype[m].val_type < val_type)
986  l = m + 1;
987  else
988  r = m;
989  }
990  return l;
991 }
992 
993 /** @param clp the parser
994  * @param val_type value type ID
995  * @param flags value type flags
996  * @param parser parser function
997  * @param user_data user data for @a parser function
998  * @return 0 on success, -1 on failure
999  *
1000  * Defines argument type @a val_type in parser @a clp. The parsing function
1001  * @a parser will be passed argument values for type @a val_type. It should
1002  * parse the argument into values (usually in @a clp->val, but sometimes
1003  * elsewhere), report errors if necessary, and return whether the parse was
1004  * successful.
1005  *
1006  * Any prior argument parser match @a val_type is removed. @a val_type must
1007  * be greater than zero.
1008  *
1009  * @a flags specifies additional parsing flags. At the moment the only
1010  * relevant flag is Clp_DisallowOptions, which means that separated values
1011  * must not look like options. For example, assume argument
1012  * <tt>--a</tt>/<tt>-a</tt> has mandatory value type Clp_ValStringNotOption
1013  * (which has Clp_DisallowOptions). Then:
1014  *
1015  * <ul>
1016  * <li><tt>--a=--b</tt> will parse with value <tt>--b</tt>.</li>
1017  * <li><tt>-a--b</tt> will parse with value <tt>--b</tt>.</li>
1018  * <li><tt>--a --b</tt> will not parse, since the mandatory value looks like
1019  * an option.</li>
1020  * <li><tt>-a --b</tt> will not parse, since the mandatory value looks like
1021  * an option.</li>
1022  * </ul>
1023  */
1024 int
1026  Clp_ValParseFunc parser, void *user_data)
1027 {
1028  Clp_Internal *cli = clp->internal;
1029  int vtpos;
1030 
1031  if (val_type <= 0 || !parser)
1032  return -1;
1033 
1034  vtpos = val_type_binsearch(cli, val_type);
1035 
1036  if (vtpos == cli->nvaltype || cli->valtype[vtpos].val_type != val_type) {
1037  if (cli->nvaltype != 0 && (cli->nvaltype % Clp_InitialValType) == 0) {
1038  Clp_ValType *new_valtype =
1039  (Clp_ValType *) realloc(cli->valtype, sizeof(Clp_ValType) * (cli->nvaltype + Clp_InitialValType));
1040  if (!new_valtype)
1041  return -1;
1042  cli->valtype = new_valtype;
1043  }
1044  memmove(&cli->valtype[vtpos + 1], &cli->valtype[vtpos],
1045  sizeof(Clp_ValType) * (cli->nvaltype - vtpos));
1046  cli->nvaltype++;
1047  cli->valtype[vtpos].func = 0;
1048  }
1049 
1050  if (cli->valtype[vtpos].func == parse_string_list) {
1051  Clp_StringList *clsl = (Clp_StringList *) cli->valtype[vtpos].user_data;
1052  free(clsl->items);
1053  free(clsl->iopt);
1054  free(clsl);
1055  }
1056 
1057  cli->valtype[vtpos].val_type = val_type;
1058  cli->valtype[vtpos].func = parser;
1059  cli->valtype[vtpos].flags = flags;
1060  cli->valtype[vtpos].user_data = user_data;
1061  return 0;
1062 }
1063 
1064 
1065 /*******
1066  * Default argument parsers
1067  **/
1068 
1069 static int
1070 parse_string(Clp_Parser *clp, const char *arg, int complain, void *user_data)
1071 {
1072  (void)complain, (void)user_data;
1073  clp->val.s = arg;
1074  return 1;
1075 }
1076 
1077 static int
1078 parse_int(Clp_Parser *clp, const char *arg, int complain, void *user_data)
1079 {
1080  const char *val;
1081  if (*arg == 0 || isspace((unsigned char) *arg)
1082  || (user_data != 0 && *arg == '-'))
1083  val = arg;
1084  else if (user_data != 0) { /* unsigned */
1085 #if HAVE_STRTOUL
1086  clp->val.u = strtoul(arg, (char **) &val, 0);
1087 #else
1088  /* don't bother really trying to do it right */
1089  if (arg[0] == '-')
1090  val = arg;
1091  else
1092  clp->val.u = strtol(arg, (char **) &val, 0);
1093 #endif
1094  } else
1095  clp->val.i = strtol(arg, (char **) &val, 0);
1096  if (*arg != 0 && *val == 0)
1097  return 1;
1098  else if (complain) {
1099  const char *message = user_data != 0
1100  ? "%<%O%> expects a nonnegative integer, not %<%s%>"
1101  : "%<%O%> expects an integer, not %<%s%>";
1102  return Clp_OptionError(clp, message, arg);
1103  } else
1104  return 0;
1105 }
1106 
1107 static int
1108 parse_double(Clp_Parser *clp, const char *arg, int complain, void *user_data)
1109 {
1110  const char *val;
1111  (void)user_data;
1112  if (*arg == 0 || isspace((unsigned char) *arg))
1113  val = arg;
1114  else
1115  clp->val.d = strtod(arg, (char **) &val);
1116  if (*arg != 0 && *val == 0)
1117  return 1;
1118  else if (complain)
1119  return Clp_OptionError(clp, "%<%O%> expects a real number, not %<%s%>", arg);
1120  else
1121  return 0;
1122 }
1123 
1124 static int
1125 parse_bool(Clp_Parser *clp, const char *arg, int complain, void *user_data)
1126 {
1127  int i;
1128  char lcarg[6];
1129  (void)user_data;
1130  if (strlen(arg) > 5 || strchr(arg, '=') != 0)
1131  goto error;
1132 
1133  for (i = 0; arg[i] != 0; i++)
1134  lcarg[i] = tolower((unsigned char) arg[i]);
1135  lcarg[i] = 0;
1136 
1137  if (argcmp("yes", lcarg, 1, 0) > 0
1138  || argcmp("true", lcarg, 1, 0) > 0
1139  || argcmp("1", lcarg, 1, 0) > 0) {
1140  clp->val.i = 1;
1141  return 1;
1142  } else if (argcmp("no", lcarg, 1, 0) > 0
1143  || argcmp("false", lcarg, 1, 0) > 0
1144  || argcmp("1", lcarg, 1, 0) > 0) {
1145  clp->val.i = 0;
1146  return 1;
1147  }
1148 
1149  error:
1150  if (complain)
1151  Clp_OptionError(clp, "%<%O%> expects a true-or-false value, not %<%s%>", arg);
1152  return 0;
1153 }
1154 
1155 
1156 /*****
1157  * Clp_AddStringListType
1158  **/
1159 
1160 static int
1161 parse_string_list(Clp_Parser *clp, const char *arg, int complain, void *user_data)
1162 {
1163  Clp_StringList *sl = (Clp_StringList *)user_data;
1164  int idx, ambiguous = 0;
1165  int ambiguous_values[MAX_AMBIGUOUS_VALUES + 1];
1166 
1167  /* actually look for a string value */
1169  (0, arg, sl->nitems, sl->items, sl->iopt,
1170  &ambiguous, ambiguous_values);
1171  if (idx >= 0) {
1172  clp->val.i = sl->items[idx].option_id;
1173  return 1;
1174  }
1175 
1176  if (sl->allow_int) {
1177  if (parse_int(clp, arg, 0, 0))
1178  return 1;
1179  }
1180 
1181  if (complain) {
1182  const char *complaint = (ambiguous ? "ambiguous" : "invalid");
1183  if (!ambiguous) {
1185  for (idx = 0; idx < ambiguous; idx++)
1186  ambiguous_values[idx] = idx;
1187  }
1188  return ambiguity_error
1189  (clp, ambiguous, ambiguous_values, sl->items, sl->iopt,
1190  "", "option %<%O%> value %<%s%> is %s", arg, complaint);
1191  } else
1192  return 0;
1193 }
1194 
1195 
1196 static int
1198  Clp_Option *items, int nitems, int itemscap)
1199 {
1200  int i;
1201  Clp_StringList *clsl = (Clp_StringList *)malloc(sizeof(Clp_StringList));
1202  Clp_InternOption *iopt = (Clp_InternOption *)malloc(sizeof(Clp_InternOption) * nitems);
1203  if (!clsl || !iopt)
1204  goto error;
1205 
1206  clsl->items = items;
1207  clsl->iopt = iopt;
1208  clsl->nitems = nitems;
1209  clsl->allow_int = (flags & Clp_AllowNumbers) != 0;
1210 
1211  if (nitems < MAX_AMBIGUOUS_VALUES && nitems < itemscap && clsl->allow_int) {
1212  items[nitems].long_name = "any integer";
1213  clsl->nitems_invalid_report = nitems + 1;
1214  } else if (nitems > MAX_AMBIGUOUS_VALUES + 1)
1216  else
1217  clsl->nitems_invalid_report = nitems;
1218 
1219  for (i = 0; i < nitems; i++) {
1220  iopt[i].ilong = iopt[i].ipos = 1;
1221  iopt[i].ishort = iopt[i].ineg = iopt[i].ilongoff = iopt[i].iprefmatch = 0;
1222  }
1223  calculate_lmm(clp, items, iopt, nitems);
1224 
1225  if (Clp_AddType(clp, val_type, 0, parse_string_list, clsl) >= 0)
1226  return 0;
1227 
1228  error:
1229  if (clsl)
1230  free(clsl);
1231  if (iopt)
1232  free(iopt);
1233  return -1;
1234 }
1235 
1236 /** @param clp the parser
1237  * @param val_type value type ID
1238  * @param flags string list flags
1239  * @return 0 on success, -1 on failure
1240  *
1241  * Defines argument type @a val_type in parser @a clp. The parsing function
1242  * sets @a clp->val.i to an integer. The value string is matched against
1243  * strings provided in the ellipsis arguments. For example, the
1244  * Clp_AddStringListType() call below has the same effect as the
1245  * Clp_AddStringListTypeVec() call:
1246  *
1247  * For example:
1248  * @code
1249  * Clp_AddStringListType(clp, 100, Clp_AllowNumbers, "cat", 1,
1250  * "cattle", 2, "dog", 3, (const char *) NULL);
1251  *
1252  * const char * const strs[] = { "cat", "cattle", "dog" };
1253  * const int vals[] = { 1, 2, 3 };
1254  * Clp_AddStringListTypeVec(clp, 100, Clp_AllowNumbers, 3, strs, vals);
1255  * @endcode
1256  *
1257  * @note The CLP library will not modify any of the passed-in strings. The
1258  * calling program must not modify or free them either until the parser is
1259  * destroyed.
1260  */
1261 int
1263 {
1264  int nitems = 0;
1265  int itemscap = 5;
1266  Clp_Option *items = (Clp_Option *)malloc(sizeof(Clp_Option) * itemscap);
1267 
1268  va_list val;
1269  va_start(val, flags);
1270 
1271  if (!items)
1272  goto error;
1273 
1274  /* slurp up the arguments */
1275  while (1) {
1276  int value;
1277  char *name = va_arg(val, char *);
1278  if (!name)
1279  break;
1280  value = va_arg(val, int);
1281 
1282  if (nitems >= itemscap) {
1283  Clp_Option *new_items;
1284  itemscap *= 2;
1285  new_items = (Clp_Option *)realloc(items, sizeof(Clp_Option) * itemscap);
1286  if (!new_items)
1287  goto error;
1288  items = new_items;
1289  }
1290 
1291  items[nitems].long_name = name;
1292  items[nitems].option_id = value;
1293  items[nitems].flags = 0;
1294  nitems++;
1295  }
1296 
1297  va_end(val);
1298  if (finish_string_list(clp, val_type, flags, items, nitems, itemscap) >= 0)
1299  return 0;
1300 
1301  error:
1302  va_end(val);
1303  if (items)
1304  free(items);
1305  return -1;
1306 }
1307 
1308 /** @param clp the parser
1309  * @param val_type value type ID
1310  * @param flags string list flags
1311  * @param nstrs number of strings in list
1312  * @param strs array of strings
1313  * @param vals array of values
1314  * @return 0 on success, -1 on failure
1315  *
1316  * Defines argument type @a val_type in parser @a clp. The parsing function
1317  * sets @a clp->val.i to an integer. The value string is matched against the
1318  * @a strs. If there's a unique match, the corresponding entry from @a vals
1319  * is returned. Unique prefix matches also work. Finally, if @a flags
1320  * contains the Clp_AllowNumbers flag, then integers are also accepted.
1321  *
1322  * For example:
1323  * @code
1324  * const char * const strs[] = { "cat", "cattle", "dog" };
1325  * const int vals[] = { 1, 2, 3 };
1326  * Clp_AddStringListTypeVec(clp, 100, Clp_AllowNumbers, 3, strs, vals);
1327  * @endcode
1328  *
1329  * Say that option <tt>--animal</tt> takes value type 100. Then:
1330  *
1331  * <ul>
1332  * <li><tt>--animal=cat</tt> will succeed and set @a clp->val.i = 1.</li>
1333  * <li><tt>--animal=cattle</tt> will succeed and set @a clp->val.i = 2.</li>
1334  * <li><tt>--animal=dog</tt> will succeed and set @a clp->val.i = 3.</li>
1335  * <li><tt>--animal=d</tt> will succeed and set @a clp->val.i = 3.</li>
1336  * <li><tt>--animal=c</tt> will fail, since <tt>c</tt> is ambiguous.</li>
1337  * <li><tt>--animal=4</tt> will succeed and set @a clp->val.i = 4.</li>
1338  * </ul>
1339  *
1340  * @note The CLP library will not modify the contents of @a strs or @a vals.
1341  * The calling program can modify the @a strs array, but the actual strings
1342  * (for instance, @a strs[0] and @a strs[1]) must not be modified or freed
1343  * until the parser is destroyed.
1344  */
1345 int
1347  int nstrs, const char * const *strs,
1348  const int *vals)
1349  /* An alternate way to make a string list type. See Clp_AddStringListType
1350  for the basics; this coalesces the strings and values into two arrays,
1351  rather than spreading them out into a variable argument list. */
1352 {
1353  int i;
1354  int itemscap = (nstrs < 5 ? 5 : nstrs);
1355  Clp_Option *items = (Clp_Option *)malloc(sizeof(Clp_Option) * itemscap);
1356  if (!items)
1357  return -1;
1358 
1359  /* copy over items */
1360  for (i = 0; i < nstrs; i++) {
1361  items[i].long_name = strs[i];
1362  items[i].option_id = vals[i];
1363  items[i].flags = 0;
1364  }
1365 
1366  if (finish_string_list(clp, val_type, flags, items, nstrs, itemscap) >= 0)
1367  return 0;
1368  else {
1369  free(items);
1370  return -1;
1371  }
1372 }
1373 
1374 
1375 /*******
1376  * Returning information
1377  **/
1378 
1379 const char *
1381 {
1382  return clp->internal->program_name;
1383 }
1384 
1385 /** @param clp the parser
1386  * @param name new program name
1387  * @return previous program name
1388  *
1389  * The calling program should not modify or free @a name until @a clp itself
1390  * is destroyed. */
1391 const char *
1393 {
1394  const char *old = clp->internal->program_name;
1395  clp->internal->program_name = name;
1396  return old;
1397 }
1398 
1399 
1400 /******
1401  * Clp_ParserStates
1402  **/
1403 
1404 /** @return the parser state
1405  *
1406  * A Clp_ParserState object can store a parsing state of a Clp_Parser object.
1407  * This state specifies exactly how far the Clp_Parser has gotten in parsing
1408  * an argument list. The Clp_SaveParser() and Clp_RestoreParser() functions
1409  * can be used to save this state and then restore it later, allowing a
1410  * Clp_Parser to switch among argument lists.
1411  *
1412  * The initial state is empty, in that after Clp_RestoreParser(clp, state),
1413  * Clp_Next(clp) would return Clp_Done.
1414  *
1415  * Parser states can be saved and restored among different parser objects.
1416  *
1417  * @sa Clp_DeleteParserState, Clp_SaveParser, Clp_RestoreParser
1418  */
1421 {
1423  if (state) {
1424  state->argv = 0;
1425  state->argc = 0;
1426  state->option_chars[0] = 0;
1427  state->xtext = 0;
1428  state->option_processing = 0;
1429  state->opt_generation = 0;
1430  state->current_option = -1;
1431  state->is_short = 0;
1432  state->whole_negated = 0;
1433  state->current_short = 0;
1434  state->negated_by_no = 0;
1435  }
1436  return state;
1437 }
1438 
1439 /** @param state parser state
1440  *
1441  * The memory associated with @a state is freed.
1442  */
1443 void
1445 {
1446  free(state);
1447 }
1448 
1449 /** @param clp the parser
1450  * @param state parser state
1451  * @sa Clp_NewParserState, Clp_RestoreParser
1452  */
1453 void
1455 {
1456  Clp_Internal *cli = clp->internal;
1457  state->argv = cli->argv;
1458  state->argc = cli->argc;
1459  memcpy(state->option_chars, cli->option_chars, Clp_OptionCharsSize);
1460  state->xtext = cli->xtext;
1461 
1462  state->option_processing = cli->option_processing;
1463  state->opt_generation = cli->opt_generation;
1464  state->current_option = cli->current_option;
1465  state->is_short = cli->is_short;
1466  state->whole_negated = cli->whole_negated;
1467  state->current_short = cli->current_short;
1468  state->negated_by_no = cli->negated_by_no;
1469 }
1470 
1471 
1472 /** @param clp the parser
1473  * @param state parser state
1474  *
1475  * The parser state in @a state is restored into @a clp. The next call to
1476  * Clp_Next() will return the same result as it would have at the time @a
1477  * state was saved (probably by Clp_SaveParser(@a clp, @a state)).
1478  *
1479  * A parser state contains information about arguments (argc and argv; see
1480  * Clp_SetArguments()) and option processing (Clp_SetOptionProcessing()), but
1481  * not about options (Clp_SetOptions()). Changes to options and value types
1482  * are preserved across Clp_RestoreParser().
1483  *
1484  * @sa Clp_NewParserState, Clp_SaveParser
1485  */
1486 void
1488 {
1489  Clp_Internal *cli = clp->internal;
1490  cli->argv = state->argv;
1491  cli->argc = state->argc;
1492  memcpy(cli->option_chars, state->option_chars, Clp_OptionCharsSize);
1493  cli->xtext = state->xtext;
1494  cli->option_processing = state->option_processing;
1495  cli->is_short = state->is_short;
1496  cli->whole_negated = state->whole_negated;
1497  cli->current_short = state->current_short;
1498  cli->negated_by_no = state->negated_by_no;
1499  if (cli->opt_generation == state->opt_generation)
1500  cli->current_option = state->current_option;
1501  else
1502  cli->current_option = -1;
1503 }
1504 
1505 
1506 /*******
1507  * Clp_Next and its helpers
1508  **/
1509 
1510 static void
1511 set_option_text(Clp_Internal *cli, const char *text, int n_option_chars)
1512 {
1513  assert(n_option_chars < Clp_OptionCharsSize);
1514  memcpy(cli->option_chars, text, n_option_chars);
1515  cli->option_chars[n_option_chars] = 0;
1516  cli->xtext = text + n_option_chars;
1517 }
1518 
1519 static int
1520 get_oclass(Clp_Parser *clp, const char *text, int *ocharskip)
1521 {
1522  int c;
1523  if (clp->internal->utf8) {
1524  const char *s;
1525  c = decode_utf8(text, &s);
1526  *ocharskip = s - text;
1527  } else {
1528  c = (unsigned char) text[0];
1529  *ocharskip = 1;
1530  }
1531  return Clp_OptionChar(clp, c);
1532 }
1533 
1534 static int
1535 next_argument(Clp_Parser *clp, int want_argument)
1536  /* Moves clp to the next argument.
1537  Returns 1 if it finds another option.
1538  Returns 0 if there aren't any more arguments.
1539  Returns 0, sets clp->have_val = 1, and sets clp->vstr to the argument
1540  if the next argument isn't an option.
1541  If want_argument > 0, it'll look for an argument.
1542  want_argument == 1: Accept arguments that start with Clp_NotOption
1543  or Clp_LongImplicit.
1544  want_argument == 2: Accept ALL arguments.
1545 
1546  Where is the option stored when this returns?
1547  Well, cli->argv[0] holds the whole of the next command line argument.
1548  cli->option_chars holds a string: what characters began the option?
1549  It is generally "-" or "--".
1550  cli->text holds the text of the option:
1551  for short options, cli->text[0] is the relevant character;
1552  for long options, cli->text holds the rest of the option. */
1553 {
1554  Clp_Internal *cli = clp->internal;
1555  const char *text;
1556  int oclass, ocharskip;
1557 
1558  /* clear relevant flags */
1559  clp->have_val = 0;
1560  clp->vstr = 0;
1561  cli->could_be_short = 0;
1562 
1563  /* if we're in a string of short options, move up one char in the string */
1564  if (cli->is_short) {
1565  cli->xtext += clp_utf8_charlen(cli, cli->xtext);
1566  if (cli->xtext[0] == 0)
1567  cli->is_short = 0;
1568  else if (want_argument > 0) {
1569  /* handle -O[=]argument case */
1570  clp->have_val = 1;
1571  if (cli->xtext[0] == '=')
1572  clp->vstr = cli->xtext + 1;
1573  else
1574  clp->vstr = cli->xtext;
1575  cli->is_short = 0;
1576  return 0;
1577  }
1578  }
1579 
1580  /* if in short options, we're all set */
1581  if (cli->is_short)
1582  return 1;
1583 
1584  /** if not in short options, move to the next argument **/
1585  cli->whole_negated = 0;
1586  cli->xtext = 0;
1587 
1588  if (cli->argc <= 1)
1589  return 0;
1590 
1591  cli->argc--;
1592  cli->argv++;
1593  text = cli->argv[0];
1594 
1595  if (want_argument > 1)
1596  goto not_option;
1597 
1598  if (text[0] == '-' && text[1] == '-') {
1599  oclass = Clp_DoubledLong;
1600  ocharskip = 2;
1601  } else
1602  oclass = get_oclass(clp, text, &ocharskip);
1603 
1604  /* If this character could introduce either a short or a long option,
1605  try a long option first, but remember that short's a possibility for
1606  later. */
1607  if ((oclass & (Clp_Short | Clp_ShortNegated))
1608  && (oclass & (Clp_Long | Clp_LongNegated))) {
1609  oclass &= ~(Clp_Short | Clp_ShortNegated);
1610  if (text[ocharskip])
1611  cli->could_be_short = 1;
1612  }
1613 
1614  switch (oclass) {
1615 
1616  case Clp_Short:
1617  cli->is_short = 1;
1618  goto check_singleton;
1619 
1620  case Clp_ShortNegated:
1621  cli->is_short = 1;
1622  cli->whole_negated = 1;
1623  goto check_singleton;
1624 
1625  case Clp_Long:
1626  goto check_singleton;
1627 
1628  case Clp_LongNegated:
1629  cli->whole_negated = 1;
1630  goto check_singleton;
1631 
1632  check_singleton:
1633  /* For options introduced with one character, option-char,
1634  '[option-char]' alone is NOT an option. */
1635  if (!text[ocharskip])
1636  goto not_option;
1637  set_option_text(cli, text, ocharskip);
1638  break;
1639 
1640  case Clp_LongImplicit:
1641  /* LongImplict: option_chars == "" (since all chars are part of the
1642  option); restore head -> text of option */
1643  if (want_argument > 0)
1644  goto not_option;
1645  set_option_text(cli, text, 0);
1646  break;
1647 
1648  case Clp_DoubledLong:
1649  set_option_text(cli, text, ocharskip);
1650  break;
1651 
1652  not_option:
1653  case Clp_NotOption:
1654  cli->is_short = 0;
1655  clp->have_val = 1;
1656  clp->vstr = text;
1657  return 0;
1658 
1659  default:
1660  assert(0 /* CLP misconfiguration: bad option type */);
1661 
1662  }
1663 
1664  return 1;
1665 }
1666 
1667 
1668 static void
1670 {
1671  Clp_Internal *cli = clp->internal;
1672  const char *text = cli->argv[0];
1673  int ocharskip, oclass = get_oclass(clp, text, &ocharskip);
1674  assert(cli->could_be_short);
1675  cli->is_short = 1;
1676  cli->whole_negated = (oclass & Clp_ShortNegated ? 1 : 0);
1677  set_option_text(cli, cli->argv[0], ocharskip);
1678 }
1679 
1680 
1681 static int
1682 find_long(Clp_Parser *clp, const char *arg)
1683  /* If arg corresponds to one of clp's options, finds that option &
1684  returns it. If any argument is given after an = sign in arg, sets
1685  clp->have_val = 1 and clp->vstr to that argument. Sets cli->ambiguous
1686  to 1 iff there was no match because the argument was ambiguous. */
1687 {
1688  Clp_Internal *cli = clp->internal;
1689  int optno, len, lmm;
1690  const Clp_Option *opt = cli->opt;
1691  const Clp_InternOption *iopt;
1692  int first_negative_ambiguous;
1693 
1694  /* Look for a normal option. */
1695  optno = find_prefix_opt
1696  (clp, arg, cli->nopt, opt, cli->iopt,
1697  &cli->ambiguous, cli->ambiguous_values);
1698  if (optno >= 0)
1699  goto worked;
1700 
1701  /* If we can't find it, look for a negated option. */
1702  /* I know this is silly, but it makes me happy to accept
1703  --no-no-option as a double negative synonym for --option. :) */
1704  first_negative_ambiguous = cli->ambiguous;
1705  while (arg[0] == 'n' && arg[1] == 'o' && arg[2] == '-') {
1706  arg += 3;
1707  clp->negated = !clp->negated;
1708  optno = find_prefix_opt
1709  (clp, arg, cli->nopt, opt, cli->iopt,
1710  &cli->ambiguous, cli->ambiguous_values);
1711  if (optno >= 0)
1712  goto worked;
1713  }
1714 
1715  /* No valid option was found; return 0. Mark the ambiguous values found
1716  through '--no' by making them negative. */
1717  {
1718  int i, max = cli->ambiguous;
1720  for (i = first_negative_ambiguous; i < max; i++)
1721  cli->ambiguous_values[i] = -cli->ambiguous_values[i] - 1;
1722  }
1723  return -1;
1724 
1725  worked:
1726  iopt = &cli->iopt[optno];
1727  lmm = (clp->negated ? iopt->lmmneg : iopt->lmmpos);
1728  if (cli->could_be_short
1729  && (clp->negated ? iopt->lmmneg_short : iopt->lmmpos_short)) {
1730  int first_charlen = clp_utf8_charlen(cli, arg);
1731  lmm = (first_charlen >= lmm ? first_charlen + 1 : lmm);
1732  }
1733  len = argcmp(opt[optno].long_name + iopt->ilongoff, arg, lmm, 1);
1734  assert(len > 0);
1735  if (arg[len] == '=') {
1736  clp->have_val = 1;
1737  clp->vstr = arg + len + 1;
1738  }
1739  return optno;
1740 }
1741 
1742 
1743 static int
1744 find_short(Clp_Parser *clp, const char *text)
1745  /* If short_name corresponds to one of clp's options, returns it. */
1746 {
1747  Clp_Internal *cli = clp->internal;
1748  const Clp_Option *opt = cli->opt;
1749  const Clp_InternOption *iopt = cli->iopt;
1750  int i, c;
1751  if (clp->internal->utf8)
1752  c = decode_utf8(text, 0);
1753  else
1754  c = (unsigned char) *text;
1755 
1756  for (i = 0; i < cli->nopt; i++)
1757  if (iopt[i].ishort && opt[i].short_name == c
1758  && (!clp->negated || iopt[i].ineg)) {
1759  clp->negated = clp->negated || !iopt[i].ipos;
1760  return i;
1761  }
1762 
1763  return -1;
1764 }
1765 
1766 
1767 /** @param clp the parser
1768  * @return option ID of next option
1769  *
1770  * Parse the next argument from the argument list, store information about
1771  * that argument in the fields of @a clp, and return the option's ID.
1772  *
1773  * If an argument was successfully parsed, that option's ID is returned.
1774  * Other possible return values are:
1775  *
1776  * <dl>
1777  * <dt>Clp_Done</dt>
1778  * <dd>There are no more arguments.</dd>
1779  * <dt>Clp_NotOption</dt>
1780  * <dd>The next argument was not an option. The argument's text is @a
1781  * clp->vstr (and @a clp->val.s).</dd>
1782  * <dt>Clp_BadOption</dt>
1783  * <dd>The next argument was a bad option: either an option that wasn't
1784  * understood, or an option lacking a required value, or an option whose value
1785  * couldn't be parsed. The option has been skipped.</dd>
1786  * <dt>Clp_Error</dt>
1787  * <dd>There was an internal error. This should never occur unless a user
1788  * messes with, for example, a Clp_Option array.</dd>
1789  * </dl>
1790  *
1791  * The fields of @a clp are set as follows.
1792  *
1793  * <dl>
1794  * <dt><tt>negated</tt></dt>
1795  * <dd>1 if the option was negated, 0 if it wasn't.</dd>
1796  * <dt><tt>have_val</tt></dt>
1797  * <dd>1 if the option had a value, 0 if it didn't. Note that negated options
1798  * are not allowed to have values.</dd>
1799  * <dt><tt>vstr</tt></dt>
1800  * <dd>The value string, if any. NULL if there was no value.</dd>
1801  * <dt><tt>val</tt></dt>
1802  * <dd>An option's value type will parse the value string into this
1803  * union.</dd>
1804  * </dl>
1805  *
1806  * The parsed argument is shifted off the argument list, so that sequential
1807  * calls to Clp_Next() step through the arugment list.
1808  */
1809 int
1811 {
1812  Clp_Internal *cli = clp->internal;
1813  int optno;
1814  const Clp_Option *opt;
1815  Clp_ParserState clpsave;
1816  int vtpos, complain;
1817 
1818  /* Set up clp */
1819  cli->current_option = -1;
1820  cli->ambiguous = 0;
1821 
1822  /* Get the next argument or option */
1823  if (!next_argument(clp, cli->option_processing ? 0 : 2)) {
1824  clp->val.s = clp->vstr;
1825  optno = clp->have_val ? Clp_NotOption : Clp_Done;
1826  clp->option = &clp_option_sentinel[-optno];
1827  return optno;
1828  }
1829 
1830  clp->negated = cli->whole_negated;
1831  if (cli->is_short)
1832  optno = find_short(clp, cli->xtext);
1833  else
1834  optno = find_long(clp, cli->xtext);
1835 
1836  /* If there's ambiguity between long & short options, and we couldn't
1837  find a long option, look for a short option */
1838  if (optno < 0 && cli->could_be_short) {
1840  optno = find_short(clp, cli->xtext);
1841  }
1842 
1843  /* If we didn't find an option... */
1844  if (optno < 0 || (clp->negated && !cli->iopt[optno].ineg)) {
1845  /* default processing for the "--" option: turn off option processing
1846  and return the next argument */
1847  if (strcmp(cli->argv[0], "--") == 0) {
1848  Clp_SetOptionProcessing(clp, 0);
1849  return Clp_Next(clp);
1850  }
1851 
1852  /* otherwise, report some error or other */
1853  if (cli->ambiguous)
1854  ambiguity_error(clp, cli->ambiguous, cli->ambiguous_values,
1855  cli->opt, cli->iopt, cli->option_chars,
1856  "option %<%s%s%> is ambiguous",
1857  cli->option_chars, cli->xtext);
1858  else if (cli->is_short && !cli->could_be_short)
1859  Clp_OptionError(clp, "unrecognized option %<%s%C%>",
1860  cli->option_chars, cli->xtext);
1861  else
1862  Clp_OptionError(clp, "unrecognized option %<%s%s%>",
1863  cli->option_chars, cli->xtext);
1864 
1866  return Clp_BadOption;
1867  }
1868 
1869  /* Set the current option */
1870  cli->current_option = optno;
1871  cli->current_short = cli->is_short;
1872  cli->negated_by_no = clp->negated && !cli->whole_negated;
1873 
1874  /* The no-argument (or should-have-no-argument) case */
1875  if (clp->negated
1876  || (!cli->iopt[optno].imandatory && !cli->iopt[optno].ioptional)) {
1877  if (clp->have_val) {
1878  Clp_OptionError(clp, "%<%O%> can%,t take an argument");
1880  return Clp_BadOption;
1881  } else {
1882  clp->option = &cli->opt[optno];
1883  return cli->opt[optno].option_id;
1884  }
1885  }
1886 
1887  /* Get an argument if we need one, or if it's optional */
1888  /* Sanity-check the argument type. */
1889  opt = &cli->opt[optno];
1890  if (opt->val_type <= 0) {
1892  return Clp_Error;
1893  }
1894  vtpos = val_type_binsearch(cli, opt->val_type);
1895  if (vtpos == cli->nvaltype
1896  || cli->valtype[vtpos].val_type != opt->val_type) {
1898  return Clp_Error;
1899  }
1900 
1901  /* complain == 1 only if the argument was explicitly given,
1902  or it is mandatory. */
1903  complain = (clp->have_val != 0) || cli->iopt[optno].imandatory;
1904  Clp_SaveParser(clp, &clpsave);
1905 
1906  if (cli->iopt[optno].imandatory && !clp->have_val) {
1907  /* Mandatory argument case */
1908  /* Allow arguments to options to start with a dash, but only if the
1909  argument type allows it by not setting Clp_DisallowOptions */
1910  int disallow = (cli->valtype[vtpos].flags & Clp_DisallowOptions) != 0;
1911  next_argument(clp, disallow ? 1 : 2);
1912  if (!clp->have_val) {
1913  int got_option = cli->xtext != 0;
1914  Clp_RestoreParser(clp, &clpsave);
1915  if (got_option)
1916  Clp_OptionError(clp, "%<%O%> requires a non-option argument");
1917  else
1918  Clp_OptionError(clp, "%<%O%> requires an argument");
1920  return Clp_BadOption;
1921  }
1922 
1923  } else if (cli->is_short && !clp->have_val
1924  && cli->xtext[clp_utf8_charlen(cli, cli->xtext)])
1925  /* The -[option]argument case:
1926  Assume that the rest of the current string is the argument. */
1927  next_argument(clp, 1);
1928 
1929  /* Parse the argument */
1930  if (clp->have_val) {
1931  Clp_ValType *atr = &cli->valtype[vtpos];
1932  if (atr->func(clp, clp->vstr, complain, atr->user_data) <= 0) {
1933  /* parser failed */
1934  clp->have_val = 0;
1935  if (cli->iopt[optno].imandatory) {
1937  return Clp_BadOption;
1938  } else
1939  Clp_RestoreParser(clp, &clpsave);
1940  }
1941  }
1942 
1943  clp->option = opt;
1944  return opt->option_id;
1945 }
1946 
1947 
1948 /** @param clp the parser
1949  * @param allow_options whether options will be allowed
1950  *
1951  * Remove and return the next argument from @a clp's argument array. If there
1952  * are no arguments left, or if the next argument is an option and @a
1953  * allow_options != 0, then returns null.
1954  */
1955 const char *
1956 Clp_Shift(Clp_Parser *clp, int allow_options)
1957  /* Returns the next argument from the argument list without parsing it.
1958  If there are no more arguments, returns 0. */
1959 {
1960  Clp_ParserState clpsave;
1961  Clp_SaveParser(clp, &clpsave);
1962  next_argument(clp, allow_options ? 2 : 1);
1963  if (!clp->have_val)
1964  Clp_RestoreParser(clp, &clpsave);
1965  return clp->vstr;
1966 }
1967 
1968 
1969 /*******
1970  * Clp_OptionError
1971  **/
1972 
1973 typedef struct Clp_BuildString {
1974  char *text;
1975  char *pos;
1977  int bad;
1979 
1980 static Clp_BuildString *
1982 {
1984  if (!bs) goto bad;
1985  bs->text = (char *)malloc(256);
1986  if (!bs->text) goto bad;
1987  bs->pos = bs->text;
1988  bs->capacity = 256;
1989  bs->bad = 0;
1990  return bs;
1991 
1992  bad:
1993  if (bs) free(bs);
1994  return 0;
1995 }
1996 
1997 static void
1999 {
2000  if (bs) free(bs->text);
2001  free(bs);
2002 }
2003 
2004 static int
2006 {
2007  char *new_text;
2008  int ipos = bs->pos - bs->text;
2009  int new_capacity = bs->capacity;
2010  while (want >= new_capacity)
2011  new_capacity *= 2;
2012  new_text = (char *)realloc(bs->text, new_capacity);
2013  if (!new_text) {
2014  bs->bad = 1;
2015  return 0;
2016  } else {
2017  bs->text = new_text;
2018  bs->pos = bs->text + ipos;
2019  bs->capacity = new_capacity;
2020  return 1;
2021  }
2022 }
2023 
2024 #define ENSURE_BUILD_STRING(bs, space) \
2025  ((((bs)->pos - (bs)->text) + (space) >= (bs)->capacity) \
2026  || grow_build_string((bs), ((bs)->pos - (bs)->text) + (space)))
2027 
2028 static void
2029 append_build_string(Clp_BuildString *bs, const char *s, int l)
2030 {
2031  if (l < 0)
2032  l = strlen(s);
2033  if (ENSURE_BUILD_STRING(bs, l)) {
2034  memcpy(bs->pos, s, l);
2035  bs->pos += l;
2036  }
2037 }
2038 
2039 
2040 static Clp_BuildString *
2042  const char *fmt, va_list val)
2043 {
2044  Clp_Internal *cli = clp->internal;
2045  const char *percent;
2046  int c;
2047 
2048  if (!bs)
2049  bs = new_build_string();
2050  if (!bs)
2051  return 0;
2052  if (cli->program_name && cli->program_name[0]) {
2053  append_build_string(bs, cli->program_name, -1);
2054  append_build_string(bs, ": ", 2);
2055  }
2056 
2057  for (percent = strchr(fmt, '%'); percent; percent = strchr(fmt, '%')) {
2059  switch (*++percent) {
2060 
2061  case 's': {
2062  const char *s = va_arg(val, const char *);
2063  if (s)
2064  append_build_string(bs, s, -1);
2065  else
2066  append_build_string(bs, "(null)", 6);
2067  break;
2068  }
2069 
2070  case 'C': {
2071  const char *s = va_arg(val, const char *);
2072  if (cli->utf8)
2073  c = decode_utf8(s, 0);
2074  else
2075  c = (unsigned char) *s;
2076  goto char_c;
2077  }
2078 
2079  case 'c':
2080  c = va_arg(val, int);
2081  goto char_c;
2082 
2083  char_c:
2084  if (ENSURE_BUILD_STRING(bs, 4)) {
2085  if (c >= 32 && c <= 126)
2086  *bs->pos++ = c;
2087  else if (c < 32) {
2088  *bs->pos++ = '^';
2089  *bs->pos++ = c + 64;
2090  } else if (cli->utf8 && c >= 127 && c < 0x110000) {
2091  bs->pos = encode_utf8(bs->pos, 4, c);
2092  } else if (c >= 127 && c <= 255) {
2093  sprintf(bs->pos, "\\%03o", c & 0xFF);
2094  bs->pos += 4;
2095  } else {
2096  *bs->pos++ = '\\';
2097  *bs->pos++ = '?';
2098  }
2099  }
2100  break;
2101 
2102  case 'd': {
2103  int d = va_arg(val, int);
2104  if (ENSURE_BUILD_STRING(bs, 32)) {
2105  sprintf(bs->pos, "%d", d);
2106  bs->pos = strchr(bs->pos, 0);
2107  }
2108  break;
2109  }
2110 
2111  case 'O': {
2112  int optno = cli->current_option;
2113  const Clp_Option *opt = &cli->opt[optno];
2114  if (optno < 0)
2115  append_build_string(bs, "(no current option!)", -1);
2116  else if (cli->current_short) {
2117  append_build_string(bs, cli->option_chars, -1);
2118  if (ENSURE_BUILD_STRING(bs, 5)) {
2119  if (cli->utf8)
2120  bs->pos = encode_utf8(bs->pos, 5, opt->short_name);
2121  else
2122  *bs->pos++ = opt->short_name;
2123  }
2124  } else if (cli->negated_by_no) {
2125  append_build_string(bs, cli->option_chars, -1);
2126  append_build_string(bs, "no-", 3);
2127  append_build_string(bs, opt->long_name + cli->iopt[optno].ilongoff, -1);
2128  } else {
2129  append_build_string(bs, cli->option_chars, -1);
2130  append_build_string(bs, opt->long_name + cli->iopt[optno].ilongoff, -1);
2131  }
2132  break;
2133  }
2134 
2135  case '%':
2136  if (ENSURE_BUILD_STRING(bs, 1))
2137  *bs->pos++ = '%';
2138  break;
2139 
2140  case '`': /* backwards compatibility */
2141  case '<':
2142  append_build_string(bs, (cli->utf8 ? "\342\200\230" : "'"), -1);
2143  break;
2144 
2145  case '\'': /* backwards compatibility */
2146  case ',':
2147  case '>':
2148  append_build_string(bs, (cli->utf8 ? "\342\200\231" : "'"), -1);
2149  break;
2150 
2151  default:
2152  if (ENSURE_BUILD_STRING(bs, 2)) {
2153  *bs->pos++ = '%';
2154  *bs->pos++ = *percent;
2155  }
2156  break;
2157 
2158  }
2159  fmt = ++percent;
2160  }
2161 
2162  append_build_string(bs, fmt, -1);
2163  append_build_string(bs, "\n", 1);
2164 
2165  return bs;
2166 }
2167 
2168 static void
2170 {
2171  const char *text;
2172  if (bs && !bs->bad) {
2173  *bs->pos = 0;
2174  text = bs->text;
2175  } else
2176  text = "out of memory\n";
2177 
2178  if (clp->internal->error_handler != 0)
2179  (*clp->internal->error_handler)(clp, text);
2180  else
2181  fputs(text, stderr);
2182 }
2183 
2184 /** @param clp the parser
2185  * @param format error format
2186  *
2187  * Format an error message from @a format and any additional arguments in the
2188  * ellipsis. The resulting error string by printing it to standard error or
2189  * passing it to Clp_SetErrorHandler.
2190  *
2191  * The following format characters are accepted:
2192  *
2193  * <dl>
2194  * <dt><tt>%</tt><tt>c</tt></dt>
2195  * <dd>A character (type <tt>int</tt>). Control characters are printed in
2196  * caret notation. If the parser is in UTF-8 mode, the character is formatted
2197  * in UTF-8. Otherwise, special characters are printed with backslashes and
2198  * octal notation.</dd>
2199  * <dt><tt>%</tt><tt>s</tt></dt>
2200  * <dd>A string (type <tt>const char *</tt>).</dd>
2201  * <dt><tt>%</tt><tt>C</tt></dt>
2202  * <dd>The argument is a string (type <tt>const char *</tt>). The first
2203  * character in this string is printed. If the parser is in UTF-8 mode, this
2204  * may involve multiple bytes.</dd>
2205  * <dt><tt>%</tt><tt>d</tt></dt>
2206  * <dd>An integer (type <tt>int</tt>). Printed in decimal.</dd>
2207  * <dt><tt>%</tt><tt>O</tt></dt>
2208  * <dd>The current option. No values are read from the argument list; the
2209  * current option is defined in the Clp_Parser object itself.</dd>
2210  * <dt><tt>%%</tt></dt>
2211  * <dd>Prints a percent character.</dd>
2212  * <dt><tt>%</tt><tt>&lt;</tt></dt>
2213  * <dd>Prints an open quote string. In UTF-8 mode, prints a left single
2214  * quote. Otherwise prints a single quote.</dd>
2215  * <dt><tt>%</tt><tt>&gt;</tt></dt>
2216  * <dd>Prints a closing quote string. In UTF-8 mode, prints a right single
2217  * quote. Otherwise prints a single quote.</dd>
2218  * <dt><tt>%</tt><tt>,</tt></dt>
2219  * <dd>Prints an apostrophe. In UTF-8 mode, prints a right single quote.
2220  * Otherwise prints a single quote.</dd>
2221  * </dl>
2222  *
2223  * Note that no flag characters, precision, or field width characters are
2224  * currently supported.
2225  *
2226  * @sa Clp_SetErrorHandler
2227  */
2228 int
2229 Clp_OptionError(Clp_Parser *clp, const char *format, ...)
2230 {
2231  Clp_BuildString *bs;
2232  va_list val;
2233  va_start(val, format);
2234  bs = Clp_VaOptionError(clp, 0, format, val);
2235  va_end(val);
2236  do_error(clp, bs);
2237  free_build_string(bs);
2238  return 0;
2239 }
2240 
2241 static int
2242 ambiguity_error(Clp_Parser *clp, int ambiguous, int *ambiguous_values,
2243  const Clp_Option *opt, const Clp_InternOption *iopt,
2244  const char *prefix, const char *fmt, ...)
2245 {
2246  Clp_Internal *cli = clp->internal;
2247  Clp_BuildString *bs;
2248  int i;
2249  va_list val;
2250  va_start(val, fmt);
2251  bs = Clp_VaOptionError(clp, 0, fmt, val);
2252  if (!bs) goto done;
2253 
2254  if (clp->internal->program_name && clp->internal->program_name[0]) {
2255  append_build_string(bs, clp->internal->program_name, -1);
2256  append_build_string(bs, ": ", 2);
2257  }
2258  append_build_string(bs, "(Possibilities are", -1);
2259 
2260  for (i = 0; i < ambiguous && i < MAX_AMBIGUOUS_VALUES; i++) {
2261  int value = ambiguous_values[i];
2262  const char *no_dash = "";
2263  if (value < 0)
2264  value = -(value + 1), no_dash = "no-";
2265  if (i == 0)
2266  append_build_string(bs, " ", 1);
2267  else if (i == ambiguous - 1)
2268  append_build_string(bs, (i == 1 ? " and " : ", and "), -1);
2269  else
2270  append_build_string(bs, ", ", 2);
2271  append_build_string(bs, (cli->utf8 ? "\342\200\230" : "'"), -1);
2272  append_build_string(bs, prefix, -1);
2273  append_build_string(bs, no_dash, -1);
2274  append_build_string(bs, opt[value].long_name + iopt[value].ilongoff, -1);
2275  append_build_string(bs, (cli->utf8 ? "\342\200\231" : "'"), -1);
2276  }
2277 
2279  append_build_string(bs, ", and others", -1);
2280  append_build_string(bs, ".)\n", -1);
2281  va_end(val);
2282 
2283  done:
2284  do_error(clp, bs);
2285  free_build_string(bs);
2286  return 0;
2287 }
2288 
2289 static int
2290 copy_string(char *buf, int buflen, int bufpos, const char *what)
2291 {
2292  int l = strlen(what);
2293  if (l > buflen - bufpos - 1)
2294  l = buflen - bufpos - 1;
2295  memcpy(buf + bufpos, what, l);
2296  return l;
2297 }
2298 
2299 /** @param clp the parser
2300  * @param buf output buffer
2301  * @param len length of output buffer
2302  * @return number of characters written to the buffer, not including the terminating NUL
2303  *
2304  * A string that looks like the last option parsed by @a clp is extracted into
2305  * @a buf. The correct option characters are put into the string first,
2306  * followed by the option text. The output buffer is null-terminated unless
2307  * @a len == 0.
2308  *
2309  * @sa Clp_CurOptionName
2310  */
2311 int
2313 {
2314  Clp_Internal *cli = clp->internal;
2315  int optno = cli->current_option;
2316  int pos = 0;
2317  if (optno < 0)
2318  pos += copy_string(buf, len, pos, "(no current option!)");
2319  else if (cli->current_short) {
2320  pos += copy_string(buf, len, pos, cli->option_chars);
2321  if (cli->utf8)
2322  pos = (encode_utf8(buf + pos, len - pos - 1, cli->opt[optno].short_name) - buf);
2323  else if (pos < len - 1)
2324  buf[pos++] = cli->opt[optno].short_name;
2325  } else if (cli->negated_by_no) {
2326  pos += copy_string(buf, len, pos, cli->option_chars);
2327  pos += copy_string(buf, len, pos, "no-");
2328  pos += copy_string(buf, len, pos, cli->opt[optno].long_name + cli->iopt[optno].ilongoff);
2329  } else {
2330  pos += copy_string(buf, len, pos, cli->option_chars);
2331  pos += copy_string(buf, len, pos, cli->opt[optno].long_name + cli->iopt[optno].ilongoff);
2332  }
2333  if (pos < len)
2334  buf[pos] = 0;
2335  return pos;
2336 }
2337 
2338 /** @param clp the parser
2339  * @return string describing the current option
2340  *
2341  * This function acts like Clp_CurOptionNameBuf(), but returns a pointer into
2342  * a static buffer that will be rewritten on the next call to
2343  * Clp_CurOptionName().
2344  *
2345  * @note This function is not thread safe.
2346  *
2347  * @sa Clp_CurOptionName
2348  */
2349 const char *
2351 {
2352  static char buf[256];
2353  Clp_CurOptionNameBuf(clp, buf, 256);
2354  return buf;
2355 }
2356 
2357 #ifdef __cplusplus
2358 }
2359 #endif
double __cdecl strtod(char const *_String, char **_EndPtr)
long __cdecl strtol(char const *_String, char **_EndPtr, int _Radix)
unsigned long __cdecl strtoul(char const *_String, char **_EndPtr, int _Radix)
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
cp
Definition: action.c:1035
#define buflen
Definition: afm2pl.c:181
#define message
Definition: aptex-macros.h:418
#define state
Definition: aptex-macros.h:996
#define type(a)
Definition: aptex-macros.h:171
#define name
#define text(a)
Definition: aptex-macros.h:925
static double percent(cairo_time_t a, cairo_time_t b)
#define n
Definition: t4ht.c:1290
static U_NAMESPACE_USE UnicodeString ** strs
Definition: dbgutil.cpp:25
#define free(a)
Definition: decNumber.cpp:310
#define strrchr
Definition: detex.c:67
int strcmp()
Definition: coll.cpp:143
#define error(a)
Definition: dviinfo.c:48
static void
Definition: fpif.c:118
Integer_T bad
#define s
Definition: afcover.h:80
#define c(n)
Definition: gpos-common.c:150
#define d(n)
Definition: gpos-common.c:151
#define strchr
Definition: gsftopk.c:59
#define memmove(d, s, n)
Definition: gsftopk.c:65
#define memcpy(d, s, n)
Definition: gsftopk.c:64
assert(pcxLoadImage24((char *)((void *) 0), fp, pinfo, hdr))
small capitals from c petite p scientific i
Definition: afcover.h:80
FT_UInt idx
Definition: cffcmap.c:135
char * getenv()
#define buf
char * strstr()
#define fputs
Definition: mendex.h:67
#define malloc
Definition: alloca.c:91
int strncmp()
#define sprintf
Definition: snprintf.c:44
int Clp_SetOptions(Clp_Parser *clp, int nopt, const Clp_Option *opt)
Set clp's option definitions.
Definition: clp.c:784
void Clp_SetArguments(Clp_Parser *clp, int argc, const char *const *argv)
Set clp's arguments.
Definition: clp.c:870
int Clp_OptionChar(Clp_Parser *clp, int c)
Return clp's treatment of character c.
Definition: clp.c:651
Clp_Parser * Clp_NewParser(int argc, const char *const *argv, int nopt, const Clp_Option *opt)
Create a new Clp_Parser.
Definition: clp.c:502
Clp_ParserState * Clp_NewParserState(void)
Create a new Clp_ParserState.
Definition: clp.c:1460
Clp_ErrorHandler Clp_SetErrorHandler(Clp_Parser *clp, void(*errh)(Clp_Parser *, const char *))
Definition: clp.c:613
void Clp_RestoreParser(Clp_Parser *clp, const Clp_ParserState *state)
Restore parser state from state into clp.
Definition: clp.c:1527
int Clp_SetOptionProcessing(Clp_Parser *clp, int on)
Set whether clp is searching for options.
Definition: clp.c:893
struct Clp_Internal Clp_Internal
int Clp_SetOptionChar(Clp_Parser *clp, int c, int type)
Set clp's treatment of character c.
Definition: clp.c:709
int Clp_OptionError(Clp_Parser *clp, const char *format,...)
Report a parser error.
Definition: clp.c:2279
int Clp_AddStringListTypeVec(Clp_Parser *clp, int val_type, int flags, int nstrs, const char *const *strs, const int *vals)
Define a new string list value type for clp.
Definition: clp.c:1386
struct Clp_BuildString Clp_BuildString
int Clp_CurOptionNameBuf(Clp_Parser *clp, char *buf, int len)
Extract the current option as a string.
Definition: clp.c:2440
void Clp_SaveParser(const Clp_Parser *clp, Clp_ParserState *state)
Save clp's current state in state.
Definition: clp.c:1494
struct Clp_StringList Clp_StringList
int Clp_AddStringListType(Clp_Parser *clp, int val_type, int flags,...)
Define a new string list value type for clp.
Definition: clp.c:1297
const char * Clp_CurOptionName(Clp_Parser *clp)
Extract the current option as a string.
Definition: clp.c:2478
int Clp_AddType(Clp_Parser *clp, int val_type, int flags, Clp_ValParseFunc parser, void *user_data)
Define a new value type for clp.
Definition: clp.c:1042
int Clp_Next(Clp_Parser *clp)
Parse and return the next argument from clp.
Definition: clp.c:1850
const char * Clp_Shift(Clp_Parser *clp, int allow_options)
Return the next argument from clp without option parsing.
Definition: clp.c:1998
void Clp_DeleteParserState(Clp_ParserState *state)
Destroy a Clp_ParserState object.
Definition: clp.c:1484
void Clp_DeleteParser(Clp_Parser *clp)
Destroy a Clp_Parser object.
Definition: clp.c:578
const char * Clp_SetProgramName(Clp_Parser *clp, const char *name)
Set clp's program name.
Definition: clp.c:1432
int Clp_SetUTF8(Clp_Parser *clp, int utf8)
Set clp's UTF-8 mode.
Definition: clp.c:634
const char * Clp_ProgramName(Clp_Parser *clp)
Return clp's program name.
Definition: clp.c:1420
#define Clp_ValBool
Option value is a boolean.
Definition: clp.h:69
#define Clp_ValUnsigned
Option value is an unsigned int.
Definition: clp.h:91
#define Clp_ShortNegated
Option character begins a set of negated short options.
Definition: clp.h:178
#define Clp_Negate
Option flag: option may be negated.
Definition: clp.h:139
#define Clp_Error
Clp_Next value: internal CLP error.
Definition: clp.h:200
#define Clp_Mandatory
Option flag: value is mandatory.
Definition: clp.h:125
#define Clp_BadOption
Clp_Next value: argument was an erroneous option.
Definition: clp.h:197
#define Clp_NotOption
Clp_Next value: argument was not an option.
Definition: clp.h:191
void(* Clp_ErrorHandler)(Clp_Parser *clp, const char *message)
A function for reporting option errors.
Definition: clp.h:226
#define Clp_AllowNumbers
String list flag: allow explicit numbers.
Definition: clp.h:327
#define Clp_PreferredMatch
Option flag: prefer this option when matching.
Definition: clp.h:157
#define Clp_ValString
Option value is an arbitrary string.
Definition: clp.h:59
#define Clp_ValStringNotOption
Option value is a non-option string.
Definition: clp.h:62
#define Clp_ValDouble
Option value is a double. Accepts a real number as defined by strtod().
Definition: clp.h:110
#define Clp_DisallowOptions
Value type flag: value can't be an option string.
Definition: clp.h:314
#define Clp_Optional
Option flag: value is optional.
Definition: clp.h:136
#define Clp_Long
Option character begins a long option.
Definition: clp.h:175
#define Clp_LongNegated
Option character begins a negated long option.
Definition: clp.h:181
#define Clp_LongImplicit
Option character can begin a long option, and is part of that long option.
Definition: clp.h:184
#define Clp_OnlyNegated
Option flag: option must be negated.
Definition: clp.h:146
int(* Clp_ValParseFunc)(Clp_Parser *clp, const char *vstr, int complain, void *user_data)
A value parsing function.
Definition: clp.h:219
#define Clp_Done
Clp_Next value: there are no more arguments.
Definition: clp.h:194
#define Clp_Short
Option character begins a set of short options.
Definition: clp.h:172
#define Clp_ValInt
Option value is a signed int.
Definition: clp.h:78
const int * pos
Definition: combiners.h:905
static luaL_Reg func[]
Definition: except.c:32
#define realloc
Definition: glob.c:206
utf< uint8 > utf8
Definition: UtfCodec.h:249
constexpr std::size_t ambiguous
Definition: variant.hpp:974
def ref(x)
Definition: pdf-org.py:104
union value value
Definition: obx.h:44
static int format
Definition: pbmclean.c:15
#define max(a, b)
Definition: pbmto4425.c:11
static int items
Definition: pgmtofs.c:86
integer ishort
Definition: pmxab.c:657
int r
Definition: ppmqvga.c:68
#define flags
val_type
Definition: splinefont.h:110
#define tolower(ch)
Definition: utype.h:137
#define isspace(ch)
Definition: utype.h:87
static int clp_utf8_charlen(const Clp_Internal *cli, const char *s)
Definition: clp.c:343
static const Clp_Option clp_option_sentinel[]
Definition: clp.c:236
#define Clp_InitialValType
Definition: clp.c:134
static void append_build_string(Clp_BuildString *bs, const char *s, int l)
Definition: clp.c:2029
static int parse_double(Clp_Parser *, const char *, int, void *)
Definition: clp.c:1108
static int utf8_charlen(const char *s)
Definition: clp.c:335
static char * encode_utf8(char *s, int n, int c)
Definition: clp.c:262
#define Clp_OclassSize
Definition: clp.c:166
static int finish_string_list(Clp_Parser *clp, int val_type, int flags, Clp_Option *items, int nitems, int itemscap)
Definition: clp.c:1197
#define U_REPLACEMENT
Definition: clp.c:259
#define MAX_AMBIGUOUS_VALUES
Definition: clp.c:135
static void set_option_text(Clp_Internal *cli, const char *text, int n_option_chars)
Definition: clp.c:1511
static Clp_BuildString * Clp_VaOptionError(Clp_Parser *clp, Clp_BuildString *bs, const char *fmt, va_list val)
Definition: clp.c:2041
static void calculate_lmm(Clp_Parser *clp, const Clp_Option *opt, Clp_InternOption *iopt, int nopt)
Definition: clp.c:442
static int grow_build_string(Clp_BuildString *bs, int want)
Definition: clp.c:2005
static int find_long(Clp_Parser *clp, const char *arg)
Definition: clp.c:1682
static int find_prefix_opt(Clp_Parser *clp, const char *arg, int nopt, const Clp_Option *opt, const Clp_InternOption *iopt, int *ambiguous, int *ambiguous_values)
Definition: clp.c:930
static int long_as_short(const Clp_Internal *cli, const Clp_Option *o, Clp_InternOption *io, int failure)
Definition: clp.c:369
static int val_type_binsearch(Clp_Internal *cli, int val_type)
Definition: clp.c:978
static int parse_int(Clp_Parser *, const char *, int, void *)
Definition: clp.c:1078
static int get_oclass(Clp_Parser *clp, const char *text, int *ocharskip)
Definition: clp.c:1520
static int ambiguity_error(Clp_Parser *, int, int *, const Clp_Option *, const Clp_InternOption *, const char *, const char *,...)
Definition: clp.c:2242
static int parse_string(Clp_Parser *, const char *, int, void *)
Definition: clp.c:1070
static void free_build_string(Clp_BuildString *bs)
Definition: clp.c:1998
#define Clp_DoubledLong
Definition: clp.c:132
static int copy_string(char *buf, int buflen, int bufpos, const char *what)
Definition: clp.c:2290
static Clp_BuildString * new_build_string(void)
Definition: clp.c:1981
static int parse_string_list(Clp_Parser *, const char *, int, void *)
Definition: clp.c:1161
static void switch_to_short_argument(Clp_Parser *clp)
Definition: clp.c:1669
static int decode_utf8(const char *s, const char **cp)
Definition: clp.c:286
#define Clp_OptionCharsSize
Definition: clp.c:160
static int next_argument(Clp_Parser *clp, int want_argument)
Definition: clp.c:1535
static int parse_bool(Clp_Parser *, const char *, int, void *)
Definition: clp.c:1125
static int argcmp(const char *ref, const char *arg, int min_match, int fewer_dashes)
Definition: clp.c:892
#define ENSURE_BUILD_STRING(bs, space)
Definition: clp.c:2024
static void compare_options(Clp_Parser *clp, const Clp_Option *o1, Clp_InternOption *io1, const Clp_Option *o2, Clp_InternOption *io2)
Definition: clp.c:385
static int find_short(Clp_Parser *clp, const char *text)
Definition: clp.c:1744
static void do_error(Clp_Parser *clp, Clp_BuildString *bs)
Definition: clp.c:2169
static int min_different_chars(const char *s, const char *t)
Definition: clp.c:354
static ErrorHandler * errh
Definition: main.cc:71
size_t bufpos(caryll_Buffer *buf)
Definition: buffer.c:18
static void complain(struct file *file)
Definition: remake.c:362
char * pos
Definition: clp.c:2017
int capacity
Definition: clp.c:1976
char * text
Definition: clp.c:1974
unsigned lmmpos_short
Definition: clp.c:165
unsigned lmmneg_short
Definition: clp.c:166
unsigned ilong
Definition: clp.c:158
unsigned ineg
Definition: clp.c:163
unsigned imandatory
Definition: clp.c:160
unsigned ioptional
Definition: clp.c:161
unsigned iprefmatch
Definition: clp.c:164
unsigned char ilongoff
Definition: clp.c:167
int lmmpos
Definition: clp.c:168
unsigned ishort
Definition: clp.c:159
unsigned ipos
Definition: clp.c:162
int lmmneg
Definition: clp.c:169
int long1neg
Definition: clp.c:196
Clp_ValType * valtype
Definition: clp.c:187
unsigned char negated_by_no
Definition: clp.c:212
Clp_InternOption * iopt
Definition: clp.c:183
const Clp_Option * opt
Definition: clp.c:182
int long1pos
Definition: clp.c:195
unsigned char whole_negated
Definition: clp.c:209
unsigned char current_short
Definition: clp.c:211
char option_chars[5]
Definition: clp.c:199
int noclass
Definition: clp.c:194
int utf8
Definition: clp.c:197
unsigned opt_generation
Definition: clp.c:185
unsigned char could_be_short
Definition: clp.c:210
int current_option
Definition: clp.c:206
const char *const * argv
Definition: clp.c:190
void(* error_handler)(Clp_Parser *, const char *)
Definition: clp.c:203
int nopt
Definition: clp.c:184
int nvaltype
Definition: clp.c:188
int ambiguous
Definition: clp.c:214
const char * program_name
Definition: clp.c:202
int option_processing
Definition: clp.c:205
Clp_Oclass oclass[10]
Definition: clp.c:193
unsigned char is_short
Definition: clp.c:208
const char * xtext
Definition: clp.c:200
int argc
Definition: clp.c:191
int ambiguous_values[4]
Definition: clp.c:215
int type
Definition: clp.c:177
int c
Definition: clp.c:176
Option description.
Definition: clp.h:41
int val_type
Definition: clp.h:48
const char * long_name
Definition: clp.h:42
int flags
Definition: clp.h:50
int option_id
Definition: clp.h:46
int short_name
Definition: clp.h:44
int current_option
Definition: clp.c:229
int argc
Definition: clp.c:221
const char * xtext
Definition: clp.c:224
int option_processing
Definition: clp.c:226
unsigned char current_short
Definition: clp.c:232
const char *const * argv
Definition: clp.c:220
unsigned char whole_negated
Definition: clp.c:231
unsigned char negated_by_no
Definition: clp.c:233
unsigned opt_generation
Definition: clp.c:228
char option_chars[5]
Definition: clp.c:223
unsigned char is_short
Definition: clp.c:230
Command line parser.
Definition: clp.h:234
const Clp_Option * option
Definition: clp.h:235
union Clp_Parser::@427 val
int have_val
Definition: clp.h:239
struct Clp_Internal * internal
Definition: clp.h:265
double d
Definition: clp.h:248
int negated
Definition: clp.h:237
int i
Definition: clp.h:244
unsigned u
Definition: clp.h:245
const char * vstr
Definition: clp.h:240
const char * s
Definition: clp.h:249
void * user_data
Definition: clp.h:262
int nitems
Definition: clp.c:240
int allow_int
Definition: clp.c:230
int nitems_invalid_report
Definition: clp.c:244
Clp_InternOption * iopt
Definition: clp.c:239
Clp_Option * items
Definition: clp.c:238
unsigned char allow_int
Definition: clp.c:242
int flags
Definition: clp.c:153
void * user_data
Definition: clp.c:154
int val_type
Definition: clp.c:151
Clp_ValParseFunc func
Definition: clp.c:152
Definition: psread.c:42
Definition: ffi.h:208
Definition: dvips.h:235
Definition: strexpr.c:21
int j
Definition: t4ht.c:1589
*job_name strlen((char *) job_name) - 4)
char fmt[256]
Definition: tex4ht.c:3925
val
Definition: tex4ht.c:3227
m
Definition: tex4ht.c:3990
int _cdecl compare(const void *a1, const void *a2)
Definition: misc.c:34
Definition: sd.h:149
Definition: obx.h:51
#define va_start(pvar)
Definition: varargs.h:30
#define va_arg(pvar, type)
Definition: varargs.h:35
#define va_end(pvar)
Definition: varargs.h:38
char * va_list
Definition: varargs.h:22
#define argv
Definition: xmain.c:270
#define argc
Definition: xmain.c:269