+
     h  c                   s   ^RI Ht ^RIHtHt ^RIHtHt  ^RI Ht	 ^ RIt^ RIt^ RIt ]P                  R"8  d   ^ RItM^ RIt]P"                  ! 4       tR tRt]P*                  ! R]P,                  ]P.                  ,          4      t]P*                  ! R	]P,                  ]P.                  ,          4      t]P*                  ! R
]P.                  4      t]P*                  ! R4      t]P*                  ! R4      t]P*                  ! R4      t]P*                  ! R4      tRs]P*                  ! R]P@                  4      t!]P*                  ! R4      t"]P*                  ! R4      t#]P*                  ! R4      t$]P*                  ! R4      t%]P*                  ! R4      t&]P*                  ! R4      t']P*                  ! R4      t(R t)R t*R t+R t,R t-R t.R t/R t0R t1 ! R  R!]24      t3R#   ]
 d	    ^ RI	t	 ELi ; i  ]
 d    Rt ELi ; i)#   )model)COMMON_TYPESresolve_common_type)FFIError	CDefError)
_pycparserNc                  s    ^ RI p ^ RIp R#     N)Zpycparser.yacctabZpycparser.lextab)	pycparsers    3/usr/lib64/python3.14/site-packages/cffi/cparser.py%_workaround_for_static_import_findersr      s
         z<cdef source string>z/\*.*?\*/|//([^\n\\]|\\.)*?$z?^\s*#\s*define\s+([A-Za-z_][A-Za-z_0-9]*)\b((?:[^\n\\]|\\.)*?)$z^[ \t]*#[ \t]*(?:line|\d+)\b.*$z=\s*\.\.\.\s*[,}]|\.\.\.\s*\}z__dotdotdot\d+__$z\[\s*\.\.\.\s*\]z\w+|\Sz-?0?x?[0-9a-f]+[lu]*$z\b(__stdcall|WINAPI)\bz[(]\s*(__stdcall|WINAPI)\bz\b__cdecl\bz9\bextern\s*"(Python|Python\s*\+\s*C|C\s*\+\s*Python)"\s*.z'[*]\s*((const|volatile|restrict)\b\s*)+z3(\b(int|long|short|signed|unsigned|char)\s*)+\.\.\.z\b(double|float)\s*\.\.\.c                  sH    \         f   \        P                  ! 4       s \         # N)_parser_cacher	   ZCParser r   r
   _get_parserr   2   s    !))+r   c                 s   . p \         P                  V 4      pV'       g   EMVP                  V RVP                  4        4       VP                  R4       RpVP                  VP	                  4       4       VP                  4       pV P                  RV4      '       d   VP                  R4       VR,          p^ pTpV\        V 4      8  dM   W,          pVR8X  d   V^,          pM(VR8X  d   V^ 8X  d   M$V^,          pMVR9   d	   V^ 8X  d   MV^,          pK\  WV V,           WR ,           p EK-  VP                  V 4       RP                  V4      # )TN()*z,;= )	_r_star_const_spacesearchappendstartgroupend
startswithlenjoin)csourcepartsmatchclosingendposZleveliZcs   &       r
   _workaround_for_old_pycparserr$   8   s"    E
#**73W^ekkm,-SS7U[[]#c6**LLw#~w#g,
ACx
cA:
eA:FA#g-;	LL775>r   c                 s*   . p \         P                  V 4      pV'       g   EMPVP                  4       ^,
          pVP                  V RVP	                  4        4       RVP                  ^4      9   d   VP                  R4       MVP                  R4       W,          R8X  du   V P                  RV4      pV^ 8  d   \        R4      hV P                  RV^,           V4      ^ 8  d   \        R4      hVP                  W^,           V 4       W^,           R p MIV P                  R	V4      pV^ 8  d   \        R
4      hVP                  WV^,            4       W^,           R p VP                  R4       EKp  VP                  V 4       RP                  V4      # )TNZCz(void __cffi_extern_python_plus_c_start; z!void __cffi_extern_python_start; Z{Z}z!'extern "Python" {': no '}' foundz7cannot use { } inside a block 'extern "Python" { ... }';z'extern "Python": no ';' foundz  void __cffi_extern_python_stop;r   )
_r_extern_pythonr   r   r   r   r   findr   NotImplementedErrorr   )r   r   r    r"   r!   Z	semicolons   &     r
   _preprocess_extern_pythonr)   b   se    E
 ''0q 	W^ekkm,-%++a. LLCDLL<=?c!ll3/G{ EFF||C!W5:) +H I ILL'23aij)G  S&1I1} BCCLL	!45kl+G78 
LL775>r   c                 s    R V 9  d   R# V P                  4        FI  pR V9   g   K  VP                  4       P                  R4      '       d   K3  ^ RIpVP	                  R4        R# 	  R# )"NZ#zString literal found in cdef() or type source. String literals are ignored here, but you should remove them anyway because some character sequences confuse pre-parsing.)
splitlinesZlstripr   warningswarn)r   liner,   s   &  r
   _warn_for_string_literalr/      sV    
