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)  

AcroForm.cc
Go to the documentation of this file.
1 //========================================================================
2 //
3 // AcroForm.cc
4 //
5 // Copyright 2012 Glyph & Cog, LLC
6 //
7 //========================================================================
8 
9 #include <aconf.h>
10 
11 #ifdef USE_GCC_PRAGMAS
12 #pragma implementation
13 #endif
14 
15 #include <stdlib.h>
16 #include <math.h>
17 #include "gmem.h"
18 #include "gmempp.h"
19 #include "GString.h"
20 #include "GList.h"
21 #include "Error.h"
22 #include "Object.h"
23 #include "PDFDoc.h"
24 #include "TextString.h"
25 #include "Gfx.h"
26 #include "GfxFont.h"
27 #include "OptionalContent.h"
28 #include "Annot.h"
29 #include "Lexer.h"
30 #include "XFAScanner.h"
31 #include "UTF8.h"
32 #include "PDF417Barcode.h"
33 #include "AcroForm.h"
34 
35 //------------------------------------------------------------------------
36 
37 #define acroFormFlagReadOnly (1 << 0) // all
38 #define acroFormFlagRequired (1 << 1) // all
39 #define acroFormFlagNoExport (1 << 2) // all
40 #define acroFormFlagMultiline (1 << 12) // text
41 #define acroFormFlagPassword (1 << 13) // text
42 #define acroFormFlagNoToggleToOff (1 << 14) // button
43 #define acroFormFlagRadio (1 << 15) // button
44 #define acroFormFlagPushbutton (1 << 16) // button
45 #define acroFormFlagCombo (1 << 17) // choice
46 #define acroFormFlagEdit (1 << 18) // choice
47 #define acroFormFlagSort (1 << 19) // choice
48 #define acroFormFlagFileSelect (1 << 20) // text
49 #define acroFormFlagMultiSelect (1 << 21) // choice
50 #define acroFormFlagDoNotSpellCheck (1 << 22) // text, choice
51 #define acroFormFlagDoNotScroll (1 << 23) // text
52 #define acroFormFlagComb (1 << 24) // text
53 #define acroFormFlagRadiosInUnison (1 << 25) // button
54 #define acroFormFlagRichText (1 << 25) // text
55 #define acroFormFlagCommitOnSelChange (1 << 26) // choice
56 
57 #define acroFormQuadLeft 0
58 #define acroFormQuadCenter 1
59 #define acroFormQuadRight 2
60 
61 #define acroFormVAlignTop 0
62 #define acroFormVAlignMiddle 1
63 #define acroFormVAlignMiddleNoDescender 2
64 #define acroFormVAlignBottom 3
65 
66 #define annotFlagHidden 0x0002
67 #define annotFlagPrint 0x0004
68 #define annotFlagNoView 0x0020
69 
70 // distance of Bezier control point from center for circle approximation
71 // = (4 * (sqrt(2) - 1) / 3) * r
72 #define bezierCircle 0.55228475
73 
74 // limit recursive field-parent lookups to avoid infinite loops
75 #define maxFieldObjectDepth 50
76 
77 //------------------------------------------------------------------------
78 
79 // 5 bars + 5 spaces -- each can be wide (1) or narrow (0)
80 // (there are always exactly 3 wide elements;
81 // the last space is always narrow)
82 static Guchar code3Of9Data[128][10] = {
83  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // 0x00
84  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
85  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
86  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
87  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
88  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
89  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
90  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
91  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
92  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
93  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
94  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
95  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
96  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
97  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
98  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
99  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // 0x10
100  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
101  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
102  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
103  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
104  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
105  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
106  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
107  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
108  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
109  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
110  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
111  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
112  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
113  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
114  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
115  { 0, 1, 1, 0, 0, 0, 1, 0, 0, 0 }, // ' ' = 0x20
116  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
117  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
118  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
119  { 0, 1, 0, 1, 0, 1, 0, 0, 0, 0 }, // '$' = 0x24
120  { 0, 0, 0, 1, 0, 1, 0, 1, 0, 0 }, // '%' = 0x25
121  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
122  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
123  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
124  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
125  { 0, 1, 0, 0, 1, 0, 1, 0, 0, 0 }, // '*' = 0x2a
126  { 0, 1, 0, 0, 0, 1, 0, 1, 0, 0 }, // '+' = 0x2b
127  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
128  { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0 }, // '-' = 0x2d
129  { 1, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, // '.' = 0x2e
130  { 0, 1, 0, 1, 0, 0, 0, 1, 0, 0 }, // '/' = 0x2f
131  { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0 }, // '0' = 0x30
132  { 1, 0, 0, 1, 0, 0, 0, 0, 1, 0 }, // '1'
133  { 0, 0, 1, 1, 0, 0, 0, 0, 1, 0 }, // '2'
134  { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0 }, // '3'
135  { 0, 0, 0, 1, 1, 0, 0, 0, 1, 0 }, // '4'
136  { 1, 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // '5'
137  { 0, 0, 1, 1, 1, 0, 0, 0, 0, 0 }, // '6'
138  { 0, 0, 0, 1, 0, 0, 1, 0, 1, 0 }, // '7'
139  { 1, 0, 0, 1, 0, 0, 1, 0, 0, 0 }, // '8'
140  { 0, 0, 1, 1, 0, 0, 1, 0, 0, 0 }, // '9'
141  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
142  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
143  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
144  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
145  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
146  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
147  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // 0x40
148  { 1, 0, 0, 0, 0, 1, 0, 0, 1, 0 }, // 'A' = 0x41
149  { 0, 0, 1, 0, 0, 1, 0, 0, 1, 0 }, // 'B'
150  { 1, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, // 'C'
151  { 0, 0, 0, 0, 1, 1, 0, 0, 1, 0 }, // 'D'
152  { 1, 0, 0, 0, 1, 1, 0, 0, 0, 0 }, // 'E'
153  { 0, 0, 1, 0, 1, 1, 0, 0, 0, 0 }, // 'F'
154  { 0, 0, 0, 0, 0, 1, 1, 0, 1, 0 }, // 'G'
155  { 1, 0, 0, 0, 0, 1, 1, 0, 0, 0 }, // 'H'
156  { 0, 0, 1, 0, 0, 1, 1, 0, 0, 0 }, // 'I'
157  { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0 }, // 'J'
158  { 1, 0, 0, 0, 0, 0, 0, 1, 1, 0 }, // 'K'
159  { 0, 0, 1, 0, 0, 0, 0, 1, 1, 0 }, // 'L'
160  { 1, 0, 1, 0, 0, 0, 0, 1, 0, 0 }, // 'M'
161  { 0, 0, 0, 0, 1, 0, 0, 1, 1, 0 }, // 'N'
162  { 1, 0, 0, 0, 1, 0, 0, 1, 0, 0 }, // 'O'
163  { 0, 0, 1, 0, 1, 0, 0, 1, 0, 0 }, // 'P' = 0x50
164  { 0, 0, 0, 0, 0, 0, 1, 1, 1, 0 }, // 'Q'
165  { 1, 0, 0, 0, 0, 0, 1, 1, 0, 0 }, // 'R'
166  { 0, 0, 1, 0, 0, 0, 1, 1, 0, 0 }, // 'S'
167  { 0, 0, 0, 0, 1, 0, 1, 1, 0, 0 }, // 'T'
168  { 1, 1, 0, 0, 0, 0, 0, 0, 1, 0 }, // 'U'
169  { 0, 1, 1, 0, 0, 0, 0, 0, 1, 0 }, // 'V'
170  { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }, // 'W'
171  { 0, 1, 0, 0, 1, 0, 0, 0, 1, 0 }, // 'X'
172  { 1, 1, 0, 0, 1, 0, 0, 0, 0, 0 }, // 'Y'
173  { 0, 1, 1, 0, 1, 0, 0, 0, 0, 0 }, // 'Z'
174  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
175  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
176  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
177  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
178  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
179  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // 0x60
180  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
181  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
182  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
183  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
184  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
185  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
186  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
187  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
188  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
189  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
190  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
191  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
192  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
193  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
194  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
195  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // 0x70
196  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
197  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
198  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
199  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
200  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
201  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
202  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
203  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
204  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
205  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
206  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
207  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
208  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
209  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
210  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
211 };
212 
213 // 3 bars + 3 spaces -- each can be 1, 2, 3, or 4 units wide
214 static Guchar code128Data[107][6] = {
215  { 2, 1, 2, 2, 2, 2 },
216  { 2, 2, 2, 1, 2, 2 },
217  { 2, 2, 2, 2, 2, 1 },
218  { 1, 2, 1, 2, 2, 3 },
219  { 1, 2, 1, 3, 2, 2 },
220  { 1, 3, 1, 2, 2, 2 },
221  { 1, 2, 2, 2, 1, 3 },
222  { 1, 2, 2, 3, 1, 2 },
223  { 1, 3, 2, 2, 1, 2 },
224  { 2, 2, 1, 2, 1, 3 },
225  { 2, 2, 1, 3, 1, 2 },
226  { 2, 3, 1, 2, 1, 2 },
227  { 1, 1, 2, 2, 3, 2 },
228  { 1, 2, 2, 1, 3, 2 },
229  { 1, 2, 2, 2, 3, 1 },
230  { 1, 1, 3, 2, 2, 2 },
231  { 1, 2, 3, 1, 2, 2 },
232  { 1, 2, 3, 2, 2, 1 },
233  { 2, 2, 3, 2, 1, 1 },
234  { 2, 2, 1, 1, 3, 2 },
235  { 2, 2, 1, 2, 3, 1 },
236  { 2, 1, 3, 2, 1, 2 },
237  { 2, 2, 3, 1, 1, 2 },
238  { 3, 1, 2, 1, 3, 1 },
239  { 3, 1, 1, 2, 2, 2 },
240  { 3, 2, 1, 1, 2, 2 },
241  { 3, 2, 1, 2, 2, 1 },
242  { 3, 1, 2, 2, 1, 2 },
243  { 3, 2, 2, 1, 1, 2 },
244  { 3, 2, 2, 2, 1, 1 },
245  { 2, 1, 2, 1, 2, 3 },
246  { 2, 1, 2, 3, 2, 1 },
247  { 2, 3, 2, 1, 2, 1 },
248  { 1, 1, 1, 3, 2, 3 },
249  { 1, 3, 1, 1, 2, 3 },
250  { 1, 3, 1, 3, 2, 1 },
251  { 1, 1, 2, 3, 1, 3 },
252  { 1, 3, 2, 1, 1, 3 },
253  { 1, 3, 2, 3, 1, 1 },
254  { 2, 1, 1, 3, 1, 3 },
255  { 2, 3, 1, 1, 1, 3 },
256  { 2, 3, 1, 3, 1, 1 },
257  { 1, 1, 2, 1, 3, 3 },
258  { 1, 1, 2, 3, 3, 1 },
259  { 1, 3, 2, 1, 3, 1 },
260  { 1, 1, 3, 1, 2, 3 },
261  { 1, 1, 3, 3, 2, 1 },
262  { 1, 3, 3, 1, 2, 1 },
263  { 3, 1, 3, 1, 2, 1 },
264  { 2, 1, 1, 3, 3, 1 },
265  { 2, 3, 1, 1, 3, 1 },
266  { 2, 1, 3, 1, 1, 3 },
267  { 2, 1, 3, 3, 1, 1 },
268  { 2, 1, 3, 1, 3, 1 },
269  { 3, 1, 1, 1, 2, 3 },
270  { 3, 1, 1, 3, 2, 1 },
271  { 3, 3, 1, 1, 2, 1 },
272  { 3, 1, 2, 1, 1, 3 },
273  { 3, 1, 2, 3, 1, 1 },
274  { 3, 3, 2, 1, 1, 1 },
275  { 3, 1, 4, 1, 1, 1 },
276  { 2, 2, 1, 4, 1, 1 },
277  { 4, 3, 1, 1, 1, 1 },
278  { 1, 1, 1, 2, 2, 4 },
279  { 1, 1, 1, 4, 2, 2 },
280  { 1, 2, 1, 1, 2, 4 },
281  { 1, 2, 1, 4, 2, 1 },
282  { 1, 4, 1, 1, 2, 2 },
283  { 1, 4, 1, 2, 2, 1 },
284  { 1, 1, 2, 2, 1, 4 },
285  { 1, 1, 2, 4, 1, 2 },
286  { 1, 2, 2, 1, 1, 4 },
287  { 1, 2, 2, 4, 1, 1 },
288  { 1, 4, 2, 1, 1, 2 },
289  { 1, 4, 2, 2, 1, 1 },
290  { 2, 4, 1, 2, 1, 1 },
291  { 2, 2, 1, 1, 1, 4 },
292  { 4, 1, 3, 1, 1, 1 },
293  { 2, 4, 1, 1, 1, 2 },
294  { 1, 3, 4, 1, 1, 1 },
295  { 1, 1, 1, 2, 4, 2 },
296  { 1, 2, 1, 1, 4, 2 },
297  { 1, 2, 1, 2, 4, 1 },
298  { 1, 1, 4, 2, 1, 2 },
299  { 1, 2, 4, 1, 1, 2 },
300  { 1, 2, 4, 2, 1, 1 },
301  { 4, 1, 1, 2, 1, 2 },
302  { 4, 2, 1, 1, 1, 2 },
303  { 4, 2, 1, 2, 1, 1 },
304  { 2, 1, 2, 1, 4, 1 },
305  { 2, 1, 4, 1, 2, 1 },
306  { 4, 1, 2, 1, 2, 1 },
307  { 1, 1, 1, 1, 4, 3 },
308  { 1, 1, 1, 3, 4, 1 },
309  { 1, 3, 1, 1, 4, 1 },
310  { 1, 1, 4, 1, 1, 3 },
311  { 1, 1, 4, 3, 1, 1 },
312  { 4, 1, 1, 1, 1, 3 },
313  { 4, 1, 1, 3, 1, 1 },
314  { 1, 1, 3, 1, 4, 1 },
315  { 1, 1, 4, 1, 3, 1 },
316  { 3, 1, 1, 1, 4, 1 },
317  { 4, 1, 1, 1, 3, 1 },
318  { 2, 1, 1, 4, 1, 2 }, // start code A
319  { 2, 1, 1, 2, 1, 4 }, // start code B
320  { 2, 1, 1, 2, 3, 2 }, // start code C
321  { 2, 3, 3, 1, 1, 1 } // stop code (without final bar)
322 };
323 
324 //------------------------------------------------------------------------
325 
326 // map an annotation ref to a page number
328 public:
329  AcroFormAnnotPage(int annotNumA, int annotGenA, int pageNumA)
330  { annotNum = annotNumA; annotGen = annotGenA; pageNum = pageNumA; }
331  int annotNum;
332  int annotGen;
333  int pageNum;
334 };
335 
336 //------------------------------------------------------------------------
337 // AcroForm
338 //------------------------------------------------------------------------
339 
341  Object acroFormObj2;
342  AcroForm *acroForm;
344  Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2;
345  int pageNum, i, j;
346 
347  // this is the normal case: acroFormObj is a dictionary, as expected
348  if (acroFormObjA->isDict()) {
349  acroForm = new AcroForm(docA, acroFormObjA);
350 
351  if (!acroFormObjA->dictLookup("XFA", &xfaObj)->isNull()) {
352  acroForm->xfaScanner = XFAScanner::load(&xfaObj);
353  if (!catalog->getNeedsRendering()) {
354  acroForm->isStaticXFA = gTrue;
355  }
356  }
357  xfaObj.free();
358 
359  if (acroFormObjA->dictLookup("NeedAppearances", &obj1)->isBool()) {
360  acroForm->needAppearances = obj1.getBool();
361  }
362  obj1.free();
363 
364  acroForm->buildAnnotPageList(catalog);
365 
366  if (!acroFormObjA->dictLookup("Fields", &obj1)->isArray()) {
367  if (!obj1.isNull()) {
368  error(errSyntaxError, -1, "AcroForm Fields entry is wrong type");
369  }
370  obj1.free();
371  delete acroForm;
372  return NULL;
373  }
374  for (i = 0; i < obj1.arrayGetLength(); ++i) {
375  obj1.arrayGetNF(i, &obj2);
376  acroForm->scanField(&obj2);
377  obj2.free();
378  }
379  obj1.free();
380 
381  // scan the annotations, looking for Widget-type annots that are
382  // not attached to the AcroForm object
383  for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
384  if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
385  for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
386  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
387  for (j = 0; j < acroForm->fields->getLength(); ++j) {
388  field = (AcroFormField *)acroForm->fields->get(j);
389  if (field->fieldRef.isRef()) {
390  if (field->fieldRef.getRefNum() == annotRef.getRefNum() &&
391  field->fieldRef.getRefGen() == annotRef.getRefGen()) {
392  break;
393  }
394  }
395  }
396  if (j == acroForm->fields->getLength()) {
397  annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
398  if (annotObj.isDict()) {
399  if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
400  acroForm->scanField(&annotRef);
401  }
402  obj1.free();
403  }
404  annotObj.free();
405  }
406  }
407  annotRef.free();
408  }
409  }
410  annotsObj.free();
411  }
412 
413  // if acroFormObjA is a null object, but there are Widget-type
414  // annots, we still create an AcroForm
415  } else {
416  // create an empty dict for acroFormObj
417  acroFormObj2.initDict(docA->getXRef());
418  acroForm = new AcroForm(docA, &acroFormObj2);
419  acroFormObj2.free();
420 
421  acroForm->buildAnnotPageList(catalog);
422 
423  // scan the annotations, looking for any Widget-type annots
424  for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
425  if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
426  for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
427  if (annotsObj.arrayGetNF(i, &annotRef)->isRef()) {
428  annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
429  if (annotObj.isDict()) {
430  if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) {
431  acroForm->scanField(&annotRef);
432  }
433  obj1.free();
434  }
435  annotObj.free();
436  }
437  annotRef.free();
438  }
439  }
440  annotsObj.free();
441  }
442 
443  if (acroForm->fields->getLength() == 0) {
444  delete acroForm;
445  acroForm = NULL;
446  }
447  }
448 
449  return acroForm;
450 }
451 
452 AcroForm::AcroForm(PDFDoc *docA, Object *acroFormObjA) {
453  doc = docA;
454  acroFormObjA->copy(&acroFormObj);
456  annotPages = new GList();
457  fields = new GList();
458  xfaScanner = NULL;
460 }
461 
463  acroFormObj.free();
466  delete xfaScanner;
467 }
468 
469 const char *AcroForm::getType() {
470  return isStaticXFA ? "static XFA" : "AcroForm";
471 }
472 
474  Object annotsObj, annotObj;
475  int pageNum, i;
476 
477  for (pageNum = 1; pageNum <= catalog->getNumPages(); ++pageNum) {
478  if (catalog->getPage(pageNum)->getAnnots(&annotsObj)->isArray()) {
479  for (i = 0; i < annotsObj.arrayGetLength(); ++i) {
480  if (annotsObj.arrayGetNF(i, &annotObj)->isRef()) {
482  annotObj.getRefGen(),
483  pageNum));
484  }
485  annotObj.free();
486  }
487  }
488  annotsObj.free();
489  }
490  //~ sort the list
491 }
492 
494  AcroFormAnnotPage *annotPage;
495  int num, gen, i;
496 
497  if (!annotRef->isRef()) {
498  return 0;
499  }
500  num = annotRef->getRefNum();
501  gen = annotRef->getRefGen();
502  //~ use bin search
503  for (i = 0; i < annotPages->getLength(); ++i) {
504  annotPage = (AcroFormAnnotPage *)annotPages->get(i);
505  if (annotPage->annotNum == num && annotPage->annotGen == gen) {
506  return annotPage->pageNum;
507  }
508  }
509  return 0;
510 }
511 
512 void AcroForm::scanField(Object *fieldRef) {
514  Object fieldObj, kidsObj, kidRef, kidObj, subtypeObj;
515  GBool isTerminal;
516  int i;
517 
518  fieldRef->fetch(doc->getXRef(), &fieldObj);
519  if (!fieldObj.isDict()) {
520  error(errSyntaxError, -1, "AcroForm field object is wrong type");
521  fieldObj.free();
522  return;
523  }
524 
525  // if this field has a Kids array, and all of the kids have a Parent
526  // reference (i.e., they're all form fields, not widget
527  // annotations), then this is a non-terminal field, and we need to
528  // scan the kids
529  isTerminal = gTrue;
530  if (fieldObj.dictLookup("Kids", &kidsObj)->isArray()) {
531  isTerminal = gFalse;
532  for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
533  kidsObj.arrayGet(i, &kidObj);
534  if (kidObj.isDict()) {
535  if (kidObj.dictLookup("Parent", &subtypeObj)->isNull()) {
536  isTerminal = gTrue;
537  }
538  subtypeObj.free();
539  }
540  kidObj.free();
541  }
542  if (!isTerminal) {
543  for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) {
544  kidsObj.arrayGetNF(i, &kidRef);
545  scanField(&kidRef);
546  kidRef.free();
547  }
548  }
549  }
550  kidsObj.free();
551 
552  if (isTerminal) {
553  if ((field = AcroFormField::load(this, fieldRef))) {
554  fields->append(field);
555  }
556  }
557 
558  fieldObj.free();
559 }
560 
561 void AcroForm::draw(int pageNum, Gfx *gfx, GBool printing) {
562  int i;
563 
564  for (i = 0; i < fields->getLength(); ++i) {
565  ((AcroFormField *)fields->get(i))->draw(pageNum, gfx, printing);
566  }
567 }
568 
570  return fields->getLength();
571 }
572 
574  return (AcroFormField *)fields->get(idx);
575 }
576 
577 AcroFormField *AcroForm::findField(int pg, double x, double y) {
579  double llx, lly, urx, ury;
580  int i;
581 
582  for (i = 0; i < fields->getLength(); ++i) {
583  field = (AcroFormField *)fields->get(i);
584  if (field->getPageNum() == pg) {
585  field->getBBox(&llx, &lly, &urx, &ury);
586  if (llx <= x && x <= urx && lly <= y && y <= ury) {
587  return field;
588  }
589  }
590  }
591  return NULL;
592 }
593 
594 int AcroForm::findFieldIdx(int pg, double x, double y) {
596  double llx, lly, urx, ury;
597  int i;
598 
599  for (i = 0; i < fields->getLength(); ++i) {
600  field = (AcroFormField *)fields->get(i);
601  if (field->getPageNum() == pg) {
602  field->getBBox(&llx, &lly, &urx, &ury);
603  if (llx <= x && x <= urx && lly <= y && y <= ury) {
604  return i;
605  }
606  }
607  }
608  return -1;
609 }
610 
611 //------------------------------------------------------------------------
612 // AcroFormField
613 //------------------------------------------------------------------------
614 
616  GString *typeStr;
617  TextString *nameA;
618  GString *xfaName;
619  Guint flagsA;
620  GBool haveFlags, typeFromParentA;
621  Object fieldObjA, parentObj, parentObj2, obj1, obj2;
622  AcroFormFieldType typeA;
623  XFAField *xfaFieldA;
625  int depth, i0, i1;
626 
627  fieldRefA->fetch(acroFormA->doc->getXRef(), &fieldObjA);
628 
629  //----- get field info
630 
631  if (fieldObjA.dictLookup("T", &obj1)->isString()) {
632  nameA = new TextString(obj1.getString());
633  } else {
634  nameA = new TextString();
635  }
636  obj1.free();
637 
638  if (fieldObjA.dictLookup("FT", &obj1)->isName()) {
639  typeStr = new GString(obj1.getName());
640  typeFromParentA = gFalse;
641  } else {
642  typeStr = NULL;
643  typeFromParentA = gTrue;
644  }
645  obj1.free();
646 
647  if (fieldObjA.dictLookup("Ff", &obj1)->isInt()) {
648  flagsA = (Guint)obj1.getInt();
649  haveFlags = gTrue;
650  } else {
651  flagsA = 0;
652  haveFlags = gFalse;
653  }
654  obj1.free();
655 
656  //----- get info from parent non-terminal fields
657 
658  fieldObjA.dictLookup("Parent", &parentObj);
659  depth = 0;
660  while (parentObj.isDict() && depth < maxFieldObjectDepth) {
661 
662  if (parentObj.dictLookup("T", &obj1)->isString()) {
663  if (nameA->getLength()) {
664  nameA->insert(0, (Unicode)'.');
665  }
666  nameA->insert(0, obj1.getString());
667  }
668  obj1.free();
669 
670  if (!typeStr) {
671  if (parentObj.dictLookup("FT", &obj1)->isName()) {
672  typeStr = new GString(obj1.getName());
673  }
674  obj1.free();
675  }
676 
677  if (!haveFlags) {
678  if (parentObj.dictLookup("Ff", &obj1)->isInt()) {
679  flagsA = (Guint)obj1.getInt();
680  haveFlags = gTrue;
681  }
682  obj1.free();
683  }
684 
685  parentObj.dictLookup("Parent", &parentObj2);
686  parentObj.free();
687  parentObj = parentObj2;
688 
689  ++depth;
690  }
691  parentObj.free();
692 
693  if (!typeStr) {
694  error(errSyntaxError, -1, "Missing type in AcroForm field");
695  goto err1;
696  }
697 
698  //----- get static XFA info
699 
700  xfaFieldA = NULL;
701  if (acroFormA->xfaScanner) {
702  // convert field name to UTF-8, and remove segments that start
703  // with '#' -- to match the XFA field name
704  xfaName = nameA->toUTF8();
705  i0 = 0;
706  while (i0 < xfaName->getLength()) {
707  i1 = i0;
708  while (i1 < xfaName->getLength()) {
709  if (xfaName->getChar(i1) == '.') {
710  ++i1;
711  break;
712  }
713  ++i1;
714  }
715  if (xfaName->getChar(i0) == '#') {
716  xfaName->del(i0, i1 - i0);
717  } else {
718  i0 = i1;
719  }
720  }
721  xfaFieldA = acroFormA->xfaScanner->findField(xfaName);
722  delete xfaName;
723  }
724 
725  //----- check for a radio button
726 
727  // this is a kludge: if we see a Btn-type field with kids, and the
728  // Ff entry is missing, assume the kids are radio buttons
729  if (typeFromParentA && !typeStr->cmp("Btn") && !haveFlags) {
730  flagsA = acroFormFlagRadio;
731  }
732 
733  //----- determine field type
734 
735  if (!typeStr->cmp("Btn")) {
736  if (flagsA & acroFormFlagPushbutton) {
737  typeA = acroFormFieldPushbutton;
738  } else if (flagsA & acroFormFlagRadio) {
739  typeA = acroFormFieldRadioButton;
740  } else {
741  typeA = acroFormFieldCheckbox;
742  }
743  } else if (!typeStr->cmp("Tx")) {
744  if (xfaFieldA && xfaFieldA->getBarcodeInfo()) {
745  typeA = acroFormFieldBarcode;
746  } else if (flagsA & acroFormFlagFileSelect) {
747  typeA = acroFormFieldFileSelect;
748  } else if (flagsA & acroFormFlagMultiline) {
750  } else {
751  typeA = acroFormFieldText;
752  }
753  } else if (!typeStr->cmp("Ch")) {
754  if (flagsA & acroFormFlagCombo) {
755  typeA = acroFormFieldComboBox;
756  } else {
757  typeA = acroFormFieldListBox;
758  }
759  } else if (!typeStr->cmp("Sig")) {
760  typeA = acroFormFieldSignature;
761  } else {
762  error(errSyntaxError, -1, "Invalid type in AcroForm field");
763  goto err1;
764  }
765  delete typeStr;
766 
767  field = new AcroFormField(acroFormA, fieldRefA, &fieldObjA,
768  typeA, nameA, flagsA, typeFromParentA, xfaFieldA);
769  fieldObjA.free();
770  return field;
771 
772  err1:
773  delete typeStr;
774  delete nameA;
775  fieldObjA.free();
776  return NULL;
777 }
778 
780  Object *fieldRefA, Object *fieldObjA,
781  AcroFormFieldType typeA, TextString *nameA,
782  Guint flagsA, GBool typeFromParentA,
783  XFAField *xfaFieldA) {
784  acroForm = acroFormA;
785  fieldRefA->copy(&fieldRef);
786  fieldObjA->copy(&fieldObj);
787  type = typeA;
788  name = nameA;
789  flags = flagsA;
790  typeFromParent = typeFromParentA;
791  xfaField = xfaFieldA;
792 }
793 
795  fieldRef.free();
796  fieldObj.free();
797  delete name;
798 }
799 
801  Object kidsObj, annotRef;
802  int pageNum;
803 
804  pageNum = 0;
805  if (fieldObj.dictLookup("Kids", &kidsObj)->isArray()) {
806  if (kidsObj.arrayGetLength() > 0) {
807  kidsObj.arrayGetNF(0, &annotRef);
808  pageNum = acroForm->lookupAnnotPage(&annotRef);
809  annotRef.free();
810  }
811  } else {
812  pageNum = acroForm->lookupAnnotPage(&fieldRef);
813  }
814  kidsObj.free();
815  return pageNum;
816 }
817 
818 const char *AcroFormField::getType() {
819  switch (type) {
820  case acroFormFieldPushbutton: return "PushButton";
821  case acroFormFieldRadioButton: return "RadioButton";
822  case acroFormFieldCheckbox: return "Checkbox";
823  case acroFormFieldFileSelect: return "FileSelect";
824  case acroFormFieldMultilineText: return "MultilineText";
825  case acroFormFieldText: return "Text";
826  case acroFormFieldBarcode: return "Barcode";
827  case acroFormFieldComboBox: return "ComboBox";
828  case acroFormFieldListBox: return "ListBox";
829  case acroFormFieldSignature: return "Signature";
830  default: return NULL;
831  }
832 }
833 
835  Unicode *u, *ret;
836  int n;
837 
838  u = name->getUnicode();
839  n = name->getLength();
840  ret = (Unicode *)gmallocn(n, sizeof(Unicode));
841  memcpy(ret, u, n * sizeof(Unicode));
842  *length = n;
843  return ret;
844 }
845 
847  Object obj1, obj2;
848  Unicode *u;
849  char *s;
850  TextString *ts;
851  GString *gs;
852  int n, i;
853 
854  u = NULL;
855  *length = 0;
856 
857  // if this field has a counterpart in the XFA form, take the value
858  // from the XFA field (NB: an XFA field with no value overrides the
859  // AcroForm value)
860  if (xfaField) {
861  if (xfaField->getValue()) {
863  }
864 
865  // no XFA form - take the AcroForm value
866  } else {
867  fieldLookup("V", &obj1);
868  if (obj1.isName()) {
869  s = obj1.getName();
870  n = (int)strlen(s);
871  u = (Unicode *)gmallocn(n, sizeof(Unicode));
872  for (i = 0; i < n; ++i) {
873  u[i] = s[i] & 0xff;
874  }
875  *length = n;
876  } else if (obj1.isString()) {
877  ts = new TextString(obj1.getString());
878  n = ts->getLength();
879  u = (Unicode *)gmallocn(n, sizeof(Unicode));
880  memcpy(u, ts->getUnicode(), n * sizeof(Unicode));
881  *length = n;
882  delete ts;
883  } else if (obj1.isDict()) {
884  obj1.dictLookup("Contents", &obj2);
885  if (obj2.isString()) {
886  gs = obj2.getString();
887  n = gs->getLength();
888  u = (Unicode *)gmallocn(n, sizeof(Unicode));
889  for (i = 0; i < n; ++i) {
890  u[i] = gs->getChar(i) & 0xff;
891  }
892  *length = n;
893  }
894  obj2.free();
895  }
896  obj1.free();
897  }
898 
899  return u;
900 }
901 
902 void AcroFormField::getBBox(double *llx, double *lly,
903  double *urx, double *ury) {
904  Object annotObj, rectObj, numObj;
905  double t;
906 
907  *llx = *lly = *urx = *ury = 0;
908 
909  if (getAnnotObj(&annotObj)->isDict()) {
910  annotObj.dictLookup("Rect", &rectObj);
911  if (rectObj.isArray() && rectObj.arrayGetLength() == 4) {
912  rectObj.arrayGet(0, &numObj);
913  if (numObj.isNum()) {
914  *llx = numObj.getNum();
915  }
916  numObj.free();
917  rectObj.arrayGet(1, &numObj);
918  if (numObj.isNum()) {
919  *lly = numObj.getNum();
920  }
921  numObj.free();
922  rectObj.arrayGet(2, &numObj);
923  if (numObj.isNum()) {
924  *urx = numObj.getNum();
925  }
926  numObj.free();
927  rectObj.arrayGet(3, &numObj);
928  if (numObj.isNum()) {
929  *ury = numObj.getNum();
930  }
931  numObj.free();
932  }
933  rectObj.free();
934  }
935  annotObj.free();
936 
937  if (*llx > *urx) {
938  t = *llx; *llx = *urx; *urx = t;
939  }
940  if (*lly > *ury) {
941  t = *lly; *lly = *ury; *ury = t;
942  }
943 }
944 
945 void AcroFormField::getFont(Ref *fontID, double *fontSize) {
946  Object daObj;
947  GList *daToks;
948  char *fontTag;
949  double tfSize, m2, m3;
950  int tfPos, tmPos, i;
951 
952  fontID->num = fontID->gen = -1;
953  *fontSize = 0;
954 
955  if (fieldLookup("DA", &daObj)->isString()) {
956 
957  // parse the default appearance string
958  daToks = tokenize(daObj.getString());
959  tfPos = tmPos = -1;
960  for (i = 2; i < daToks->getLength(); ++i) {
961  if (!((GString *)daToks->get(i))->cmp("Tf")) {
962  tfPos = i - 2;
963  } else if (i >= 6 && !((GString *)daToks->get(i))->cmp("Tm")) {
964  tmPos = i - 6;
965  }
966  }
967 
968  // handle the Tf operator
969  if (tfPos >= 0) {
970  fontTag = ((GString *)daToks->get(tfPos))->getCString();
971  if (*fontTag == '/') {
972  ++fontTag;
973  }
974  *fontID = findFontName(fontTag);
975  tfSize = atof(((GString *)daToks->get(tfPos + 1))->getCString());
976  } else {
977  tfSize = 1;
978  }
979 
980  // handle the Tm operator
981  if (tmPos >= 0) {
982  // transformed font size = sqrt(m[2]^2 + m[3]^2) * size
983  m2 = atof(((GString *)daToks->get(tfPos + 2))->getCString());
984  m3 = atof(((GString *)daToks->get(tfPos + 3))->getCString());
985  tfSize *= sqrt(m2*m2 + m3*m3);
986  }
987  *fontSize = tfSize;
988 
989  deleteGList(daToks, GString);
990  }
991 
992  daObj.free();
993 }
994 
996  Object drObj, fontDictObj, fontObj, baseFontObj;
997  Ref fontID;
998  GBool found;
999 
1000  fontID.num = fontID.gen = -1;
1001  found = gFalse;
1002 
1003  if (fieldObj.dictLookup("DR", &drObj)->isDict()) {
1004  if (drObj.dictLookup("Font", &fontDictObj)->isDict()) {
1005  if (fontDictObj.dictLookupNF(fontTag, &fontObj)->isRef()) {
1006  fontID = fontObj.getRef();
1007  found = gTrue;
1008  }
1009  fontObj.free();
1010  }
1011  fontDictObj.free();
1012  }
1013  drObj.free();
1014  if (found) {
1015  return fontID;
1016  }
1017 
1018  if (acroForm->acroFormObj.dictLookup("DR", &drObj)->isDict()) {
1019  if (drObj.dictLookup("Font", &fontDictObj)->isDict()) {
1020  if (fontDictObj.dictLookupNF(fontTag, &fontObj)->isRef()) {
1021  fontID = fontObj.getRef();
1022  }
1023  fontObj.free();
1024  }
1025  fontDictObj.free();
1026  }
1027  drObj.free();
1028  return fontID;
1029 }
1030 
1031 void AcroFormField::getColor(double *red, double *green, double *blue) {
1032  Object daObj;
1033  GList *daToks;
1034  int i;
1035 
1036  *red = *green = *blue = 0;
1037 
1038  if (fieldLookup("DA", &daObj)->isString()) {
1039 
1040  // parse the default appearance string
1041  daToks = tokenize(daObj.getString());
1042  for (i = 1; i < daToks->getLength(); ++i) {
1043 
1044  // handle the g operator
1045  if (!((GString *)daToks->get(i))->cmp("g")) {
1046  *red = *green = *blue =
1047  atof(((GString *)daToks->get(i - 1))->getCString());
1048  break;
1049 
1050  // handle the rg operator
1051  } else if (i >= 3 && !((GString *)daToks->get(i))->cmp("rg")) {
1052  *red = atof(((GString *)daToks->get(i - 3))->getCString());
1053  *green = atof(((GString *)daToks->get(i - 2))->getCString());
1054  *blue = atof(((GString *)daToks->get(i - 1))->getCString());
1055  break;
1056  }
1057  }
1058 
1059  deleteGList(daToks, GString);
1060  }
1061 
1062  daObj.free();
1063 }
1064 
1066  Object obj;
1067  int len;
1068 
1069  if (fieldLookup("MaxLen", &obj)->isInt()) {
1070  len = obj.getInt();
1071  } else {
1072  len = -1;
1073  }
1074  obj.free();
1075  return len;
1076 }
1077 
1078 void AcroFormField::draw(int pageNum, Gfx *gfx, GBool printing) {
1079  Object kidsObj, annotRef, annotObj;
1080  int i;
1081 
1082  // find the annotation object(s)
1083  if (fieldObj.dictLookup("Kids", &kidsObj)->isArray()) {
1084  for (i = 0; i < kidsObj.arrayGetLength(); ++i) {
1085  kidsObj.arrayGetNF(i, &annotRef);
1086  annotRef.fetch(acroForm->doc->getXRef(), &annotObj);
1087  drawAnnot(pageNum, gfx, printing, &annotRef, &annotObj);
1088  annotObj.free();
1089  annotRef.free();
1090  }
1091  } else {
1092  drawAnnot(pageNum, gfx, printing, &fieldRef, &fieldObj);
1093  }
1094  kidsObj.free();
1095 }
1096 
1097 void AcroFormField::drawAnnot(int pageNum, Gfx *gfx, GBool printing,
1098  Object *annotRef, Object *annotObj) {
1099  Object obj1, obj2;
1100  double xMin, yMin, xMax, yMax, t;
1101  int annotFlags;
1102  GBool oc, render;
1103 
1104  if (!annotObj->isDict()) {
1105  return;
1106  }
1107 
1108  //----- get the page number
1109 
1110  // the "P" (page) field in annotations is optional, so we can't
1111  // depend on it here
1112  if (acroForm->lookupAnnotPage(annotRef) != pageNum) {
1113  return;
1114  }
1115 
1116  //----- check annotation flags
1117 
1118  if (annotObj->dictLookup("F", &obj1)->isInt()) {
1119  annotFlags = obj1.getInt();
1120  } else {
1121  annotFlags = 0;
1122  }
1123  obj1.free();
1124  if ((annotFlags & annotFlagHidden) ||
1125  (printing && !(annotFlags & annotFlagPrint)) ||
1126  (!printing && (annotFlags & annotFlagNoView))) {
1127  return;
1128  }
1129 
1130  //----- check the optional content entry
1131 
1132  annotObj->dictLookupNF("OC", &obj1);
1133  if (acroForm->doc->getOptionalContent()->evalOCObject(&obj1, &oc) && !oc) {
1134  obj1.free();
1135  return;
1136  }
1137  obj1.free();
1138 
1139  //----- get the bounding box
1140 
1141  if (annotObj->dictLookup("Rect", &obj1)->isArray() &&
1142  obj1.arrayGetLength() == 4) {
1143  xMin = yMin = xMax = yMax = 0;
1144  if (obj1.arrayGet(0, &obj2)->isNum()) {
1145  xMin = obj2.getNum();
1146  }
1147  obj2.free();
1148  if (obj1.arrayGet(1, &obj2)->isNum()) {
1149  yMin = obj2.getNum();
1150  }
1151  obj2.free();
1152  if (obj1.arrayGet(2, &obj2)->isNum()) {
1153  xMax = obj2.getNum();
1154  }
1155  obj2.free();
1156  if (obj1.arrayGet(3, &obj2)->isNum()) {
1157  yMax = obj2.getNum();
1158  }
1159  obj2.free();
1160  if (xMin > xMax) {
1161  t = xMin; xMin = xMax; xMax = t;
1162  }
1163  if (yMin > yMax) {
1164  t = yMin; yMin = yMax; yMax = t;
1165  }
1166  } else {
1167  error(errSyntaxError, -1, "Bad bounding box for annotation");
1168  obj1.free();
1169  return;
1170  }
1171  obj1.free();
1172 
1173  //----- draw it
1174 
1175  render = gFalse;
1176  if (acroForm->needAppearances) {
1177  render = gTrue;
1178  } else if (xfaField && xfaField->getValue()) {
1179  render = gTrue;
1180  } else {
1181  if (!annotObj->dictLookup("AP", &obj1)->isDict()) {
1182  render = gTrue;
1183  }
1184  obj1.free();
1185  }
1186  if (render) {
1187  drawNewAppearance(gfx, annotObj->getDict(),
1188  xMin, yMin, xMax, yMax);
1189  } else {
1190  drawExistingAppearance(gfx, annotObj->getDict(),
1191  xMin, yMin, xMax, yMax);
1192  }
1193 }
1194 
1195 // Draw the existing appearance stream for a single annotation
1196 // attached to this field.
1198  double xMin, double yMin,
1199  double xMax, double yMax) {
1200  Object apObj, asObj, appearance, obj1;
1201 
1202  //----- get the appearance stream
1203 
1204  if (annot->lookup("AP", &apObj)->isDict()) {
1205  apObj.dictLookup("N", &obj1);
1206  if (obj1.isDict()) {
1207  if (annot->lookup("AS", &asObj)->isName()) {
1208  obj1.dictLookupNF(asObj.getName(), &appearance);
1209  } else if (obj1.dictGetLength() == 1) {
1210  obj1.dictGetValNF(0, &appearance);
1211  } else {
1212  obj1.dictLookupNF("Off", &appearance);
1213  }
1214  asObj.free();
1215  } else {
1216  apObj.dictLookupNF("N", &appearance);
1217  }
1218  obj1.free();
1219  }
1220  apObj.free();
1221 
1222  //----- draw it
1223 
1224  if (!appearance.isNone()) {
1225  gfx->drawAnnot(&appearance, NULL, xMin, yMin, xMax, yMax);
1226  appearance.free();
1227  }
1228 }
1229 
1230 // Regenerate the appearance for this field, and draw it.
1232  double xMin, double yMin,
1233  double xMax, double yMax) {
1234  GString *appearBuf;
1235  Object appearance, mkObj, ftObj, appearDict, drObj, apObj, asObj;
1236  Object resources, fontResources, defaultFont, gfxStateDict;
1237  Object obj1, obj2, obj3, obj4;
1238  Dict *mkDict;
1239  MemStream *appearStream;
1240  GfxFontDict *fontDict;
1241  GBool hasCaption;
1242  double dx, dy, r;
1243  GString *val, *caption, *da;
1244  GString **text;
1245  GBool done;
1246  GBool *selection;
1247  AnnotBorderType borderType;
1248  double borderWidth;
1249  double *borderDash;
1250  GString *appearanceState;
1251  int borderDashLength, rot, quadding, vAlign, comb, nOptions, topIdx, i;
1252 
1253  appearBuf = new GString();
1254 #if 0 //~debug
1255  appearBuf->appendf("1 1 0 rg 0 0 {0:.4f} {1:.4f} re f\n",
1256  xMax - xMin, yMax - yMin);
1257 #endif
1258 #if 0 //~debug
1259  appearBuf->appendf("1 1 0 RG 0 0 {0:.4f} {1:.4f} re s\n",
1260  xMax - xMin, yMax - yMin);
1261 #endif
1262 
1263  // get the appearance characteristics (MK) dictionary
1264  if (annot->lookup("MK", &mkObj)->isDict()) {
1265  mkDict = mkObj.getDict();
1266  } else {
1267  mkDict = NULL;
1268  }
1269 
1270  // draw the background
1271  if (mkDict) {
1272  if (mkDict->lookup("BG", &obj1)->isArray() &&
1273  obj1.arrayGetLength() > 0) {
1274  setColor(obj1.getArray(), gTrue, 0, appearBuf);
1275  appearBuf->appendf("0 0 {0:.4f} {1:.4f} re f\n",
1276  xMax - xMin, yMax - yMin);
1277  }
1278  obj1.free();
1279  }
1280 
1281  // get the field type
1282  fieldLookup("FT", &ftObj);
1283 
1284  // draw the border
1285  borderType = annotBorderSolid;
1286  borderWidth = 1;
1287  borderDash = NULL;
1288  borderDashLength = 0;
1289  if (annot->lookup("BS", &obj1)->isDict()) {
1290  if (obj1.dictLookup("S", &obj2)->isName()) {
1291  if (obj2.isName("S")) {
1292  borderType = annotBorderSolid;
1293  } else if (obj2.isName("D")) {
1294  borderType = annotBorderDashed;
1295  } else if (obj2.isName("B")) {
1296  borderType = annotBorderBeveled;
1297  } else if (obj2.isName("I")) {
1298  borderType = annotBorderInset;
1299  } else if (obj2.isName("U")) {
1300  borderType = annotBorderUnderlined;
1301  }
1302  }
1303  obj2.free();
1304  if (obj1.dictLookup("W", &obj2)->isNum()) {
1305  borderWidth = obj2.getNum();
1306  }
1307  obj2.free();
1308  if (obj1.dictLookup("D", &obj2)->isArray()) {
1309  borderDashLength = obj2.arrayGetLength();
1310  borderDash = (double *)gmallocn(borderDashLength, sizeof(double));
1311  for (i = 0; i < borderDashLength; ++i) {
1312  if (obj2.arrayGet(i, &obj3)->isNum()) {
1313  borderDash[i] = obj3.getNum();
1314  } else {
1315  borderDash[i] = 1;
1316  }
1317  obj3.free();
1318  }
1319  }
1320  obj2.free();
1321  } else {
1322  obj1.free();
1323  if (annot->lookup("Border", &obj1)->isArray()) {
1324  if (obj1.arrayGetLength() >= 3) {
1325  if (obj1.arrayGet(2, &obj2)->isNum()) {
1326  borderWidth = obj2.getNum();
1327  }
1328  obj2.free();
1329  if (obj1.arrayGetLength() >= 4) {
1330  if (obj1.arrayGet(3, &obj2)->isArray()) {
1331  borderType = annotBorderDashed;
1332  borderDashLength = obj2.arrayGetLength();
1333  borderDash = (double *)gmallocn(borderDashLength, sizeof(double));
1334  for (i = 0; i < borderDashLength; ++i) {
1335  if (obj2.arrayGet(i, &obj3)->isNum()) {
1336  borderDash[i] = obj3.getNum();
1337  } else {
1338  borderDash[i] = 1;
1339  }
1340  obj3.free();
1341  }
1342  } else {
1343  // Adobe draws no border at all if the last element is of
1344  // the wrong type.
1345  borderWidth = 0;
1346  }
1347  obj2.free();
1348  }
1349  }
1350  }
1351  }
1352  obj1.free();
1353  if (mkDict) {
1354  if (borderWidth > 0) {
1355  mkDict->lookup("BC", &obj1);
1356  if (!(obj1.isArray() && obj1.arrayGetLength() > 0)) {
1357  obj1.free();
1358  mkDict->lookup("BG", &obj1);
1359  }
1360  if (obj1.isArray() && obj1.arrayGetLength() > 0) {
1361  dx = xMax - xMin;
1362  dy = yMax - yMin;
1363 
1364  // radio buttons with no caption have a round border
1365  hasCaption = mkDict->lookup("CA", &obj2)->isString();
1366  obj2.free();
1367  if (ftObj.isName("Btn") && (flags & acroFormFlagRadio) && !hasCaption) {
1368  r = 0.5 * (dx < dy ? dx : dy);
1369  switch (borderType) {
1370  case annotBorderDashed:
1371  appearBuf->append("[");
1372  for (i = 0; i < borderDashLength; ++i) {
1373  appearBuf->appendf(" {0:.4f}", borderDash[i]);
1374  }
1375  appearBuf->append("] 0 d\n");
1376  // fall through to the solid case
1377  case annotBorderSolid:
1378  case annotBorderUnderlined:
1379  appearBuf->appendf("{0:.4f} w\n", borderWidth);
1380  setColor(obj1.getArray(), gFalse, 0, appearBuf);
1381  drawCircle(0.5 * dx, 0.5 * dy, r - 0.5 * borderWidth, "s",
1382  appearBuf);
1383  break;
1384  case annotBorderBeveled:
1385  case annotBorderInset:
1386  appearBuf->appendf("{0:.4f} w\n", 0.5 * borderWidth);
1387  setColor(obj1.getArray(), gFalse, 0, appearBuf);
1388  drawCircle(0.5 * dx, 0.5 * dy, r - 0.25 * borderWidth, "s",
1389  appearBuf);
1390  setColor(obj1.getArray(), gFalse,
1391  borderType == annotBorderBeveled ? 1 : -1,
1392  appearBuf);
1393  drawCircleTopLeft(0.5 * dx, 0.5 * dy, r - 0.75 * borderWidth,
1394  appearBuf);
1395  setColor(obj1.getArray(), gFalse,
1396  borderType == annotBorderBeveled ? -1 : 1,
1397  appearBuf);
1398  drawCircleBottomRight(0.5 * dx, 0.5 * dy, r - 0.75 * borderWidth,
1399  appearBuf);
1400  break;
1401  }
1402 
1403  } else {
1404  switch (borderType) {
1405  case annotBorderDashed:
1406  appearBuf->append("[");
1407  for (i = 0; i < borderDashLength; ++i) {
1408  appearBuf->appendf(" {0:.4f}", borderDash[i]);
1409  }
1410  appearBuf->append("] 0 d\n");
1411  // fall through to the solid case
1412  case annotBorderSolid:
1413  appearBuf->appendf("{0:.4f} w\n", borderWidth);
1414  setColor(obj1.getArray(), gFalse, 0, appearBuf);
1415  appearBuf->appendf("{0:.4f} {0:.4f} {1:.4f} {2:.4f} re s\n",
1416  0.5 * borderWidth,
1417  dx - borderWidth, dy - borderWidth);
1418  break;
1419  case annotBorderBeveled:
1420  case annotBorderInset:
1421  setColor(obj1.getArray(), gTrue,
1422  borderType == annotBorderBeveled ? 1 : -1,
1423  appearBuf);
1424  appearBuf->append("0 0 m\n");
1425  appearBuf->appendf("0 {0:.4f} l\n", dy);
1426  appearBuf->appendf("{0:.4f} {1:.4f} l\n", dx, dy);
1427  appearBuf->appendf("{0:.4f} {1:.4f} l\n",
1428  dx - borderWidth, dy - borderWidth);
1429  appearBuf->appendf("{0:.4f} {1:.4f} l\n",
1430  borderWidth, dy - borderWidth);
1431  appearBuf->appendf("{0:.4f} {0:.4f} l\n", borderWidth);
1432  appearBuf->append("f\n");
1433  setColor(obj1.getArray(), gTrue,
1434  borderType == annotBorderBeveled ? -1 : 1,
1435  appearBuf);
1436  appearBuf->append("0 0 m\n");
1437  appearBuf->appendf("{0:.4f} 0 l\n", dx);
1438  appearBuf->appendf("{0:.4f} {1:.4f} l\n", dx, dy);
1439  appearBuf->appendf("{0:.4f} {1:.4f} l\n",
1440  dx - borderWidth, dy - borderWidth);
1441  appearBuf->appendf("{0:.4f} {1:.4f} l\n",
1442  dx - borderWidth, borderWidth);
1443  appearBuf->appendf("{0:.4f} {0:.4f} l\n", borderWidth);
1444  appearBuf->append("f\n");
1445  break;
1446  case annotBorderUnderlined:
1447  appearBuf->appendf("{0:.4f} w\n", borderWidth);
1448  setColor(obj1.getArray(), gFalse, 0, appearBuf);
1449  appearBuf->appendf("0 0 m {0:.4f} 0 l s\n", dx);
1450  break;
1451  }
1452 
1453  // clip to the inside of the border
1454  appearBuf->appendf("{0:.4f} {0:.4f} {1:.4f} {2:.4f} re W n\n",
1455  borderWidth,
1456  dx - 2 * borderWidth, dy - 2 * borderWidth);
1457  }
1458  }
1459  obj1.free();
1460  }
1461  }
1462  gfree(borderDash);
1463 
1464  // get the resource dictionary
1465  buildDefaultResourceDict(&drObj);
1466 
1467  // build the font dictionary
1468  if (drObj.isDict() && drObj.dictLookup("Font", &obj1)->isDict()) {
1469  fontDict = new GfxFontDict(acroForm->doc->getXRef(), NULL, obj1.getDict());
1470  } else {
1471  fontDict = NULL;
1472  }
1473  obj1.free();
1474 
1475  // get the default appearance string
1476  if (fieldLookup("DA", &obj1)->isString()) {
1477  da = obj1.getString()->copy();
1478  } else {
1479  da = NULL;
1480  }
1481  obj1.free();
1482 
1483  // get the rotation value
1484  rot = 0;
1485  if (mkDict) {
1486  if (mkDict->lookup("R", &obj1)->isInt()) {
1487  rot = obj1.getInt();
1488  }
1489  obj1.free();
1490  }
1491 
1492  // get the appearance state
1493  annot->lookup("AP", &apObj);
1494  annot->lookup("AS", &asObj);
1495  appearanceState = NULL;
1496  if (asObj.isName()) {
1497  appearanceState = new GString(asObj.getName());
1498  } else if (apObj.isDict()) {
1499  apObj.dictLookup("N", &obj1);
1500  if (obj1.isDict() && obj1.dictGetLength() == 1) {
1501  appearanceState = new GString(obj1.dictGetKey(0));
1502  }
1503  obj1.free();
1504  }
1505  if (!appearanceState) {
1506  appearanceState = new GString("Off");
1507  }
1508  asObj.free();
1509  apObj.free();
1510 
1511  int valueLength;
1512  Unicode *value = getValue(&valueLength);
1513 
1514  // draw the field contents
1515  if (ftObj.isName("Btn")) {
1516  caption = NULL;
1517  if (mkDict) {
1518  if (mkDict->lookup("CA", &obj1)->isString()) {
1519  caption = obj1.getString()->copy();
1520  }
1521  obj1.free();
1522  }
1523  // radio button
1524  if (flags & acroFormFlagRadio) {
1525  //~ Acrobat doesn't draw a caption if there is no AP dict (?)
1526  if (value && unicodeStringEqual(value, valueLength,
1527  appearanceState->getCString())) {
1528  if (caption) {
1529  drawText(caption, da, fontDict, gFalse, 0,
1531  gFalse, gTrue, rot, 0, 0, xMax - xMin, yMax - yMin,
1532  borderWidth, gFalse, appearBuf);
1533  } else {
1534  if (mkDict) {
1535  if (mkDict->lookup("BC", &obj2)->isArray() &&
1536  obj2.arrayGetLength() > 0) {
1537  dx = xMax - xMin;
1538  dy = yMax - yMin;
1539  setColor(obj2.getArray(), gTrue, 0, appearBuf);
1540  drawCircle(0.5 * dx, 0.5 * dy, 0.2 * (dx < dy ? dx : dy), "f",
1541  appearBuf);
1542  }
1543  obj2.free();
1544  }
1545  }
1546  }
1547  // pushbutton
1548  } else if (flags & acroFormFlagPushbutton) {
1549  if (caption) {
1550  drawText(caption, da, fontDict, gFalse, 0,
1552  gFalse, gFalse, rot, 0, 0, xMax - xMin, yMax - yMin,
1553  borderWidth, gFalse, appearBuf);
1554  }
1555  // checkbox
1556  } else {
1557  if (value && !(unicodeStringEqual(value, valueLength, "Off") ||
1558  unicodeStringEqual(value, valueLength, "No") ||
1559  unicodeStringEqual(value, valueLength, "0") ||
1560  valueLength == 0)) {
1561  if (!caption) {
1562  caption = new GString("3"); // ZapfDingbats checkmark
1563  }
1564  drawText(caption, da, fontDict, gFalse, 0,
1566  gFalse, gTrue, rot, 0, 0, xMax - xMin, yMax - yMin,
1567  borderWidth, gFalse, appearBuf);
1568  }
1569  }
1570  if (caption) {
1571  delete caption;
1572  }
1573  } else if (ftObj.isName("Tx")) {
1576  if (value) {
1577  //~ value strings can be Unicode
1578  GString *valueLatin1 = unicodeToLatin1(value, valueLength);
1579  if (barcodeInfo) {
1580  drawBarcode(valueLatin1, da, fontDict, rot, xMin, yMin, xMax, yMax,
1581  barcodeInfo, appearBuf);
1582  } else {
1583  if (fieldLookup("Q", &obj2)->isInt()) {
1584  quadding = obj2.getInt();
1585  } else {
1586  quadding = acroFormQuadLeft;
1587  }
1588  obj2.free();
1592  : (XFAFieldLayoutInfo *)NULL;
1593  if (layoutInfo) {
1594  switch (layoutInfo->hAlign) {
1596  default:
1597  quadding = acroFormQuadLeft;
1598  break;
1600  quadding = acroFormQuadCenter;
1601  break;
1603  quadding = acroFormQuadRight;
1604  break;
1605  }
1606  switch (layoutInfo->vAlign) {
1608  default:
1609  vAlign = acroFormVAlignTop;
1610  break;
1612  vAlign = acroFormVAlignMiddle;
1613  break;
1615  vAlign = acroFormVAlignBottom;
1616  break;
1617  }
1618  }
1619  comb = 0;
1620  if (flags & acroFormFlagComb) {
1621  if (fieldLookup("MaxLen", &obj2)->isInt()) {
1622  comb = obj2.getInt();
1623  }
1624  obj2.free();
1625  }
1626  XFAFieldPictureInfo *pictureInfo =
1629  GString *value2 = valueLatin1;
1630  if (pictureInfo) {
1631  switch (pictureInfo->subtype) {
1633  value2 = pictureFormatDateTime(valueLatin1, pictureInfo->format);
1634  break;
1636  value2 = pictureFormatNumber(valueLatin1, pictureInfo->format);
1637  break;
1638  case xfaFieldPictureText:
1639  value2 = pictureFormatText(valueLatin1, pictureInfo->format);
1640  break;
1641  }
1642  }
1643  drawText(value2, da, fontDict,
1644  flags & acroFormFlagMultiline, comb, quadding, vAlign,
1645  gTrue, gFalse, rot, 0, 0, xMax - xMin, yMax - yMin,
1646  borderWidth, gFalse, appearBuf);
1647  if (value2 != valueLatin1) {
1648  delete value2;
1649  }
1650  }
1651  delete valueLatin1;
1652  }
1653  } else if (ftObj.isName("Ch")) {
1654  //~ value/option strings can be Unicode
1655  if (fieldLookup("Q", &obj1)->isInt()) {
1656  quadding = obj1.getInt();
1657  } else {
1658  quadding = acroFormQuadLeft;
1659  }
1660  obj1.free();
1661  vAlign = acroFormVAlignMiddle;
1663  : (XFAFieldLayoutInfo *)NULL;
1664  if (layoutInfo) {
1665  switch (layoutInfo->hAlign) {
1667  default:
1668  quadding = acroFormQuadLeft;
1669  break;
1671  quadding = acroFormQuadCenter;
1672  break;
1674  quadding = acroFormQuadRight;
1675  break;
1676  }
1677  switch (layoutInfo->vAlign) {
1679  default:
1680  vAlign = acroFormVAlignTop;
1681  break;
1683  vAlign = acroFormVAlignMiddle;
1684  break;
1686  vAlign = acroFormVAlignBottom;
1687  break;
1688  }
1689  }
1690  // combo box
1691  if (flags & acroFormFlagCombo) {
1692  if (value) {
1693  val = unicodeToLatin1(value, valueLength);
1694  if (fieldObj.dictLookup("Opt", &obj2)->isArray()) {
1695  for (i = 0, done = false; i < obj2.arrayGetLength() && !done; ++i) {
1696  obj2.arrayGet(i, &obj3);
1697  if (obj3.isArray() && obj3.arrayGetLength() == 2) {
1698  if (obj3.arrayGet(0, &obj4)->isString() &&
1699  obj4.getString()->cmp(val) == 0) {
1700  obj4.free();
1701  if (obj3.arrayGet(1, &obj4)->isString()) {
1702  delete val;
1703  val = obj4.getString()->copy();
1704  }
1705  done = gTrue;
1706  }
1707  obj4.free();
1708  }
1709  obj3.free();
1710  }
1711  }
1712  obj2.free();
1713  drawText(val, da, fontDict,
1714  gFalse, 0, quadding, vAlign, gTrue, gFalse, rot,
1715  0, 0, xMax - xMin, yMax - yMin, borderWidth,
1716  gFalse, appearBuf);
1717  delete val;
1718  //~ Acrobat draws a popup icon on the right side
1719  }
1720  // list box
1721  } else {
1722  if (fieldObj.dictLookup("Opt", &obj1)->isArray()) {
1723  nOptions = obj1.arrayGetLength();
1724  // get the option text
1725  text = (GString **)gmallocn(nOptions, sizeof(GString *));
1726  for (i = 0; i < nOptions; ++i) {
1727  text[i] = NULL;
1728  obj1.arrayGet(i, &obj2);
1729  if (obj2.isString()) {
1730  text[i] = obj2.getString()->copy();
1731  } else if (obj2.isArray() && obj2.arrayGetLength() == 2) {
1732  if (obj2.arrayGet(1, &obj3)->isString()) {
1733  text[i] = obj3.getString()->copy();
1734  }
1735  obj3.free();
1736  }
1737  obj2.free();
1738  if (!text[i]) {
1739  text[i] = new GString();
1740  }
1741  }
1742  // get the selected option(s)
1743  selection = (GBool *)gmallocn(nOptions, sizeof(GBool));
1744  //~ need to use the I field in addition to the V field
1745  for (i = 0; i < nOptions; ++i) {
1746  selection[i] = unicodeStringEqual(value, valueLength, text[i]);
1747  }
1748  // get the top index
1749  if (fieldObj.dictLookup("TI", &obj2)->isInt()) {
1750  topIdx = obj2.getInt();
1751  if (topIdx < 0 || topIdx >= nOptions) {
1752  topIdx = 0;
1753  }
1754  } else {
1755  topIdx = 0;
1756  }
1757  obj2.free();
1758  // draw the text
1759  drawListBox(text, selection, nOptions, topIdx, da, fontDict, quadding,
1760  xMin, yMin, xMax, yMax, borderWidth, appearBuf);
1761  for (i = 0; i < nOptions; ++i) {
1762  delete text[i];
1763  }
1764  gfree(text);
1765  gfree(selection);
1766  }
1767  obj1.free();
1768  }
1769  } else if (ftObj.isName("Sig")) {
1770  //~ check to see if background is already drawn
1771  gfxStateDict.initDict(acroForm->doc->getXRef());
1772  obj1.initReal(0.5);
1773  gfxStateDict.dictAdd(copyString("ca"), &obj1);
1774  appearBuf->append("/GS1 gs\n");
1775  appearBuf->appendf("0.7 0.7 1 rg 0 0 {0:.2f} {1:.2f} re f\n",
1776  xMax - xMin, yMax - yMin);
1777  caption = new GString("SIGN HERE");
1778  if (da) {
1779  delete da;
1780  }
1781  da = new GString("/Helv 10 Tf 1 0 0 rg");
1782  drawText(caption, da, fontDict, gFalse, 0,
1784  0, 0, xMax - xMin, yMax - yMin, borderWidth, gFalse, appearBuf);
1785  delete caption;
1786  } else {
1787  error(errSyntaxError, -1, "Unknown field type");
1788  }
1789 
1790  gfree(value);
1791 
1792  delete appearanceState;
1793  if (da) {
1794  delete da;
1795  }
1796 
1797  // build the appearance stream dictionary
1798  appearDict.initDict(acroForm->doc->getXRef());
1799  appearDict.dictAdd(copyString("Length"),
1800  obj1.initInt(appearBuf->getLength()));
1801  appearDict.dictAdd(copyString("Subtype"), obj1.initName("Form"));
1802  obj1.initArray(acroForm->doc->getXRef());
1803  obj1.arrayAdd(obj2.initReal(0));
1804  obj1.arrayAdd(obj2.initReal(0));
1805  obj1.arrayAdd(obj2.initReal(xMax - xMin));
1806  obj1.arrayAdd(obj2.initReal(yMax - yMin));
1807  appearDict.dictAdd(copyString("BBox"), &obj1);
1808 
1809  // set the resource dictionary; add a default font
1810  if (drObj.isDict()) {
1811  drObj.copy(&resources);
1812  } else {
1813  resources.initDict(acroForm->doc->getXRef());
1814  }
1815  drObj.free();
1816  fontResources.initDict(acroForm->doc->getXRef());
1817  if (resources.dictLookup("Font", &obj1)->isDict()) {
1818  for (i = 0; i < obj1.dictGetLength(); ++i) {
1819  obj1.dictGetValNF(i, &obj2);
1820  fontResources.dictAdd(copyString(obj1.dictGetKey(i)), &obj2);
1821  }
1822  }
1823  obj1.free();
1824  defaultFont.initDict(acroForm->doc->getXRef());
1825  defaultFont.dictAdd(copyString("Type"), obj1.initName("Font"));
1826  defaultFont.dictAdd(copyString("Subtype"), obj1.initName("Type1"));
1827  defaultFont.dictAdd(copyString("BaseFont"), obj1.initName("Helvetica"));
1828  defaultFont.dictAdd(copyString("Encoding"), obj1.initName("WinAnsiEncoding"));
1829  fontResources.dictAdd(copyString("xpdf_default_font"), &defaultFont);
1830  resources.dictAdd(copyString("Font"), &fontResources);
1831  if (gfxStateDict.isDict()) {
1832  obj1.initDict(acroForm->doc->getXRef());
1833  obj1.dictAdd(copyString("GS1"), &gfxStateDict);
1834  resources.dictAdd(copyString("ExtGState"), &obj1);
1835  }
1836  appearDict.dictAdd(copyString("Resources"), &resources);
1837 
1838  // build the appearance stream
1839  appearStream = new MemStream(appearBuf->getCString(), 0,
1840  appearBuf->getLength(), &appearDict);
1841  appearance.initStream(appearStream);
1842 
1843  // draw it
1844  gfx->drawAnnot(&appearance, NULL, xMin, yMin, xMax, yMax);
1845 
1846  appearance.free();
1847  delete appearBuf;
1848  appearBuf = NULL;
1849  if (fontDict) {
1850  delete fontDict;
1851  }
1852  ftObj.free();
1853  mkObj.free();
1854 }
1855 
1856 // Set the current fill or stroke color, based on <a> (which should
1857 // have 1, 3, or 4 elements). If <adjust> is +1, color is brightened;
1858 // if <adjust> is -1, color is darkened; otherwise color is not
1859 // modified.
1861  GString *appearBuf) {
1862  Object obj1;
1863  double color[4];
1864  int nComps, i;
1865 
1866  nComps = a->getLength();
1867  if (nComps > 4) {
1868  nComps = 4;
1869  }
1870  for (i = 0; i < nComps && i < 4; ++i) {
1871  if (a->get(i, &obj1)->isNum()) {
1872  color[i] = obj1.getNum();
1873  } else {
1874  color[i] = 0;
1875  }
1876  obj1.free();
1877  }
1878  if (nComps == 4) {
1879  adjust = -adjust;
1880  }
1881  if (adjust > 0) {
1882  for (i = 0; i < nComps; ++i) {
1883  color[i] = 0.5 * color[i] + 0.5;
1884  }
1885  } else if (adjust < 0) {
1886  for (i = 0; i < nComps; ++i) {
1887  color[i] = 0.5 * color[i];
1888  }
1889  }
1890  if (nComps == 4) {
1891  appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:c}\n",
1892  color[0], color[1], color[2], color[3],
1893  fill ? 'k' : 'K');
1894  } else if (nComps == 3) {
1895  appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:s}\n",
1896  color[0], color[1], color[2],
1897  fill ? "rg" : "RG");
1898  } else {
1899  appearBuf->appendf("{0:.2f} {1:c}\n",
1900  color[0],
1901  fill ? 'g' : 'G');
1902  }
1903 }
1904 
1905 // Draw the variable text or caption for a field.
1907  GBool multiline, int comb,
1908  int quadding, int vAlign,
1909  GBool txField, GBool forceZapfDingbats, int rot,
1910  double x, double y, double width, double height,
1911  double border, GBool whiteBackground,
1912  GString *appearBuf) {
1913  GString *text2;
1914  GList *daToks;
1915  GString *tok;
1916  GfxFont *font;
1917  double dx, dy;
1918  double fontSize, fontSize2, topBorder, xx, xPrev, yy, w, wMax;
1919  double offset, offset2, charWidth, ascent, descent;
1920  int tfPos, tmPos, nLines, i, j, k, c;
1921 
1922  //~ if there is no MK entry, this should use the existing content stream,
1923  //~ and only replace the marked content portion of it
1924  //~ (this is only relevant for Tx fields)
1925 
1926  // check for a Unicode string
1927  //~ this currently drops all non-Latin1 characters
1928  if (text->getLength() >= 2 &&
1929  text->getChar(0) == '\xfe' && text->getChar(1) == '\xff') {
1930  text2 = new GString();
1931  for (i = 2; i+1 < text->getLength(); i += 2) {
1932  c = ((text->getChar(i) & 0xff) << 8) + (text->getChar(i+1) & 0xff);
1933  if (c <= 0xff) {
1934  text2->append((char)c);
1935  } else {
1936  text2->append('?');
1937  }
1938  }
1939  } else {
1940  text2 = text;
1941  }
1942  if (text2->getLength() == 0) {
1943  if (text2 != text) {
1944  delete text2;
1945  }
1946  return;
1947  }
1948 
1949  // parse the default appearance string
1950  tfPos = tmPos = -1;
1951  if (da) {
1952  daToks = tokenize(da);
1953  for (i = 2; i < daToks->getLength(); ++i) {
1954  if (!((GString *)daToks->get(i))->cmp("Tf")) {
1955  tfPos = i - 2;
1956  } else if (i >= 6 && !((GString *)daToks->get(i))->cmp("Tm")) {
1957  tmPos = i - 6;
1958  }
1959  }
1960  } else {
1961  daToks = NULL;
1962  }
1963 
1964  // force ZapfDingbats
1965  //~ this should create the font if needed (?)
1966  if (forceZapfDingbats) {
1967  if (tfPos >= 0) {
1968  tok = (GString *)daToks->get(tfPos);
1969  if (tok->cmp("/ZaDb")) {
1970  tok->clear();
1971  tok->append("/ZaDb");
1972  }
1973  }
1974  }
1975 
1976  // get the font and font size
1977  font = NULL;
1978  fontSize = 0;
1979  if (tfPos >= 0) {
1980  tok = (GString *)daToks->get(tfPos);
1981  if (tok->getLength() >= 1 && tok->getChar(0) == '/') {
1982  if (!fontDict || !(font = fontDict->lookup(tok->getCString() + 1))) {
1983  error(errSyntaxError, -1, "Unknown font in field's DA string");
1984  tok->clear();
1985  tok->append("/xpdf_default_font");
1986  }
1987  } else {
1988  error(errSyntaxError, -1,
1989  "Invalid font name in 'Tf' operator in field's DA string");
1990  }
1991  tok = (GString *)daToks->get(tfPos + 1);
1992  fontSize = atof(tok->getCString());
1993  } else {
1994  error(errSyntaxError, -1, "Missing 'Tf' operator in field's DA string");
1995  fontSize = 0;
1996  if (!daToks) {
1997  daToks = new GList();
1998  }
1999  tfPos = daToks->getLength();
2000  daToks->append(new GString("/xpdf_default_font"));
2001  daToks->append(new GString("10"));
2002  daToks->append(new GString("Tf"));
2003  }
2004 
2005  // setup
2006  if (txField) {
2007  appearBuf->append("/Tx BMC\n");
2008  }
2009  appearBuf->append("q\n");
2010  if (rot == 90) {
2011  appearBuf->appendf("0 1 -1 0 {0:.4f} 0 cm\n", width);
2012  dx = height;
2013  dy = width;
2014  } else if (rot == 180) {
2015  appearBuf->appendf("-1 0 0 -1 {0:.4f} {1:.4f} cm\n", width, height);
2016  dx = width;
2017  dy = height;
2018  } else if (rot == 270) {
2019  appearBuf->appendf("0 -1 1 0 0 {0:.4f} cm\n", height);
2020  dx = height;
2021  dy = width;
2022  } else { // assume rot == 0
2023  dx = width;
2024  dy = height;
2025  }
2026 
2027  // multi-line text
2028  if (multiline) {
2029  // note: the comb flag is ignored in multiline mode
2030 
2031  wMax = dx - 2 * border - 4;
2032 
2033 #if 1 //~tmp
2034  // this is a kludge that appears to match Adobe's behavior
2035  if (height > 15) {
2036  topBorder = 5;
2037  } else {
2038  topBorder = 2;
2039  }
2040 #else
2041  topBorder = 5;
2042 #endif
2043 
2044  // compute font autosize
2045  if (fontSize == 0) {
2046  for (fontSize = 10; fontSize > 1; --fontSize) {
2047  yy = dy - topBorder;
2048  i = 0;
2049  while (i < text2->getLength()) {
2050  getNextLine(text2, i, font, fontSize, wMax, &j, &w, &k);
2051  i = k;
2052  yy -= fontSize;
2053  }
2054  // approximate the descender for the last line
2055  if (yy >= 0.25 * fontSize && w <= wMax) {
2056  break;
2057  }
2058  }
2059  if (tfPos >= 0) {
2060  tok = (GString *)daToks->get(tfPos + 1);
2061  tok->clear();
2062  tok->appendf("{0:.2f}", fontSize);
2063  }
2064  }
2065 
2066  // starting y coordinate
2067  nLines = 0;
2068  i = 0;
2069  while (i < text2->getLength()) {
2070  getNextLine(text2, i, font, fontSize, wMax, &j, &w, &k);
2071  i = k;
2072  ++nLines;
2073  }
2074  if (font) {
2075  ascent = font->getDeclaredAscent() * fontSize;
2076  descent = font->getDescent() * fontSize;
2077  } else {
2078  ascent = 0.75 * fontSize;
2079  descent = -0.25 * fontSize;
2080  }
2081  switch (vAlign) {
2082  case acroFormVAlignTop:
2083  default:
2084  yy = dy - ascent - topBorder;
2085  break;
2086  case acroFormVAlignMiddle:
2087  yy = 0.5 * (dy - nLines * fontSize) + (nLines - 1) * fontSize - descent;
2088  break;
2090  yy = 0.5 * (dy - nLines * fontSize) + (nLines - 1) * fontSize;
2091  break;
2092  case acroFormVAlignBottom:
2093  yy = (nLines - 1) * fontSize - descent;
2094  break;
2095  }
2096  // if the field is shorter than a line of text, Acrobat positions
2097  // the text relative to the bottom edge
2098  if (dy < fontSize + topBorder) {
2099  yy = 2 - descent;
2100  }
2101  // each line of text starts with a Td operator that moves down a
2102  // line -- so move up a line here
2103  yy += fontSize;
2104 
2105  appearBuf->append("BT\n");
2106 
2107  // set the font matrix
2108  if (tmPos >= 0) {
2109  tok = (GString *)daToks->get(tmPos + 4);
2110  tok->clear();
2111  tok->appendf("{0:.4f}", x);
2112  tok = (GString *)daToks->get(tmPos + 5);
2113  tok->clear();
2114  tok->appendf("{0:.4f}", y + yy);
2115  }
2116 
2117  // write the DA string
2118  if (daToks) {
2119  for (i = 0; i < daToks->getLength(); ++i) {
2120  appearBuf->append((GString *)daToks->get(i))->append(' ');
2121  }
2122  }
2123 
2124  // write the font matrix (if not part of the DA string)
2125  if (tmPos < 0) {
2126  appearBuf->appendf("1 0 0 1 {0:.4f} {1:.4f} Tm\n", x, y + yy);
2127  }
2128 
2129  // write a series of lines of text
2130  i = 0;
2131  xPrev = 0;
2132  while (i < text2->getLength()) {
2133 
2134  getNextLine(text2, i, font, fontSize, wMax, &j, &w, &k);
2135 
2136  // compute text start position
2137  switch (quadding) {
2138  case acroFormQuadLeft:
2139  default:
2140  xx = border + 2;
2141  break;
2142  case acroFormQuadCenter:
2143  xx = (dx - w) / 2;
2144  break;
2145  case acroFormQuadRight:
2146  xx = dx - border - 2 - w;
2147  break;
2148  }
2149 
2150  // draw the line
2151  appearBuf->appendf("{0:.4f} {1:.4f} Td\n", xx - xPrev, -fontSize);
2152  appearBuf->append('(');
2153  for (; i < j; ++i) {
2154  c = text2->getChar(i) & 0xff;
2155  if (c == '(' || c == ')' || c == '\\') {
2156  appearBuf->append('\\');
2157  appearBuf->append((char)c);
2158  } else if (c < 0x20 || c >= 0x80) {
2159  appearBuf->appendf("\\{0:03o}", c);
2160  } else {
2161  appearBuf->append((char)c);
2162  }
2163  }
2164  appearBuf->append(") Tj\n");
2165 
2166  // next line
2167  i = k;
2168  xPrev = xx;
2169  }
2170 
2171  appearBuf->append("ET\n");
2172 
2173  // single-line text
2174  } else {
2175  //~ replace newlines with spaces? - what does Acrobat do?
2176 
2177  // comb formatting
2178  if (comb > 0) {
2179 
2180  // compute comb spacing
2181  w = dx / comb;
2182 
2183  // compute font autosize
2184  if (fontSize == 0) {
2185  fontSize = dy - 2 * border;
2186  if (w < fontSize) {
2187  fontSize = w;
2188  }
2189  fontSize = floor(fontSize);
2190  if (fontSize > 10) {
2191  fontSize = 10;
2192  }
2193  if (tfPos >= 0) {
2194  tok = (GString *)daToks->get(tfPos + 1);
2195  tok->clear();
2196  tok->appendf("{0:.4f}", fontSize);
2197  }
2198  }
2199 
2200  // compute text start position
2201  switch (quadding) {
2202  case acroFormQuadLeft:
2203  default:
2204  xx = 0;
2205  break;
2206  case acroFormQuadCenter:
2207  xx = ((comb - text2->getLength()) / 2) * w;
2208  break;
2209  case acroFormQuadRight:
2210  xx = (comb - text2->getLength()) * w;
2211  break;
2212  }
2213  if (font) {
2214  ascent = font->getDeclaredAscent() * fontSize;
2215  descent = font->getDescent() * fontSize;
2216  } else {
2217  ascent = 0.75 * fontSize;
2218  descent = -0.25 * fontSize;
2219  }
2220  switch (vAlign) {
2221  case acroFormVAlignTop:
2222  default:
2223  yy = dy - ascent;
2224  break;
2225  case acroFormVAlignMiddle:
2226  yy = 0.5 * (dy - ascent - descent);
2227  break;
2229  yy = 0.5 * (dy - ascent);
2230  break;
2231  case acroFormVAlignBottom:
2232  yy = -descent;
2233  break;
2234  }
2235 
2236  appearBuf->append("BT\n");
2237 
2238  // set the font matrix
2239  if (tmPos >= 0) {
2240  tok = (GString *)daToks->get(tmPos + 4);
2241  tok->clear();
2242  tok->appendf("{0:.4f}", x + xx);
2243  tok = (GString *)daToks->get(tmPos + 5);
2244  tok->clear();
2245  tok->appendf("{0:.4f}", y + yy);
2246  }
2247 
2248  // write the DA string
2249  if (daToks) {
2250  for (i = 0; i < daToks->getLength(); ++i) {
2251  appearBuf->append((GString *)daToks->get(i))->append(' ');
2252  }
2253  }
2254 
2255  // write the font matrix (if not part of the DA string)
2256  if (tmPos < 0) {
2257  appearBuf->appendf("1 0 0 1 {0:.4f} {1:.4f} Tm\n", x + xx, y + yy);
2258  }
2259 
2260  // write the text string
2261  offset = 0;
2262  for (i = 0; i < text2->getLength(); ++i) {
2263  c = text2->getChar(i) & 0xff;
2264  if (c >= 0x20 && c < 0x80) {
2265  if (font && !font->isCIDFont()) {
2266  charWidth = ((Gfx8BitFont *)font)->getWidth((Guchar)c) * fontSize;
2267  } else {
2268  // otherwise, make a crude estimate
2269  charWidth = 0.5 * fontSize;
2270  }
2271  offset2 = 0.5 * (w - charWidth);
2272  appearBuf->appendf("{0:.4f} 0 Td\n", offset + offset2);
2273  if (c == '(' || c == ')' || c == '\\') {
2274  appearBuf->appendf("(\\{0:c}) Tj\n", c);
2275  } else {
2276  appearBuf->appendf("({0:c}) Tj\n", c);
2277  }
2278  offset = w - offset2;
2279  } else {
2280  offset += w;
2281  }
2282  }
2283 
2284  appearBuf->append("ET\n");
2285 
2286  // regular (non-comb) formatting
2287  } else {
2288 
2289  // compute string width
2290  if (font && !font->isCIDFont()) {
2291  w = 0;
2292  for (i = 0; i < text2->getLength(); ++i) {
2293  w += ((Gfx8BitFont *)font)->getWidth(text2->getChar(i));
2294  }
2295  } else {
2296  // otherwise, make a crude estimate
2297  w = text2->getLength() * 0.5;
2298  }
2299 
2300  // compute font autosize
2301  if (fontSize == 0) {
2302  fontSize = dy - 2 * border;
2303  fontSize2 = (dx - 4 - 2 * border) / w;
2304  if (fontSize2 < fontSize) {
2305  fontSize = fontSize2;
2306  }
2307  fontSize = floor(fontSize);
2308  if (fontSize > 10) {
2309  fontSize = 10;
2310  }
2311  if (tfPos >= 0) {
2312  tok = (GString *)daToks->get(tfPos + 1);
2313  tok->clear();
2314  tok->appendf("{0:.4f}", fontSize);
2315  }
2316  }
2317 
2318  // compute text start position
2319  w *= fontSize;
2320  switch (quadding) {
2321  case acroFormQuadLeft:
2322  default:
2323  xx = border + 2;
2324  break;
2325  case acroFormQuadCenter:
2326  xx = (dx - w) / 2;
2327  break;
2328  case acroFormQuadRight:
2329  xx = dx - border - 2 - w;
2330  break;
2331  }
2332  if (font) {
2333  ascent = font->getDeclaredAscent() * fontSize;
2334  descent = font->getDescent() * fontSize;
2335  } else {
2336  ascent = 0.75 * fontSize;
2337  descent = -0.25 * fontSize;
2338  }
2339  switch (vAlign) {
2340  case acroFormVAlignTop:
2341  default:
2342  yy = dy - ascent;
2343  break;
2344  case acroFormVAlignMiddle:
2345  yy = 0.5 * (dy - ascent - descent);
2346  break;
2348  yy = 0.5 * (dy - ascent);
2349  break;
2350  case acroFormVAlignBottom:
2351  yy = -descent;
2352  break;
2353  }
2354 
2355  if (whiteBackground) {
2356  appearBuf->appendf("q 1 g {0:.4f} {1:.4f} {2:.4f} {3:.4f} re f Q\n",
2357  xx - 0.25 * fontSize, yy - 0.35 * fontSize,
2358  w + 0.5 * fontSize, 1.2 * fontSize);
2359  }
2360 
2361  appearBuf->append("BT\n");
2362 
2363  // set the font matrix
2364  if (tmPos >= 0) {
2365  tok = (GString *)daToks->get(tmPos + 4);
2366  tok->clear();
2367  tok->appendf("{0:.4f}", x + xx);
2368  tok = (GString *)daToks->get(tmPos + 5);
2369  tok->clear();
2370  tok->appendf("{0:.4f}", y + yy);
2371  }
2372 
2373  // write the DA string
2374  if (daToks) {
2375  for (i = 0; i < daToks->getLength(); ++i) {
2376  appearBuf->append((GString *)daToks->get(i))->append(' ');
2377  }
2378  }
2379 
2380  // write the font matrix (if not part of the DA string)
2381  if (tmPos < 0) {
2382  appearBuf->appendf("1 0 0 1 {0:.4f} {1:.4f} Tm\n", x + xx, y + yy);
2383  }
2384 
2385  // write the text string
2386  appearBuf->append('(');
2387  for (i = 0; i < text2->getLength(); ++i) {
2388  c = text2->getChar(i) & 0xff;
2389  if (c == '(' || c == ')' || c == '\\') {
2390  appearBuf->append('\\');
2391  appearBuf->append((char)c);
2392  } else if (c < 0x20 || c >= 0x80) {
2393  appearBuf->appendf("\\{0:03o}", c);
2394  } else {
2395  appearBuf->append((char)c);
2396  }
2397  }
2398  appearBuf->append(") Tj\n");
2399  }
2400 
2401  appearBuf->append("ET\n");
2402  }
2403 
2404  // cleanup
2405  appearBuf->append("Q\n");
2406  if (txField) {
2407  appearBuf->append("EMC\n");
2408  }
2409 
2410  if (daToks) {
2411  deleteGList(daToks, GString);
2412  }
2413  if (text2 != text) {
2414  delete text2;
2415  }
2416 }
2417 
2418 // Draw the variable text or caption for a field.
2420  int nOptions, int topIdx,
2421  GString *da, GfxFontDict *fontDict,
2422  GBool quadding, double xMin, double yMin,
2423  double xMax, double yMax, double border,
2424  GString *appearBuf) {
2425  GList *daToks;
2426  GString *tok;
2427  GfxFont *font;
2428  double fontSize, fontSize2, x, y, w, wMax;
2429  int tfPos, tmPos, i, j, c;
2430 
2431  //~ if there is no MK entry, this should use the existing content stream,
2432  //~ and only replace the marked content portion of it
2433  //~ (this is only relevant for Tx fields)
2434 
2435  // parse the default appearance string
2436  tfPos = tmPos = -1;
2437  if (da) {
2438  daToks = tokenize(da);
2439  for (i = 2; i < daToks->getLength(); ++i) {
2440  if (i >= 2 && !((GString *)daToks->get(i))->cmp("Tf")) {
2441  tfPos = i - 2;
2442  } else if (i >= 6 && !((GString *)daToks->get(i))->cmp("Tm")) {
2443  tmPos = i - 6;
2444  }
2445  }
2446  } else {
2447  daToks = NULL;
2448  }
2449 
2450  // get the font and font size
2451  font = NULL;
2452  fontSize = 0;
2453  if (tfPos >= 0) {
2454  tok = (GString *)daToks->get(tfPos);
2455  if (tok->getLength() >= 1 && tok->getChar(0) == '/') {
2456  if (!fontDict || !(font = fontDict->lookup(tok->getCString() + 1))) {
2457  error(errSyntaxError, -1, "Unknown font in field's DA string");
2458  tok->clear();
2459  tok->append("/xpdf_default_font");
2460  }
2461  } else {
2462  error(errSyntaxError, -1,
2463  "Invalid font name in 'Tf' operator in field's DA string");
2464  }
2465  tok = (GString *)daToks->get(tfPos + 1);
2466  fontSize = atof(tok->getCString());
2467  } else {
2468  error(errSyntaxError, -1, "Missing 'Tf' operator in field's DA string");
2469  }
2470 
2471  // compute font autosize
2472  if (fontSize == 0) {
2473  wMax = 0;
2474  for (i = 0; i < nOptions; ++i) {
2475  if (font && !font->isCIDFont()) {
2476  w = 0;
2477  for (j = 0; j < text[i]->getLength(); ++j) {
2478  w += ((Gfx8BitFont *)font)->getWidth(text[i]->getChar(j));
2479  }
2480  } else {
2481  // otherwise, make a crude estimate
2482  w = text[i]->getLength() * 0.5;
2483  }
2484  if (w > wMax) {
2485  wMax = w;
2486  }
2487  }
2488  fontSize = yMax - yMin - 2 * border;
2489  fontSize2 = (xMax - xMin - 4 - 2 * border) / wMax;
2490  if (fontSize2 < fontSize) {
2491  fontSize = fontSize2;
2492  }
2493  fontSize = floor(fontSize);
2494  if (fontSize > 10) {
2495  fontSize = 10;
2496  }
2497  if (tfPos >= 0) {
2498  tok = (GString *)daToks->get(tfPos + 1);
2499  tok->clear();
2500  tok->appendf("{0:.4f}", fontSize);
2501  }
2502  }
2503 
2504  // draw the text
2505  y = yMax - yMin - 1.1 * fontSize;
2506  for (i = topIdx; i < nOptions; ++i) {
2507 
2508  // setup
2509  appearBuf->append("q\n");
2510 
2511  // draw the background if selected
2512  if (selection[i]) {
2513  appearBuf->append("0 g f\n");
2514  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} re f\n",
2515  border,
2516  y - 0.2 * fontSize,
2517  xMax - xMin - 2 * border,
2518  1.1 * fontSize);
2519  }
2520 
2521  // setup
2522  appearBuf->append("BT\n");
2523 
2524  // compute string width
2525  if (font && !font->isCIDFont()) {
2526  w = 0;
2527  for (j = 0; j < text[i]->getLength(); ++j) {
2528  w += ((Gfx8BitFont *)font)->getWidth(text[i]->getChar(j));
2529  }
2530  } else {
2531  // otherwise, make a crude estimate
2532  w = text[i]->getLength() * 0.5;
2533  }
2534 
2535  // compute text start position
2536  w *= fontSize;
2537  switch (quadding) {
2538  case acroFormQuadLeft:
2539  default:
2540  x = border + 2;
2541  break;
2542  case acroFormQuadCenter:
2543  x = (xMax - xMin - w) / 2;
2544  break;
2545  case acroFormQuadRight:
2546  x = xMax - xMin - border - 2 - w;
2547  break;
2548  }
2549 
2550  // set the font matrix
2551  if (tmPos >= 0) {
2552  tok = (GString *)daToks->get(tmPos + 4);
2553  tok->clear();
2554  tok->appendf("{0:.4f}", x);
2555  tok = (GString *)daToks->get(tmPos + 5);
2556  tok->clear();
2557  tok->appendf("{0:.4f}", y);
2558  }
2559 
2560  // write the DA string
2561  if (daToks) {
2562  for (j = 0; j < daToks->getLength(); ++j) {
2563  appearBuf->append((GString *)daToks->get(j))->append(' ');
2564  }
2565  }
2566 
2567  // write the font matrix (if not part of the DA string)
2568  if (tmPos < 0) {
2569  appearBuf->appendf("1 0 0 1 {0:.4f} {1:.4f} Tm\n", x, y);
2570  }
2571 
2572  // change the text color if selected
2573  if (selection[i]) {
2574  appearBuf->append("1 g\n");
2575  }
2576 
2577  // write the text string
2578  appearBuf->append('(');
2579  for (j = 0; j < text[i]->getLength(); ++j) {
2580  c = text[i]->getChar(j) & 0xff;
2581  if (c == '(' || c == ')' || c == '\\') {
2582  appearBuf->append('\\');
2583  appearBuf->append((char)c);
2584  } else if (c < 0x20 || c >= 0x80) {
2585  appearBuf->appendf("\\{0:03o}", c);
2586  } else {
2587  appearBuf->append((char)c);
2588  }
2589  }
2590  appearBuf->append(") Tj\n");
2591 
2592  // cleanup
2593  appearBuf->append("ET\n");
2594  appearBuf->append("Q\n");
2595 
2596  // next line
2597  y -= 1.1 * fontSize;
2598  }
2599 
2600  if (daToks) {
2601  deleteGList(daToks, GString);
2602  }
2603 }
2604 
2605 // Figure out how much text will fit on the next line. Returns:
2606 // *end = one past the last character to be included
2607 // *width = width of the characters start .. end-1
2608 // *next = index of first character on the following line
2610  GfxFont *font, double fontSize, double wMax,
2611  int *end, double *width, int *next) {
2612  double w, dw;
2613  int j, k, c;
2614 
2615  // figure out how much text will fit on the line
2616  //~ what does Adobe do with tabs?
2617  w = 0;
2618  for (j = start; j < text->getLength() && w <= wMax; ++j) {
2619  c = text->getChar(j) & 0xff;
2620  if (c == 0x0a || c == 0x0d) {
2621  break;
2622  }
2623  if (font && !font->isCIDFont()) {
2624  dw = ((Gfx8BitFont *)font)->getWidth((Guchar)c) * fontSize;
2625  } else {
2626  // otherwise, make a crude estimate
2627  dw = 0.5 * fontSize;
2628  }
2629  w += dw;
2630  }
2631  if (w > wMax) {
2632  for (k = j; k > start && text->getChar(k-1) != ' '; --k) ;
2633  for (; k > start && text->getChar(k-1) == ' '; --k) ;
2634  if (k > start) {
2635  j = k;
2636  }
2637  if (j == start) {
2638  // handle the pathological case where the first character is
2639  // too wide to fit on the line all by itself
2640  j = start + 1;
2641  }
2642  }
2643  *end = j;
2644 
2645  // compute the width
2646  w = 0;
2647  for (k = start; k < j; ++k) {
2648  if (font && !font->isCIDFont()) {
2649  dw = ((Gfx8BitFont *)font)->getWidth(text->getChar(k)) * fontSize;
2650  } else {
2651  // otherwise, make a crude estimate
2652  dw = 0.5 * fontSize;
2653  }
2654  w += dw;
2655  }
2656  *width = w;
2657 
2658  // next line
2659  while (j < text->getLength() && text->getChar(j) == ' ') {
2660  ++j;
2661  }
2662  if (j < text->getLength() && text->getChar(j) == 0x0d) {
2663  ++j;
2664  }
2665  if (j < text->getLength() && text->getChar(j) == 0x0a) {
2666  ++j;
2667  }
2668  *next = j;
2669 }
2670 
2671 // Draw an (approximate) circle of radius <r> centered at (<cx>, <cy>).
2672 // <cmd> is used to draw the circle ("f", "s", or "b").
2673 void AcroFormField::drawCircle(double cx, double cy, double r,
2674  const char *cmd, GString *appearBuf) {
2675  appearBuf->appendf("{0:.4f} {1:.4f} m\n",
2676  cx + r, cy);
2677  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} {4:.4f} {5:.4f} c\n",
2678  cx + r, cy + bezierCircle * r,
2679  cx + bezierCircle * r, cy + r,
2680  cx, cy + r);
2681  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} {4:.4f} {5:.4f} c\n",
2682  cx - bezierCircle * r, cy + r,
2683  cx - r, cy + bezierCircle * r,
2684  cx - r, cy);
2685  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} {4:.4f} {5:.4f} c\n",
2686  cx - r, cy - bezierCircle * r,
2687  cx - bezierCircle * r, cy - r,
2688  cx, cy - r);
2689  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} {4:.4f} {5:.4f} c\n",
2690  cx + bezierCircle * r, cy - r,
2691  cx + r, cy - bezierCircle * r,
2692  cx + r, cy);
2693  appearBuf->appendf("{0:s}\n", cmd);
2694 }
2695 
2696 // Draw the top-left half of an (approximate) circle of radius <r>
2697 // centered at (<cx>, <cy>).
2698 void AcroFormField::drawCircleTopLeft(double cx, double cy, double r,
2699  GString *appearBuf) {
2700  double r2;
2701 
2702  r2 = r / sqrt(2.0);
2703  appearBuf->appendf("{0:.4f} {1:.4f} m\n",
2704  cx + r2, cy + r2);
2705  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} {4:.4f} {5:.4f} c\n",
2706  cx + (1 - bezierCircle) * r2,
2707  cy + (1 + bezierCircle) * r2,
2708  cx - (1 - bezierCircle) * r2,
2709  cy + (1 + bezierCircle) * r2,
2710  cx - r2,
2711  cy + r2);
2712  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} {4:.4f} {5:.4f} c\n",
2713  cx - (1 + bezierCircle) * r2,
2714  cy + (1 - bezierCircle) * r2,
2715  cx - (1 + bezierCircle) * r2,
2716  cy - (1 - bezierCircle) * r2,
2717  cx - r2,
2718  cy - r2);
2719  appearBuf->append("S\n");
2720 }
2721 
2722 // Draw the bottom-right half of an (approximate) circle of radius <r>
2723 // centered at (<cx>, <cy>).
2724 void AcroFormField::drawCircleBottomRight(double cx, double cy, double r,
2725  GString *appearBuf) {
2726  double r2;
2727 
2728  r2 = r / sqrt(2.0);
2729  appearBuf->appendf("{0:.4f} {1:.4f} m\n",
2730  cx - r2, cy - r2);
2731  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} {4:.4f} {5:.4f} c\n",
2732  cx - (1 - bezierCircle) * r2,
2733  cy - (1 + bezierCircle) * r2,
2734  cx + (1 - bezierCircle) * r2,
2735  cy - (1 + bezierCircle) * r2,
2736  cx + r2,
2737  cy - r2);
2738  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} {4:.4f} {5:.4f} c\n",
2739  cx + (1 + bezierCircle) * r2,
2740  cy - (1 - bezierCircle) * r2,
2741  cx + (1 + bezierCircle) * r2,
2742  cy + (1 - bezierCircle) * r2,
2743  cx + r2,
2744  cy + r2);
2745  appearBuf->append("S\n");
2746 }
2747 
2749  GfxFontDict *fontDict, int rot,
2750  double xMin, double yMin,
2751  double xMax, double yMax,
2752  XFAFieldBarcodeInfo *barcodeInfo,
2753  GString *appearBuf) {
2754  //--- handle rotation
2755  double w, h;
2756  appearBuf->append("q\n");
2757  switch (rot) {
2758  case 0:
2759  default:
2760  w = xMax - xMin;
2761  h = yMax - yMin;
2762  break;
2763  case 90:
2764  appearBuf->appendf("0 1 -1 0 {0:.4f} 0 cm\n", xMax - xMin);
2765  w = yMax - yMin;
2766  h = xMax - xMin;
2767  break;
2768  case 180:
2769  appearBuf->appendf("0 -1 1 0 0 {0:.4f} cm\n", yMax - yMin);
2770  w = yMax - yMin;
2771  h = xMax - xMin;
2772  break;
2773  case 270:
2774  appearBuf->appendf("0 -1 1 0 0 {0:.4f} cm\n", yMax - yMin);
2775  w = yMax - yMin;
2776  h = xMax - xMin;
2777  break;
2778  }
2779 
2780  //--- get the font size
2781  double fontSize = 0.2 * h;
2782  if (da) {
2783  GList *daToks = tokenize(da);
2784  for (int i = 2; i < daToks->getLength(); ++i) {
2785  if (!((GString *)daToks->get(i))->cmp("Tf")) {
2786  fontSize = atof(((GString *)daToks->get(i - 1))->getCString());
2787  break;
2788  }
2789  }
2790  deleteGList(daToks, GString);
2791  }
2792 
2793  //--- compute the embedded text type position
2794  GBool doText = gTrue;
2795  double yText = 0;
2796  int vAlign = acroFormVAlignTop;
2797  double yBarcode = 0;
2798  double hBarcode = 0;
2799  GBool whiteBackground = gFalse;
2800  //~ this uses an estimate of the font baseline position
2801  if (barcodeInfo->textLocation &&
2802  !barcodeInfo->textLocation->cmp("above")) {
2803  yText = h;
2804  vAlign = acroFormVAlignTop;
2805  yBarcode = 0;
2806  hBarcode = h - fontSize;
2807  } else if (barcodeInfo->textLocation &&
2808  !barcodeInfo->textLocation->cmp("belowEmbedded")) {
2809  yText = 0;
2810  vAlign = acroFormVAlignBottom;
2811  yBarcode = 0;
2812  hBarcode = h;
2813  whiteBackground = gTrue;
2814  } else if (barcodeInfo->textLocation &&
2815  !barcodeInfo->textLocation->cmp("aboveEmbedded")) {
2816  yText = h;
2817  vAlign = acroFormVAlignTop;
2818  yBarcode = 0;
2819  hBarcode = h;
2820  whiteBackground = gTrue;
2821  } else if (barcodeInfo->textLocation &&
2822  !barcodeInfo->textLocation->cmp("none")) {
2823  doText = gFalse;
2824  } else { // default is "below"
2825  yText = 0;
2826  vAlign = acroFormVAlignBottom;
2827  yBarcode = fontSize;
2828  hBarcode = h - fontSize;
2829  }
2830  double wText = w;
2831 
2832  //--- remove extraneous start/stop chars
2833  GString *value2 = value->copy();
2834  if (!barcodeInfo->barcodeType->cmp("code3Of9")) {
2835  if (value2->getLength() >= 1 && value2->getChar(0) == '*') {
2836  value2->del(0);
2837  }
2838  if (value2->getLength() >= 1 &&
2839  value2->getChar(value2->getLength() - 1) == '*') {
2840  value2->del(value2->getLength() - 1);
2841  }
2842  }
2843 
2844  //--- draw the bar code
2845  if (!barcodeInfo->barcodeType->cmp("code3Of9")) {
2846  if (!barcodeInfo->dataLength) {
2847  error(errSyntaxError, -1,
2848  "Missing 'dataLength' attribute in barcode field");
2849  goto err;
2850  }
2851  appearBuf->append("0 g\n");
2852  double wNarrow = w / ((7 + 3 * barcodeInfo->wideNarrowRatio)
2853  * (barcodeInfo->dataLength + 2));
2854  double xx = 0;
2855  for (int i = -1; i <= value2->getLength(); ++i) {
2856  int c;
2857  if (i < 0 || i >= value2->getLength()) {
2858  c = '*';
2859  } else {
2860  c = value2->getChar(i) & 0x7f;
2861  }
2862  for (int j = 0; j < 10; j += 2) {
2863  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} re f\n",
2864  xx, yBarcode,
2865  (code3Of9Data[c][j] ? barcodeInfo->wideNarrowRatio
2866  : 1) * wNarrow,
2867  hBarcode);
2868  xx += ((code3Of9Data[c][j] ? barcodeInfo->wideNarrowRatio : 1) +
2869  (code3Of9Data[c][j+1] ? barcodeInfo->wideNarrowRatio : 1))
2870  * wNarrow;
2871  }
2872  }
2873  // center the text on the drawn barcode (not the max length barcode)
2874  wText = (value2->getLength() + 2) * (7 + 3 * barcodeInfo->wideNarrowRatio)
2875  * wNarrow;
2876  } else if (!barcodeInfo->barcodeType->cmp("code128B")) {
2877  if (!barcodeInfo->dataLength) {
2878  error(errSyntaxError, -1,
2879  "Missing 'dataLength' attribute in barcode field");
2880  goto err;
2881  }
2882  appearBuf->append("0 g\n");
2883  double wNarrow = w / (11 * (barcodeInfo->dataLength + 3) + 2);
2884  double xx = 0;
2885  int checksum = 0;
2886  for (int i = -1; i <= value2->getLength() + 1; ++i) {
2887  int c;
2888  if (i == -1) {
2889  // start code B
2890  c = 104;
2891  checksum += c;
2892  } else if (i == value2->getLength()) {
2893  // checksum
2894  c = checksum % 103;
2895  } else if (i == value2->getLength() + 1) {
2896  // stop code
2897  c = 106;
2898  } else {
2899  c = value2->getChar(i) & 0xff;
2900  if (c >= 32 && c <= 127) {
2901  c -= 32;
2902  } else {
2903  c = 0;
2904  }
2905  checksum += (i + 1) * c;
2906  }
2907  for (int j = 0; j < 6; j += 2) {
2908  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} re f\n",
2909  xx, yBarcode,
2910  code128Data[c][j] * wNarrow, hBarcode);
2911  xx += (code128Data[c][j] + code128Data[c][j+1]) * wNarrow;
2912  }
2913  }
2914  // final bar of the stop code
2915  appearBuf->appendf("{0:.4f} {1:.4f} {2:.4f} {3:.4f} re f\n",
2916  xx, yBarcode, 2 * wNarrow, hBarcode);
2917  // center the text on the drawn barcode (not the max length barcode)
2918  wText = (11 * (value2->getLength() + 3) + 2) * wNarrow;
2919  } else if (!barcodeInfo->barcodeType->cmp("pdf417")) {
2920  drawPDF417Barcode(w, h, barcodeInfo->moduleWidth,
2921  barcodeInfo->moduleHeight,
2922  barcodeInfo->errorCorrectionLevel,
2923  value2, appearBuf);
2924  doText = gFalse;
2925  } else {
2926  error(errSyntaxError, -1,
2927  "Unimplemented barcode type '{0:t}' in barcode field",
2928  barcodeInfo->barcodeType);
2929  }
2930  //~ add other barcode types here
2931 
2932  //--- draw the embedded text
2933  if (doText) {
2934  drawText(value2, da, fontDict, gFalse, 0, acroFormQuadCenter,
2935  vAlign, gFalse, gFalse, 0, 0, yText, wText, yText + fontSize,
2936  0, whiteBackground, appearBuf);
2937  }
2938 
2939  appearBuf->append("Q\n");
2940 
2941  err:
2942  delete value2;
2943 }
2944 
2946  GList *toks;
2947  int i, j;
2948 
2949  toks = new GList();
2950  i = 0;
2951  while (i < s->getLength()) {
2952  while (i < s->getLength() && Lexer::isSpace(s->getChar(i))) {
2953  ++i;
2954  }
2955  if (i < s->getLength()) {
2956  for (j = i + 1;
2957  j < s->getLength() && !Lexer::isSpace(s->getChar(j));
2958  ++j) ;
2959  toks->append(new GString(s, i, j - i));
2960  i = j;
2961  }
2962  }
2963  return toks;
2964 }
2965 
2967  Object kidsObj, annotObj, obj1;
2968  int i;
2969 
2970  if (acroForm->needAppearances) {
2971  fieldLookup("DR", res);
2972  } else {
2973  res->initArray(acroForm->doc->getXRef());
2974  // find the annotation object(s)
2975  if (fieldObj.dictLookup("Kids", &kidsObj)->isArray()) {
2976  for (i = 0; i < kidsObj.arrayGetLength(); ++i) {
2977  kidsObj.arrayGet(i, &annotObj);
2978  if (annotObj.isDict()) {
2979  if (getAnnotResources(annotObj.getDict(), &obj1)->isDict()) {
2980  res->arrayAdd(&obj1);
2981  } else {
2982  obj1.free();
2983  }
2984  }
2985  annotObj.free();
2986  }
2987  } else {
2988  if (getAnnotResources(fieldObj.getDict(), &obj1)->isDict()) {
2989  res->arrayAdd(&obj1);
2990  } else {
2991  obj1.free();
2992  }
2993  }
2994  kidsObj.free();
2995  }
2996 
2997  return res;
2998 }
2999 
3001  return fieldRef.copy(ref);
3002 }
3003 
3005  return fieldLookup("V", val);
3006 }
3007 
3009  return fieldObj.dictLookupNF("Parent", parent);
3010 }
3011 
3012 // Get the first annotation object associated with this field.
3014  Object kidsObj;
3015 
3016  if (fieldObj.dictLookup("Kids", &kidsObj)->isArray()) {
3017  if (kidsObj.arrayGetLength() > 0) {
3018  kidsObj.arrayGet(0, annotObj);
3019  } else {
3020  annotObj->initNull();
3021  }
3022  } else {
3023  fieldObj.copy(annotObj);
3024  }
3025  kidsObj.free();
3026  return annotObj;
3027 }
3028 
3030  Object apObj, asObj, appearance, obj1;
3031 
3032  // get the appearance stream
3033  if (annot->lookup("AP", &apObj)->isDict()) {
3034  apObj.dictLookup("N", &obj1);
3035  if (obj1.isDict()) {
3036  if (annot->lookup("AS", &asObj)->isName()) {
3037  obj1.dictLookup(asObj.getName(), &appearance);
3038  } else if (obj1.dictGetLength() == 1) {
3039  obj1.dictGetVal(0, &appearance);
3040  } else {
3041  obj1.dictLookup("Off", &appearance);
3042  }
3043  asObj.free();
3044  } else {
3045  obj1.copy(&appearance);
3046  }
3047  obj1.free();
3048  }
3049  apObj.free();
3050 
3051  if (appearance.isStream()) {
3052  appearance.streamGetDict()->lookup("Resources", res);
3053  } else {
3054  res->initNull();
3055  }
3056  appearance.free();
3057 
3058  return res;
3059 }
3060 
3061 // Merge the field and AcroForm DR objects.
3063  Object formDR, fieldDR, resDict, newResDict, resObj;
3064  char *resType, *resName;
3065  int i, j;
3066 
3067  // NB: we need to deep-copy the dictionaries here, because multiple
3068  // threads can be sharing these objects.
3069 
3070  dr->initDict(acroForm->doc->getXRef());
3071 
3072  acroForm->acroFormObj.dictLookup("DR", &formDR);
3073  if (formDR.isDict()) {
3074  for (i = 0; i < formDR.dictGetLength(); ++i) {
3075  resType = formDR.dictGetKey(i);
3076  formDR.dictGetVal(i, &resDict);
3077  if (resDict.isDict()) {
3078  newResDict.initDict(acroForm->doc->getXRef());
3079  dr->dictAdd(copyString(resType), &newResDict);
3080  for (j = 0; j < resDict.dictGetLength(); ++j) {
3081  resName = resDict.dictGetKey(j);
3082  resDict.dictGetValNF(j, &resObj);
3083  newResDict.dictAdd(copyString(resName), &resObj);
3084  }
3085  }
3086  resDict.free();
3087  }
3088  }
3089  formDR.free();
3090 
3091  fieldObj.dictLookup("DR", &fieldDR);
3092  if (fieldDR.isDict()) {
3093  for (i = 0; i < fieldDR.dictGetLength(); ++i) {
3094  resType = fieldDR.dictGetKey(i);
3095  fieldDR.dictGetVal(i, &resDict);
3096  if (resDict.isDict()) {
3097  dr->dictLookup(resType, &newResDict);
3098  if (!newResDict.isDict()) {
3099  newResDict.free();
3100  newResDict.initDict(acroForm->doc->getXRef());
3101  }
3102  dr->dictAdd(copyString(resType), &newResDict);
3103  for (j = 0; j < resDict.dictGetLength(); ++j) {
3104  resName = resDict.dictGetKey(j);
3105  resDict.dictGetValNF(j, &resObj);
3106  newResDict.dictAdd(copyString(resName), &resObj);
3107  }
3108  }
3109  resDict.free();
3110  }
3111  }
3112  fieldDR.free();
3113 }
3114 
3115 // Look up an inheritable field dictionary entry.
3117  return fieldLookup(fieldObj.getDict(), key, obj);
3118 }
3119 
3120 Object *AcroFormField::fieldLookup(Dict *dict, const char *key, Object *obj) {
3121  Object parent, parent2;
3122  int depth;
3123 
3124  if (!dict->lookup(key, obj)->isNull()) {
3125  return obj;
3126  }
3127  obj->free();
3128 
3129  dict->lookup("Parent", &parent)->isDict();
3130  depth = 0;
3131  while (parent.isDict() && depth < maxFieldObjectDepth) {
3132  if (!parent.dictLookup(key, obj)->isNull()) {
3133  parent.free();
3134  return obj;
3135  }
3136  obj->free();
3137  parent.dictLookup("Parent", &parent2);
3138  parent.free();
3139  parent = parent2;
3140  ++depth;
3141  }
3142  parent.free();
3143 
3144  // some fields don't specify a parent, so we check the AcroForm
3145  // dictionary just in case
3147  return obj;
3148 }
3149 
3151  int n = 0;
3152  int i = 0;
3153  Unicode u;
3154  while (getUTF8(s, &i, &u)) {
3155  ++n;
3156  }
3157  Unicode *uVec = (Unicode *)gmallocn(n, sizeof(Unicode));
3158  n = 0;
3159  i = 0;
3160  while (getUTF8(s, &i, &uVec[n])) {
3161  ++n;
3162  }
3163  *unicodeLength = n;
3164  return uVec;
3165 }
3166 
3168  GString *s = new GString();
3169  for (int i = 0; i < unicodeLength; ++i) {
3170  if (u[i] <= 0xff) {
3171  s->append((char)u[i]);
3172  }
3173  }
3174  return s;
3175 }
3176 
3178  GString *s) {
3179  if (s->getLength() != unicodeLength) {
3180  return gFalse;
3181  }
3182  for (int i = 0; i < unicodeLength; ++i) {
3183  if ((s->getChar(i) & 0xff) != u[i]) {
3184  return gFalse;
3185  }
3186  }
3187  return gTrue;
3188 }
3189 
3191  const char *s) {
3192  for (int i = 0; i < unicodeLength; ++i) {
3193  if (!s[i] || (s[i] & 0xff) != u[i]) {
3194  return gFalse;
3195  }
3196  }
3197  return gTrue;
3198 }
3199 
3200 //------------------------------------------------------------------------
3201 // 'picture' formatting
3202 //------------------------------------------------------------------------
3203 
3205 public:
3206  virtual ~PictureNode() {}
3207  virtual GBool isLiteral() { return gFalse; }
3208  virtual GBool isSign() { return gFalse; }
3209  virtual GBool isDigit() { return gFalse; }
3210  virtual GBool isDecPt() { return gFalse; }
3211  virtual GBool isSeparator() { return gFalse; }
3212  virtual GBool isYear() { return gFalse; }
3213  virtual GBool isMonth() { return gFalse; }
3214  virtual GBool isDay() { return gFalse; }
3215  virtual GBool isHour() { return gFalse; }
3216  virtual GBool isMinute() { return gFalse; }
3217  virtual GBool isSecond() { return gFalse; }
3218  virtual GBool isChar() { return gFalse; }
3219 };
3220 
3222 public:
3223  PictureLiteral(GString *sA) { s = sA; }
3224  virtual ~PictureLiteral() { delete s; }
3225  virtual GBool isLiteral() { return gTrue; }
3227 };
3228 
3229 class PictureSign: public PictureNode {
3230 public:
3231  PictureSign(char cA) { c = cA; }
3232  virtual GBool isSign() { return gTrue; }
3233  char c;
3234 };
3235 
3236 class PictureDigit: public PictureNode {
3237 public:
3238  PictureDigit(char cA) { c = cA; pos = 0; }
3239  virtual GBool isDigit() { return gTrue; }
3240  char c;
3241  int pos;
3242 };
3243 
3244 class PictureDecPt: public PictureNode {
3245 public:
3247  virtual GBool isDecPt() { return gTrue; }
3248 };
3249 
3251 public:
3253  virtual GBool isSeparator() { return gTrue; }
3254 };
3255 
3256 class PictureYear: public PictureNode {
3257 public:
3258  PictureYear(int nDigitsA) { nDigits = nDigitsA; }
3259  virtual GBool isYear() { return gTrue; }
3260  int nDigits;
3261 };
3262 
3263 class PictureMonth: public PictureNode {
3264 public:
3265  PictureMonth(int nDigitsA) { nDigits = nDigitsA; }
3266  virtual GBool isMonth() { return gTrue; }
3267  int nDigits;
3268 };
3269 
3270 class PictureDay: public PictureNode {
3271 public:
3272  PictureDay(int nDigitsA) { nDigits = nDigitsA; }
3273  virtual GBool isDay() { return gTrue; }
3274  int nDigits;
3275 };
3276 
3277 class PictureHour: public PictureNode {
3278 public:
3279  PictureHour(GBool is24HourA, int nDigitsA)
3280  { is24Hour = is24HourA; nDigits = nDigitsA; }
3281  virtual GBool isHour() { return gTrue; }
3283  int nDigits;
3284 };
3285 
3287 public:
3288  PictureMinute(int nDigitsA) { nDigits = nDigitsA; }
3289  virtual GBool isMinute() { return gTrue; }
3290  int nDigits;
3291 };
3292 
3294 public:
3295  PictureSecond(int nDigitsA) { nDigits = nDigitsA; }
3296  virtual GBool isSecond() { return gTrue; }
3297  int nDigits;
3298 };
3299 
3300 class PictureChar: public PictureNode {
3301 public:
3303  virtual GBool isChar() { return gTrue; }
3304 };
3305 
3307  GString *picture) {
3308  GList *pic;
3309  PictureNode *node;
3310  GString *ret, *s;
3311  char c;
3312  int year, month, day, hour, min, sec;
3313  int len, picStart, picEnd, u, n, i, j;
3314 
3315  len = value->getLength();
3316  if (len == 0) {
3317  return value->copy();
3318  }
3319 
3320  //--- parse the value
3321 
3322  // expected format is yyyy(-mm(-dd)?)?Thh(:mm(:ss)?)?
3323  // where:
3324  // - the '-'s and ':'s are optional
3325  // - the 'T' is literal
3326  // - we're ignoring optional time zone info at the end
3327  // (if the value is not in this canonical format, we just punt and
3328  // return the value string)
3329  //~ another option would be to parse the value following the
3330  //~ <ui><picture> element
3331  year = month = day = hour = min = sec = 0;
3332  i = 0;
3333  if (!(i + 4 <= len && isValidInt(value, i, 4))) {
3334  return value->copy();
3335  }
3336  year = convertInt(value, i, 4);
3337  i += 4;
3338  if (i < len && value->getChar(i) == '-') {
3339  ++i;
3340  }
3341  if (i + 2 <= len && isValidInt(value, i, 2)) {
3342  month = convertInt(value, i, 2);
3343  i += 2;
3344  if (i < len && value->getChar(i) == '-') {
3345  ++i;
3346  }
3347  if (i + 2 <= len && isValidInt(value, i, 2)) {
3348  day = convertInt(value, i, 2);
3349  i += 2;
3350  }
3351  }
3352  if (i < len) {
3353  if (value->getChar(i) != 'T') {
3354  return value->copy();
3355  }
3356  ++i;
3357  if (!(i + 2 <= len && isValidInt(value, i, 2))) {
3358  return value->copy();
3359  }
3360  hour = convertInt(value, i, 2);
3361  i += 2;
3362  if (i < len && value->getChar(i) == ':') {
3363  ++i;
3364  }
3365  if (i + 2 <= len && isValidInt(value, i, 2)) {
3366  min = convertInt(value, i, 2);
3367  i += 2;
3368  if (i < len && value->getChar(i) == ':') {
3369  ++i;
3370  }
3371  if (i + 2 <= len && isValidInt(value, i, 2)) {
3372  sec = convertInt(value, i, 2);
3373  i += 2;
3374  }
3375  }
3376  }
3377  if (i < len) {
3378  return value->copy();
3379  }
3380 
3381  //--- skip the category and locale in the picture
3382 
3383  picStart = 0;
3384  picEnd = picture->getLength();
3385  for (i = 0; i < picture->getLength(); ++i) {
3386  c = picture->getChar(i);
3387  if (c == '{') {
3388  picStart = i + 1;
3389  for (picEnd = picStart;
3390  picEnd < picture->getLength() && picture->getChar(picEnd) != '}';
3391  ++picEnd) ;
3392  break;
3393  } else if (!((c >= 'a' && c <= 'z') ||
3394  (c >= 'A' && c <= 'Z') ||
3395  c == '(' ||
3396  c == ')')) {
3397  break;
3398  }
3399  }
3400 
3401  //--- parse the picture
3402 
3403  pic = new GList();
3404  i = picStart;
3405  while (i < picEnd) {
3406  c = picture->getChar(i);
3407  ++i;
3408  if (c == '\'') {
3409  s = new GString();
3410  while (i < picEnd) {
3411  c = picture->getChar(i);
3412  if (c == '\'') {
3413  ++i;
3414  if (i < picEnd && picture->getChar(i) == '\'') {
3415  s->append('\'');
3416  ++i;
3417  } else {
3418  break;
3419  }
3420  } else if (c == '\\') {
3421  ++i;
3422  if (i == picEnd) {
3423  break;
3424  }
3425  c = picture->getChar(i);
3426  ++i;
3427  if (c == 'u' && i+4 <= picEnd) {
3428  u = 0;
3429  for (j = 0; j < 4; ++j, ++i) {
3430  c = picture->getChar(i);
3431  u <<= 4;
3432  if (c >= '0' && c <= '9') {
3433  u += c - '0';
3434  } else if (c >= 'a' && c <= 'f') {
3435  u += c - 'a' + 10;
3436  } else if (c >= 'A' && c <= 'F') {
3437  u += c - 'A' + 10;
3438  }
3439  }
3440  //~ this should convert to UTF-8 (?)
3441  if (u <= 0xff) {
3442  s->append((char)u);
3443  }
3444  } else {
3445  s->append(c);
3446  }
3447  } else {
3448  s->append(c);
3449  }
3450  }
3451  pic->append(new PictureLiteral(s));
3452  } else if (c == ',' || c == '-' || c == ':' ||
3453  c == '/' || c == '.' || c == ' ') {
3454  s = new GString();
3455  s->append(c);
3456  pic->append(new PictureLiteral(s));
3457  } else if (c == 'Y') {
3458  for (n = 1; n < 4 && i < picEnd && picture->getChar(i) == 'Y'; ++n, ++i) ;
3459  pic->append(new PictureYear(n));
3460  } else if (c == 'M') {
3461  for (n = 1; n < 2 && i < picEnd && picture->getChar(i) == 'M'; ++n, ++i) ;
3462  pic->append(new PictureMonth(n));
3463  } else if (c == 'D') {
3464  for (n = 1; n < 2 && i < picEnd && picture->getChar(i) == 'D'; ++n, ++i) ;
3465  pic->append(new PictureDay(n));
3466  } else if (c == 'h') {
3467  for (n = 1; n < 2 && i < picEnd && picture->getChar(i) == 'h'; ++n, ++i) ;
3468  pic->append(new PictureHour(gFalse, n));
3469  } else if (c == 'H') {
3470  for (n = 1; n < 2 && i < picEnd && picture->getChar(i) == 'H'; ++n, ++i) ;
3471  pic->append(new PictureHour(gTrue, n));
3472  } else if (c == 'M') {
3473  for (n = 1; n < 2 && i < picEnd && picture->getChar(i) == 'M'; ++n, ++i) ;
3474  pic->append(new PictureMinute(n));
3475  } else if (c == 'S') {
3476  for (n = 1; n < 2 && i < picEnd && picture->getChar(i) == 'S'; ++n, ++i) ;
3477  pic->append(new PictureSecond(n));
3478  }
3479  }
3480 
3481  //--- generate formatted text
3482 
3483  ret = new GString();
3484  for (i = 0; i < pic->getLength(); ++i) {
3485  node = (PictureNode *)pic->get(i);
3486  if (node->isLiteral()) {
3487  ret->append(((PictureLiteral *)node)->s);
3488  } else if (node->isYear()) {
3489  if (((PictureYear *)node)->nDigits == 2) {
3490  if (year >= 1930 && year < 2030) {
3491  ret->appendf("{0:02d}", year % 100);
3492  } else {
3493  ret->append("??");
3494  }
3495  } else {
3496  ret->appendf("{0:04d}", year);
3497  }
3498  } else if (node->isMonth()) {
3499  if (((PictureMonth *)node)->nDigits == 1) {
3500  ret->appendf("{0:d}", month);
3501  } else {
3502  ret->appendf("{0:02d}", month);
3503  }
3504  } else if (node->isDay()) {
3505  if (((PictureDay *)node)->nDigits == 1) {
3506  ret->appendf("{0:d}", day);
3507  } else {
3508  ret->appendf("{0:02d}", day);
3509  }
3510  } else if (node->isHour()) {
3511  if (((PictureHour *)node)->is24Hour) {
3512  n = hour;
3513  } else {
3514  n = hour % 12;
3515  if (n == 0) {
3516  n = 12;
3517  }
3518  }
3519  if (((PictureHour *)node)->nDigits == 1) {
3520  ret->appendf("{0:d}", n);
3521  } else {
3522  ret->appendf("{0:02d}", n);
3523  }
3524  } else if (node->isMinute()) {
3525  if (((PictureMinute *)node)->nDigits == 1) {
3526  ret->appendf("{0:d}", min);
3527  } else {
3528  ret->appendf("{0:02d}", min);
3529  }
3530  } else if (node->isSecond()) {
3531  if (((PictureSecond *)node)->nDigits == 1) {
3532  ret->appendf("{0:d}", sec);
3533  } else {
3534  ret->appendf("{0:02d}", sec);
3535  }
3536  }
3537  }
3539 
3540  return ret;
3541 }
3542 
3544  GList *pic;
3545  PictureNode *node;
3546  GString *ret, *s;
3547  GBool neg, haveDigits;
3548  char c;
3549  int start, decPt, trailingZero, len;
3550  int picStart, picEnd, u, pos, i, j;
3551 
3552  len = value->getLength();
3553  if (len == 0) {
3554  return value->copy();
3555  }
3556 
3557  //--- parse the value
3558 
3559  // -nnnn.nnnn0000
3560  // ^ ^ ^ ^
3561  // | | | +-- len
3562  // | | +------ trailingZero
3563  // | +----------- decPt
3564  // +--------------- start
3565  start = 0;
3566  neg = gFalse;
3567  if (value->getChar(start) == '-') {
3568  neg = gTrue;
3569  ++start;
3570  } else if (value->getChar(start) == '+') {
3571  ++start;
3572  }
3573  for (decPt = start; decPt < len && value->getChar(decPt) != '.'; ++decPt) ;
3574  for (trailingZero = len;
3575  trailingZero > decPt && value->getChar(trailingZero - 1) == '0';
3576  --trailingZero) ;
3577 
3578  //--- skip the category and locale in the picture
3579 
3580  picStart = 0;
3581  picEnd = picture->getLength();
3582  for (i = 0; i < picture->getLength(); ++i) {
3583  c = picture->getChar(i);
3584  if (c == '{') {
3585  picStart = i + 1;
3586  for (picEnd = picStart;
3587  picEnd < picture->getLength() && picture->getChar(picEnd) != '}';
3588  ++picEnd) ;
3589  break;
3590  } else if (!((c >= 'a' && c <= 'z') ||
3591  (c >= 'A' && c <= 'Z') ||
3592  c == '(' ||
3593  c == ')')) {
3594  break;
3595  }
3596  }
3597 
3598  //--- parse the picture
3599 
3600  pic = new GList();
3601  i = picStart;
3602  while (i < picEnd) {
3603  c = picture->getChar(i);
3604  ++i;
3605  if (c == '\'') {
3606  s = new GString();
3607  while (i < picEnd) {
3608  c = picture->getChar(i);
3609  if (c == '\'') {
3610  ++i;
3611  if (i < picEnd && picture->getChar(i) == '\'') {
3612  s->append('\'');
3613  ++i;
3614  } else {
3615  break;
3616  }
3617  } else if (c == '\\') {
3618  ++i;
3619  if (i == picEnd) {
3620  break;
3621  }
3622  c = picture->getChar(i);
3623  ++i;
3624  if (c == 'u' && i+4 <= picEnd) {
3625  u = 0;
3626  for (j = 0; j < 4; ++j, ++i) {
3627  c = picture->getChar(i);
3628  u <<= 4;
3629  if (c >= '0' && c <= '9') {
3630  u += c - '0';
3631  } else if (c >= 'a' && c <= 'F') {
3632  u += c - 'a' + 10;
3633  } else if (c >= 'A' && c <= 'F') {
3634  u += c - 'A' + 10;
3635  }
3636  }
3637  //~ this should convert to UTF-8 (?)
3638  if (u <= 0xff) {
3639  s->append((char)u);
3640  }
3641  } else {
3642  s->append(c);
3643  }
3644  } else {
3645  s->append(c);
3646  ++i;
3647  }
3648  }
3649  pic->append(new PictureLiteral(s));
3650  } else if (c == '-' || c == ':' || c == '/' || c == ' ') {
3651  s = new GString();
3652  s->append(c);
3653  pic->append(new PictureLiteral(s));
3654  } else if (c == 's' || c == 'S') {
3655  pic->append(new PictureSign(c));
3656  } else if (c == 'Z' || c == 'z' || c == '8' || c == '9') {
3657  pic->append(new PictureDigit(c));
3658  } else if (c == '.') {
3659  pic->append(new PictureDecPt());
3660  } else if (c == ',') {
3661  pic->append(new PictureSeparator());
3662  }
3663  }
3664  for (i = 0; i < pic->getLength(); ++i) {
3665  node = (PictureNode *)pic->get(i);
3666  if (node->isDecPt()) {
3667  break;
3668  }
3669  }
3670  pos = 0;
3671  for (j = i - 1; j >= 0; --j) {
3672  node = (PictureNode *)pic->get(j);
3673  if (node->isDigit()) {
3674  ((PictureDigit *)node)->pos = pos;
3675  ++pos;
3676  }
3677  }
3678  pos = -1;
3679  for (j = i + 1; j < pic->getLength(); ++j) {
3680  node = (PictureNode *)pic->get(j);
3681  if (node->isDigit()) {
3682  ((PictureDigit *)node)->pos = pos;
3683  --pos;
3684  }
3685  }
3686 
3687  //--- generate formatted text
3688 
3689  ret = new GString();
3690  haveDigits = gFalse;
3691  for (i = 0; i < pic->getLength(); ++i) {
3692  node = (PictureNode *)pic->get(i);
3693  if (node->isLiteral()) {
3694  ret->append(((PictureLiteral *)node)->s);
3695  } else if (node->isSign()) {
3696  if (((PictureSign *)node)->c == 'S') {
3697  ret->append(neg ? '-' : ' ');
3698  } else {
3699  if (neg) {
3700  ret->append('-');
3701  }
3702  }
3703  } else if (node->isDigit()) {
3704  pos = ((PictureDigit *)node)->pos;
3705  c = ((PictureDigit *)node)->c;
3706  if (pos >= 0 && pos < decPt - start) {
3707  ret->append(value->getChar(decPt - 1 - pos));
3708  haveDigits = gTrue;
3709  } else if (pos < 0 && -pos <= trailingZero - decPt - 1) {
3710  ret->append(value->getChar(decPt - pos));
3711  haveDigits = gTrue;
3712  } else if (c == '8' &&
3713  pos < 0 &&
3714  -pos <= len - decPt - 1) {
3715  ret->append('0');
3716  haveDigits = gTrue;
3717  } else if (c == '9') {
3718  ret->append('0');
3719  haveDigits = gTrue;
3720  } else if (c == 'Z' && pos >= 0) {
3721  ret->append(' ');
3722  }
3723  } else if (node->isDecPt()) {
3724  if (!(i+1 < pic->getLength() &&
3725  ((PictureNode *)pic->get(i+1))->isDigit() &&
3726  ((PictureDigit *)pic->get(i+1))->c == 'z') ||
3727  trailingZero > decPt + 1) {
3728  ret->append('.');
3729  }
3730  } else if (node->isSeparator()) {
3731  if (haveDigits) {
3732  ret->append(',');
3733  }
3734  }
3735  }
3737 
3738  return ret;
3739 }
3740 
3742  GList *pic;
3743  PictureNode *node;
3744  GString *ret, *s;
3745  char c;
3746  int len, picStart, picEnd, u, i, j;
3747 
3748  len = value->getLength();
3749  if (len == 0) {
3750  return value->copy();
3751  }
3752 
3753  //--- skip the category and locale in the picture
3754 
3755  picStart = 0;
3756  picEnd = picture->getLength();
3757  for (i = 0; i < picture->getLength(); ++i) {
3758  c = picture->getChar(i);
3759  if (c == '{') {
3760  picStart = i + 1;
3761  for (picEnd = picStart;
3762  picEnd < picture->getLength() && picture->getChar(picEnd) != '}';
3763  ++picEnd) ;
3764  break;
3765  } else if (!((c >= 'a' && c <= 'z') ||
3766  (c >= 'A' && c <= 'Z') ||
3767  c == '(' ||
3768  c == ')')) {
3769  break;
3770  }
3771  }
3772 
3773  //--- parse the picture
3774 
3775  pic = new GList();
3776  i = picStart;
3777  while (i < picEnd) {
3778  c = picture->getChar(i);
3779  ++i;
3780  if (c == '\'') {
3781  s = new GString();
3782  while (i < picEnd) {
3783  c = picture->getChar(i);
3784  if (c == '\'') {
3785  ++i;
3786  if (i < picEnd && picture->getChar(i) == '\'') {
3787  s->append('\'');
3788  ++i;
3789  } else {
3790  break;
3791  }
3792  } else if (c == '\\') {
3793  ++i;
3794  if (i == picEnd) {
3795  break;
3796  }
3797  c = picture->getChar(i);
3798  ++i;
3799  if (c == 'u' && i+4 <= picEnd) {
3800  u = 0;
3801  for (j = 0; j < 4; ++j, ++i) {
3802  c = picture->getChar(i);
3803  u <<= 4;
3804  if (c >= '0' && c <= '9') {
3805  u += c - '0';
3806  } else if (c >= 'a' && c <= 'F') {
3807  u += c - 'a' + 10;
3808  } else if (c >= 'A' && c <= 'F') {
3809  u += c - 'A' + 10;
3810  }
3811  }
3812  //~ this should convert to UTF-8 (?)
3813  if (u <= 0xff) {
3814  s->append((char)u);
3815  }
3816  } else {
3817  s->append(c);
3818  }
3819  } else {
3820  s->append(c);
3821  ++i;
3822  }
3823  }
3824  pic->append(new PictureLiteral(s));
3825  } else if (c == ',' || c == '-' || c == ':' ||
3826  c == '/' || c == '.' || c == ' ') {
3827  s = new GString();
3828  s->append(c);
3829  pic->append(new PictureLiteral(s));
3830  } else if (c == 'A' || c == 'X' || c == 'O' || c == '0' || c == '9') {
3831  pic->append(new PictureChar());
3832  }
3833  }
3834 
3835  //--- generate formatted text
3836 
3837  ret = new GString();
3838  j = 0;
3839  for (i = 0; i < pic->getLength(); ++i) {
3840  node = (PictureNode *)pic->get(i);
3841  if (node->isLiteral()) {
3842  ret->append(((PictureLiteral *)node)->s);
3843  } else if (node->isChar()) {
3844  // if there are more chars in the picture than in the value,
3845  // Adobe renders the value as-is, without picture formatting
3846  if (j >= value->getLength()) {
3847  delete ret;
3848  ret = value->copy();
3849  break;
3850  }
3851  ret->append(value->getChar(j));
3852  ++j;
3853  }
3854  }
3856 
3857  return ret;
3858 }
3859 
3861  int i;
3862 
3863  for (i = 0; i < len; ++i) {
3864  if (!(start + i < s->getLength() &&
3865  s->getChar(start + i) >= '0' &&
3866  s->getChar(start + i) <= '9')) {
3867  return gFalse;
3868  }
3869  }
3870  return gTrue;
3871 }
3872 
3874  char c;
3875  int x, i;
3876 
3877  x = 0;
3878  for (i = 0; i < len && start + i < s->getLength(); ++i) {
3879  c = s->getChar(start + i);
3880  if (c < '0' || c > '9') {
3881  break;
3882  }
3883  x = x * 10 + (c - '0');
3884  }
3885  return x;
3886 }
#define acroFormVAlignMiddleNoDescender
Definition: AcroForm.cc:63
#define acroFormQuadRight
Definition: AcroForm.cc:59
#define acroFormFlagCombo
Definition: AcroForm.cc:45
#define acroFormVAlignTop
Definition: AcroForm.cc:61
#define bezierCircle
Definition: AcroForm.cc:72
#define acroFormFlagPushbutton
Definition: AcroForm.cc:44
#define acroFormFlagComb
Definition: AcroForm.cc:52
#define acroFormFlagFileSelect
Definition: AcroForm.cc:48
#define acroFormFlagRadio
Definition: AcroForm.cc:43
#define acroFormQuadCenter
Definition: AcroForm.cc:58
static Guchar code128Data[107][6]
Definition: AcroForm.cc:214
#define annotFlagHidden
Definition: AcroForm.cc:66
#define acroFormFlagMultiline
Definition: AcroForm.cc:40
#define acroFormVAlignMiddle
Definition: AcroForm.cc:62
#define acroFormQuadLeft
Definition: AcroForm.cc:57
#define annotFlagNoView
Definition: AcroForm.cc:68
#define annotFlagPrint
Definition: AcroForm.cc:67
#define acroFormVAlignBottom
Definition: AcroForm.cc:64
#define maxFieldObjectDepth
Definition: AcroForm.cc:75
static Guchar code3Of9Data[128][10]
Definition: AcroForm.cc:82
AcroFormFieldType
Definition: AcroForm.h:65
@ acroFormFieldText
Definition: AcroForm.h:71
@ acroFormFieldCheckbox
Definition: AcroForm.h:68
@ acroFormFieldBarcode
Definition: AcroForm.h:72
@ acroFormFieldComboBox
Definition: AcroForm.h:73
@ acroFormFieldFileSelect
Definition: AcroForm.h:69
@ acroFormFieldMultilineText
Definition: AcroForm.h:70
@ acroFormFieldSignature
Definition: AcroForm.h:75
@ acroFormFieldRadioButton
Definition: AcroForm.h:67
@ acroFormFieldListBox
Definition: AcroForm.h:74
@ acroFormFieldPushbutton
Definition: AcroForm.h:66
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 deleteGList(list, T)
Definition: GList.h:94
GBool drawPDF417Barcode(double fieldWidth, double fieldHeight, double moduleWidth, double moduleHeight, int errorCorrectionLevel, GString *value, GString *appearBuf)
GBool getUTF8(GString *s, int *i, Unicode *u)
Definition: UTF8.cc:61
@ xfaFieldLayoutHAlignCenter
Definition: XFAScanner.h:25
@ xfaFieldLayoutHAlignLeft
Definition: XFAScanner.h:24
@ xfaFieldLayoutHAlignRight
Definition: XFAScanner.h:26
@ xfaFieldLayoutVAlignMiddle
Definition: XFAScanner.h:31
@ xfaFieldLayoutVAlignTop
Definition: XFAScanner.h:30
@ xfaFieldLayoutVAlignBottom
Definition: XFAScanner.h:32
@ xfaFieldPictureText
Definition: XFAScanner.h:50
@ xfaFieldPictureDateTime
Definition: XFAScanner.h:48
@ xfaFieldPictureNumeric
Definition: XFAScanner.h:49
double ury
Definition: aftopl.c:56
double urx
Definition: aftopl.c:55
double lly
Definition: aftopl.c:54
double llx
Definition: aftopl.c:53
#define toks(a)
Definition: aptex-macros.h:674
#define year
Definition: aptex-macros.h:808
#define fill
Definition: aptex-macros.h:292
#define font
Definition: aptex-macros.h:175
#define width(a)
Definition: aptex-macros.h:198
#define day
Definition: aptex-macros.h:806
#define depth(a)
Definition: aptex-macros.h:199
#define adjust(a)
#define height(a)
Definition: aptex-macros.h:200
#define text(a)
Definition: aptex-macros.h:925
#define month
Definition: aptex-macros.h:807
#define next(a)
Definition: aptex-macros.h:924
#define blue
Definition: backend_eps.c:37
#define green
Definition: backend_eps.c:36
#define red
Definition: backend_eps.c:35
AcroFormAnnotPage(int annotNumA, int annotGenA, int pageNumA)
Definition: AcroForm.cc:329
int getMaxLen()
Definition: AcroForm.cc:1065
void drawNewAppearance(Gfx *gfx, Dict *annot, double xMin, double yMin, double xMax, double yMax)
Definition: AcroForm.cc:1231
void getBBox(double *llx, double *lly, double *urx, double *ury)
Definition: AcroForm.cc:902
Unicode * utf8ToUnicode(GString *s, int *unicodeLength)
Definition: AcroForm.cc:3150
void drawCircle(double cx, double cy, double r, const char *cmd, GString *appearBuf)
Definition: AcroForm.cc:2673
void drawExistingAppearance(Gfx *gfx, Dict *annot, double xMin, double yMin, double xMax, double yMax)
Definition: AcroForm.cc:1197
GString * pictureFormatNumber(GString *value, GString *picture)
Definition: AcroForm.cc:3543
AcroFormField(AcroForm *acroFormA, Object *fieldRefA, Object *fieldObjA, AcroFormFieldType typeA, TextString *nameA, Guint flagsA, GBool typeFromParentA, XFAField *xfaFieldA)
Definition: AcroForm.cc:779
void setColor(Array *a, GBool fill, int adjust, GString *appearBuf)
Definition: AcroForm.cc:1860
Object * getResources(Object *res)
Definition: AcroForm.cc:2966
Object * getValueObj(Object *val)
Definition: AcroForm.cc:3004
static AcroFormField * load(AcroForm *acroFormA, Object *fieldRefA)
Definition: AcroForm.cc:615
GString * pictureFormatText(GString *value, GString *picture)
Definition: AcroForm.cc:3741
void drawListBox(GString **text, GBool *selection, int nOptions, int topIdx, GString *da, GfxFontDict *fontDict, GBool quadding, double xMin, double yMin, double xMax, double yMax, double border, GString *appearBuf)
Definition: AcroForm.cc:2419
AcroForm * acroForm
Definition: AcroForm.h:157
GList * tokenize(GString *s)
Definition: AcroForm.cc:2945
Object * getAnnotObj(Object *annotObj)
Definition: AcroForm.cc:3013
GBool isValidInt(GString *s, int start, int len)
Definition: AcroForm.cc:3860
void getNextLine(GString *text, int start, GfxFont *font, double fontSize, double wMax, int *end, double *width, int *next)
Definition: AcroForm.cc:2609
int getPageNum()
Definition: AcroForm.cc:800
void draw(int pageNum, Gfx *gfx, GBool printing)
Definition: AcroForm.cc:1078
const char * getType()
Definition: AcroForm.cc:818
Ref findFontName(char *fontTag)
Definition: AcroForm.cc:995
void getColor(double *red, double *green, double *blue)
Definition: AcroForm.cc:1031
void drawBarcode(GString *value, GString *da, GfxFontDict *fontDict, int rot, double xMin, double yMin, double xMax, double yMax, XFAFieldBarcodeInfo *barcodeInfo, GString *appearBuf)
Definition: AcroForm.cc:2748
GString * pictureFormatDateTime(GString *value, GString *picture)
Definition: AcroForm.cc:3306
Unicode * getValue(int *length)
Definition: AcroForm.cc:846
Unicode * getName(int *length)
Definition: AcroForm.cc:834
GString * unicodeToLatin1(Unicode *u, int unicodeLength)
Definition: AcroForm.cc:3167
void drawAnnot(int pageNum, Gfx *gfx, GBool printing, Object *annotRef, Object *annotObj)
Definition: AcroForm.cc:1097
Object * fieldLookup(const char *key, Object *obj)
Definition: AcroForm.cc:3116
void getFont(Ref *fontID, double *fontSize)
Definition: AcroForm.cc:945
void drawCircleTopLeft(double cx, double cy, double r, GString *appearBuf)
Definition: AcroForm.cc:2698
GBool unicodeStringEqual(Unicode *u, int unicodeLength, GString *s)
Definition: AcroForm.cc:3177
TextString * name
Definition: AcroForm.h:161
Object * getFieldRef(Object *ref)
Definition: AcroForm.cc:3000
AcroFormFieldType type
Definition: AcroForm.h:160
Object fieldObj
Definition: AcroForm.h:159
void buildDefaultResourceDict(Object *dr)
Definition: AcroForm.cc:3062
void drawText(GString *text, GString *da, GfxFontDict *fontDict, GBool multiline, int comb, int quadding, int vAlign, GBool txField, GBool forceZapfDingbats, int rot, double x, double y, double width, double height, double border, GBool whiteBackground, GString *appearBuf)
Definition: AcroForm.cc:1906
void drawCircleBottomRight(double cx, double cy, double r, GString *appearBuf)
Definition: AcroForm.cc:2724
Object * getAnnotResources(Dict *annot, Object *res)
Definition: AcroForm.cc:3029
int convertInt(GString *s, int start, int len)
Definition: AcroForm.cc:3873
Object * getParentRef(Object *parent)
Definition: AcroForm.cc:3008
Guint flags
Definition: AcroForm.h:162
Object fieldRef
Definition: AcroForm.h:158
GBool typeFromParent
Definition: AcroForm.h:163
XFAField * xfaField
Definition: AcroForm.h:164
GBool isStaticXFA
Definition: AcroForm.h:58
PDFDoc * doc
Definition: AcroForm.h:52
~AcroForm()
Definition: AcroForm.cc:462
AcroFormField * findField(int pg, double x, double y)
Definition: AcroForm.cc:577
void buildAnnotPageList(Catalog *catalog)
Definition: AcroForm.cc:473
GList * annotPages
Definition: AcroForm.h:55
GBool needAppearances
Definition: AcroForm.h:54
void scanField(Object *fieldRef)
Definition: AcroForm.cc:512
int getNumFields()
Definition: AcroForm.cc:569
XFAScanner * xfaScanner
Definition: AcroForm.h:57
void draw(int pageNum, Gfx *gfx, GBool printing)
Definition: AcroForm.cc:561
int lookupAnnotPage(Object *annotRef)
Definition: AcroForm.cc:493
static AcroForm * load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA)
Definition: AcroForm.cc:340
AcroFormField * getField(int idx)
Definition: AcroForm.cc:573
const char * getType()
Definition: AcroForm.cc:469
AcroForm(PDFDoc *docA, Object *acroFormObjA)
Definition: AcroForm.cc:452
Object acroFormObj
Definition: AcroForm.h:53
int findFieldIdx(int pg, double x, double y)
Definition: AcroForm.cc:594
GList * fields
Definition: AcroForm.h:56
Definition: Array.h:29
Definition: Dict.h:29
Object * lookup(const char *key, Object *obj, int recursion=0)
Definition: Dict.cc:122
Definition: GList.h:24
int getLength()
Definition: GList.h:39
void append(void *p)
Definition: GList.cc:53
void * get(int i)
Definition: GList.h:48
GString * copy()
Definition: GString.h:42
char getChar(int i)
Definition: GString.h:86
int cmp(GString *str)
Definition: GString.cc:777
GString * appendf(const char *fmt,...)
Definition: GString.cc:263
char * getCString()
Definition: GString.h:83
int getLength()
Definition: GString.h:80
GString * append(char c)
Definition: GString.cc:218
GString * del(int i, int n=1)
Definition: GString.cc:740
GfxFont * lookup(char *tag)
Definition: GfxFont.cc:2170
Definition: Gfx.h:130
void drawAnnot(Object *strRef, AnnotBorderStyle *borderStyle, double xMin, double yMin, double xMax, double yMax)
Definition: Gfx.cc:5098
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
GBool isNum()
Definition: Object.h:132
Array * getArray()
Definition: Object.h:160
Object * initName(const char *nameA)
Definition: Object.h:100
Object * initReal(double realA)
Definition: Object.h:96
double getNum()
Definition: Object.h:157
Object * arrayGetNF(int i, Object *obj)
Definition: Object.h:245
GBool isName()
Definition: Object.h:134
void free()
Definition: Object.cc:119
GBool isStream()
Definition: Object.h:138
GBool isRef()
Definition: Object.h:139
GBool getBool()
Definition: Object.h:154
int getRefGen()
Definition: Object.h:165
Object * copy(Object *obj)
Definition: Object.cc:80
Object * fetch(XRef *xref, Object *obj, int recursion=0)
Definition: Object.cc:114
void arrayAdd(Object *elem)
Definition: Object.h:239
int dictGetLength()
Definition: Object.h:254
char * getName()
Definition: Object.h:159
void dictAdd(char *key, Object *val)
Definition: Object.h:257
int getInt()
Definition: Object.h:155
GBool isNone()
Definition: Object.h:143
GBool isInt()
Definition: Object.h:130
Dict * streamGetDict()
Definition: Object.h:317
Object * initArray(XRef *xref)
Definition: Object.cc:55
Object * initNull()
Definition: Object.h:102
int arrayGetLength()
Definition: Object.h:236
GBool isArray()
Definition: Object.h:136
Object * initDict(XRef *xref)
Definition: Object.cc:61
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
Object * initInt(int intgA)
Definition: Object.h:94
Object * dictGetVal(int i, Object *obj)
Definition: Object.h:275
Object * initStream(Stream *streamA)
Definition: Object.cc:74
GBool isNull()
Definition: Object.h:135
int getRefNum()
Definition: Object.h:164
Object * dictGetValNF(int i, Object *obj)
Definition: Object.h:278
Object * arrayGet(int i, Object *obj, int recursion=0)
Definition: Object.h:242
GBool isBool()
Definition: Object.h:129
GBool evalOCObject(Object *obj, GBool *visible)
Definition: PDFDoc.h:38
XRef * getXRef()
Definition: PDFDoc.h:72
OptionalContent * getOptionalContent()
Definition: PDFDoc.h:150
virtual GBool isChar()
Definition: AcroForm.cc:3303
virtual GBool isDay()
Definition: AcroForm.cc:3273
PictureDay(int nDigitsA)
Definition: AcroForm.cc:3272
virtual GBool isDecPt()
Definition: AcroForm.cc:3247
PictureDigit(char cA)
Definition: AcroForm.cc:3238
virtual GBool isDigit()
Definition: AcroForm.cc:3239
PictureHour(GBool is24HourA, int nDigitsA)
Definition: AcroForm.cc:3279
virtual GBool isHour()
Definition: AcroForm.cc:3281
GBool is24Hour
Definition: AcroForm.cc:3282
virtual GBool isLiteral()
Definition: AcroForm.cc:3225
virtual ~PictureLiteral()
Definition: AcroForm.cc:3224
GString * s
Definition: AcroForm.cc:3226
PictureLiteral(GString *sA)
Definition: AcroForm.cc:3223
PictureMinute(int nDigitsA)
Definition: AcroForm.cc:3288
virtual GBool isMinute()
Definition: AcroForm.cc:3289
PictureMonth(int nDigitsA)
Definition: AcroForm.cc:3265