1 /*
2  * Copyright (c) 2007 Henri Sivonen
3  * Copyright (c) 2007-2015 Mozilla Foundation
4  * Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla
5  * Foundation, and Opera Software ASA.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a
8  * copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation
10  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11  * and/or sell copies of the Software, and to permit persons to whom the
12  * Software is furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23  * DEALINGS IN THE SOFTWARE.
24  */
25 
26 /*
27  * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
28  * Please edit TreeBuilder.java instead and regenerate.
29  */
30 
31 #ifndef nsHtml5TreeBuilder_h
32 #define nsHtml5TreeBuilder_h
33 
34 #include "nsContentUtils.h"
35 #include "nsIAtom.h"
36 #include "nsHtml5AtomTable.h"
37 #include "nsITimer.h"
38 #include "nsString.h"
39 #include "nsNameSpaceManager.h"
40 #include "nsIContent.h"
41 #include "nsTraceRefcnt.h"
42 #include "jArray.h"
43 #include "nsHtml5DocumentMode.h"
44 #include "nsHtml5ArrayCopy.h"
45 #include "nsHtml5Parser.h"
46 #include "nsHtml5Atoms.h"
47 #include "nsHtml5TreeOperation.h"
48 #include "nsHtml5StateSnapshot.h"
49 #include "nsHtml5StackNode.h"
50 #include "nsHtml5TreeOpExecutor.h"
51 #include "nsHtml5StreamParser.h"
52 #include "nsAHtml5TreeBuilderState.h"
53 #include "nsHtml5Highlighter.h"
54 #include "nsHtml5PlainTextUtils.h"
55 #include "nsHtml5ViewSourceUtils.h"
56 #include "mozilla/Likely.h"
57 #include "nsIContentHandle.h"
58 #include "nsHtml5OplessBuilder.h"
59 
60 class nsHtml5StreamParser;
61 
62 class nsHtml5Tokenizer;
63 class nsHtml5MetaScanner;
64 class nsHtml5AttributeName;
65 class nsHtml5ElementName;
66 class nsHtml5HtmlAttributes;
67 class nsHtml5UTF16Buffer;
68 class nsHtml5StateSnapshot;
69 class nsHtml5Portability;
70 
71 
72 class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState
73 {
74   private:
75     static char16_t REPLACEMENT_CHARACTER[];
76     static staticJArray<const char*,int32_t> QUIRKY_PUBLIC_IDS;
77     int32_t mode;
78     int32_t originalMode;
79     bool framesetOk;
80   protected:
81     nsHtml5Tokenizer* tokenizer;
82   private:
83     bool scriptingEnabled;
84     bool needToDropLF;
85     bool fragment;
86     nsIAtom* contextName;
87     int32_t contextNamespace;
88     nsIContentHandle* contextNode;
89     autoJArray<int32_t,int32_t> templateModeStack;
90     int32_t templateModePtr;
91     autoJArray<nsHtml5StackNode*,int32_t> stack;
92     int32_t currentPtr;
93     autoJArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements;
94     int32_t listPtr;
95     nsIContentHandle* formPointer;
96     nsIContentHandle* headPointer;
97     nsIContentHandle* deepTreeSurrogateParent;
98   protected:
99     autoJArray<char16_t,int32_t> charBuffer;
100     int32_t charBufferLen;
101   private:
102     bool quirks;
103     bool isSrcdocDocument;
104   public:
105     void startTokenization(nsHtml5Tokenizer* self);
106     void doctype(nsIAtom* name, nsString* publicIdentifier, nsString* systemIdentifier, bool forceQuirks);
107     void comment(char16_t* buf, int32_t start, int32_t length);
108     void characters(const char16_t* buf, int32_t start, int32_t length);
109     void zeroOriginatingReplacementCharacter();
110     void eof();
111     void endTokenization();
112     void startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes, bool selfClosing);
113   private:
114     void startTagTitleInHead(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
115     void startTagGenericRawText(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
116     void startTagScriptInHead(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
117     void startTagTemplateInHead(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
118     bool isTemplateContents();
119     bool isTemplateModeStackEmpty();
120     bool isSpecialParentInForeign(nsHtml5StackNode* stackNode);
121   public:
122     static nsString* extractCharsetFromContent(nsString* attributeValue, nsHtml5TreeBuilder* tb);
123   private:
124     void checkMetaCharset(nsHtml5HtmlAttributes* attributes);
125   public:
126     void endTag(nsHtml5ElementName* elementName);
127   private:
128     void endTagTemplateInHead();
129     int32_t findLastInTableScopeOrRootTemplateTbodyTheadTfoot();
130     int32_t findLast(nsIAtom* name);
131     int32_t findLastInTableScope(nsIAtom* name);
132     int32_t findLastInButtonScope(nsIAtom* name);
133     int32_t findLastInScope(nsIAtom* name);
134     int32_t findLastInListScope(nsIAtom* name);
135     int32_t findLastInScopeHn();
136     void generateImpliedEndTagsExceptFor(nsIAtom* name);
137     void generateImpliedEndTags();
138     bool isSecondOnStackBody();
139     void documentModeInternal(nsHtml5DocumentMode m, nsString* publicIdentifier, nsString* systemIdentifier, bool html4SpecificAdditionalErrorChecks);
140     bool isAlmostStandards(nsString* publicIdentifier, nsString* systemIdentifier);
141     bool isQuirky(nsIAtom* name, nsString* publicIdentifier, nsString* systemIdentifier, bool forceQuirks);
142     void closeTheCell(int32_t eltPos);
143     int32_t findLastInTableScopeTdTh();
144     void clearStackBackTo(int32_t eltPos);
145     void resetTheInsertionMode();
146     void implicitlyCloseP();
147     bool debugOnlyClearLastStackSlot();
148     bool debugOnlyClearLastListSlot();
149     void pushTemplateMode(int32_t mode);
150     void push(nsHtml5StackNode* node);
151     void silentPush(nsHtml5StackNode* node);
152     void append(nsHtml5StackNode* node);
insertMarker()153     inline void insertMarker()
154     {
155       append(nullptr);
156     }
157 
158     void clearTheListOfActiveFormattingElementsUpToTheLastMarker();
isCurrent(nsIAtom * name)159     inline bool isCurrent(nsIAtom* name)
160     {
161       return stack[currentPtr]->ns == kNameSpaceID_XHTML && name == stack[currentPtr]->name;
162     }
163 
164     void removeFromStack(int32_t pos);
165     void removeFromStack(nsHtml5StackNode* node);
166     void removeFromListOfActiveFormattingElements(int32_t pos);
167     bool adoptionAgencyEndTag(nsIAtom* name);
168     void insertIntoStack(nsHtml5StackNode* node, int32_t position);
169     void insertIntoListOfActiveFormattingElements(nsHtml5StackNode* formattingClone, int32_t bookmark);
170     int32_t findInListOfActiveFormattingElements(nsHtml5StackNode* node);
171     int32_t findInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker(nsIAtom* name);
172     void maybeForgetEarlierDuplicateFormattingElement(nsIAtom* name, nsHtml5HtmlAttributes* attributes);
173     int32_t findLastOrRoot(nsIAtom* name);
174     int32_t findLastOrRoot(int32_t group);
175     bool addAttributesToBody(nsHtml5HtmlAttributes* attributes);
176     void addAttributesToHtml(nsHtml5HtmlAttributes* attributes);
177     void pushHeadPointerOntoStack();
178     void reconstructTheActiveFormattingElements();
179     void insertIntoFosterParent(nsIContentHandle* child);
180     nsIContentHandle* createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes);
181     nsIContentHandle* createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
182     bool isInStack(nsHtml5StackNode* node);
183     void popTemplateMode();
184     void pop();
185     void silentPop();
186     void popOnEof();
187     void appendHtmlElementToDocumentAndPush(nsHtml5HtmlAttributes* attributes);
188     void appendHtmlElementToDocumentAndPush();
189     void appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes* attributes);
190     void appendToCurrentNodeAndPushBodyElement(nsHtml5HtmlAttributes* attributes);
191     void appendToCurrentNodeAndPushBodyElement();
192     void appendToCurrentNodeAndPushFormElementMayFoster(nsHtml5HtmlAttributes* attributes);
193     void appendToCurrentNodeAndPushFormattingElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
194     void appendToCurrentNodeAndPushElement(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
195     void appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
196     void appendToCurrentNodeAndPushElementMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
197     bool annotationXmlEncodingPermitsHtml(nsHtml5HtmlAttributes* attributes);
198     void appendToCurrentNodeAndPushElementMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
199     void appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
200     void appendVoidElementToCurrentMayFoster(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
201     void appendVoidElementToCurrentMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
202     void appendVoidElementToCurrentMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
203     void appendVoidElementToCurrentMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes);
204     void appendVoidElementToCurrent(nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form);
205     void appendVoidFormToCurrent(nsHtml5HtmlAttributes* attributes);
206   protected:
207     void accumulateCharacters(const char16_t* buf, int32_t start, int32_t length);
208     void requestSuspension();
209     nsIContentHandle* createElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* intendedParent);
210     nsIContentHandle* createElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form, nsIContentHandle* intendedParent);
211     nsIContentHandle* createHtmlElementSetAsRoot(nsHtml5HtmlAttributes* attributes);
212     void detachFromParent(nsIContentHandle* element);
213     bool hasChildren(nsIContentHandle* element);
214     void appendElement(nsIContentHandle* child, nsIContentHandle* newParent);
215     void appendChildrenToNewParent(nsIContentHandle* oldParent, nsIContentHandle* newParent);
216     void insertFosterParentedChild(nsIContentHandle* child, nsIContentHandle* table, nsIContentHandle* stackParent);
217     nsIContentHandle* createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form, nsIContentHandle* table, nsIContentHandle* stackParent);
218     ;void insertFosterParentedCharacters(char16_t* buf, int32_t start, int32_t length, nsIContentHandle* table, nsIContentHandle* stackParent);
219     void appendCharacters(nsIContentHandle* parent, char16_t* buf, int32_t start, int32_t length);
220     void appendIsindexPrompt(nsIContentHandle* parent);
221     void appendComment(nsIContentHandle* parent, char16_t* buf, int32_t start, int32_t length);
222     void appendCommentToDocument(char16_t* buf, int32_t start, int32_t length);
223     void addAttributesToElement(nsIContentHandle* element, nsHtml5HtmlAttributes* attributes);
224     void markMalformedIfScript(nsIContentHandle* elt);
225     void start(bool fragmentMode);
226     void end();
227     void appendDoctypeToDocument(nsIAtom* name, nsString* publicIdentifier, nsString* systemIdentifier);
228     void elementPushed(int32_t ns, nsIAtom* name, nsIContentHandle* node);
229     void elementPopped(int32_t ns, nsIAtom* name, nsIContentHandle* node);
230   public:
cdataSectionAllowed()231     inline bool cdataSectionAllowed()
232     {
233       return isInForeign();
234     }
235 
236   private:
237     bool isInForeign();
238     bool isInForeignButNotHtmlOrMathTextIntegrationPoint();
239   public:
240     void setFragmentContext(nsIAtom* context, int32_t ns, nsIContentHandle* node, bool quirks);
241   protected:
242     nsIContentHandle* currentNode();
243   public:
244     bool isScriptingEnabled();
245     void setScriptingEnabled(bool scriptingEnabled);
246     void setIsSrcdocDocument(bool isSrcdocDocument);
247     void flushCharacters();
248   private:
249     bool charBufferContainsNonWhitespace();
250   public:
251     nsAHtml5TreeBuilderState* newSnapshot();
252     bool snapshotMatches(nsAHtml5TreeBuilderState* snapshot);
253     void loadState(nsAHtml5TreeBuilderState* snapshot, nsHtml5AtomTable* interner);
254   private:
255     int32_t findInArray(nsHtml5StackNode* node, jArray<nsHtml5StackNode*,int32_t> arr);
256   public:
257     nsIContentHandle* getFormPointer();
258     nsIContentHandle* getHeadPointer();
259     nsIContentHandle* getDeepTreeSurrogateParent();
260     jArray<nsHtml5StackNode*,int32_t> getListOfActiveFormattingElements();
261     jArray<nsHtml5StackNode*,int32_t> getStack();
262     jArray<int32_t,int32_t> getTemplateModeStack();
263     int32_t getMode();
264     int32_t getOriginalMode();
265     bool isFramesetOk();
266     bool isNeedToDropLF();
267     bool isQuirks();
268     int32_t getListOfActiveFormattingElementsLength();
269     int32_t getStackLength();
270     int32_t getTemplateModeStackLength();
271     static void initializeStatics();
272     static void releaseStatics();
273 
274 #include "nsHtml5TreeBuilderHSupplement.h"
275 };
276 
277 #define NS_HTML5TREE_BUILDER_OTHER 0
278 #define NS_HTML5TREE_BUILDER_A 1
279 #define NS_HTML5TREE_BUILDER_BASE 2
280 #define NS_HTML5TREE_BUILDER_BODY 3
281 #define NS_HTML5TREE_BUILDER_BR 4
282 #define NS_HTML5TREE_BUILDER_BUTTON 5
283 #define NS_HTML5TREE_BUILDER_CAPTION 6
284 #define NS_HTML5TREE_BUILDER_COL 7
285 #define NS_HTML5TREE_BUILDER_COLGROUP 8
286 #define NS_HTML5TREE_BUILDER_FORM 9
287 #define NS_HTML5TREE_BUILDER_FRAME 10
288 #define NS_HTML5TREE_BUILDER_FRAMESET 11
289 #define NS_HTML5TREE_BUILDER_IMAGE 12
290 #define NS_HTML5TREE_BUILDER_INPUT 13
291 #define NS_HTML5TREE_BUILDER_ISINDEX 14
292 #define NS_HTML5TREE_BUILDER_LI 15
293 #define NS_HTML5TREE_BUILDER_LINK_OR_BASEFONT_OR_BGSOUND 16
294 #define NS_HTML5TREE_BUILDER_MATH 17
295 #define NS_HTML5TREE_BUILDER_META 18
296 #define NS_HTML5TREE_BUILDER_SVG 19
297 #define NS_HTML5TREE_BUILDER_HEAD 20
298 #define NS_HTML5TREE_BUILDER_HR 22
299 #define NS_HTML5TREE_BUILDER_HTML 23
300 #define NS_HTML5TREE_BUILDER_NOBR 24
301 #define NS_HTML5TREE_BUILDER_NOFRAMES 25
302 #define NS_HTML5TREE_BUILDER_NOSCRIPT 26
303 #define NS_HTML5TREE_BUILDER_OPTGROUP 27
304 #define NS_HTML5TREE_BUILDER_OPTION 28
305 #define NS_HTML5TREE_BUILDER_P 29
306 #define NS_HTML5TREE_BUILDER_PLAINTEXT 30
307 #define NS_HTML5TREE_BUILDER_SCRIPT 31
308 #define NS_HTML5TREE_BUILDER_SELECT 32
309 #define NS_HTML5TREE_BUILDER_STYLE 33
310 #define NS_HTML5TREE_BUILDER_TABLE 34
311 #define NS_HTML5TREE_BUILDER_TEXTAREA 35
312 #define NS_HTML5TREE_BUILDER_TITLE 36
313 #define NS_HTML5TREE_BUILDER_TR 37
314 #define NS_HTML5TREE_BUILDER_XMP 38
315 #define NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT 39
316 #define NS_HTML5TREE_BUILDER_TD_OR_TH 40
317 #define NS_HTML5TREE_BUILDER_DD_OR_DT 41
318 #define NS_HTML5TREE_BUILDER_H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6 42
319 #define NS_HTML5TREE_BUILDER_MARQUEE_OR_APPLET 43
320 #define NS_HTML5TREE_BUILDER_PRE_OR_LISTING 44
321 #define NS_HTML5TREE_BUILDER_B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U 45
322 #define NS_HTML5TREE_BUILDER_UL_OR_OL_OR_DL 46
323 #define NS_HTML5TREE_BUILDER_IFRAME 47
324 #define NS_HTML5TREE_BUILDER_EMBED 48
325 #define NS_HTML5TREE_BUILDER_AREA_OR_WBR 49
326 #define NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU 50
327 #define NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY 51
328 #define NS_HTML5TREE_BUILDER_RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR 52
329 #define NS_HTML5TREE_BUILDER_RB_OR_RTC 53
330 #define NS_HTML5TREE_BUILDER_PARAM_OR_SOURCE_OR_TRACK 55
331 #define NS_HTML5TREE_BUILDER_MGLYPH_OR_MALIGNMARK 56
332 #define NS_HTML5TREE_BUILDER_MI_MO_MN_MS_MTEXT 57
333 #define NS_HTML5TREE_BUILDER_ANNOTATION_XML 58
334 #define NS_HTML5TREE_BUILDER_FOREIGNOBJECT_OR_DESC 59
335 #define NS_HTML5TREE_BUILDER_NOEMBED 60
336 #define NS_HTML5TREE_BUILDER_FIELDSET 61
337 #define NS_HTML5TREE_BUILDER_OUTPUT 62
338 #define NS_HTML5TREE_BUILDER_OBJECT 63
339 #define NS_HTML5TREE_BUILDER_FONT 64
340 #define NS_HTML5TREE_BUILDER_KEYGEN 65
341 #define NS_HTML5TREE_BUILDER_MENUITEM 66
342 #define NS_HTML5TREE_BUILDER_TEMPLATE 67
343 #define NS_HTML5TREE_BUILDER_IMG 68
344 #define NS_HTML5TREE_BUILDER_RT_OR_RP 69
345 #define NS_HTML5TREE_BUILDER_IN_ROW 0
346 #define NS_HTML5TREE_BUILDER_IN_TABLE_BODY 1
347 #define NS_HTML5TREE_BUILDER_IN_TABLE 2
348 #define NS_HTML5TREE_BUILDER_IN_CAPTION 3
349 #define NS_HTML5TREE_BUILDER_IN_CELL 4
350 #define NS_HTML5TREE_BUILDER_FRAMESET_OK 5
351 #define NS_HTML5TREE_BUILDER_IN_BODY 6
352 #define NS_HTML5TREE_BUILDER_IN_HEAD 7
353 #define NS_HTML5TREE_BUILDER_IN_HEAD_NOSCRIPT 8
354 #define NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP 9
355 #define NS_HTML5TREE_BUILDER_IN_SELECT_IN_TABLE 10
356 #define NS_HTML5TREE_BUILDER_IN_SELECT 11
357 #define NS_HTML5TREE_BUILDER_AFTER_BODY 12
358 #define NS_HTML5TREE_BUILDER_IN_FRAMESET 13
359 #define NS_HTML5TREE_BUILDER_AFTER_FRAMESET 14
360 #define NS_HTML5TREE_BUILDER_INITIAL 15
361 #define NS_HTML5TREE_BUILDER_BEFORE_HTML 16
362 #define NS_HTML5TREE_BUILDER_BEFORE_HEAD 17
363 #define NS_HTML5TREE_BUILDER_AFTER_HEAD 18
364 #define NS_HTML5TREE_BUILDER_AFTER_AFTER_BODY 19
365 #define NS_HTML5TREE_BUILDER_AFTER_AFTER_FRAMESET 20
366 #define NS_HTML5TREE_BUILDER_TEXT 21
367 #define NS_HTML5TREE_BUILDER_IN_TEMPLATE 22
368 #define NS_HTML5TREE_BUILDER_CHARSET_INITIAL 0
369 #define NS_HTML5TREE_BUILDER_CHARSET_C 1
370 #define NS_HTML5TREE_BUILDER_CHARSET_H 2
371 #define NS_HTML5TREE_BUILDER_CHARSET_A 3
372 #define NS_HTML5TREE_BUILDER_CHARSET_R 4
373 #define NS_HTML5TREE_BUILDER_CHARSET_S 5
374 #define NS_HTML5TREE_BUILDER_CHARSET_E 6
375 #define NS_HTML5TREE_BUILDER_CHARSET_T 7
376 #define NS_HTML5TREE_BUILDER_CHARSET_EQUALS 8
377 #define NS_HTML5TREE_BUILDER_CHARSET_SINGLE_QUOTED 9
378 #define NS_HTML5TREE_BUILDER_CHARSET_DOUBLE_QUOTED 10
379 #define NS_HTML5TREE_BUILDER_CHARSET_UNQUOTED 11
380 #define NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK INT32_MAX
381 
382 
383 #endif
384 
385