'""$$;t{{}77<<MM 1 2  %r   c                 sv    V P                   '       g'   ^ RIpVP                  RV P                  : R24       R# R# )r   NzGlobal variable 'z_' in cdef(): for consistency with C it should have a storage class specifier (usually 'extern'))Zstorager,   r-   name)declr,   s   & r
   /_warn_for_non_extern_non_static_global_variabler2      s+    <<<.2ii: 	; r   c                 sF   a . oV3R  lp\         P                  W4      p V S3# )c                 sj   < \        S4      pSP                  V P                  4       4       R V,          # )z#line@%d)r   r   r   )mr#   line_directives   & r
   replaceZ(_remove_line_directives.<locals>.replace   s+     qwwy)A~r   _r_line_directivesub)r   r6   r4   s   & @r
   _remove_line_directivesr:      s,    
 O  ##G5GO##r   c                 s:   a V3R  lp\         P                  W 4      # )c                 s   < V P                  4       pVP                  R 4      '       g   \        R4      hS\        VR,          4      ,          # )z#line@zBunexpected #line directive (should have been processed and removed:i   NN)r   r   AssertionErrorint)r3   sr4   r5   r
   r6   Z*_put_back_line_directives.<locals>.replace   sE    GGI||H%%  "K L Ls1R5z**r   r7   )r   r4   r6   s   &f r
   _put_back_line_directivesr>      s    +   22r   c                 s(   \        V 4      w  rR  p\        P                  W 4      p / p\        P	                  V 4       F9  pVP                  4       w  rVVP                  RR4      P                  4       pWcV&   K;  	  \        P                  RV 4      p \        P                  R8  d   \        V 4      p \        P                  RV 4      p \        P                  RV 4      p \        P                  RV 4      p \        V 4      p \        V 4       \         P                  RV 4      p \#        \$        P	                  V 4      4      p\'        \)        V4      4       Ft  w  rVP+                  4       p	W	,          R8X  d;   V P-                  R	WP/                  4       4      p
R
V RV	 VW
^,           R 3,          p K\  RV RV	 VW	^,           R 3,          p Kv  	  \0        P                  RV 4      p \2        P                  RV 4      p V P                  R	R4      p \5        W4      p W3# )c                 s\    R V P                  4       P                  R4      R,          ,           # ) 
)r   Zcount)r3      &r
   replace_keeping_newlinesZ-_preprocess.<locals>.replace_keeping_newlines   s!    QWWY__T*T111r   z\
r   z2.14z volatile volatile const(z volatile volatile const r?   z[__dotdotdotarray__]Z=...z%s,__dotdotdot%d__ %sNz%s __dotdotdot%d__ %sz __dotdotdotint__ z __dotdotdotfloat__ z __dotdotdot__ )r:   
_r_commentr9   	_r_defineZfinditerZgroupsr6   stripr	   Z__version__r$   _r_stdcall2_r_stdcall1_r_cdeclr)   r/   _r_partial_arraylist_r_partial_enum	enumerateZreversedr   r'   r   _r_int_dotdotdot_r_float_dotdotdotr>   )r   r4   rB   macrosr    Z	macronameZ
macrovalueZmatchesZnumberZpZp2s   &          r
   _preprocessrQ      s     7w?G2nn5?GF##G, %	''399;
&y - mmB(Gv%/8 oo97CGoo97CGll3(G (0G W% ""#97CG ?++G45G"8G#45KKM:eQ		4B-!f18A1A AG .!f1811@ @G 6 ""#7AG $$%;WEG ooe%67G'AG?r   c                 s   \        \        4      pVP                  R 4       VP                  R4       VP                  R4       VP                  R4       VP                  R4       \        4       pRp^ pRp\        P	                  V 4       F  pWa9   d   VR 8X  d.   V'       d%   VP                  V4       VP                  V4       RpMxVR8X  d   Rp^ pMlVR8X  d   V^,          pM[VR8X  d   V^,          pMJVR8X  d3   V'       d*   V^ 8X  d#   VP                  V4       VP                  V4       MVP                  V4       TpK  	  V# )r%   Z,r   r   typedefFr   T)setr   add_r_wordsZfindalldiscard)r   Zlook_for_wordsZ
words_usedZ
is_typedefZparenZprevious_wordZwords   &      r
   _common_type_namesrW      s)    &Nssssy!JJEM  )!s{&&}5"**=9!&J"!


%1*&&}5"**=9t$) ** r   c                   s   a  ] tR tRt o R tR tR tR tRR ltR t	R	 t
R
 tR tR tR tR tR tR R ltR tR!R ltR"R ltR!R ltR tR#R ltR tR$R ltR tR tR tR tR tRtV t R# )%Parseri'  c                s    / V n         \        4       V n        ^ V n        \        P
                  ! 4       V n        / V n        / V n        . V n	        RV n
        R# r   )_declarationsrS   _included_declarations_anonymous_counterweakrefZWeakKeyDictionary_structnode2type_options_int_constants_recomplete_uses_new_feature)selfrA   r
   __init__ZParser.__init__)  sL    &)e#"# ' 9 9 ; !%r   c                s   \        V4      w  r\        V4      p. p\        V P                  4       FG  pVP	                  R 4      '       g   K  VR,          pVP                  V4       VP                  V4       KI  	  V\        V4      ,          p. pVP                  R4       V F  pVP                  RV,          4       K  	  VP                  R4       VP                  R\        : R24       VP                  V4       VP                  R4       RP                  V4      p\        e   \        P                  4         \        4       P                  V4      p	\        e   \        P#                  4        X	Y!3#   \        P                  P                   d   p
