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)  

Form.cc
Go to the documentation of this file.
1 //========================================================================
2 //
3 // Form.cc
4 //
5 // This file is licensed under the GPLv2 or later
6 //
7 // Copyright 2006-2008 Julien Rebetez <julienr@svn.gnome.org>
8 // Copyright 2007-2012, 2015-2021 Albert Astals Cid <aacid@kde.org>
9 // Copyright 2007-2008, 2011 Carlos Garcia Campos <carlosgc@gnome.org>
10 // Copyright 2007, 2013, 2016, 2019 Adrian Johnson <ajohnson@redneon.com>
11 // Copyright 2007 Iñigo Martínez <inigomartinez@gmail.com>
12 // Copyright 2008, 2011 Pino Toscano <pino@kde.org>
13 // Copyright 2008 Michael Vrable <mvrable@cs.ucsd.edu>
14 // Copyright 2009 Matthias Drochner <M.Drochner@fz-juelich.de>
15 // Copyright 2009 KDAB via Guillermo Amaral <gamaral@amaral.com.mx>
16 // Copyright 2010, 2012 Mark Riedesel <mark@klowner.com>
17 // Copyright 2012 Fabio D'Urso <fabiodurso@hotmail.it>
18 // Copyright 2015 André Guerreiro <aguerreiro1985@gmail.com>
19 // Copyright 2015 André Esser <bepandre@hotmail.com>
20 // Copyright 2017 Hans-Ulrich Jüttner <huj@froreich-bioscientia.de>
21 // Copyright 2017 Bernd Kuhls <berndkuhls@hotmail.com>
22 // Copyright 2018 Andre Heinecke <aheinecke@intevation.de>
23 // Copyright 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
24 // Copyright 2018 Chinmoy Ranjan Pradhan <chinmoyrp65@protonmail.com>
25 // Copyright 2018 Adam Reichold <adam.reichold@t-online.de>
26 // Copyright 2018-2020 Nelson Benítez León <nbenitezl@gmail.com>
27 // Copyright 2019, 2020 Oliver Sander <oliver.sander@tu-dresden.de>
28 // Copyright 2019 Tomoyuki Kubota <himajin100000@gmail.com>
29 // Copyright 2019 João Netto <joaonetto901@gmail.com>
30 // Copyright 2020 Marek Kasik <mkasik@redhat.com>
31 // Copyright 2020 Thorsten Behrens <Thorsten.Behrens@CIB.de>
32 // Copyright 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by Technische Universität Dresden
33 //
34 //========================================================================
35 
36 #include <config.h>
37 
38 #include <set>
39 #include <limits>
40 #include <cstddef>
41 #include <cstdlib>
42 #include <cstring>
43 #include <cctype>
44 #include "goo/gmem.h"
45 #include "goo/gfile.h"
46 #include "goo/GooString.h"
47 #include "Error.h"
48 #include "ErrorCodes.h"
49 #include "Object.h"
50 #include "Array.h"
51 #include "Dict.h"
52 #include "Gfx.h"
53 #include "Form.h"
54 #include "PDFDoc.h"
55 #include "DateInfo.h"
56 #ifdef ENABLE_NSS3
57 # include "SignatureHandler.h"
58 #endif
59 #include "SignatureInfo.h"
60 #include "CertificateInfo.h"
61 #include "XRef.h"
62 #include "PDFDocEncoding.h"
63 #include "Annot.h"
64 #include "Link.h"
65 #include "Lexer.h"
66 #include "Parser.h"
67 
68 // return a newly allocated char* containing an UTF16BE string of size length
69 char *pdfDocEncodingToUTF16(const std::string &orig, int *length)
70 {
71  // double size, a unicode char takes 2 char, add 2 for the unicode marker
72  *length = 2 + 2 * orig.size();
73  char *result = new char[(*length)];
74  const char *cstring = orig.c_str();
75  // unicode marker
76  result[0] = '\xfe';
77  result[1] = '\xff';
78  // convert to utf16
79  for (int i = 2, j = 0; i < (*length); i += 2, j++) {
80  Unicode u = pdfDocEncoding[(unsigned int)((unsigned char)cstring[j])] & 0xffff;
81  result[i] = (u >> 8) & 0xff;
82  result[i + 1] = u & 0xff;
83  }
84  return result;
85 }
86 
87 static GooString *convertToUtf16(GooString *pdfDocEncodingString)
88 {
89  int tmp_length;
90  char *tmp_str = pdfDocEncodingToUTF16(pdfDocEncodingString->toStr(), &tmp_length);
91  delete pdfDocEncodingString;
92  pdfDocEncodingString = new GooString(tmp_str, tmp_length);
93  delete[] tmp_str;
94  return pdfDocEncodingString;
95 }
96 
97 FormWidget::FormWidget(PDFDoc *docA, Object *aobj, unsigned num, Ref aref, FormField *fieldA)
98 {
99  ref = aref;
100  ID = 0;
101  childNum = num;
102  doc = docA;
103  xref = doc->getXRef();
104  obj = aobj->copy();
105  type = formUndef;
106  field = fieldA;
107  widget = nullptr;
108 }
109 
111 {
112  if (widget)
113  widget->decRefCnt();
114 }
115 
117 {
118  printf("%*s+ (%d %d): [widget]\n", indent, "", ref.num, ref.gen);
119 }
120 
122 {
123  if (widget)
124  return;
125 
126  Object obj1(ref);
127  widget = new AnnotWidget(doc, &obj, &obj1, field);
128 }
129 
130 bool FormWidget::inRect(double x, double y) const
131 {
132  return widget ? widget->inRect(x, y) : false;
133 }
134 
135 void FormWidget::getRect(double *x1, double *y1, double *x2, double *y2) const
136 {
137  if (widget)
138  widget->getRect(x1, y1, x2, y2);
139 }
140 
142 {
143  return field->isReadOnly();
144 }
145 
147 {
149 }
150 
151 int FormWidget::encodeID(unsigned pageNum, unsigned fieldNum)
152 {
153  return (pageNum << 4 * sizeof(unsigned)) + fieldNum;
154 }
155 
156 void FormWidget::decodeID(unsigned id, unsigned *pageNum, unsigned *fieldNum)
157 {
158  *pageNum = id >> 4 * sizeof(unsigned);
159  *fieldNum = (id << 4 * sizeof(unsigned)) >> 4 * sizeof(unsigned);
160 }
161 
163 {
164  return field->getPartialName();
165 }
166 
168 {
170 }
171 
173 {
174  return field->getAlternateUiName();
175 }
176 
178 {
179  return field->getMappingName();
180 }
181 
183 {
184  return field->getFullyQualifiedName();
185 }
186 
188 {
189  return widget ? widget->getAction() : nullptr;
190 }
191 
193 {
194  return widget ? widget->getFormAdditionalAction(t) : nullptr;
195 }
196 
198 {
199  if (!widget)
200  return false;
201 
202  return widget->setFormAdditionalAction(t, js);
203 }
204 
205 FormWidgetButton::FormWidgetButton(PDFDoc *docA, Object *dictObj, unsigned num, Ref refA, FormField *p) : FormWidget(docA, dictObj, num, refA, p)
206 {
207  type = formButton;
208  onStr = nullptr;
209 
210  // Find the name of the ON state in the AP dictionary
211  // The reference say the Off state, if it exists, _must_ be stored in the AP dict under the name /Off
212  // The "on" state may be stored under any other name
213  Object obj1 = obj.dictLookup("AP");
214  if (obj1.isDict()) {
215  Object obj2 = obj1.dictLookup("N");
216  if (obj2.isDict()) {
217  for (int i = 0; i < obj2.dictGetLength(); i++) {
218  const char *key = obj2.dictGetKey(i);
219  if (strcmp(key, "Off") != 0) {
220  onStr = new GooString(key);
221  break;
222  }
223  }
224  }
225  }
226 }
227 
228 const char *FormWidgetButton::getOnStr() const
229 {
230  if (onStr)
231  return onStr->c_str();
232 
233  // 12.7.4.2.3 Check Boxes
234  // Yes should be used as the name for the on state
235  return parent()->getButtonType() == formButtonCheck ? "Yes" : nullptr;
236 }
237 
239 {
240  delete onStr;
241 }
242 
244 {
245  return parent()->getButtonType();
246 }
247 
249 {
250  if (!widget)
251  return;
253 }
254 
256 {
257  // The appearance stream must NOT be regenerated for this widget type
258 }
259 
260 void FormWidgetButton::setState(bool astate)
261 {
262  // pushButtons don't have state
263  if (parent()->getButtonType() == formButtonPush)
264  return;
265 
266  // Silently return if can't set ON state
267  if (astate && !getOnStr())
268  return;
269 
270  parent()->setState(astate ? getOnStr() : (char *)"Off");
271  // Parent will call setAppearanceState()
272 }
273 
275 {
276  return getOnStr() ? parent()->getState(getOnStr()) : false;
277 }
278 
280 {
281  return static_cast<FormFieldButton *>(field);
282 }
283 
284 FormWidgetText::FormWidgetText(PDFDoc *docA, Object *dictObj, unsigned num, Ref refA, FormField *p) : FormWidget(docA, dictObj, num, refA, p)
285 {
286  type = formText;
287 }
288 
290 {
291  return parent()->getContent();
292 }
293 
295 {
296  if (widget)
298 }
299 
301 {
302  return parent()->isMultiline();
303 }
304 
306 {
307  return parent()->isPassword();
308 }
309 
311 {
312  return parent()->isFileSelect();
313 }
314 
316 {
317  return parent()->noSpellCheck();
318 }
319 
321 {
322  return parent()->noScroll();
323 }
324 
326 {
327  return parent()->isComb();
328 }
329 
331 {
332  return parent()->isRichText();
333 }
334 
336 {
337  return parent()->getMaxLen();
338 }
339 
341 {
342  return parent()->getTextFontSize();
343 }
344 
346 {
348 }
349 
350 void FormWidgetText::setContent(const GooString *new_content)
351 {
352  parent()->setContentCopy(new_content);
353 }
354 
356 {
357  parent()->setAppearanceContentCopy(new_content);
358 }
359 
361 {
362  return static_cast<FormFieldText *>(field);
363 }
364 
365 FormWidgetChoice::FormWidgetChoice(PDFDoc *docA, Object *dictObj, unsigned num, Ref refA, FormField *p) : FormWidget(docA, dictObj, num, refA, p)
366 {
367  type = formChoice;
368 }
369 
371 
373 {
374  if (i < 0 || i >= parent()->getNumChoices()) {
375  error(errInternal, -1, "FormWidgetChoice::_checkRange i out of range : {0:d}", i);
376  return false;
377  }
378  return true;
379 }
380 
382 {
383  if (!_checkRange(i))
384  return;
385  parent()->select(i);
386 }
387 
389 {
390  if (!_checkRange(i))
391  return;
392  parent()->toggle(i);
393 }
394 
396 {
397  parent()->deselectAll();
398 }
399 
401 {
402  if (!hasEdit()) {
403  error(errInternal, -1, "FormFieldChoice::getEditChoice called on a non-editable choice\n");
404  return nullptr;
405  }
406  return parent()->getEditChoice();
407 }
408 
410 {
411  if (widget)
413 }
414 
416 {
417  if (!_checkRange(i))
418  return false;
419  return parent()->isSelected(i);
420 }
421 
423 {
424  if (!hasEdit()) {
425  error(errInternal, -1, "FormFieldChoice::setEditChoice : trying to edit an non-editable choice\n");
426  return;
427  }
428 
429  parent()->setEditChoice(new_content);
430 }
431 
433 {
434  return parent()->getNumChoices();
435 }
436 
438 {
439  return parent()->getChoice(i);
440 }
441 
443 {
444  return parent()->getExportVal(i);
445 }
446 
448 {
449  return parent()->isCombo();
450 }
451 
453 {
454  return parent()->hasEdit();
455 }
456 
458 {
459  return parent()->isMultiSelect();
460 }
461 
463 {
464  return parent()->noSpellCheck();
465 }
466 
468 {
469  return parent()->commitOnSelChange();
470 }
471 
473 {
474  return parent()->isListBox();
475 }
476 
478 {
479  return static_cast<FormFieldChoice *>(field);
480 }
481 
482 FormWidgetSignature::FormWidgetSignature(PDFDoc *docA, Object *dictObj, unsigned num, Ref refA, FormField *p) : FormWidget(docA, dictObj, num, refA, p)
483 {
485 }
486 
488 {
489  return static_cast<FormFieldSignature *>(field)->getSignature();
490 }
491 
492 SignatureInfo *FormWidgetSignature::validateSignature(bool doVerifyCert, bool forceRevalidation, time_t validationTime)
493 {
494  return static_cast<FormFieldSignature *>(field)->validateSignature(doVerifyCert, forceRevalidation, validationTime);
495 }
496 
497 #ifdef ENABLE_NSS3
498 // update hash with the specified range of data from the file
499 static bool hashFileRange(FILE *f, SignatureHandler *handler, Goffset start, Goffset end)
500 {
501  const int BUF_SIZE = 65536;
502 
503  unsigned char *buf = new unsigned char[BUF_SIZE];
504 
505  while (start < end) {
506  if (Gfseek(f, start, SEEK_SET) != 0) {
507  delete[] buf;
508  return false;
509  }
510  int len = BUF_SIZE;
511  if (end - start < len)
512  len = end - start;
513  if (fread(buf, 1, len, f) != static_cast<size_t>(len)) {
514  delete[] buf;
515  return false;
516  }
517  handler->updateHash(buf, len);
518  start += len;
519  }
520  delete[] buf;
521  return true;
522 }
523 #endif
524 
525 bool FormWidgetSignature::signDocument(const char *saveFilename, const char *certNickname, const char *digestName, const char *password, const char *reason)
526 {
527 #ifdef ENABLE_NSS3
528  if (!certNickname) {
529  fprintf(stderr, "signDocument: Empty nickname\n");
530  return false;
531  }
532 
533  // calculate a signature over tmp_buffer with the certificate to get its size
534  unsigned char tmp_buffer[4];
535  memcpy(tmp_buffer, "PDF", 4);
536  SignatureHandler sigHandler(certNickname, SEC_OID_SHA256);
537  sigHandler.updateHash(tmp_buffer, 4);
538  const std::unique_ptr<GooString> tmpSignature = sigHandler.signDetached(password);
539  if (!tmpSignature)
540  return false;
541 
542  FormFieldSignature *signatureField = static_cast<FormFieldSignature *>(field);
543  std::unique_ptr<X509CertificateInfo> certInfo = sigHandler.getCertificateInfo();
544  const std::string signerName = certInfo->getSubjectInfo().commonName;
545  signatureField->setCertificateInfo(certInfo);
546  updateWidgetAppearance(); // add visible signing info to appearance
547 
548  GooString gReason(reason ? reason : "");
549  Object vObj(new Dict(xref));
550  Ref vref = xref->addIndirectObject(&vObj);
551  if (!createSignature(vObj, vref, GooString(signerName), gReason, tmpSignature.get())) {
552  return false;
553  }
554 
555  // Incremental save to avoid breaking any existing signatures
556  GooString *fname = new GooString(saveFilename);
558  fprintf(stderr, "signDocument: error saving to file \"%s\"\n", saveFilename);
559  delete fname;
560  return false;
561  }
562 
563  // Get start/end offset of signature object in the saved PDF
564  Goffset objStart, objEnd;
565  if (!getObjectStartEnd(fname, vref.num, &objStart, &objEnd)) {
566  fprintf(stderr, "signDocument: unable to get signature object offsets\n");
567  }
568 
569  // Update byte range of signature in the saved PDF
570  Goffset sigStart, sigEnd, fileSize;
571  FILE *file = openFile(saveFilename, "r+b");
572  if (!updateOffsets(file, objStart, objEnd, &sigStart, &sigEnd, &fileSize)) {
573  fprintf(stderr, "signDocument: unable update byte range\n");
574  fclose(file);
575  return false;
576  }
577 
578  // compute hash of byte ranges
579  sigHandler.restartHash();
580  if (!hashFileRange(file, &sigHandler, 0LL, sigStart)) {
581  fclose(file);
582  return false;
583  }
584  if (!hashFileRange(file, &sigHandler, sigEnd, fileSize)) {
585  fclose(file);
586  return false;
587  }
588 
589  // and sign it
590  const std::unique_ptr<GooString> signature = sigHandler.signDetached(password);
591  if (!signature) {
592  fclose(file);
593  return false;
594  }
595 
596  // write signature to saved file
597  if (!updateSignature(file, sigStart, sigEnd, signature.get())) {
598  fprintf(stderr, "signDocument: unable update signature\n");
599  fclose(file);
600  return false;
601  }
602  signatureField->setSignature(*signature);
603 
604  fclose(file);
605 
606  return true;
607 #else
608  return false;
609 #endif
610 }
611 
612 // Get start and end file position of objNum in the PDF named filename.
614 {
615  PDFDoc newDoc(filename);
616  if (!newDoc.isOk())
617  return false;
618 
619  XRef *newXref = newDoc.getXRef();
620  XRefEntry *entry = newXref->getEntry(objNum);
622  return false;
623 
624  *objStart = entry->offset;
625  newXref->fetch(objNum, entry->gen, 0, objEnd);
626  return true;
627 }
628 
629 // find next offset containing the dummy offset '9999999999' and overwrite with offset
630 static char *setNextOffset(char *start, Goffset offset)
631 {
632  char buf[50];
633  sprintf(buf, "%lld", offset);
634  strcat(buf, " "); // add some padding
635 
636  char *p = strstr(start, "9999999999");
637  if (p) {
638  strncpy(p, buf, 10); // overwrite exact size.
639  p += 10;
640  } else {
641  return nullptr;
642  }
643  return p;
644 }
645 
646 // Updates the ByteRange array of the signature object in the file.
647 // Returns start/end of signature string and file size.
649 {
650  if (Gfseek(f, 0, SEEK_END) != 0) {
651  return false;
652  }
653  *fileSize = Gftell(f);
654 
655  if (objEnd > *fileSize)
656  objEnd = *fileSize;
657 
658  // sanity check object offsets
659  if (objEnd <= objStart || (objEnd - objStart >= INT_MAX)) {
660  return false;
661  }
662 
663  const size_t bufSize = static_cast<int>(objEnd - objStart);
664  if (Gfseek(f, objStart, SEEK_SET) != 0) {
665  return false;
666  }
667  std::vector<char> buf(bufSize + 1);
668  if (fread(buf.data(), 1, bufSize, f) != bufSize) {
669  return false;
670  }
671  buf[bufSize] = 0; // prevent string functions from searching past the end
672 
673  // search for the Contents field which contains the signature
674  // which always must start with hex digits 308
675  *sigStart = -1;
676  *sigEnd = -1;
677  for (size_t i = 0; i < bufSize - 14; i++) {
678  if (buf[i] == '/' && strncmp(&buf[i], "/Contents <308", 14) == 0) {
679  *sigStart = objStart + i + 10;
680  char *p = strchr(&buf[i], '>');
681  if (p)
682  *sigEnd = objStart + (p - buf.data()) + 1;
683  break;
684  }
685  }
686 
687  if (*sigStart == -1 || *sigEnd == -1)
688  return false;
689 
690  // Search for ByteRange array and update offsets
691  for (size_t i = 0; i < bufSize - 10; i++) {
692  if (buf[i] == '/' && strncmp(&buf[i], "/ByteRange", 10) == 0) {
693  // update range
694  char *p = setNextOffset(&buf[i], *sigStart);
695  if (!p)
696  return false;
697  p = setNextOffset(p, *sigEnd);
698  if (!p)
699  return false;
700  p = setNextOffset(p, *fileSize - *sigEnd);
701  if (!p)
702  return false;
703  break;
704  }
705  }
706 
707  // write buffer back to disk
708  if (Gfseek(f, objStart, SEEK_SET) != 0) {
709  return false;
710  }
711  fwrite(buf.data(), bufSize, 1, f);
712  return true;
713 }
714 
715 // Overwrite signature string in the file with new signature
716 bool FormWidgetSignature::updateSignature(FILE *f, Goffset sigStart, Goffset sigEnd, const GooString *signature)
717 {
718  if (signature->getLength() * 2 + 2 != sigEnd - sigStart)
719  return false;
720 
721  if (Gfseek(f, sigStart, SEEK_SET) != 0) {
722  return false;
723  }
724  const char *c = signature->c_str();
725  fprintf(f, "<");
726  for (int i = 0; i < signature->getLength(); i++) {
727  unsigned char value = *(c + i) & 0x000000ff;
728  fprintf(f, "%2.2x", value);
729  }
730  fprintf(f, "> ");
731  return true;
732 }
733 
734 bool FormWidgetSignature::createSignature(Object &vObj, Ref vRef, const GooString &name, const GooString &reason, const GooString *signature)
735 {
736  vObj.dictAdd("Type", Object(objName, "Sig"));
737  vObj.dictAdd("Filter", Object(objName, "Adobe.PPKLite"));
738  vObj.dictAdd("SubFilter", Object(objName, "adbe.pkcs7.detached"));
739  vObj.dictAdd("Name", Object(name.copy()));
740  GooString *date = timeToDateString(nullptr);
741  vObj.dictAdd("M", Object(date));
742  if (reason.getLength() > 0)
743  vObj.dictAdd("Reason", Object(reason.copy()));
744  vObj.dictAdd("Contents", Object(objHexString, signature->copy()));
745  Object bObj(new Array(xref));
746  // reserve space in byte range for maximum number of bytes
747  bObj.arrayAdd(Object(static_cast<long long>(0LL)));
748  bObj.arrayAdd(Object(static_cast<long long>(9999999999LL)));
749  bObj.arrayAdd(Object(static_cast<long long>(9999999999LL)));
750  bObj.arrayAdd(Object(static_cast<long long>(9999999999LL)));
751  vObj.dictAdd("ByteRange", bObj.copy());
752  obj.dictSet("V", Object(vRef));
754  return true;
755 }
756 
757 std::vector<Goffset> FormWidgetSignature::getSignedRangeBounds() const
758 {
759  return static_cast<FormFieldSignature *>(field)->getSignedRangeBounds();
760 }
761 
763 {
764  return static_cast<FormFieldSignature *>(field)->getCheckedSignature(checkedFileSize);
765 }
766 
768 {
769  if (widget)
771 }
772 
773 //========================================================================
774 // FormField
775 //========================================================================
776 
777 FormField::FormField(PDFDoc *docA, Object &&aobj, const Ref aref, FormField *parentA, std::set<int> *usedParents, FormFieldType ty)
778 {
779  doc = docA;
780  xref = doc->getXRef();
781  obj = std::move(aobj);
782  Dict *dict = obj.getDict();
783  ref = aref;
784  type = ty;
785  parent = parentA;
786  numChildren = 0;
787  children = nullptr;
788  terminal = false;
789  widgets = nullptr;
790  readOnly = false;
791  defaultAppearance = nullptr;
792  fullyQualifiedName = nullptr;
794  hasQuadding = false;
795  standAlone = false;
796 
797  // childs
798  Object obj1 = dict->lookup("Kids");
799  if (obj1.isArray()) {
800  // Load children
801  for (int i = 0; i < obj1.arrayGetLength(); i++) {
802  Ref childRef;
803  Object childObj = obj1.getArray()->get(i, &childRef);
804  if (childRef == Ref::INVALID()) {
805  error(errSyntaxError, -1, "Invalid form field renference");
806  continue;
807  }
808  if (!childObj.isDict()) {
809  error(errSyntaxError, -1, "Form field child is not a dictionary");
810  continue;
811  }
812 
813  if (usedParents->find(childRef.num) == usedParents->end()) {
814  // Field child: it could be a form field or a widget or composed dict
815  const Object &objParent = childObj.dictLookupNF("Parent");
816  Object obj3 = childObj.dictLookup("Parent");
817  if (objParent.isRef() || obj3.isDict()) {
818  // Child is a form field or composed dict
819  // We create the field, if it's composed
820  // it will create the widget as a child
821  std::set<int> usedParentsAux = *usedParents;
822  usedParentsAux.insert(childRef.num);
823 
824  if (terminal) {
825  error(errSyntaxWarning, -1, "Field can't have both Widget AND Field as kids\n");
826  continue;
827  }
828 
829  numChildren++;
831  children[numChildren - 1] = Form::createFieldFromDict(std::move(childObj), doc, childRef, this, &usedParentsAux);
832  } else {
833  Object obj2 = childObj.dictLookup("Subtype");
834  if (obj2.isName("Widget")) {
835  // Child is a widget annotation
836  if (!terminal && numChildren > 0) {
837  error(errSyntaxWarning, -1, "Field can't have both Widget AND Field as kids\n");
838  continue;
839  }
840  _createWidget(&childObj, childRef);
841  }
842  }
843  }
844  }
845  } else {
846  // No children, if it's a composed dict, create the child widget
847  obj1 = dict->lookup("Subtype");
848  if (obj1.isName("Widget"))
849  _createWidget(&obj, ref);
850  }
851 
852  // flags
853  obj1 = Form::fieldLookup(dict, "Ff");
854  if (obj1.isInt()) {
855  int flags = obj1.getInt();
856  if (flags & 0x1) { // 1 -> ReadOnly
857  readOnly = true;
858  }
859  if (flags & 0x2) { // 2 -> Required
860  // TODO
861  }
862  if (flags & 0x4) { // 3 -> NoExport
863  // TODO
864  }
865  }
866 
867  // Variable Text
868  obj1 = Form::fieldLookup(dict, "DA");
869  if (obj1.isString())
870  defaultAppearance = obj1.getString()->copy();
871 
872  obj1 = Form::fieldLookup(dict, "Q");
873  if (obj1.isInt()) {
874  const int aux = obj1.getInt();
876  if (likely(hasQuadding)) {
877  quadding = static_cast<VariableTextQuadding>(aux);
878  }
879  }
880 
881  obj1 = dict->lookup("T");
882  if (obj1.isString()) {
883  partialName = obj1.getString()->copy();
884  } else {
885  partialName = nullptr;
886  }
887 
888  obj1 = dict->lookup("TU");
889  if (obj1.isString()) {
890  alternateUiName = obj1.getString()->copy();
891  } else {
892  alternateUiName = nullptr;
893  }
894 
895  obj1 = dict->lookup("TM");
896  if (obj1.isString()) {
897  mappingName = obj1.getString()->copy();
898  } else {
899  mappingName = nullptr;
900  }
901 }
902 
904 {
905  delete partialName;
906  partialName = name.copy();
907 
908  obj.getDict()->set("T", Object(name.copy()));
910 }
911 
913 {
914  if (!terminal) {
915  if (children) {
916  for (int i = 0; i < numChildren; i++)
917  delete children[i];
918  gfree(children);
919  }
920  } else {
921  for (int i = 0; i < numChildren; ++i)
922  delete widgets[i];
923  gfree(widgets);
924  }
925 
926  delete defaultAppearance;
927  delete partialName;
928  delete alternateUiName;
929  delete mappingName;
930  delete fullyQualifiedName;
931 }
932 
934 {
935  printf("%*s- (%d %d): [container] terminal: %s children: %d\n", indent, "", ref.num, ref.gen, terminal ? "Yes" : "No", numChildren);
936 }
937 
939 {
940  print(indent);
941  if (terminal) {
942  for (int i = 0; i < numChildren; i++)
943  widgets[i]->print(indent + 4);
944  } else {
945  for (int i = 0; i < numChildren; i++)
946  children[i]->printTree(indent + 4);
947  }
948 }
949 
951 {
952  if (terminal)
953  return;
954  for (int i = 0; i < numChildren; i++) {
956  }
957 }
958 
960 {
961  if (terminal) {
962  for (int i = 0; i < numChildren; i++)
963  widgets[i]->createWidgetAnnotation();
964  } else {
965  for (int i = 0; i < numChildren; i++)
967  }
968 }
969 
971 {
972  terminal = true;
973  numChildren++;
975  // ID = index in "widgets" table
976  switch (type) {
977  case formButton:
978  widgets[numChildren - 1] = new FormWidgetButton(doc, objA, numChildren - 1, aref, this);
979  break;
980  case formText:
981  widgets[numChildren - 1] = new FormWidgetText(doc, objA, numChildren - 1, aref, this);
982  break;
983  case formChoice:
984  widgets[numChildren - 1] = new FormWidgetChoice(doc, objA, numChildren - 1, aref, this);
985  break;
986  case formSignature:
987  widgets[numChildren - 1] = new FormWidgetSignature(doc, objA, numChildren - 1, aref, this);
988  break;
989  default:
990  error(errSyntaxWarning, -1, "SubType on non-terminal field, invalid document?");
991  numChildren--;
992  }
993 }
994 
996 {
997  if (terminal) {
998  for (int i = 0; i < numChildren; i++) {
999  if (widgets[i]->getRef() == aref)
1000  return widgets[i];
1001  }
1002  } else {
1003  for (int i = 0; i < numChildren; i++) {
1005  if (result)
1006  return result;
1007  }
1008  }
1009  return nullptr;
1010 }
1011 
1013 {
1014  Object obj1;
1015  Object parentObj;
1016  const GooString *parent_name;
1017  GooString *full_name;
1018  bool unicode_encoded = false;
1019 
1020  if (fullyQualifiedName)
1021  return fullyQualifiedName;
1022 
1023  full_name = new GooString();
1024 
1025  obj1 = obj.copy();
1026  while (parentObj = obj1.dictLookup("Parent"), parentObj.isDict()) {
1027  Object obj2 = parentObj.dictLookup("T");
1028  if (obj2.isString()) {
1029  parent_name = obj2.getString();
1030 
1031  if (unicode_encoded) {
1032  full_name->insert(0, "\0.", 2); // 2-byte unicode period
1033  if (parent_name->hasUnicodeMarker()) {
1034  full_name->insert(0, parent_name->c_str() + 2, parent_name->getLength() - 2); // Remove the unicode BOM
1035  } else {
1036  int tmp_length;
1037  char *tmp_str = pdfDocEncodingToUTF16(parent_name->toStr(), &tmp_length);
1038  full_name->insert(0, tmp_str + 2, tmp_length - 2); // Remove the unicode BOM
1039  delete[] tmp_str;
1040  }
1041  } else {
1042  full_name->insert(0, '.'); // 1-byte ascii period
1043  if (parent_name->hasUnicodeMarker()) {
1044  unicode_encoded = true;
1045  full_name = convertToUtf16(full_name);
1046  full_name->insert(0, parent_name->c_str() + 2, parent_name->getLength() - 2); // Remove the unicode BOM
1047  } else {
1048  full_name->insert(0, parent_name);
1049  }
1050  }
1051  }
1052  obj1 = parentObj.copy();
1053  }
1054 
1055  if (partialName) {
1056  if (unicode_encoded) {
1057  if (partialName->hasUnicodeMarker()) {
1058  full_name->append(partialName->c_str() + 2, partialName->getLength() - 2); // Remove the unicode BOM
1059  } else {
1060  int tmp_length;
1061  char *tmp_str = pdfDocEncodingToUTF16(partialName->toStr(), &tmp_length);
1062  full_name->append(tmp_str + 2, tmp_length - 2); // Remove the unicode BOM
1063  delete[] tmp_str;
1064  }
1065  } else {
1066  if (partialName->hasUnicodeMarker()) {
1067  unicode_encoded = true;
1068  full_name = convertToUtf16(full_name);
1069  full_name->append(partialName->c_str() + 2, partialName->getLength() - 2); // Remove the unicode BOM
1070  } else {
1071  full_name->append(partialName);
1072  }
1073  }
1074  } else {
1075  int len = full_name->getLength();
1076  // Remove the last period
1077  if (unicode_encoded) {
1078  if (len > 1) {
1079  full_name->del(len - 2, 2);
1080  }
1081  } else {
1082  if (len > 0) {
1083  full_name->del(len - 1, 1);
1084  }
1085  }
1086  }
1087 
1088  if (unicode_encoded) {
1089  full_name->prependUnicodeMarker();
1090  }
1091 
1092  fullyQualifiedName = full_name;
1093  return fullyQualifiedName;
1094 }
1095 
1097 {
1098  // Recursively update each child's appearance
1099  if (terminal) {
1100  for (int i = 0; i < numChildren; i++)
1101  widgets[i]->updateWidgetAppearance();
1102  } else {
1103  for (int i = 0; i < numChildren; i++)
1105  }
1106 }
1107 
1109 {
1110  if (value == readOnly) {
1111  return;
1112  }
1113 
1114  readOnly = value;
1115 
1116  Dict *dict = obj.getDict();
1117 
1118  const Object obj1 = Form::fieldLookup(dict, "Ff");
1119  int flags = 0;
1120  if (obj1.isInt()) {
1121  flags = obj1.getInt();
1122  }
1123  if (value) {
1124  flags |= 1;
1125  } else {
1126  flags &= ~1;
1127  }
1128 
1129  dict->set("Ff", Object(flags));
1132 }
1133 
1134 void FormField::reset(const std::vector<std::string> &excludedFields)
1135 {
1136  resetChildren(excludedFields);
1137 }
1138 
1139 void FormField::resetChildren(const std::vector<std::string> &excludedFields)
1140 {
1141  if (!terminal) {
1142  for (int i = 0; i < numChildren; i++)
1143  children[i]->reset(excludedFields);
1144  }
1145 }
1146 
1147 bool FormField::isAmongExcludedFields(const std::vector<std::string> &excludedFields)
1148 {
1149  Ref fieldRef;
1150 
1151  for (const std::string &field : excludedFields) {
1152  if (field.compare(field.size() - 2, 2, " R") == 0) {
1153  if (sscanf(field.c_str(), "%d %d R", &fieldRef.num, &fieldRef.gen) == 2 && fieldRef == getRef())
1154  return true;
1155  } else {
1156  if (field == getFullyQualifiedName()->toStr())
1157  return true;
1158  }
1159  }
1160 
1161  return false;
1162 }
1163 
1165 {
1166  if (terminal) {
1167  if (this->getRef() == aref)
1168  return this;
1169  } else {
1170  for (int i = 0; i < numChildren; i++) {
1172  if (result)
1173  return result;
1174  }
1175  }
1176  return nullptr;
1177 }
1178 
1180 {
1181  if (terminal) {
1182  if (getFullyQualifiedName()->cmp(name.c_str()) == 0)
1183  return this;
1184  } else {
1185  for (int i = 0; i < numChildren; i++) {
1187  if (result)
1188  return result;
1189  }
1190  }
1191  return nullptr;
1192 }
1193 
1194 //------------------------------------------------------------------------
1195 // FormFieldButton
1196 //------------------------------------------------------------------------
1197 FormFieldButton::FormFieldButton(PDFDoc *docA, Object &&dictObj, const Ref refA, FormField *parentA, std::set<int> *usedParents) : FormField(docA, std::move(dictObj), refA, parentA, usedParents, formButton)
1198 {
1199  Dict *dict = obj.getDict();
1200  active_child = -1;
1201  noAllOff = false;
1202  siblings = nullptr;
1203  numSiblings = 0;
1206 
1208  Object obj1 = Form::fieldLookup(dict, "Ff");
1209  if (obj1.isInt()) {
1210  int flags = obj1.getInt();
1211 
1212  if (flags & 0x10000) { // 17 -> push button
1214  } else if (flags & 0x8000) { // 16 -> radio button
1216  if (flags & 0x4000) { // 15 -> noToggleToOff
1217  noAllOff = true;
1218  }
1219  }
1220  if (flags & 0x1000000) { // 26 -> radiosInUnison
1221  error(errUnimplemented, -1, "FormFieldButton:: radiosInUnison flag unimplemented, please report a bug with a testcase\n");
1222  }
1223  }
1224 
1225  bool isChildRadiobutton = btype == formButtonRadio && terminal && parent && parent->getType() == formButton;
1226  // Ignore "V" for child radiobuttons, so FormFieldButton::getState() does not use it and instead uses the
1227  // "V" of the parent, which is the real value indicating the active field in the radio group. Issue #159
1228  if (btype != formButtonPush && !isChildRadiobutton) {
1229  // Even though V is inheritable we are interested in the value of this
1230  // field, if not present it's probably because it's a button in a set.
1231  appearanceState = dict->lookup("V");
1233  }
1234 }
1235 
1237 {
1238  switch (type) {
1239  case formButtonPush:
1240  return "push";
1241  case formButtonCheck:
1242  return "check";
1243  case formButtonRadio:
1244  return "radio";
1245  default:
1246  break;
1247  }
1248  return "unknown";
1249 }
1250 
1252 {
1253  printf("%*s- (%d %d): [%s] terminal: %s children: %d\n", indent, "", ref.num, ref.gen, _getButtonType(btype), terminal ? "Yes" : "No", numChildren);
1254 }
1255 
1257 {
1258  numSiblings = num;
1260 }
1261 
1263 {
1264  if (!terminal) {
1265  for (int i = 0; i < numChildren; i++) {
1266  FormFieldButton *child = dynamic_cast<FormFieldButton *>(children[i]);
1267  if (child != nullptr) {
1268  // Fill the siblings of this node childs
1269  child->setNumSiblings(numChildren - 1);
1270  for (int j = 0, counter = 0; j < numChildren; j++) {
1271  FormFieldButton *otherChild = dynamic_cast<FormFieldButton *>(children[j]);
1272  if (i == j)
1273  continue;
1274  if (child == otherChild)
1275  continue;
1276  child->setSibling(counter, otherChild);
1277  counter++;
1278  }
1279 
1280  // now call ourselves on the child
1281  // to fill its children data
1282  child->fillChildrenSiblingsID();
1283  }
1284  }
1285  }
1286 }
1287 
1289 {
1290  // A check button could behave as a radio button
1291  // when it's in a set of more than 1 buttons
1293  return false;
1294 
1296  // It's button in a set, set state on parent
1297  if (static_cast<FormFieldButton *>(parent)->setState(state)) {
1298  return true;
1299  }
1300  return false;
1301  }
1302 
1303  bool isOn = strcmp(state, "Off") != 0;
1304 
1305  if (!isOn && noAllOff)
1306  return false; // Don't allow to set all radio to off
1307 
1308  const char *current = getAppearanceState();
1309  bool currentFound = false, newFound = false;
1310 
1311  for (int i = 0; i < numChildren; i++) {
1312  FormWidgetButton *widget;
1313 
1314  // If radio button is a terminal field we want the widget at i, but
1315  // if it's not terminal, the child widget is a composed dict, so
1316  // we want the ony child widget of the children at i
1317  if (terminal)
1318  widget = static_cast<FormWidgetButton *>(widgets[i]);
1319  else
1320  widget = static_cast<FormWidgetButton *>(children[i]->getWidget(0));
1321 
1322  if (!widget->getOnStr())
1323  continue;
1324 
1325  const char *onStr = widget->getOnStr();
1326  if (current && strcmp(current, onStr) == 0) {
1327  widget->setAppearanceState("Off");
1328  if (!isOn)
1329  break;
1330  currentFound = true;
1331  }
1332 
1333  if (isOn && strcmp(state, onStr) == 0) {
1334  widget->setAppearanceState(state);
1335  newFound = true;
1336  }
1337 
1338  if (currentFound && newFound)
1339  break;
1340  }
1341 
1342  updateState(state);
1343 
1344  return true;
1345 }
1346 
1347 bool FormFieldButton::getState(const char *state) const
1348 {
1350  return true;
1351 
1352  return (parent && parent->getType() == formButton) ? static_cast<FormFieldButton *>(parent)->getState(state) : false;
1353 }
1354 
1356 {
1358  obj.getDict()->set("V", appearanceState.copy());
1360 }
1361 
1363 {
1364  if (siblings)
1365  gfree(siblings);
1366 }
1367 
1368 void FormFieldButton::reset(const std::vector<std::string> &excludedFields)
1369 {
1370  if (!isAmongExcludedFields(excludedFields)) {
1371  if (getDefaultAppearanceState()) {
1373  } else {
1374  obj.getDict()->remove("V");
1375 
1376  // Clear check button if it doesn't have default value.
1377  // This behaviour is what Adobe Reader does, it is not written in specification.
1378  if (btype == formButtonCheck)
1379  setState("Off");
1380  }
1381  }
1382 
1383  resetChildren(excludedFields);
1384 }
1385 
1386 //------------------------------------------------------------------------
1387 // FormFieldText
1388 //------------------------------------------------------------------------
1389 FormFieldText::FormFieldText(PDFDoc *docA, Object &&dictObj, const Ref refA, FormField *parentA, std::set<int> *usedParents) : FormField(docA, std::move(dictObj), refA, parentA, usedParents, formText)
1390 {
1391  Dict *dict = obj.getDict();
1392  Object obj1;
1393  content = nullptr;
1394  internalContent = nullptr;
1395  defaultContent = nullptr;
1397  maxLen = 0;
1398 
1399  obj1 = Form::fieldLookup(dict, "Ff");
1400  if (obj1.isInt()) {
1401  int flags = obj1.getInt();
1402  if (flags & 0x1000) // 13 -> Multiline
1403  multiline = true;
1404  if (flags & 0x2000) // 14 -> Password
1405  password = true;
1406  if (flags & 0x100000) // 21 -> FileSelect
1407  fileSelect = true;
1408  if (flags & 0x400000) // 23 -> DoNotSpellCheck
1409  doNotSpellCheck = true;
1410  if (flags & 0x800000) // 24 -> DoNotScroll
1411  doNotScroll = true;
1412  if (flags & 0x1000000) // 25 -> Comb
1413  comb = true;
1414  if (flags & 0x2000000) // 26 -> RichText
1415  richText = true;
1416  }
1417 
1418  obj1 = Form::fieldLookup(dict, "MaxLen");
1419  if (obj1.isInt()) {
1420  maxLen = obj1.getInt();
1421  }
1422 
1425 }
1426 
1428 {
1429  Dict *dict = obj.getDict();
1430  Object obj1;
1431 
1432  obj1 = Form::fieldLookup(dict, fillType == fillDefaultValue ? "DV" : "V");
1433  if (obj1.isString()) {
1434  if (obj1.getString()->hasUnicodeMarker()) {
1435  if (obj1.getString()->getLength() > 2) {
1436  if (fillType == fillDefaultValue)
1437  defaultContent = obj1.getString()->copy();
1438  else
1439  content = obj1.getString()->copy();
1440  }
1441  } else if (obj1.getString()->getLength() > 0) {
1442  // non-unicode string -- assume pdfDocEncoding and try to convert to UTF16BE
1443  int tmp_length;
1444  char *tmp_str = pdfDocEncodingToUTF16(obj1.getString()->toStr(), &tmp_length);
1445 
1446  if (fillType == fillDefaultValue)
1447  defaultContent = new GooString(tmp_str, tmp_length);
1448  else
1449  content = new GooString(tmp_str, tmp_length);
1450 
1451  delete[] tmp_str;
1452  }
1453  }
1454 }
1455 
1457 {
1458  printf("%*s- (%d %d): [text] terminal: %s children: %d\n", indent, "", ref.num, ref.gen, terminal ? "Yes" : "No", numChildren);
1459 }
1460 
1462 {
1463  delete content;
1464  content = nullptr;
1465 
1466  if (new_content) {
1467  content = new_content->copy();
1468 
1469  // append the unicode marker <FE FF> if needed
1470  if (!content->hasUnicodeMarker()) {
1472  }
1473  }
1474 
1475  obj.getDict()->set("V", Object(content ? content->copy() : new GooString("")));
1478 }
1479 
1481 {
1482  delete internalContent;
1483  internalContent = nullptr;
1484 
1485  if (new_content) {
1486  internalContent = new_content->copy();
1487  }
1489 }
1490 
1492 {
1493  delete content;
1494  delete internalContent;
1495  delete defaultContent;
1496 }
1497 
1498 void FormFieldText::reset(const std::vector<std::string> &excludedFields)
1499 {
1500  if (!isAmongExcludedFields(excludedFields)) {
1502  if (defaultContent == nullptr)
1503  obj.getDict()->remove("V");
1504  }
1505 
1506  resetChildren(excludedFields);
1507 }
1508 
1510 {
1511  std::vector<GooString *> *daToks = new std::vector<GooString *>();
1512  int idx = parseDA(daToks);
1513  double fontSize = -1;
1514  if (idx >= 0) {
1515  char *p = nullptr;
1516  fontSize = strtod((*daToks)[idx]->c_str(), &p);
1517  if (!p || *p)
1518  fontSize = -1;
1519  }
1520  for (auto entry : *daToks) {
1521  delete entry;
1522  }
1523  delete daToks;
1524  return fontSize;
1525 }
1526 
1528 {
1529  if (fontSize > 0 && obj.isDict()) {
1530  std::vector<GooString *> *daToks = new std::vector<GooString *>();
1531  int idx = parseDA(daToks);
1532  if (idx == -1) {
1533  error(errSyntaxError, -1, "FormFieldText:: invalid DA object\n");
1534  for (auto entry : *daToks) {
1535  delete entry;
1536  }
1537  delete daToks;
1538  return;
1539  }
1540  if (defaultAppearance)
1541  delete defaultAppearance;
1543  for (std::size_t i = 0; i < daToks->size(); ++i) {
1544  if (i > 0)
1545  defaultAppearance->append(' ');
1546  if (i == (std::size_t)idx) {
1547  defaultAppearance->appendf("{0:d}", fontSize);
1548  } else {
1549  defaultAppearance->append((*daToks)[i]);
1550  }
1551  }
1552  for (auto entry : *daToks) {
1553  delete entry;
1554  }
1555  delete daToks;
1559  }
1560 }
1561 
1562 int FormFieldText::tokenizeDA(const GooString *da, std::vector<GooString *> *daToks, const char *searchTok)
1563 {
1564  int idx = -1;
1565  if (da && daToks) {
1566  int i = 0;
1567  int j = 0;
1568  while (i < da->getLength()) {
1569  while (i < da->getLength() && Lexer::isSpace(da->getChar(i))) {
1570  ++i;
1571  }
1572  if (i < da->getLength()) {
1573  for (j = i + 1; j < da->getLength() && !Lexer::isSpace(da->getChar(j)); ++j) { }
1574  GooString *tok = new GooString(da, i, j - i);
1575  if (searchTok && !tok->cmp(searchTok))
1576  idx = daToks->size();
1577  daToks->push_back(tok);
1578  i = j;
1579  }
1580  }
1581  }
1582  return idx;
1583 }
1584 
1585 int FormFieldText::parseDA(std::vector<GooString *> *daToks)
1586 {
1587  int idx = -1;
1588  if (obj.isDict()) {
1589  Object objDA(obj.dictLookup("DA"));
1590  if (objDA.isString()) {
1591  const GooString *da = objDA.getString();
1592  idx = tokenizeDA(da, daToks, "Tf") - 1;
1593  }
1594  }
1595  return idx;
1596 }
1597 
1598 //------------------------------------------------------------------------
1599 // FormFieldChoice
1600 //------------------------------------------------------------------------
1601 FormFieldChoice::FormFieldChoice(PDFDoc *docA, Object &&aobj, const Ref refA, FormField *parentA, std::set<int> *usedParents) : FormField(docA, std::move(aobj), refA, parentA, usedParents, formChoice)
1602 {
1603  numChoices = 0;
1604  choices = nullptr;
1605  defaultChoices = nullptr;
1606  editedChoice = nullptr;
1607  topIdx = 0;
1608 
1609  Dict *dict = obj.getDict();
1610  Object obj1;
1611 
1613 
1614  obj1 = Form::fieldLookup(dict, "Ff");
1615  if (obj1.isInt()) {
1616  int flags = obj1.getInt();
1617  if (flags & 0x20000) // 18 -> Combo
1618  combo = true;
1619  if (flags & 0x40000) // 19 -> Edit
1620  edit = true;
1621  if (flags & 0x200000) // 22 -> MultiSelect
1622  multiselect = true;
1623  if (flags & 0x400000) // 23 -> DoNotSpellCheck
1624  doNotSpellCheck = true;
1625  if (flags & 0x4000000) // 27 -> CommitOnSelChange
1626  doCommitOnSelChange = true;
1627  }
1628 
1629  obj1 = dict->lookup("TI");
1630  if (obj1.isInt())
1631  topIdx = obj1.getInt();
1632 
1633  obj1 = Form::fieldLookup(dict, "Opt");
1634  if (obj1.isArray()) {
1635  numChoices = obj1.arrayGetLength();
1636  choices = new ChoiceOpt[numChoices];
1637  memset(choices, 0, sizeof(ChoiceOpt) * numChoices);
1638 
1639  for (int i = 0; i < numChoices; i++) {
1640  Object obj2 = obj1.arrayGet(i);
1641  if (obj2.isString()) {
1642  choices[i].optionName = obj2.getString()->copy();
1643  } else if (obj2.isArray()) { // [Export_value, Displayed_text]
1644  if (obj2.arrayGetLength() < 2) {
1645  error(errSyntaxError, -1, "FormWidgetChoice:: invalid Opt entry -- array's length < 2\n");
1646  continue;
1647  }
1648  Object obj3 = obj2.arrayGet(0);
1649  if (obj3.isString())
1650  choices[i].exportVal = obj3.getString()->copy();
1651  else
1652  error(errSyntaxError, -1, "FormWidgetChoice:: invalid Opt entry -- exported value not a string\n");
1653 
1654  obj3 = obj2.arrayGet(1);
1655  if (obj3.isString())
1656  choices[i].optionName = obj3.getString()->copy();
1657  else
1658  error(errSyntaxError, -1, "FormWidgetChoice:: invalid Opt entry -- choice name not a string\n");
1659  } else {
1660  error(errSyntaxError, -1, "FormWidgetChoice:: invalid {0:d} Opt entry\n", i);
1661  }
1662  }
1663  } else {
1664  // empty choice
1665  }
1666 
1667  // Find selected items
1668  // Note: PDF specs say that /V has precedence over /I, but acroread seems to
1669  // do the opposite. We do the same.
1670  obj1 = Form::fieldLookup(dict, "I");
1671  if (obj1.isArray()) {
1672  for (int i = 0; i < obj1.arrayGetLength(); i++) {
1673  Object obj2 = obj1.arrayGet(i);
1674  if (obj2.isInt() && obj2.getInt() >= 0 && obj2.getInt() < numChoices) {
1675  choices[obj2.getInt()].selected = true;
1676  }
1677  }
1678  } else {
1679  // Note: According to PDF specs, /V should *never* contain the exportVal.
1680  // However, if /Opt is an array of (exportVal,optionName) pairs, acroread
1681  // seems to expect the exportVal instead of the optionName and so we do too.
1683  }
1684 
1686 }
1687 
1689 {
1690  const char *key = fillType == fillDefaultValue ? "DV" : "V";
1691  Dict *dict = obj.getDict();
1692  Object obj1;
1693 
1694  obj1 = Form::fieldLookup(dict, key);
1695  if (obj1.isString() || obj1.isArray()) {
1696  if (fillType == fillDefaultValue) {
1697  defaultChoices = new bool[numChoices];
1698  memset(defaultChoices, 0, sizeof(bool) * numChoices);
1699  }
1700 
1701  if (obj1.isString()) {
1702  bool optionFound = false;
1703 
1704  for (int i = 0; i < numChoices; i++) {
1705  if (choices[i].exportVal) {
1706  if (choices[i].exportVal->cmp(obj1.getString()) == 0) {
1707  optionFound = true;
1708  }
1709  } else if (choices[i].optionName) {
1710  if (choices[i].optionName->cmp(obj1.getString()) == 0) {
1711  optionFound = true;
1712  }
1713  }
1714 
1715  if (optionFound) {
1716  if (fillType == fillDefaultValue)
1717  defaultChoices[i] = true;
1718  else
1719  choices[i].selected = true;
1720  break; // We've determined that this option is selected. No need to keep on scanning
1721  }
1722  }
1723 
1724  // Set custom value if /V doesn't refer to any predefined option and the field is user-editable
1725  if (fillType == fillValue && !optionFound && edit) {
1726  editedChoice = obj1.getString()->copy();
1727  }
1728  } else if (obj1.isArray()) {
1729  for (int i = 0; i < numChoices; i++) {
1730  for (int j = 0; j < obj1.arrayGetLength(); j++) {
1731  const Object obj2 = obj1.arrayGet(j);
1732  if (!obj2.isString()) {
1733  error(errSyntaxError, -1, "FormWidgetChoice:: {0:s} array contains a non string object", key);
1734  continue;
1735  }
1736 
1737  bool matches = false;
1738 
1739  if (choices[i].exportVal) {
1740  if (choices[i].exportVal->cmp(obj2.getString()) == 0) {
1741  matches = true;
1742  }
1743  } else if (choices[i].optionName) {
1744  if (choices[i].optionName->cmp(obj2.getString()) == 0) {
1745  matches = true;
1746  }
1747  }
1748 
1749  if (matches) {
1750  if (fillType == fillDefaultValue)
1751  defaultChoices[i] = true;
1752  else
1753  choices[i].selected = true;
1754  break; // We've determined that this option is selected. No need to keep on scanning
1755  }
1756  }
1757  }
1758  }
1759  }
1760 }
1761 
1763 {
1764  for (int i = 0; i < numChoices; i++) {
1765  delete choices[i].exportVal;
1766  delete choices[i].optionName;
1767  }
1768  delete[] choices;
1769  delete[] defaultChoices;
1770  delete editedChoice;
1771 }
1772 
1774 {
1775  printf("%*s- (%d %d): [choice] terminal: %s children: %d\n", indent, "", ref.num, ref.gen, terminal ? "Yes" : "No", numChildren);
1776 }
1777 
1779 {
1780  Object objV;
1781  Object objI(objNull);
1782 
1783  if (edit && editedChoice) {
1784  // This is an editable combo-box with user-entered text
1785  objV = Object(editedChoice->copy());
1786  } else {
1787  const int numSelected = getNumSelected();
1788 
1789  // Create /I array only if multiple selection is allowed (as per PDF spec)
1790  if (multiselect) {
1791  objI = Object(new Array(xref));
1792  }
1793 
1794  if (numSelected == 0) {
1795  // No options are selected
1796  objV = Object(new GooString(""));
1797  } else if (numSelected == 1) {
1798  // Only one option is selected
1799  for (int i = 0; i < numChoices; i++) {
1800  if (choices[i].selected) {
1801  if (multiselect) {
1802  objI.arrayAdd(Object(i));
1803  }
1804 
1805  if (choices[i].exportVal) {
1806  objV = Object(choices[i].exportVal->copy());
1807  } else if (choices[i].optionName) {
1808  objV = Object(choices[i].optionName->copy());
1809  }
1810 
1811  break; // We've just written the selected option. No need to keep on scanning
1812  }
1813  }
1814  } else {
1815  // More than one option is selected
1816  objV = Object(new Array(xref));
1817  for (int i = 0; i < numChoices; i++) {
1818  if (choices[i].selected) {
1819  if (multiselect) {
1820  objI.arrayAdd(Object(i));
1821  }
1822 
1823  if (choices[i].exportVal) {
1824  objV.arrayAdd(Object(choices[i].exportVal->copy()));
1825  } else if (choices[i].optionName) {
1826  objV.arrayAdd(Object(choices[i].optionName->copy()));
1827  }
1828  }
1829  }
1830  }
1831  }
1832 
1833  obj.getDict()->set("V", std::move(objV));
1834  obj.getDict()->set("I", std::move(objI));
1837 }
1838 
1840 {
1841  for (int i = 0; i < numChoices; i++) {
1842  choices[i].selected = false;
1843  }
1844 }
1845 
1847 {
1848  delete editedChoice;
1849  editedChoice = nullptr;
1850 
1851  unselectAll();
1852  updateSelection();
1853 }
1854 
1856 {
1857  delete editedChoice;
1858  editedChoice = nullptr;
1859 
1861  updateSelection();
1862 }
1863 
1865 {
1866  delete editedChoice;
1867  editedChoice = nullptr;
1868 
1869  if (!multiselect)
1870  unselectAll();
1871 
1872  choices[i].selected = true;
1873  updateSelection();
1874 }
1875 
1877 {
1878  delete editedChoice;
1879  editedChoice = nullptr;
1880 
1881  unselectAll();
1882 
1883  if (new_content) {
1884  editedChoice = new_content->copy();
1885 
1886  // append the unicode marker <FE FF> if needed
1887  if (!editedChoice->hasUnicodeMarker()) {
1889  }
1890  }
1891  updateSelection();
1892 }
1893 
1895 {
1896  return editedChoice;
1897 }
1898 
1900 {
1901  int cnt = 0;
1902  for (int i = 0; i < numChoices; i++) {
1903  if (choices[i].selected)
1904  cnt++;
1905  }
1906  return cnt;
1907 }
1908 
1910 {
1911  if (edit && editedChoice)
1912  return editedChoice;
1913 
1914  for (int i = 0; i < numChoices; i++) {
1915  if (choices[i].optionName && choices[i].selected)
1916  return choices[i].optionName;
1917  }
1918 
1919  return nullptr;
1920 }
1921 
1922 void FormFieldChoice::reset(const std::vector<std::string> &excludedFields)
1923 {
1924  if (!isAmongExcludedFields(excludedFields)) {
1925  delete editedChoice;
1926  editedChoice = nullptr;
1927 
1928  if (defaultChoices) {
1929  for (int i = 0; i < numChoices; i++)
1931  } else {
1932  unselectAll();
1933  }
1934  }
1935 
1936  resetChildren(excludedFields);
1937 
1938  updateSelection();
1939 }
1940 
1941 //------------------------------------------------------------------------
1942 // FormFieldSignature
1943 //------------------------------------------------------------------------
1944 FormFieldSignature::FormFieldSignature(PDFDoc *docA, Object &&dict, const Ref refA, FormField *parentA, std::set<int> *usedParents)
1945  : FormField(docA, std::move(dict), refA, parentA, usedParents, formSignature), signature_type(unknown_signature_type), signature(nullptr)
1946 {
1947  signature_info = new SignatureInfo();
1948  parseInfo();
1949 }
1950 
1952 {
1953  delete signature_info;
1954  delete signature;
1955 }
1956 
1958 {
1959  delete signature;
1960  signature = sig.copy();
1961 }
1962 
1964 {
1965  return customAppearanceContent;
1966 }
1967 
1969 {
1970  customAppearanceContent = GooString(s.toStr());
1971 }
1972 
1973 void FormFieldSignature::setCertificateInfo(std::unique_ptr<X509CertificateInfo> &certInfo)
1974 {
1975  certificate_info.swap(certInfo);
1976 }
1977 
1979 {
1980  if (!obj.isDict())
1981  return;
1982 
1983  // retrieve PKCS#7
1984  Object sig_dict = obj.dictLookup("V");
1985  if (!sig_dict.isDict()) {
1986  return;
1987  }
1988 
1989  Object contents_obj = sig_dict.dictLookup("Contents");
1990  if (contents_obj.isString()) {
1991  signature = contents_obj.getString()->copy();
1992  }
1993 
1994  byte_range = sig_dict.dictLookup("ByteRange");
1995 
1996  const Object location_obj = sig_dict.dictLookup("Location");
1997  if (location_obj.isString()) {
1998  signature_info->setLocation(location_obj.getString()->c_str());
1999  }
2000 
2001  const Object reason_obj = sig_dict.dictLookup("Reason");
2002  if (reason_obj.isString()) {
2003  signature_info->setReason(reason_obj.getString()->c_str());
2004  }
2005 
2006  // retrieve SigningTime
2007  Object time_of_signing = sig_dict.dictLookup("M");
2008  if (time_of_signing.isString()) {
2009  const GooString *time_str = time_of_signing.getString();
2010  signature_info->setSigningTime(dateStringToTime(time_str)); // Put this information directly in SignatureInfo object
2011  }
2012 
2013  // check if subfilter is supported for signature validation, only detached signatures work for now
2014  Object subfilterName = sig_dict.dictLookup("SubFilter");
2015  if (subfilterName.isName("adbe.pkcs7.sha1")) {
2018  } else if (subfilterName.isName("adbe.pkcs7.detached")) {
2021  } else if (subfilterName.isName("ETSI.CAdES.detached")) {
2024  }
2025 }
2026 
2028 {
2029 #ifdef ENABLE_NSS3
2030  const int BLOCK_SIZE = 4096;
2031  unsigned char signed_data_buffer[BLOCK_SIZE];
2032 
2033  Goffset i = 0;
2034  while (i < block_len) {
2035  Goffset bytes_left = block_len - i;
2036  if (bytes_left < BLOCK_SIZE) {
2037  doc->getBaseStream()->doGetChars(bytes_left, signed_data_buffer);
2038  handler->updateHash(signed_data_buffer, bytes_left);
2039  i = block_len;
2040  } else {
2041  doc->getBaseStream()->doGetChars(BLOCK_SIZE, signed_data_buffer);
2042  handler->updateHash(signed_data_buffer, BLOCK_SIZE);
2043  i += BLOCK_SIZE;
2044  }
2045  }
2046 #endif
2047 }
2048 
2050 {
2051  return static_cast<FormFieldSignature *>(field)->getSignatureType();
2052 }
2053 
2055 {
2056  static_cast<FormFieldSignature *>(field)->setSignatureType(fst);
2057 }
2058 
2059 SignatureInfo *FormFieldSignature::validateSignature(bool doVerifyCert, bool forceRevalidation, time_t validationTime)
2060 {
2061 #ifdef ENABLE_NSS3
2062  if (signature_info->getSignatureValStatus() != SIGNATURE_NOT_VERIFIED && !forceRevalidation) {
2063  return signature_info;
2064  }
2065 
2066  if (signature == nullptr) {
2067  error(errSyntaxError, 0, "Invalid or missing Signature string");
2068  return signature_info;
2069  }
2070 
2071  if (!byte_range.isArray()) {
2072  error(errSyntaxError, 0, "Invalid or missing ByteRange array");
2073  return signature_info;
2074  }
2075 
2076  int arrayLen = byte_range.arrayGetLength();
2077  if (arrayLen < 2) {
2078  error(errSyntaxError, 0, "Too few elements in ByteRange array");
2079  return signature_info;
2080  }
2081 
2082  const int signature_len = signature->getLength();
2083  unsigned char *signatureuchar = (unsigned char *)gmalloc(signature_len);
2084  memcpy(signatureuchar, signature->c_str(), signature_len);
2085  SignatureHandler signature_handler(signatureuchar, signature_len);
2086 
2087  Goffset fileLength = doc->getBaseStream()->getLength();
2088  for (int i = 0; i < arrayLen / 2; i++) {
2089  Object offsetObj = byte_range.arrayGet(i * 2);
2090  Object lenObj = byte_range.arrayGet(i * 2 + 1);
2091 
2092  if (!offsetObj.isIntOrInt64() || !lenObj.isIntOrInt64()) {
2093  error(errSyntaxError, 0, "Illegal values in ByteRange array");
2094  return signature_info;
2095  }
2096 
2097  Goffset offset = offsetObj.getIntOrInt64();
2098  Goffset len = lenObj.getIntOrInt64();
2099 
2100  if (offset < 0 || offset >= fileLength || len < 0 || len > fileLength || offset + len > fileLength) {
2101  error(errSyntaxError, 0, "Illegal values in ByteRange array");
2102  return signature_info;
2103  }
2104 
2106  hashSignedDataBlock(&signature_handler, len);
2107  }
2108 
2109  signature_info->setSignerName(signature_handler.getSignerName());
2110  signature_info->setSubjectDN(signature_handler.getSignerSubjectDN());
2111  signature_info->setHashAlgorithm(signature_handler.getHashAlgorithm());
2112 
2114  error(errUnimplemented, 0, "Unable to validate this type of signature");
2115  return signature_info;
2116  }
2117 
2118  const SignatureValidationStatus sig_val_state = signature_handler.validateSignature();
2119  signature_info->setSignatureValStatus(sig_val_state);
2120 
2121  // verify if signature contains a 'signing time' attribute
2122  if (signature_handler.getSigningTime() != 0) {
2123  signature_info->setSigningTime(signature_handler.getSigningTime());
2124  }
2125 
2126  if (sig_val_state != SIGNATURE_VALID || !doVerifyCert) {
2127  return signature_info;
2128  }
2129 
2130  const CertificateValidationStatus cert_val_state = signature_handler.validateCertificate(validationTime);
2131  signature_info->setCertificateValStatus(cert_val_state);
2133 
2134 #endif
2135  return signature_info;
2136 }
2137 
2138 std::vector<Goffset> FormFieldSignature::getSignedRangeBounds() const
2139 {
2140  std::vector<Goffset> range_vec;
2141  if (byte_range.isArray()) {
2142  if (byte_range.arrayGetLength() == 4) {
2143  for (int i = 0; i < 2; ++i) {
2144  const Object offsetObj(byte_range.arrayGet(2 * i));
2145  const Object lenObj(byte_range.arrayGet(2 * i + 1));
2146  if (offsetObj.isIntOrInt64() && lenObj.isIntOrInt64()) {
2147  const Goffset offset = offsetObj.getIntOrInt64();
2148  const Goffset len = lenObj.getIntOrInt64();
2149  range_vec.push_back(offset);
2150  range_vec.push_back(offset + len);
2151  }
2152  }
2153  }
2154  }
2155  return range_vec;
2156 }
2157 
2159 {
2160  Goffset start = 0;
2161  Goffset end = 0;
2162  const std::vector<Goffset> ranges = getSignedRangeBounds();
2163  if (ranges.size() == 4) {
2164  start = ranges[1];
2165  end = ranges[2];
2166  }
2167  if (end >= start + 6) {
2169  *checkedFileSize = stream->getLength();
2170  Goffset len = end - start;
2171  stream->setPos(end - 1);
2172  int c2 = stream->lookChar();
2173  stream->setPos(start);
2174  int c1 = stream->getChar();
2175  // PDF signatures are first ASN1 DER, then hex encoded PKCS#7 structures,
2176  // possibly padded with 0 characters and enclosed in '<' and '>'.
2177  // The ASN1 DER encoding of a PKCS#7 structure must start with the tag 0x30
2178  // for SEQUENCE. The next byte must be 0x80 for ASN1 DER indefinite length
2179  // encoding or (0x80 + n) for ASN1 DER definite length encoding
2180  // where n is the number of subsequent "length bytes" which big-endian
2181  // encode the length of the content of the SEQUENCE following them.
2182  if (len <= std::numeric_limits<int>::max() && *checkedFileSize > end && c1 == '<' && c2 == '>') {
2183  GooString gstr;
2184  ++start;
2185  --end;
2186  len = end - start;
2187  Goffset pos = 0;
2188  do {
2189  c1 = stream->getChar();
2190  if (c1 == EOF)
2191  return nullptr;
2192  gstr.append(static_cast<char>(c1));
2193  } while (++pos < len);
2194  if (gstr.getChar(0) == '3' && gstr.getChar(1) == '0') {
2195  if (gstr.getChar(2) == '8' && gstr.getChar(3) == '0') {
2196  // ASN1 DER indefinite length encoding:
2197  // We only check that all characters up to the enclosing '>'
2198  // are hex characters and that there are two hex encoded 0 bytes
2199  // just before the enclosing '>' marking the end of the indefinite
2200  // length encoding.
2201  int paddingCount = 0;
2202  while (gstr.getChar(len - 1) == '0' && gstr.getChar(len - 2) == '0') {
2203  ++paddingCount;
2204  len -= 2;
2205  }
2206  if (paddingCount < 2 || len % 2 == 1)
2207  len = 0;
2208  } else if (gstr.getChar(2) == '8') {
2209  // ASN1 DER definite length encoding:
2210  // We calculate the length of the following bytes from the length bytes and
2211  // check that after the length bytes and the following calculated number of
2212  // bytes all bytes up to the enclosing '>' character are hex encoded 0 bytes.
2213  int lenBytes = gstr.getChar(3) - '0';
2214  if (lenBytes > 0 && lenBytes <= 4) {
2215  int sigLen = 0;
2216  for (int i = 0; i < 2 * lenBytes; ++i) {
2217  sigLen <<= 4;
2218  char c = gstr.getChar(i + 4);
2219  if (isdigit(c))
2220  sigLen += c - '0';
2221  else if (isxdigit(c) && c >= 'a')
2222  sigLen += c - 'a' + 10;
2223  else if (isxdigit(c) && c >= 'A')
2224  sigLen += c - 'A' + 10;
2225  else {
2226  len = 0;
2227  break;
2228  }
2229  }
2230  if (sigLen > 0 && 2 * (sigLen + lenBytes) <= len - 4) {
2231  for (Goffset i = 2 * (sigLen + lenBytes) + 4; i < len; ++i) {
2232  if (gstr.getChar(i) != '0') {
2233  len = 0;
2234  break;
2235  }
2236  }
2237  } else
2238  len = 0;
2239  }
2240  }
2241  for (const char c : gstr.toStr()) {
2242  if (!isxdigit(c))
2243  len = 0;
2244  }
2245  if (len > 0) {
2246  return new GooString(&gstr, 0, len);
2247  }
2248  }
2249  }
2250  }
2251  return nullptr;
2252 }
2253 
2255 {
2256  printf("%*s- (%d %d): [signature] terminal: %s children: %d\n", indent, "", ref.num, ref.gen, terminal ? "Yes" : "No", numChildren);
2257 }
2258 
2259 //------------------------------------------------------------------------
2260 // Form
2261 //------------------------------------------------------------------------
2262 
2263 Form::Form(PDFDoc *docA, Object *acroFormA)
2264 {
2265  Object obj1;
2266 
2267  doc = docA;
2268  xref = doc->getXRef();
2269  acroForm = acroFormA;
2270 
2271  size = 0;
2272  numFields = 0;
2273  rootFields = nullptr;
2275  defaultAppearance = nullptr;
2276  defaultResources = nullptr;
2277 
2278  needAppearances = acroForm->dictLookup("NeedAppearances").getBoolWithDefaultValue(false);
2279 
2280  obj1 = acroForm->dictLookup("DA");
2281  if (obj1.isString())
2282  defaultAppearance = obj1.getString()->copy();
2283 
2284  obj1 = acroForm->dictLookup("Q");
2285  if (obj1.isInt())
2286  quadding = static_cast<VariableTextQuadding>(obj1.getInt());
2287 
2288  resDict = acroForm->dictLookup("DR");
2289  if (resDict.isDict()) {
2290  // At a minimum, this dictionary shall contain a Font entry
2291  obj1 = resDict.dictLookup("Font");
2292  if (obj1.isDict())
2293  defaultResources = new GfxResources(xref, resDict.getDict(), nullptr);
2294  }
2295  if (!defaultResources) {
2296  resDict.setToNull();
2297  }
2298 
2299  obj1 = acroForm->dictLookup("Fields");
2300  if (obj1.isArray()) {
2301  Array *array = obj1.getArray();
2302  std::set<Ref> alreadyReadRefs;
2303  for (int i = 0; i < array->getLength(); i++) {
2304  Object obj2 = array->get(i);
2305  const Object &oref = array->getNF(i);
2306  if (!oref.isRef()) {
2307  error(errSyntaxWarning, -1, "Direct object in rootFields");
2308  continue;
2309  }
2310 
2311  if (!obj2.isDict()) {
2312  error(errSyntaxWarning, -1, "Reference in Fields array to an invalid or non existent object");
2313  continue;
2314  }
2315 
2316  if (alreadyReadRefs.find(oref.getRef()) != alreadyReadRefs.end()) {
2317  continue;
2318  }
2319  alreadyReadRefs.insert(oref.getRef());
2320 
2321  if (numFields >= size) {
2322  size += 16;
2324  }
2325 
2326  std::set<int> usedParents;
2327  rootFields[numFields++] = createFieldFromDict(std::move(obj2), doc, oref.getRef(), nullptr, &usedParents);
2328  }
2329  } else {
2330  error(errSyntaxError, -1, "Can't get Fields array\n");
2331  }
2332 
2333  obj1 = acroForm->dictLookup("CO");
2334  if (obj1.isArray()) {
2335  Array *array = obj1.getArray();
2336  calculateOrder.reserve(array->getLength());
2337  for (int i = 0; i < array->getLength(); i++) {
2338  const Object &oref = array->getNF(i);
2339  if (!oref.isRef()) {
2340  error(errSyntaxWarning, -1, "Direct object in CO");
2341  continue;
2342  }
2343  calculateOrder.push_back(oref.getRef());
2344  }
2345  }
2346 
2347  // for (int i = 0; i < numFields; i++)
2348  // rootFields[i]->printTree();
2349 }
2350 
2352 {
2353  int i;
2354  for (i = 0; i < numFields; ++i)
2355  delete rootFields[i];
2356  gfree(rootFields);
2357  delete defaultAppearance;
2358  delete defaultResources;
2359 }
2360 
2361 // Look up an inheritable field dictionary entry.
2362 static Object fieldLookup(Dict *field, const char *key, std::set<int> *usedParents)
2363 {
2364  Dict *dict = field;
2365  Object obj = dict->lookup(key);
2366  if (!obj.isNull()) {
2367  return obj;
2368  }
2369  const Object &parent = dict->lookupNF("Parent");
2370  if (parent.isRef()) {
2371  const Ref ref = parent.getRef();
2372  if (usedParents->find(ref.num) == usedParents->end()) {
2373  usedParents->insert(ref.num);
2374 
2375  Object obj2 = parent.fetch(dict->getXRef());
2376  if (obj2.isDict()) {
2377  return fieldLookup(obj2.getDict(), key, usedParents);
2378  }
2379  }
2380  } else if (parent.isDict()) {
2381  return fieldLookup(parent.getDict(), key, usedParents);
2382  }
2383  return Object(objNull);
2384 }
2385 
2387 {
2388  std::set<int> usedParents;
2389  return ::fieldLookup(field, key, &usedParents);
2390 }
2391 
2392 FormField *Form::createFieldFromDict(Object &&obj, PDFDoc *docA, const Ref aref, FormField *parent, std::set<int> *usedParents)
2393 {
2394  FormField *field;
2395 
2396  const Object obj2 = Form::fieldLookup(obj.getDict(), "FT");
2397  if (obj2.isName("Btn")) {
2398  field = new FormFieldButton(docA, std::move(obj), aref, parent, usedParents);
2399  } else if (obj2.isName("Tx")) {
2400  field = new FormFieldText(docA, std::move(obj), aref, parent, usedParents);
2401  } else if (obj2.isName("Ch")) {
2402  field = new FormFieldChoice(docA, std::move(obj), aref, parent, usedParents);
2403  } else if (obj2.isName("Sig")) {
2404  field = new FormFieldSignature(docA, std::move(obj), aref, parent, usedParents);
2405  } else { // we don't have an FT entry => non-terminal field
2406  field = new FormField(docA, std::move(obj), aref, parent, usedParents);
2407  }
2408 
2409  return field;
2410 }
2411 
2413 {
2414  // We create the widget annotations associated to
2415  // every form widget here, because the AnnotWidget constructor
2416  // needs the form object that gets from the catalog. When constructing
2417  // a FormWidget the Catalog is still creating the form object
2418  for (int i = 0; i < numFields; i++) {
2421  }
2422 }
2423 
2425 {
2426  for (int i = 0; i < numFields; i++) {
2428  if (result)
2429  return result;
2430  }
2431  return nullptr;
2432 }
2433 
2435 {
2436  for (int i = 0; i < numFields; i++) {
2438  if (result)
2439  return result;
2440  }
2441  return nullptr;
2442 }
2443 
2445 {
2446  for (int i = 0; i < numFields; i++) {
2448  if (result)
2449  return result;
2450  }
2451  return nullptr;
2452 }
2453 
2454 void Form::reset(const std::vector<std::string> &fields, bool excludeFields)
2455 {
2456  FormField *foundField;
2457  const bool resetAllFields = fields.empty();
2458 
2459  if (resetAllFields) {
2460  for (int i = 0; i < numFields; i++) {
2461  rootFields[i]->reset(std::vector<std::string>());
2462  }
2463  } else {
2464  if (!excludeFields) {
2465  for (const std::string &field : fields) {
2466  Ref fieldRef;
2467 
2468  if (field.compare(field.size() - 2, 2, " R") == 0 && sscanf(field.c_str(), "%d %d R", &fieldRef.num, &fieldRef.gen) == 2) {
2469  foundField = findFieldByRef(fieldRef);
2470  } else {
2471  foundField = findFieldByFullyQualifiedName(field);
2472  }
2473 
2474  if (foundField)
2475  foundField->reset(std::vector<std::string>());
2476  }
2477  } else {
2478  for (int i = 0; i < numFields; i++) {
2479  rootFields[i]->reset(fields);
2480  }
2481  }
2482  }
2483 }
2484 
2485 //------------------------------------------------------------------------
2486 // FormPageWidgets
2487 //------------------------------------------------------------------------
2488 
2489 FormPageWidgets::FormPageWidgets(Annots *annots, unsigned int page, Form *form)
2490 {
2491  numWidgets = 0;
2492  widgets = nullptr;
2493  size = 0;
2494 
2495  if (annots && annots->getNumAnnots() > 0 && form) {
2496  size = annots->getNumAnnots();
2497  widgets = (FormWidget **)greallocn(widgets, size, sizeof(FormWidget *));
2498 
2499  /* For each entry in the page 'Annots' dict, try to find
2500  a matching form field */
2501  for (int i = 0; i < size; ++i) {
2502  Annot *annot = annots->getAnnot(i);
2503 
2504  if (annot->getType() != Annot::typeWidget)
2505  continue;
2506 
2507  if (!annot->getHasRef()) {
2508  /* Since all entry in a form field's kid dict needs to be
2509  indirect references, if this annot isn't indirect, it isn't
2510  related to a form field */
2511  continue;
2512  }
2513 
2514  Ref r = annot->getRef();
2515 
2516  /* Try to find a form field which either has this Annot in its Kids entry
2517  or is merged with this Annot */
2518  FormWidget *tmp = form->findWidgetByRef(r);
2519  if (tmp) {
2520  // We've found a corresponding form field, link it
2522  widgets[numWidgets++] = tmp;
2523  }
2524  }
2525  }
2526 }
2527 
2528 void FormPageWidgets::addWidgets(const std::vector<FormField *> &addedWidgets, unsigned int page)
2529 {
2530  if (addedWidgets.empty())
2531  return;
2532 
2533  size += addedWidgets.size();
2534  widgets = (FormWidget **)greallocn(widgets, size, sizeof(FormWidget *));
2535 
2536  for (auto frmField : addedWidgets) {
2537  FormWidget *frmWidget = frmField->getWidget(0);
2538  frmWidget->setID(FormWidget::encodeID(page, numWidgets));
2539  widgets[numWidgets++] = frmWidget;
2540  }
2541 }
2542 
2544 {
2545  gfree(widgets);
2546 }
double __cdecl strtod(char const *_String, char **_EndPtr)
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
#define type(a)
Definition: aptex-macros.h:171
#define name
static char time_str[38]
Definition: aptex-utils.c:62
int cmp(const void *p, const void *q)
Definition: bkmk2uni.c:1611
#define BUF_SIZE
Definition: chkdvifont.c:81
bool setFormAdditionalAction(FormAdditionalActionsType type, const GooString &js)
Definition: Annot.cc:3842
std::unique_ptr< LinkAction > getFormAdditionalAction(FormAdditionalActionsType type)
Definition: Annot.cc:3827
void updateAppearanceStream()
Definition: Annot.cc:5046
LinkAction * getAction()
Definition: Annot.h:1430
Definition: Annot.h:80
PDFRectangle * getRect() const
Definition: Annot.h:722
bool getHasRef() const
Definition: Annot.h:718
void setAppearanceState(const char *state)
Definition: Annot.cc:1491
@ typeWidget
Definition: Annot.h:648
GBool inRect(double x, double y)
Definition: Annot.h:97
void decRefCnt()
Definition: Annot.cc:1572
GString * getType()
Definition: Annot.h:89
FormAdditionalActionsType
Definition: Annot.h:675
Ref getRef() const
Definition: Annot.h:719
Definition: Annot.h:152
int getNumAnnots()
Definition: Annot.h:161
Annot * getAnnot(int i)
Definition: Annot.h:162
Definition: Array.h:29
Object * get(int i, Object *obj, int recursion=0)
Definition: Array.cc:54
virtual Goffset getLength()
Definition: Stream.h:337
virtual void setPos(GFileOffset pos, int dir=0)=0
Definition: Dict.h:29
XRef * getXRef() const
Definition: Dict.h:99
Object * lookupNF(const char *key, Object *obj)
Definition: Dict.cc:129
void remove(const char *key)
Definition: Dict.cc:128
Object * lookup(const char *key, Object *obj, int recursion=0)
Definition: Dict.cc:122
void set(const char *key, Object &&val)
Definition: Dict.cc:142
FormButtonType getButtonType() const
Definition: Form.h:422
const char * getDefaultAppearanceState() const
Definition: Form.h:431
FormFieldButton ** siblings
Definition: Form.h:450
void fillChildrenSiblingsID() override
Definition: Form.cc:1262
bool setState(const char *state)
Definition: Form.cc:1288
Object defaultAppearanceState
Definition: Form.h:459
Object appearanceState
Definition: Form.h:458
FormFieldButton(PDFDoc *docA, Object &&dict, const Ref ref, FormField *parent, std::set< int > *usedParents)
Definition: Form.cc:1197
void reset(const std::vector< std::string > &excludedFields) override
Definition: Form.cc:1368
FormButtonType btype
Definition: Form.h:454
int active_child
Definition: Form.h:456
void print(int indent) override
Definition: Form.cc:1251
int numSiblings
Definition: Form.h:452
void setNumSiblings(int num)
Definition: Form.cc:1256
const char * getAppearanceState() const
Definition: Form.h:430
bool noAllOff
Definition: Form.h:457
void updateState(const char *state)
Definition: Form.cc:1355
bool getState(const char *state) const
Definition: Form.cc:1347
~FormFieldButton() override
Definition: Form.cc:1362
bool noSpellCheck() const
Definition: Form.h:552
const GooString * getSelectedChoice() const
Definition: Form.cc:1909
~FormFieldChoice() override
Definition: Form.cc:1762
const GooString * getExportVal(int i) const
Definition: Form.h:527
bool isCombo() const
Definition: Form.h:549
const GooString * getChoice(int i) const
Definition: Form.h:526
const GooString * getEditChoice() const
Definition: Form.cc:1894
ChoiceOpt * choices
Definition: Form.h:580
FormFieldChoice(PDFDoc *docA, Object &&aobj, const Ref ref, FormField *parent, std::set< int > *usedParents)
Definition: Form.cc:1601
void updateSelection()
Definition: Form.cc:1778
void reset(const std::vector< std::string > &excludedFields) override
Definition: Form.cc:1922
void setEditChoice(const GooString *new_content)
Definition: Form.cc:1876
bool isSelected(int i) const
Definition: Form.h:545
void unselectAll()
Definition: Form.cc:1839
bool hasEdit() const
Definition: Form.h:550
bool isListBox() const
Definition: Form.h:554
int topIdx
Definition: Form.h:583
void toggle(int i)
Definition: Form.cc:1855
bool combo
Definition: Form.h:566
bool doCommitOnSelChange
Definition: Form.h:570
int numChoices
Definition: Form.h:579
bool * defaultChoices
Definition: Form.h:581
void print(int indent) override
Definition: Form.cc:1773
bool edit
Definition: Form.h:567
GooString * editedChoice
Definition: Form.h:582
void fillChoices(FillValueType fillType)
Definition: Form.cc:1688
bool isMultiSelect() const
Definition: Form.h:551
bool commitOnSelChange() const
Definition: Form.h:553
void select(int i)
Definition: Form.cc:1864
void deselectAll()
Definition: Form.cc:1846
bool doNotSpellCheck
Definition: Form.h:569
int getNumChoices() const
Definition: Form.h:525
int getNumSelected()
Definition: Form.cc:1899
bool multiselect
Definition: Form.h:568
void setCertificateInfo(std::unique_ptr< X509CertificateInfo > &)
Definition: Form.cc:1973
void setCustomAppearanceContent(const GooString &s)
Definition: Form.cc:1968
void parseInfo()
Definition: Form.cc:1978
const GooString & getCustomAppearanceContent() const
Definition: Form.cc:1963
~FormFieldSignature() override
Definition: Form.cc:1951
Object byte_range
Definition: Form.h:624
FormSignatureType signature_type
Definition: Form.h:623
void hashSignedDataBlock(SignatureHandler *handler, Goffset block_len)
Definition: Form.cc:2027
GooString * signature
Definition: Form.h:625
std::vector< Goffset > getSignedRangeBounds() const
Definition: Form.cc:2138
void setSignature(const GooString &sig)
Definition: Form.cc:1957
GooString customAppearanceContent
Definition: Form.h:627
void print(int indent) override
Definition: Form.cc:2254
GooString * getCheckedSignature(Goffset *checkedFileSize)
Definition: Form.cc:2158
FormFieldSignature(PDFDoc *docA, Object &&dict, const Ref ref, FormField *parent, std::set< int > *usedParents)
Definition: Form.cc:1944
SignatureInfo * validateSignature(bool doVerifyCert, bool forceRevalidation, time_t validationTime)
Definition: Form.cc:2059
std::unique_ptr< X509CertificateInfo > certificate_info
Definition: Form.h:628
SignatureInfo * signature_info
Definition: Form.h:626
GooString * defaultContent
Definition: Form.h:503
bool isFileSelect() const
Definition: Form.h:479
FormFieldText(PDFDoc *docA, Object &&dictObj, const Ref ref, FormField *parent, std::set< int > *usedParents)
Definition: Form.cc:1389
bool isPassword() const
Definition: Form.h:478
void setContentCopy(const GooString *new_content)
Definition: Form.cc:1461
bool isRichText() const
Definition: Form.h:483
bool doNotSpellCheck
Definition: Form.h:507
int maxLen
Definition: Form.h:511
void fillContent(FillValueType fillType)
Definition: Form.cc:1427
void print(int indent) override
Definition: Form.cc:1456
int parseDA(std::vector< GooString * > *daToks)
Definition: Form.cc:1585
bool password
Definition: Form.h:505
GooString * internalContent
Definition: Form.h:502
int getMaxLen() const
Definition: Form.h:485
bool richText
Definition: Form.h:510
bool doNotScroll
Definition: Form.h:508
bool noScroll() const
Definition: Form.h:481
~FormFieldText() override
Definition: Form.cc:1491
void reset(const std::vector< std::string > &excludedFields) override
Definition: Form.cc:1498
bool isMultiline() const
Definition: Form.h:477
static int tokenizeDA(const GooString *daString, std::vector< GooString * > *daToks, const char *searchTok)
Definition: Form.cc:1562
double getTextFontSize()
Definition: Form.cc:1509
const GooString * getContent() const
Definition: Form.h:471
bool isComb() const
Definition: Form.h:482
GooString * content
Definition: Form.h:501
bool fileSelect
Definition: Form.h:506
bool comb
Definition: Form.h:509
bool multiline
Definition: Form.h:504
void setTextFontSize(int fontSize)
Definition: Form.cc:1527
void setAppearanceContentCopy(const GooString *new_content)
Definition: Form.cc:1480
bool noSpellCheck() const
Definition: Form.h:480
virtual void reset(const std::vector< std::string > &excludedFields)
Definition: Form.cc:1134
bool isReadOnly() const
Definition: Form.h:346
bool isAmongExcludedFields(const std::vector< std::string > &excludedFields)
Definition: Form.cc:1147
FormField ** children
Definition: Form.h:390
virtual void print(int indent=0)
Definition: Form.cc:933
bool standAlone
Definition: Form.h:407
void updateChildrenAppearance()
Definition: Form.cc:1096
Ref getRef()
Definition: Form.h:343
FormField()
Definition: Form.h:410
const GooString * getAlternateUiName() const
Definition: Form.h:356
GooString * mappingName
Definition: Form.h:398
void _createWidget(Object *obj, Ref aref)
Definition: Form.cc:970
FormWidget * getWidget(int i) const
Definition: Form.h:362
GooString * getFullyQualifiedName()
Definition: Form.cc:1012
void printTree(int indent=0)
Definition: Form.cc:938
void setReadOnly(bool value)
Definition: Form.cc:1108
FormWidget ** widgets
Definition: Form.h:393
const GooString * getPartialName() const
Definition: Form.h:354
virtual void fillChildrenSiblingsID()
Definition: Form.cc:950
void createWidgetAnnotations()
Definition: Form.cc:959
const GooString * getMappingName() const
Definition: Form.h:357
bool terminal
Definition: Form.h:386
GooString * alternateUiName
Definition: Form.h:397
Object obj
Definition: Form.h:387
FormField * parent
Definition: Form.h:391
FormField * findFieldByFullyQualifiedName(const std::string &name)
Definition: Form.cc:1179
int numChildren
Definition: Form.h:392
FormWidget * findWidgetByRef(Ref aref)
Definition: Form.cc:995
bool readOnly
Definition: Form.h:394
Ref ref
Definition: Form.h:385
XRef * xref
Definition: Form.h:389
VariableTextQuadding quadding
Definition: Form.h:404
GooString * fullyQualifiedName
Definition: Form.h:399
GooString * partialName
Definition: Form.h:396
GooString * defaultAppearance
Definition: Form.h:402
bool hasQuadding
Definition: Form.h:403
void setPartialName(const GooString &name)
Definition: Form.cc:903
FormField * findFieldByRef(Ref aref)
Definition: Form.cc:1164
PDFDoc * doc
Definition: Form.h:388
void resetChildren(const std::vector< std::string > &excludedFields)
Definition: Form.cc:1139
virtual ~FormField()
Definition: Form.cc:912
FormFieldType getType() const
Definition: Form.h:341
FormFieldType type
Definition: Form.h:384
FormWidget ** widgets
Definition: Form.h:711
~FormPageWidgets()
Definition: Form.cc:2543
int numWidgets
Definition: Form.h:712
void addWidgets(const std::vector< FormField * > &addedWidgets, unsigned int page)
Definition: Form.cc:2528
FormPageWidgets(Annots *annots, unsigned int page, Form *form)
Definition: Form.cc:2489
const char * getOnStr() const
Definition: Form.cc:228
FormButtonType getButtonType() const
Definition: Form.cc:243
FormWidgetButton(PDFDoc *docA, Object *dictObj, unsigned num, Ref ref, FormField *p)
Definition: Form.cc:205
~FormWidgetButton() override
Definition: Form.cc:238
GooString * onStr
Definition: Form.h:201
FormFieldButton * parent() const
Definition: Form.cc:279
bool getState() const
Definition: Form.cc:274
void setState(bool state)
Definition: Form.cc:260
void setAppearanceState(const char *state)
Definition: Form.cc:248
void updateWidgetAppearance() override
Definition: Form.cc:255
bool noSpellCheck() const
Definition: Form.cc:462
~FormWidgetChoice() override
Definition: Form.cc:370
const GooString * getChoice(int i) const
Definition: Form.cc:437
void select(int i)
Definition: Form.cc:381
bool isListBox() const
Definition: Form.cc:472
FormFieldChoice * parent() const
Definition: Form.cc:477
void deselectAll()
Definition: Form.cc:395
bool hasEdit() const
Definition: Form.cc:452
void toggle(int i)
Definition: Form.cc:388
FormWidgetChoice(PDFDoc *docA, Object *dictObj, unsigned num, Ref ref, FormField *p)
Definition: Form.cc:365
void setEditChoice(const GooString *new_content)
Definition: Form.cc:422
bool commitOnSelChange() const
Definition: Form.cc:467
const GooString * getExportVal(int i) const
Definition: Form.cc:442
bool isMultiSelect() const
Definition: Form.cc:457
void updateWidgetAppearance() override
Definition: Form.cc:409
bool _checkRange(int i) const
Definition: Form.cc:372
const GooString * getEditChoice() const
Definition: Form.cc:400
bool isCombo() const
Definition: Form.cc:447
int getNumChoices() const
Definition: Form.cc:432
bool isSelected(int i) const
Definition: Form.cc:415
GooString * getCheckedSignature(Goffset *checkedFileSize)
Definition: Form.cc:762
const GooString * getSignature() const
Definition: Form.cc:487
bool updateOffsets(FILE *f, Goffset objStart, Goffset objEnd, Goffset *sigStart, Goffset *sigEnd, Goffset *fileSize)
Definition: Form.cc:648
void updateWidgetAppearance() override
Definition: Form.cc:767
FormWidgetSignature(PDFDoc *docA, Object *dictObj, unsigned num, Ref ref, FormField *p)
Definition: Form.cc:482
SignatureInfo * validateSignature(bool doVerifyCert, bool forceRevalidation, time_t validationTime)
Definition: Form.cc:492
bool signDocument(const char *filename, const char *certNickname, const char *digestName, const char *password, const char *reason=nullptr)
Definition: Form.cc:525
bool updateSignature(FILE *f, Goffset sigStart, Goffset sigEnd, const GooString *signature)
Definition: Form.cc:716
bool getObjectStartEnd(GooString *filename, int objNum, Goffset *objStart, Goffset *objEnd)
Definition: Form.cc:613
std::vector< Goffset > getSignedRangeBounds() const
Definition: Form.cc:757
void setSignatureType(FormSignatureType fst)
Definition: Form.cc:2054
bool createSignature(Object &vObj, Ref vRef, const GooString &name, const GooString &reason, const GooString *signature)
Definition: Form.cc:734
FormSignatureType signatureType() const
Definition: Form.cc:2049
void updateWidgetAppearance() override
Definition: Form.cc:294
bool isFileSelect() const
Definition: Form.cc:310
const GooString * getContent() const
Definition: Form.cc:289
FormWidgetText(PDFDoc *docA, Object *dictObj, unsigned num, Ref ref, FormField *p)
Definition: Form.cc:284
bool isComb() const
Definition: Form.cc:325
double getTextFontSize()
Definition: Form.cc:340
FormFieldText * parent() const
Definition: Form.cc:360
bool isPassword() const
Definition: Form.cc:305
void setContent(const GooString *new_content)
Definition: Form.cc:350
void setAppearanceContent(const GooString *new_content)
Definition: Form.cc:355
int getMaxLen() const
Definition: Form.cc:335
bool isRichText() const
Definition: Form.cc:330
void setTextFontSize(int fontSize)
Definition: Form.cc:345
bool isMultiline() const
Definition: Form.cc:300
bool noScroll() const
Definition: Form.cc:320
bool noSpellCheck() const
Definition: Form.cc:315
bool inRect(double x, double y) const
Definition: Form.cc:130
bool isReadOnly() const
Definition: Form.cc:141
LinkAction * getActivationAction()
Definition: Form.cc:187
void setPartialName(const GooString &name)
Definition: Form.cc:167
PDFDoc * doc
Definition: Form.h:163
virtual ~FormWidget()
Definition: Form.cc:110
void createWidgetAnnotation()
Definition: Form.cc:121
void print(int indent=0)
Definition: Form.cc:116
unsigned childNum
Definition: Form.h:167
FormField * field
Definition: Form.h:159
static int encodeID(unsigned pageNum, unsigned fieldNum)
Definition: Form.cc:151
void setID(unsigned int i)
Definition: Form.h:116
XRef * xref
Definition: Form.h:164
bool setAdditionalAction(Annot::FormAdditionalActionsType t, const GooString &js)
Definition: Form.cc:197
void setReadOnly(bool value)
Definition: Form.cc:146
void getRect(double *x1, double *y1, double *x2, double *y2) const
Definition: Form.cc:135
static void decodeID(unsigned id, unsigned *pageNum, unsigned *fieldNum)
Definition: Form.cc:156
const GooString * getPartialName() const
Definition: Form.cc:162
Object obj
Definition: Form.h:161
GooString * getFullyQualifiedName()
Definition: Form.cc:182
std::unique_ptr< LinkAction > getAdditionalAction(Annot::FormAdditionalActionsType type)
Definition: Form.cc:192
AnnotWidget * widget
Definition: Form.h:158
FormFieldType type
Definition: Form.h:160
FormWidget(PDFDoc *docA, Object *aobj, unsigned num, Ref aref, FormField *fieldA)
Definition: Form.cc:97
const GooString * getMappingName() const
Definition: Form.cc:177
const GooString * getAlternateUiName() const
Definition: Form.cc:172
unsigned ID
Definition: Form.h:177
Ref ref
Definition: Form.h:162
Definition: Form.h:640
FormField * findFieldByRef(Ref aref) const
Definition: Form.cc:2434
int numFields
Definition: Form.h:678
VariableTextQuadding quadding
Definition: Form.h:690
void postWidgetsLoad()
Definition: Form.cc:2412
Form(PDFDoc *docA, Object *acroForm)
Definition: Form.cc:2263
FormField * findFieldByFullyQualifiedName(const std::string &name) const
Definition: Form.cc:2444
std::vector< Ref > calculateOrder
Definition: Form.h:686
GooString * defaultAppearance
Definition: Form.h:689
static Object fieldLookup(Dict *field, const char *key)
Definition: Form.cc:2386
PDFDoc * doc
Definition: Form.h:680
Object * acroForm
Definition: Form.h:682
int size
Definition: Form.h:679
~Form()
Definition: Form.cc:2351
XRef * xref
Definition: Form.h:681
void reset(const std::vector< std::string > &fields, bool excludeFields)
Definition: Form.cc:2454
static FormField * createFieldFromDict(Object &&obj, PDFDoc *docA, const Ref aref, FormField *parent, std::set< int > *usedParents)
Definition: Form.cc:2392
FormWidget * findWidgetByRef(Ref aref)
Definition: Form.cc:2424
GfxResources * defaultResources
Definition: Form.h:684
Object resDict
Definition: Form.h:685
bool needAppearances
Definition: Form.h:683
FormField ** rootFields
Definition: Form.h:677
GString * copy()
Definition: GString.h:42
int getLength()
Definition: GString.h:80
char getChar(int i) const
Definition: GooString.h:148
GooString * del(int i, int n=1)
Definition: GooString.h:214
const std::string & toStr() const
Definition: GooString.h:72
GooString * appendf(const char *fmt,...)
Definition: GooString.cc:145
void prependUnicodeMarker()
Definition: GooString.cc:596
GooString * copy() const
Definition: GooString.h:101
bool hasUnicodeMarker() const
Definition: GooString.h:235
GooString * insert(int i, char c)
Definition: GooString.h:192
int getLength() const
Definition: GooString.h:142
GooString * append(char c)
Definition: GooString.h:161
static GBool isSpace(int c)
Definition: Lexer.cc:553
Definition: Object.h:84
Ref getRef()
Definition: Object.h:163
GBool isDict()
Definition: Object.h:137
Object * dictLookup(const char *key, Object *obj, int recursion=0)
Definition: Object.h:266
void setToNull()
Definition: Object.h:259
Array * getArray()
Definition: Object.h:160
bool getBoolWithDefaultValue(bool defaultValue) const
Definition: Object.h:520
GBool isName()
Definition: Object.h:134
GBool isRef()
Definition: Object.h:139
Object * copy(Object *obj)
Definition: Object.cc:80
void arrayAdd(Object *elem)
Definition: Object.h:239
int dictGetLength()
Definition: Object.h:254
long long getIntOrInt64() const
Definition: Object.h:474
void dictAdd(char *key, Object *val)
Definition: Object.h:257
int getInt()
Definition: Object.h:155
GBool isInt()
Definition: Object.h:130
bool isIntOrInt64() const
Definition: Object.h:363
int arrayGetLength()
Definition: Object.h:236
GBool isArray()
Definition: Object.h:136
GBool isString()
Definition: Object.h:133
GString * getString()
Definition: Object.h:158
Dict * getDict()
Definition: Object.h:161
char * dictGetKey(int i)
Definition: Object.h:272
Object * dictLookupNF(const char *key, Object *obj)
Definition: Object.h:269
void dictSet(const char *key, Object &&val)
Definition: Object.h:595
GBool isNull()
Definition: Object.h:135
Object * arrayGet(int i, Object *obj, int recursion=0)
Definition: Object.h:242
Definition: PDFDoc.h:38
BaseStream * getBaseStream()
Definition: PDFDoc.h:78
GBool saveAs(GString *name)
Definition: PDFDoc.cc:564
XRef * getXRef()
Definition: PDFDoc.h:72
GBool isOk()
Definition: PDFDoc.h:60
CertificateValidationStatus validateCertificate(time_t validation_time)
std::unique_ptr< GooString > signDetached(const char *password) const
void updateHash(unsigned char *data_block, int data_len)
std::unique_ptr< X509CertificateInfo > getCertificateInfo() const
const char * getSignerSubjectDN()
HASH_HashType getHashAlgorithm()
SignatureValidationStatus validateSignature()
void setSubFilterSupport(bool isSupported)
Definition: SignatureInfo.h:77
void setLocation(const char *)
void setSignatureValStatus(enum SignatureValidationStatus)
SignatureValidationStatus getSignatureValStatus() const
bool isSubfilterSupported() const
Definition: SignatureInfo.h:65
void setSigningTime(time_t)
void setCertificateInfo(std::unique_ptr< X509CertificateInfo >)
void setSignerName(char *)
void setHashAlgorithm(int)
void setCertificateValStatus(enum CertificateValidationStatus)
void setReason(const char *)
void setSubjectDN(const char *)
int doGetChars(int nChars, unsigned char *buffer)
Definition: Stream.h:127
Definition: XRef.h:58
Ref addIndirectObject(const Object *o)
Definition: XRef.cc:1392
XRefEntry * getEntry(int i)
Definition: XRef.h:124
Object * fetch(int num, int gen, Object *obj, int recursion=0)
Definition: XRef.cc:1155
void setModifiedObject(const Object *o, Ref r)
Definition: XRef.cc:1379
static void date(UDate when, const UChar *tz, UDateFormatStyle style, const char *format, const char *locale, UErrorCode *status)
Definition: date.c:253
#define gfree(p)
Definition: dt2dv.c:326
#define fread
Definition: xxstdio.h:25
char * strncpy()
int strcmp()
Definition: coll.cpp:143
int sscanf()
int printf()
#define error(a)
Definition: dviinfo.c:48
FcObject field
Definition: fcdefault.c:32
struct move_struct move
mpz_t * f
Definition: gen-fib.c:34
#define s
Definition: afcover.h:80
void * greallocn(void *p, int nObjs, int objSize)
Definition: gmem.cc:291
void * gmalloc(int size)
Definition: gmem.cc:139
#define c(n)
Definition: gpos-common.c:150
#define strchr
Definition: gsftopk.c:59
#define memcpy(d, s, n)
Definition: gsftopk.c:64
static int32_t fileSize(FILE *f)
Definition: icuswap.cpp:61
#define likely(x)
Definition: jbig2arith.cc:115
#define SEEK_SET
Definition: jmemansi.c:26
small capitals from c petite p scientific f u
Definition: afcover.h:88
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
FT_UInt idx
Definition: cffcmap.c:135
#define SEEK_END
Definition: ftzconf.h:251
#define EOF
Definition: afmparse.c:59
kerning y
Definition: ttdriver.c:212
T1_FIELD_DICT_PRIVATE password
Definition: t1tokens.h:64
FILE * openFile(const char *path, const char *mode)
Definition: gfile.cc:612
#define errNone
Definition: ErrorCodes.h:12
@ errSyntaxError
Definition: Error.h:25
@ errSyntaxWarning
Definition: Error.h:23
@ errUnimplemented
Definition: Error.h:32
@ errInternal
Definition: Error.h:34
@ objNull
Definition: Object.h:53
@ objName
Definition: Object.h:52
Unicode pdfDocEncoding[256]
@ xrefEntryUncompressed
Definition: XRef.h:37
int num
Definition: disdvi.c:621
#define buf
static pdf_obj * parent_name
Definition: pdfdoc.c:121
pdf_obj * entry
Definition: pdfdoc.c:64
char * strstr()
#define INT_MAX
Definition: c-minmax.h:53
#define fclose
Definition: debug.h:100
#define BLOCK_SIZE
Definition: line.c:45
int indent
Definition: main.c:118
#define fprintf
Definition: mendex.h:64
#define cstring
Definition: cpascal.h:200
#define string
Definition: ctangleboot.c:111
#define length(c)
Definition: ctangleboot.c:65
Code related to b fwrite(a, sizeof(char), b, stdout) @d C_printf(c
long time_t
Definition: types.h:18
int strncmp()
#define sprintf
Definition: snprintf.c:44
#define isdigit(c)
Definition: snprintf.c:177
int getLength(char *s)
Definition: lengths.c:99
struct array Array
const int * pos
Definition: combiners.h:905
@ aux
Definition: lyrics.c:59
#define size_t
Definition: glob.c:257
boolean selected[15]
float x
Definition: cordic.py:15
def ref(x)
Definition: pdf-org.py:104
STL namespace.
union value value
Definition: obx.h:44
#define max(a, b)
Definition: pbmto4425.c:11
char * filename[256]
Definition: pbmtopk.c:46
static char certNickname[256]
Definition: pdfsig.cc:138
static char reason[256]
Definition: pdfsig.cc:141
static char digestName[256]
Definition: pdfsig.cc:140
static struct Point current
Definition: picttoppm.c:134
static int cnt
Definition: pkout.c:166
int fontSize
Definition: plain2.c:98
char * fname
Definition: plain2.c:121
time_t dateStringToTime(const GooString *dateString)
Definition: DateInfo.cc:103
GooString * timeToDateString(const time_t *timeA)
Definition: DateInfo.cc:75
char * pdfDocEncodingToUTF16(const std::string &orig, int *length)
Definition: Form.cc:69
static char * setNextOffset(char *start, Goffset offset)
Definition: Form.cc:630
static const char * _getButtonType(FormButtonType type)
Definition: Form.cc:1236
static Object fieldLookup(Dict *field, const char *key, std::set< int > *usedParents)
Definition: Form.cc:2362
static GooString * convertToUtf16(GooString *pdfDocEncodingString)
Definition: Form.cc:87
FillValueType
Definition: Form.h:86
@ fillValue
Definition: Form.h:87
@ fillDefaultValue
Definition: Form.h:88
FormButtonType
Definition: Form.h:64
@ formButtonPush
Definition: Form.h:66
@ formButtonRadio
Definition: Form.h:67
@ formButtonCheck
Definition: Form.h:65
VariableTextQuadding
Definition: Form.h:71
@ quaddingRightJustified
Definition: Form.h:74
@ quaddingCentered
Definition: Form.h:73
@ quaddingLeftJustified
Definition: Form.h:72
FormSignatureType
Definition: Form.h:78
@ unknown_signature_type
Definition: Form.h:82
@ ETSI_CAdES_detached
Definition: Form.h:81
@ adbe_pkcs7_detached
Definition: Form.h:80
@ adbe_pkcs7_sha1
Definition: Form.h:79
FormFieldType
Definition: Form.h:55
@ formButton
Definition: Form.h:56
@ formSignature
Definition: Form.h:59
@ formChoice
Definition: Form.h:58
@ formText
Definition: Form.h:57
@ formUndef
Definition: Form.h:60
CertificateValidationStatus
Definition: SignatureInfo.h:34
SignatureValidationStatus
Definition: SignatureInfo.h:23
@ SIGNATURE_NOT_VERIFIED
Definition: SignatureInfo.h:30
@ SIGNATURE_VALID
Definition: SignatureInfo.h:24
int r
Definition: ppmqvga.c:68
static int offset
Definition: ppmtogif.c:642
bstring c int memset(void *s, int c, int length)
#define x1
#define y1
#define y2
#define x2
struct stream_s stream
Definition: pts_fax.h:93
#define flags
int Gfseek(FILE *f, Goffset offset, int whence)
Definition: gfile.cc:284
Goffset Gftell(FILE *f)
Definition: gfile.cc:299
long long Goffset
Definition: gfile.h:76
@ objHexString
Definition: Object.h:155
@ writeForceIncremental
Definition: PDFDoc.h:75
#define LL(x)
Definition: lobject.c:479
#define parent(a, t)
Definition: interp.c:105
GooString * optionName
Definition: Form.h:575
GooString * exportVal
Definition: Form.h:574
Definition: Object.h:37
static constexpr Ref INVALID()
Definition: Object.h:94
int gen
Definition: Object.h:39
int num
Definition: Object.h:38
Definition: XRef.h:41
Definition: job.h:44
Definition: filedef.h:30
Definition: mendex.h:14
int type
Definition: pdfobj.c:64
Definition: dvips.h:235
#define c2
Definition: t1io.c:53
#define c1
Definition: t1io.c:52
#define FILE
Definition: t1stdio.h:34
int j
Definition: t4ht.c:1589
#define key
Definition: tex2xindy.c:753
static struct count_rec * counter
Definition: tex4ht.c:1052
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
Definition: obx.h:51
@ start
Definition: preamble.c:52
#define nullptr
Definition: xetex.h:75
static const char * tok(parser_state *p)
Definition: y.tab.c:10456
#define end(cp)
Definition: zic.c:71