Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
internal.h File Reference
#include <limits.h>
#include "expat.h"

Go to the source code of this file.

Macros

#define FASTCALL
 
#define PTRCALL
 
#define PTRFASTCALL
 
#define inline
 
#define EXPAT_FMT_ULL(midpart)
 
#define UNUSED_P(p)
 
#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT    100.0f
 
#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT    8388608
 

Functions

void _INTERNAL_trim_to_complete_utf8_characters (const char *from, const char **fromLimRef)
 

Macro Definition Documentation

◆ EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT

#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT    8388608

Definition at line 144 of file internal.h.

144#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT \
145 8388608 // 8 MiB, 2^23

Referenced by XML_GetFeatureList().

◆ EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT

#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT    100.0f

Definition at line 142 of file internal.h.

142#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT \
143 100.0f

Referenced by XML_GetFeatureList().

◆ EXPAT_FMT_ULL

#define EXPAT_FMT_ULL ( midpart)
Value:
"%" midpart "llu"

Definition at line 122 of file internal.h.

◆ FASTCALL

#define FASTCALL

Definition at line 81 of file internal.h.

◆ inline

#define inline

Definition at line 104 of file internal.h.

◆ PTRCALL

#define PTRCALL

Definition at line 85 of file internal.h.

◆ PTRFASTCALL

#define PTRFASTCALL

Definition at line 89 of file internal.h.

◆ UNUSED_P

#define UNUSED_P ( p)
Value:
(void)p

Definition at line 135 of file internal.h.

Referenced by XML_UseForeignDTD().

Function Documentation

◆ _INTERNAL_trim_to_complete_utf8_characters()

void _INTERNAL_trim_to_complete_utf8_characters ( const char * from,
const char ** fromLimRef )

Definition at line 326 of file xmltok.c.

327 {
328 const char *fromLim = *fromLimRef;
329 size_t walked = 0;
330 for (; fromLim > from; fromLim--, walked++) {
331 const unsigned char prev = (unsigned char)fromLim[-1];
332 if ((prev & 0xf8u)
333 == 0xf0u) { /* 4-byte character, lead by 0b11110xxx byte */
334 if (walked + 1 >= 4) {
335 fromLim += 4 - 1;
336 break;
337 } else {
338 walked = 0;
339 }
340 } else if ((prev & 0xf0u)
341 == 0xe0u) { /* 3-byte character, lead by 0b1110xxxx byte */
342 if (walked + 1 >= 3) {
343 fromLim += 3 - 1;
344 break;
345 } else {
346 walked = 0;
347 }
348 } else if ((prev & 0xe0u)
349 == 0xc0u) { /* 2-byte character, lead by 0b110xxxxx byte */
350 if (walked + 1 >= 2) {
351 fromLim += 2 - 1;
352 break;
353 } else {
354 walked = 0;
355 }
356 } else if ((prev & 0x80u)
357 == 0x00u) { /* 1-byte character, matching 0b0xxxxxxx */
358 break;
359 }
360 }
361 *fromLimRef = fromLim;
362}