T P!                  Y4        R	p
?
LUR	p
?
ii ; i  \        e   \        P#                  4        i i ; i)
typedef :i   NNz*# 1 "<cdef automatic initialization code>"ztypedef int %s;z@typedef int __dotdotdotint__, __dotdotdotfloat__, __dotdotdot__;z# 1 "r*   r   r@   N)rQ   rW   ZsortedrY   r   r   rV   CDEF_SOURCE_STRINGr   lockZacquirer   parser	   Zc_parserZ
ParseErrorconvert_pycparser_errorZrelease)rb   r   rP   Zctn	typenamesr0   csourcelinesZtypenameZfullcsourceastes   &&         r
   _parseZParser._parse3  s   %g.
 !)	4--.Dz**Bx  &D!	 /
 	VC[ 	HI!H 1H <= " . 	/ 	*<>?G$Bii-LLN	-%%k2C F## !!,, 	5((44	5   s*   <E5 5F/F*%F2 *F//F2 2Gc                s   R p\        V4      p\        P                  ! \        : R2V4      pV'       dW   \	        VP                  ^4      ^
4      pVP                  4       p^Tu;8:  d   \        V4      8:  d   M V# Wv^,
          ,          pV# )Nz:(\d+):)strrer    re   r<   r   r+   r   )rb   rl   r   r.   msgr    Zlinenumrj   s   &&&     r
   _convert_pycparser_errorZParser._convert_pycparser_errorZ  su     !f);=sC%++a."-G"--/LG0s<00 $AI.r   c                s    V P                  W4      p\        V4      pV'       d   R VP                  4       : RV: 2pMRV: 2p\        V4      h)zcannot parse "z"
zparse error
)rq   rn   rF   r   )rb   rl   r   r.   rp      &&&  r
   rh   ZParser.convert_pycparser_errorh  sI    ,,Q8!f4-1ZZ\3?C  (+,Cnr   Nc                s<   V'       d)   VR 8w  d   \        R4      hV'       d   \        R4      h^pM/V'       d&   WD^,
          ,          '       d   \        RV: 24      hM^ pV P                  p RVRVRV/V n        V P                  V4       W`n        R#   Y`n        i ; i)TzB'packed' should be False or True; use 'pack' to give another valuez$cannot give both 'pack' and 'packed'z#'pack' must be a power of two, not overridepacked	dllexportN)
ValueErrorr^   _internal_parse)rb   r   rs   rt   Zpackru   Zprev_optionss   &&&&&& r
   rg   ZParser.parser  s    ~  "@ A A !GHHDax   "   ! D}}	)'%t()5DM   )(MLMs   -B Bc           	     s   V P                  V4      w  r#pV P                  V4       \        VP                  4      pV F  pVP                  R 8X  g   K   M	  Rp RV n        V EF  pTp\        V\        P                  P                  4      '       d   V P                  V4       KC  \        V\        P                  P                  4      '       Ed!   VP                  '       g   \        RV4      h^ p\        VP                  P                  \        P                  P                  4      '       dP   VP                  P                  P                  R,          P!                  R4      '       d   V P#                  V4      pEML\        VP                  \        P                  P$                  4      '       d   \        VP                  P                  \        P                  P&                  4      '       d   \        VP                  P                  P                  \        P                  P                  4      '       dY   VP                  P                  P                  P                  R,          P!                  R4      '       d   V P)                  V4      pM:V P+                  VP                  VP                  RRVP                  : R2R7      w  rV P-                  R	VP                  ,           WR
7       EK  VP.                  P0                  R8X  d   ^ RIp	V	P5                  R4       EK  \        RVP.                  P0                  ,          V4      h	  R#   \         d:   p
\7        T
P8                  4      ^8X  d   T
P8                  T3,           T
n        h Rp
?
i\:         dG   p
T P=                  Y4      pT'       d(   T
P8                  ^ ,          RT,          ,           3T
n        h Rp
?
ii ; i)__dotdotdot__N__cffi_extern_python_stopz!typedef does not declare any nameZ__dotdotdotTz*(z *)0)r0   partial_length_oktypedef_examplerd   qualsZPragmaa  #pragma in cdef() are entirely ignored. They should be removed for now, otherwise your code might behave differently in a future version of CFFI if #pragma support gets added. Note that '#pragma pack' needs to be replaced with the 'packed' keyword argument to cdef().zBunexpected <%s>: this construct is valid C but not valid in cdef()z
    *** Err: %s)rm   _process_macrosZiterextr0   _inside_extern_python
isinstancer	   c_astZDecl_parse_declZTypedefr   typeIdentifierTypenamesr   _get_unknown_typePtrDeclTypeDecl_get_unknown_ptr_type_get_type_and_quals_declareZ	__class____name__r,   r-   r   argsr   rq   )rb   r   rk   rP   Ziteratorr1   Zcurrent_declr}   Zrealtyper,   rl   rp   s   &&          r
   rw   ZParser._internal_parse  s   #{{73WV$ =DyyO+ 
 /	)DD& #dIOO$8$899$$T*ioo&=&=>>999'(K(,. .E"499>>9??3Q3QRR IINN004??NN#'#9#9$#?$TYY	0G0GHH$TYY^^Y__5M5MNN$TYY^^%8%8%.__%C%CE E))..--33B7BB=QQ#'#=#=d#C*.*B*B IIDII:>)),E +C +G MM*tyy"8(MP^^,,8#MM?@ $ %@$(NN$;$;%<=AC CE !J  	166{a</1 	//;C&&)&9C&??A		s3   BM #I*M O"4NO"O"AOO"c                s    WP                   9   d*   V P                   V,          V8X  d   R # \        RV: 24      hW P                   V&   R # )Nz#multiple declarations of constant: )r_   r   )rb   keyZval   &&&r
   _add_constantsZParser._add_constants  sG    %%%""3'3.;>@B B#&C r   c                s   VP                  4       P                  R 4      pVP                  R4      pV'       d
   VR,          pVP                  R4      '       d/   VR8w  d(   VP                  R4      '       g   RVR,          ,           p\        V^ 4      pV'       d   V) pV P	                  W4       V P                  RV,           V4       R# )Zul-r    NN00xZ0omacro N)lowerrstripr   r<   r   r   )rb   r0   Zint_strZnegZpyvaluerr   r
   _add_integer_constantZParser._add_integer_constant  s    --/((.  %bkGs##3**400WR[(Ggq/hGD*how/r   c                s*   VP                  4        F~  w  r#VP                  4       p\        P                  V4      '       d   V P	                  W#4       KC  VR 8X  d   V P                  RV,           V4       Ke  \        RV: RV: RV: RV: 24      h	  R# )rC   r   z5only supports one of the following syntax:
  #define z+ ...     (literally dot-dot-dot)
  #define zM NUMBER  (with NUMBER an integer constant, decimal/hex/octal)
got:
  #define r?   N)itemsrF   _r_int_literalr    r   r   r   )rb   rP   r   values   &&  r
   r   ZParser._process_macros  st     ,,.JCKKME##E****36%hne4 Ce-. . )r   c                s   V P                  W4      pV P                  P                  R 4      '       d   RpM*V P                  R8X  d   RpMV P                  R8X  d   RpMRpV P	                  WCP
                  ,           V4       R# )ru   zdllexport_python Z__cffi_extern_python_startzextern_python Z!__cffi_extern_python_plus_c_startzextern_python_plus_c z	function N)_get_type_pointerr^   getr   r   r0   )rb   tpr}   r1   Ztags   &&&& r
   _declare_functionZParser._declare_function  sm    ##B.==[))%C''+GG"C''+NN)CCcIIor*r   c                sH   VP                   p\        V\        P                  P                  4      '       d3   V P                  W!P                  R 7      w  r4V P                  W4V4       R# \        V\        P                  P                  4      '       d   V P                  RV4       M\        V\        P                  P                  4      '       d   V P                  RV4       M[\        V\        P                  P                  4      '       d   V P                  RV4       MVP                  '       g   \        RV4      hVP                  '       Ed   V P                  VRR7      w  r4VP                  '       d   V P                  W4V4       R# VP                  4       '       d   \        VR4      '       d~   \        VP                   R4      '       db   \"        P%                  VP                   P&                  4      '       d3   V P)                  VP                  VP                   P&                  4       R# VP                  4       '       d   \        VP                   \        P                  P*                  4      '       d   VP                   P,                  R	8X  d   \        VP                   P.                  R4      '       d}   \"        P%                  VP                   P.                  P&                  4      '       dD   V P)                  VP                  R	VP                   P.                  P&                  ,           4       R# V\0        P2                  J d5   VP                  P5                  R
4      '       d   VP                  V n        R# V P6                  R8w  d   \        R4      hV\0        P8                  ,          '       d9   VP:                  '       g'   V P=                  RVP                  ,           W4R7       R# \?        V4       V P=                  RVP                  ,           W4R7       R# R# ))r0   structunionenumz'construct does not declare any variableTrz   initr   r   Z__cffi_extern_python_ry   z<cannot declare constants or variables with 'extern "Python"'z	constant r|   z	variable N) r   r   r	   r   FuncDeclr   r0   r   Struct_get_struct_union_enum_typeUnionEnumr   Zis_raw_functionZis_integer_typehasattrr   r   r    r   r   UnaryOpopexprr   	void_typer   r   Q_CONSTZis_array_typer   r2   )rb   r1   Znoder   r}      &&   r
   r   ZParser._parse_decl  s   yydIOO445500II0FIB""2d3$	 6 677004@D)//"7"78800$?D)//"6"67700>YYY I $& & yyy 44TGK 5 M	%%%**2d;((**f--		733&,,TYY__==..tyy$))//J((**"499ioo.E.EFF		+		88&,,TYY^^-A-ABB..tyy/2TYY^^5I5I/IKEOO+ii**+BCC 26D.114OO'AB B --r7G7G7GkDII&=rOGMkDII&=rOA r   c                s2    V P                  V4      ^ ,          # r   )parse_type_and_quals)rb   cdecl   &&r
   
parse_typeZParser.parse_type0  s    ((/22r   c                sr   V P                  R V,          4      R,          w  r#VP                  R,          P                  P                  P                  ^ ,          p\        V\        P                  P                  4      '       d   \        RVP                  : R24      hV P                  VP                  4      # )zvoid __dummy(
%s
);:N   Nzunknown identifier ''r~   )rm   r   r   r   paramsr   r	   r   IDr   r0   r   )rb   r   rk   rP   exprnoder   r
   r   ZParser.parse_type_and_quals3  s    kk"9E"AB2F772;##((//2h	 2 233HII''66r   c                s6   WP                   9   dT   V P                   V,          w  rVWRJ d	   Wd8X  d   R # V P                  P                  R4      '       g   \        RV: R24      hW$3V P                   V&   V'       d   V P                  P                  V4       R # R # )Nrs   zmultiple declarations of z5 (for interactive usage, try cdef(xx, override=True)))rY   r^   r   r   rZ   rT   )rb   r0   Zobjincludedr}   ZprevobjZ	prevqualss   &&&&&  r
   r   ZParser._declare;  s    %%%!%!3!3D!9G~)"4==$$Z006:=> > %(<4 ''++C0 r   c                s   ^ p\        V\        P                  P                  \        P                  P                  34      '       dy   RVP
                  9   d   V\        P                  ,          pRVP
                  9   d   V\        P                  ,          pRVP
                  9   d   V\        P                  ,          pV# )r   constvolatileZrestrict)
r   r	   r   r   r   r}   r   r   Z
Q_VOLATILEZ
Q_RESTRICTrb   r   r}      && r
   _extract_qualsZParser._extract_qualsI  s    dY__55&__446 7 7$**$&TZZ')))TZZ')))r   c                s   \        V\        P                  4      '       d   VP                  4       # \        V\        P                  4      '       dr   VP
                  P                  R 4      '       dQ   VP
                  R,          P                  4       '       d*   VP                  f   Ve   \        P                  ! WV4      # \        P                  ! W4      # )$r   )r   r   RawFunctionTypeas_function_pointerZStructOrUnionOrEnumr0   r   Zisdigit	forcenameZNamedPointerTypePointerType)rb   r   r}   declnames   &&&&r
   r   ZParser._get_type_pointerU  s    dE1122++--tU6677		$$S))diim.C.C.E.E&8+?))$%@@  --r   c                s
   \        V\        P                  P                  4      '       d   \        VP                  \        P                  P
                  4      '       d   \        VP                  P                  4      ^8X  d   RVP                  P                  ^ ,          ,           V P                  9   dR   V P                  RVP                  P                  ^ ,          ,           ,          w  rVW`P                  V4      ,          pWV3# \        V\        P                  P                  4      '       d   VP                  f   RpMV P                  VP                  VR7      pVe   VR8X  d   RV: R2pRV,           pV P                  VP                  VVR7      w  rV\        P                  ! WW4      V3# \        V\        P                  P                   4      '       dE   V P                  VP                  4      w  rV P#                  WVR	7      pV P                  V4      pWV3# \        V\        P                  P                  4      '       Ed9   V P                  V4      pVP                  p
\        V
\        P                  P
                  4      '       Ed4   \%        V
P                  4      pVR
R.8w  d   / pV'       d2   V^ ,          pVR9   d!   VP'                  V^ 4      ^,           W&   V^  K8   . pR F6  p\)        VP'                  V^ 4      4       F  pVP+                  V4       K  	  K8  	  V'       g   R.pVR.8X  d   RV9   g   RV9   d   . pW,           pRP-                  V4      pVR8X  d   \        P.                  V3# VR8X  d'   \1        RVP2                  P4                  ,          4      h\7        V V4      w  ppVVV,          3# \        V
\        P                  P8                  4      '       d   V P;                  RW4      pWV3# \        V
\        P                  P<                  4      '       d   V P;                  RW4      pWV3# \        V
\        P                  P>                  4      '       d   V P;                  RW4      pWV3# \        V\        P                  P@                  4      '       d   V PC                  W4      ^ 3# \        V\        P                  P8                  4      '       d   V P;                  RWRR7      ^ 3# \        V\        P                  P<                  4      '       d   V P;                  RWRR7      ^ 3# \1        RVP2                  P4                  ,          4      h)r    rd   Nr   rC   z_cffi_array_len(r   r   )rz   r{   )r   signedZcharshortlongr<   r?   Zvoidrx   z:%d: bad usage of "..."r   r   r   T)nestedz(:%d: bad or unsupported type declaration)r   r   r   unsigned)r   r   r   )"r   r	   r   r   r   r   r   r   rY   r   Z	ArrayDeclZdim_parse_constantr   r   	ArrayTyper   r   rK   r   Zranger   r   r   r   coordr.   r   r   r   r   r   r   _parse_function_type)rb   typenoder0   rz   r{   r   r}   ZlengthZitemtypeZ	itemqualsr   r   ZprefixesZnewnamesZprefixr#   ZidentZtp0Zquals0s   &&&&&              r
   r   ZParser._get_type_and_quals^  s    x!9!9::x}}ioo&D&DEE##$)(----a00T5G5GG**:8K8KA8N+NOIB((22E9h	 9 9::||#--LL4E . G *U?6EGF"%"7002C0? 1 AIB ??2.55h	 7 788"&":":8=="IH''d'KB''1E9h	 8 899''1E==D$	 > >?? TZZ(Xv..!H$Qx#JJ-5\\$-BQ-FHN %a!!H"?!&x||FA'>!?A$OOF3 "@ #@ !!&'"h.&H2D$&E$,EF? ??E11O+"#<$NN//$0 1 11$>VUV^,,$	 6 67755hKy $	 5 56655gtJy $	 4 45555fdIy h	 8 899,,X<a?? h	 6 67733Hh;? 4 ABCD Dh	 5 56633GX;? 4 ABCD D A##$ % 	%r   c                s   \        \        VP                  R . 4      4      p\        V4       FH  w  rE\	        VR4      '       d   K  \        RT;'       g    RV^,           \        VRR4      3,          4      h	  \        V4      ^ 8  ;'       d    \        VR,          P                  \        P                  P                  4      ;'       ds    \        VR,          P                  P                  \        P                  P                  4      ;'       d,    VR,          P                  P                  P                  R.8H  pV'       d5   VP                  4        V'       g   \        RT;'       g    R,          4      hV Uu. uF,  pV P                  ! V P!                  VP                  4      !  NK.  	  ppV'       g   V\"        P$                  .8X  d   . pV P!                  VP                  4      w  rRp\	        VP                  R	4      '       d#   VP                  P&                  RR . RO8X  d   R
p\"        P(                  ! \+        V4      WV4      # u upi )r   r   zt%s arg %d: unknown type '%s' (if you meant to use the old C syntax of giving untyped arguments, it is not supported)zin expressionr0   Z?rx   z=%s: a function with only '(...)' as argument is not correct CNr}   Z	__stdcallr~   i)r   r   r   )rK   Zgetattrr   rM   r   r   r   r   r   r	   r   r   r   r   Zpop_as_func_argr   r   r   r}   r   tuple)rb   r   Zfuncnamer   r#   ZargZellipsisZargdeclnoder   resultr}   Zabis   &&&         r
   r   ZParser._parse_function_type  s   ghmmXr:;'FA3'' !?  22?AEsFC02!2 3 3 ( K!O < <vbz	(@(@A< <vbz++ 557< < 2JOO  &&?*;; 	 JJL(+3+F+FHI I $*+#)K !!4#;#;K<L<L#MN#) 	 +DU__$55D00? 8=='**}}""23'+LL!$$U4[&CHH+s   =2Ic                s    \        V\        P                  4      '       d"   \        P                  ! VP                  V4      # \        V\        P
                  4      '       d   VP                  4       # V# r   )r   r   r   r   Zitemr   r   r   r   r
   r   ZParser._as_func_arg  sQ    dEOO,,$$TYY66e3344++--Kr   c                sH	    V P                   V,          #   \         d     Mi ; iTpTP                  pTf>   Te   RT,          pM,T ;P                  ^,          un        RT P                  ,          pR pM)TpT: RT: 2pT P                  P                  TR4      w  ryTf   TR8X  d   \        P                  ! TR R R 4      pMeTR8X  d   \        P                  ! TR R R 4      pMDTR8X  d/   TR8X  d   \        R4      hT P                  YbP                  4      pM\        R	T: 24      hTe   T P                  XT4       M'TR8X  d!   TP                  e   \        R
T,          4      hTP                  '       g   TP!                  T4       TP                  '       d5   RTP                  9   d$   T P                  RTP                  ,          T4       YpP                   T&   TR8X  d   T# TP"                  f   T# TP$                  e   \        RT,          4      h. p
. p. p. pTP"                   EF  p\'        TP(                  \*        P,                  P.                  4      '       d>   RP1                  TP(                  P2                  4      R8X  d   T P5                  Yt4       Ku  TP6                  f   RpMT P9                  TP6                  4      pRT n        T P=                  TP(                  RR7      w  ppT P:                  '       d   T P5                  Yt4       \'        T\        P                  4      '       d$   TP>                  '       d   T P5                  Yt4       T
PA                  TP                  ;'       g    R4       TPA                  T4       TPA                  T4       TPA                  T4       EK  	  \C        T
4      Tn        \C        T4      Tn"        \C        T4      Tn#        \C        T4      Tn$        TR.\K        T4      ,          8w  dB   \'        T\        P                  4      '       d"   TP>                  '       d   \        T: R24      hT PL                  P                  R4      Tn'        TPP                  '       d#   ^ Tn(        T PR                  PA                  T4       T# )Nz$%sz$%dr?   r   r   r   rx   z!Enums cannot be declared with ...zkind = z^enum %s: the '{}' declaration should appear on the first time the enum is mentioned, not laterr   zanonymous %sz"duplicate declaration of struct %sr   FTr   z!: using both bitfields and '...;'rt   )NNr~   )*r]   ZKeyErrorr0   r[   rY   r   r   Z
StructTypeZ	UnionTyper   _build_enum_typeZvaluesr;   r   r(   r   Zforce_the_namedeclsfldnamesr   r   r	   r   r   r   r   _make_partialbitsizer   _partial_lengthr   partialr   r   fldtypes
fldbitsizefldqualsr   r^   rt   Z	completedr`   )rb   kindr   r0   r   Z
force_nameexplicit_namer   r   Z_r   r   r   r   r1   r   Zfquals   &&&&&            r
   r   Z"Parser._get_struct_union_enum_type  s   	((.. 		 
yy < % %
 2''1,' %(?(? ?B M!4(C&&**3=EB:x%%mT4F__]D$E O3#$GHH**=++F$D%:;;c2&v~$++"9)<>KLM M |||j)<<<C277NMM.2<<7<&(d# 6>I
 ::I;;"@4GHH
JJD499ioo&D&DEEGGDIIOO,? ""2.||#..t||<#(D 22499EI 3 KKD%###""2.$ 0 011dlll""2.OODIIOO,OOD!g&OOE"- . HoHoj)Ho"J//"e..//BJJJ)-/+2 3 3MM%%h/	<<<BL##B'	s    ##c                s    \        V\        P                  4      '       g   \        V: R 24      hVP	                  4       '       g   V'       g   \        V: R24      hRVn        R# )z cannot be partialz is partial but has no C nameTN)r   r   ZStructOrUnionr   Z
has_c_namer(   r   )rb   r   r   r   r
   r   ZParser._make_partialh  sE    "e1122b:;;}}v%"&NOO
r   c                sB	   \        V\        P                  P                  4      '       d   VP                  pR V^ ,          u;8:  d   R8:  dE   M MAVP                  R4      p VP                  R 4      '       d   \        V^4      # \        V^
4      # V^ ,          R8X  dO   VR,          R8X  dA   \        V4      ^8X  g   \        V4      ^8X  d!   V^,          R8X  d   \        VR,          4      # \        RV: 24      h\        V\        P                  P                  4      '       d-   VP                  R	8X  d   V P                  VP                   4      # \        V\        P                  P                  4      '       d.   VP                  R
8X  d   V P                  VP                   4      ) # \        V\        P                  P"                  4      '       d9   VP$                  V P&                  9   d   V P&                  VP$                  ,          # \        V\        P                  P"                  4      '       dI   VP$                  R8X  d8   V'       d
   RV n        R# \+        RVP,                  P.                  ,          4      h\        V\        P                  P0                  4      '       EdP   V P                  VP2                  4      pV P                  VP4                  4      pVP                  R	8X  d	   WE,           # VP                  R
8X  d	   WE,
          # VP                  R8X  d	   WE,          # VP                  R8X  d   V P7                  WE4      # VP                  R8X  d   W@P7                  WE4      V,          ,
          # VP                  R8X  d	   WE,          # VP                  R8X  d	   WE,	          # VP                  R8X  d	   WE,          # VP                  R8X  d	   WE,          # VP                  R8X  d	   WE,          # \+        RVP,                  P.                  ,          4      h  \         dh    \        T4      ^8  dU   TP                  4       R,          R8X  d   \        T^4      u # TP                  4       R,          R8X  d   \        T^4      u #  Mi ; i\        RT: 24      h)r   Z9ZuUlL:r   r   Nr   Z0bzinvalid constant r   Z\Z+r   Z__dotdotdotarray__TrC   zT:%d: unsupported '[...]' here, cannot derive the actual array length in this contextr   Z/Z%z<<z>>Z&Z|Z^z?:%d: unsupported expression: expected a simple numeric constantr~   i)r   r	   r   ZConstantr   r   r   r<   rv   r   r   r   Zordr   r   r   r   r   r0   r_   r   r   r   r.   ZBinaryOpleftright_c_div)rb   r   rz   r=   r   r   s   &&&   r
   r   ZParser._parse_constanto  sy    h	 8 899Aad!c!HHV$
-||C(("1ay("1bz) 12#FaKCFaKAaDDL1R5z! <==x!8!899s"''66x!8!899s"((777x!3!344!4!44&&x}}55x!3!344MM%99 '+$ E%^^001 2 2 h	 8 899''6D((8E{{c!|##|##|##{{4//#kk$6>>>$}$$}$#|##|##|# 13;>>3F3FG H 	Hu " -1vz779S>T1#&q":-WWYs^t3#&q!9,-   <==s%   "P 9P P AR"(RRc                sl    W,          pV^ 8  V^ 8  ,          '       d   W,          ^ 8w  d
   V^,          pV# r   r   )rb   ZaZbr   s   &&& r
   r   ZParser._c_div  s2    Uq1uAEa<aKFr   c                s$   Ve   Rp. p. p^ pVP                    F  p\        P                  VP                  4      '       d   RpK,  VP                  e   V P                  VP                  4      pVP                  VP                  4       VP                  V4       V P                  VP                  V4       V^,          pK  	  \        V4      p\        V4      p\        P                  ! WV4      pW8n        V# \        P                  ! VRR4      pV# )NFTr   )enumerators_r_enum_dotdotdotr    r0   r   r   r   r   r   r   ZEnumTyper   )	rb   r   r   r   r   Z
enumvaluesZnextenumvaluer   r   s	   &&&      r
   r   ZParser._build_enum_type  s    GKJM))$**49955"G::)$($8$8$DM""499-!!-0##DII}=" *  ,Kz*JJGB J 	 r26B	r   c                sX   VP                   P                  4        FW  w  pw  r4VP                  R 4      '       d   K!  VP                  R^4      ^ ,          pVR9   g   KC  V P	                  W#RVR7       KY  	  VP
                  P                  4        F  w  rgV P                  Wg4       K  	  R# )zanonymous $enum_$r?   T)r   r}   N)r   r   r   Z	anonymousrR   )rY   r   r   Zsplitr   r_   r   )rb   Zotherr0   r   r}   r   ZkZvs   &&      r
   includeZParser.include  s    !&!4!4!:!:!<D+2233::c1%a(DJJdUC "= ((..0DA% 1r   c                s   VP                   P                   P                  pVR .8X  d!   \        P                  ! VP                  4      # VR.8X  dG   V P
                  f   RVP                  ,          V n        \        P                  ! VP                  4      # VR.8X  dG   V P
                  f   RVP                  ,          V n        \        P                  ! VP                  4      # \        RVP                  P                  ,          4      h)rx   Z__dotdotdotint__z'typedef int... %s'Z__dotdotdotfloat__z'typedef float... %s'*:%d: unsupported usage of "..." in typedef)r   r   r   Zunknown_typer0   ra   ZUnknownIntegerTypeZUnknownFloatTyper   r   r.   )rb   r1   ri   r   r
   r   ZParser._get_unknown_type  s    IINN((	))%%dii00+,,%%-)>)J&++DII66-..%%-)@499)L&))$))44C) * 	*r   c                s    VP                   P                   P                   P                  R .8X  d!   \        P                  ! VP                  4      # \        RVP                  P                  ,          4      h)rx   r   )r   r   r   Zunknown_ptr_typer0   r   r   r.   )rb   r1   r   r
   r   ZParser._get_unknown_ptr_type  sV    99>>$$(99))$))44C) * 	*r   )
r[   rY   rZ   r   r_   r^   r   r`   r]   ra   )FFNF)Fr   r   )NFN)NF)F)!r   Z
__module__Z__qualname__Z__firstlineno__rc   rm   rq   rh   rg   rw   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r
   rX   rX   '  s     &%$N)0=~'0."
+1Pf371
.g%R!IFtlGHR0&*&* *r   rX   )i   )4r   r   Zcommontypesr   r   Zerrorr   r   r   r	   ZImportErrorr\   ro   ZsysZversion_infoZthreadZ_threadZallocate_lockrf   r   re   ZcompileZDOTALLZ	MULTILINErD   rE   r8   rL   r   rJ   rU   r   Z
IGNORECASEr   rH   rG   rI   r&   r   rN   rO   r   r$   r)   r/   r2   r:   r>   rQ   rW   ZobjectrX   r   r   r
   <module>r      s    : &)  
$   "D , ZZ7		BLL02
ZZ 2		BLL02	 JJA2<<P **=>JJ34 ::12 ::i 4bmmDjj23jj67::n%:: O P jj.0 :: ( ) ZZ <= (T0d
;$3@D%PP*V P*C	    Ds"   G! +G3 !G0/G03	H ?H 