+
    Ĉc)  c                   s   R t ^ RIt^ RIt^ RIHt ^ RI5 ^ RIHt R t/ t]! 4       ]R&   ^ ;t	t
^;tt^;tt^;tt^;tt^;tt^ ;tt^@;tt^;ttR;ttR;ttR	;tt R
;t!t"R;t#t$R;t%t&R;t't(R;t)t*R;t+t,R;t-t.R;t/t0R;t1t2R;t3t4R;t5t6R;t7t8^ ;t9t:^;t;t<^;t=t>^;t?t@^;tAtB^;tCtD^;tEtF]! RR%4      tG ! R R]H4      tI. ]InJ        ]K! ]I4      tL]R,          P                  tN]L]NnO        ]P.]NnQ        ]R,          P                  tSR]SnO        ]L.]SnQ        ]R,          P                  tU]V]UnO        ]L]V.]UnQ        ]R,          P                  tX]V]XnO        ]L]P.]XnQ        ]R,          P                  tZ]V]ZnO        ]L][]\.]ZnQ        ]R,          P                  t^]V]^nO        ]L.]^nQ        ]R,          P                  t`]P]`nO        ]L]P.]`nQ        ]R,          P                  tb]P]bnO        ]L]V.]bnQ        ]R,          P                  td]P]dnO        ]L]V.]dnQ        ]R,          P                  tf]P]fnO        ]L]V.]fnQ        ]R,          P                  th]P]hnO        ]L]V.]hnQ        ]R,          P                  tj]P]jnO        ]L.]jnQ        ]R,          P                  tl]P]lnO        ]L]P][.]lnQ        ]R,          P                  tn]P]nnO        ]L]P][.]nnQ         ! R R]o4      tpR tq ! R R]r4      ts ! R R]o4      tt]P                  ! 4       tvR  twR! txR" tyR# tzR$ t{R# )&z
Python bindings for libmagic
N)
namedtuple)Z*)find_libraryc                 sR    \         P                  P                  \        R4      4      # )zW
Loads the shared library through ctypes and returns a library
L{ctypes.CDLL} instance
magic)ctypesZcdllZLoadLibraryr        */usr/lib/python3.14/site-packages/magic.py_initr      s    
 ;;""<#899r   r   i   i   i   i  i   i   i    i @  i   i   i   i   i   i    i ? 	FileMagicc                   s    ] tR t^AtRtR# )	magic_setr   N__name__
__module____qualname____firstlineno____static_attributes__r   r   r   r	   r	   A       r   r	   c                   s   a  ] tR t^t o R tR t]R 4       t]R 4       tR t	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V tR
# )Magicc                s    Wn         R # N_magic_t)selfZms   &&r   __init__ZMagic.__init__   s    r   c                s0    \        V P                  4       R# )z?
Closes the magic database and deallocates any resources used.
N)_closer   r      &r   closeZMagic.close   s     	t}}r   c                    V f   R # \        V \        4      '       d   V #  \        V R4      #   \         d    \        T 4      u # i ; iNzutf-8)
isinstanceZstr	TypeError)Zsr   r   Z__tostrZMagic.__tostr   sE    9aH	q'?" 	q6M	   , AAc                r   r   )r   Zbytesr   )Zbr   r   Z	__tobytesZMagic.__tobytes   sF    9aH	G$$ 	8O	r    c                sz    \         P                  \        V P                  \         P	                  V4      4      4      # )z
Returns a textual description of the contents of the argument passed
as a filename or None if an error occurred and the MAGIC_ERROR flag
is set. A call to errno() will return the numeric error code.
)r   _Magic__tostr_filer   _Magic__tobytesr   filenamer   r   fileZ
Magic.file   s'     }}U4==%//(2KLMMr   c                sT    \         P                  \        V P                  V4      4      # )z
Returns a textual description of the contents of the argument passed
as a file descriptor or None if an error occurred and the MAGIC_ERROR
flag is set. A call to errno() will return the numeric error code.
)r   r!   _descriptorr   )r   Zfdr   r   
descriptorZMagic.descriptor   s     }}[;<<r   c           	     sh    \         P                  \        V P                  V\	        V4      4      4      # )z
Returns a textual description of the contents of the argument passed
as a buffer or None if an error occurred and the MAGIC_ERROR flag
is set. A call to errno() will return the numeric error code.
)r   r!   _bufferr   Zlen)r   Zbufr   r   bufferZMagic.buffer   s$     }}WT]]CSBCCr   c                sR    \         P                  \        V P                  4      4      # )zP
Returns a textual explanation of the last error or None
if there was no error.
)r   r!   _errorr   r   r   r   errorZMagic.error   s    
 }}VDMM233r   c                s.    \        V P                  V4      # )z
Set flags on the magic object which determine how magic checking
behaves; a bitwise OR of the flags described in libmagic(3), but
without the MAGIC_ prefix.

Returns -1 on systems that don't support utime(2) or utimes(2)
when PRESERVE_ATIME is set.
)	_setflagsr   )r   flagsr   r   setflagsZMagic.setflags   s     ..r   Nc                T    \        V P                  \        P                  V4      4      # )z
Must be called to load entries in the colon separated list of database
files passed as argument or the default database file if no argument
before any magic queries can be performed.

Returns 0 on success and -1 on failure.
)_loadr   r   r#   r$   r   r   loadZ
Magic.load   s     T]]EOOH$=>>r   c                r0   )a  
Compile entries in the colon separated list of database files
passed as argument or the default database file if no argument.
The compiled files created are named from the basename(1) of each file
argument with ".mgc" appended to it.

Returns 0 on success and -1 on failure.
)_compiler   r   r#   r   Zdbsr   r   compileZMagic.compile   s     us';<<r   c                r0   z
Check the validity of entries in the colon separated list of
database files passed as argument or the default database file
if no argument.

Returns 0 on success and -1 on failure.
)_checkr   r   r#   r4   r   r   checkZMagic.check   s     dmmU__S%9::r   c                r0   r6   )_listr   r   r#   r4   r   r   listZ
Magic.list   s     T]]EOOC$899r   c                s,    \        V P                  4      # )z
Returns a numeric error code. If return value is 0, an internal
magic error occurred. If return value is non-zero, the value is
an OS error code. Use the errno module or os.strerror() can be used
to provide detailed error information.
)_errnor   r   r   r   errnoZMagic.errno   s     dmm$$r   c                s    \        4       p\        V P                  V\        V4      4      pVR8X  d   R# VP                  # )zL
Returns the param value if successful and -1 if the parameter
was unknown.
)c_int	_getparamr   byrefvalue)r   paramvZi   &&  r   getparamZMagic.getparam   s6    
 GdmmUE!H57Iwwr   c                sX    \        V4      p\        V P                  V\        V4      4      # )z>
Returns 0 if successful and -1 if the parameter was unknown.
)r>   	_setparamr   r@   )r   rB   rA   rC   s   &&& r   setparamZMagic.setparam  s$     %LuQx88r   r   r   )r   r   r   r   r   r   Zstaticmethodr!   r#   r&   r(   r*   r,   r/   r2   r5   r8   r:   r<   rE   rG   r   __classdictcell__Z__classdict__   @r   r   r      sz         N=D4	/?	=;:%	9 9r   r   c                s:    \        V 4      pVf   R# \        V4      # )zX
Returns a magic object on success and None on failure.
Flags argument as for setflags.
N)_openr   )r.   magic_t   & r   openrN     s    
 ElG>r   c                   s    ] tR tRtRtR# )r,   i  r   Nr
   r   r   r   r,   r,     r   r   r,   c                   s,   a  ] tR tRt o R tR tRtV tR# )MagicDetecti  c                sB   \        \        4      V n        V P                  f   \        hV P                  P	                  4       R8X  d(   V P                  P                  4        R V n        \        h\        \        4      V n        V P                  f(   V P                  P                  4        R V n        \        hV P                  P	                  4       R8X  dI   V P                  P                  4        R V n        V P                  P                  4        R V n        \        hR # )Nr=   )rN   
MAGIC_MIME
mime_magicr,   r2   r   
MAGIC_NONE
none_magicr   r   r   r   ZMagicDetect.__init__  s    z*??"K??!R'OO!!#"DOKz*??"OO!!#"DOK??!R'OO!!#"DOOO!!#"DOK (r   c                s    V P                   e   V P                   P                  4        V P                  e   V P                  P                  4        R # R # r   )rQ   r   rS   r   r   r   __del__ZMagicDetect.__del__2  s;    ??&OO!!#??&OO!!# 'r   )rQ   rS   N)r   r   r   r   r   rT   r   rH   rI   rJ   r   rO   rO     s     ($ $r   rO   c                  sf    \        \        R R4      p V f   \        4       p \        \        R V 4       V # )Zmagic_instanceN)ZgetattrthreadlocalrO   Zsetattr)rC   s    r   _detect_makerV   :  s/    -t4AyM-q1Hr   c                 s     V P                  R 4      w  r#\        YTP                  RR4      R7      #   \         d    \        T 4      hi ; i)z; zcharset=Z )name	mime_typeencoding)ZsplitZ
ValueErrorr   Zreplace)Zmime_detectedZtype_detectedrX   Zmime_encodingrD   r   _create_filemagicrZ   A  sY    (#0#6#6t#< 	 -+33JCE E  (''(s	   2 A	c                    \        4       p\        VP                  P                  V 4      VP                  P                  V 4      4      # )z\Detect mime type, encoding and file type from a filename

Returns a `FileMagic` namedtuple.
)rV   rZ   rQ   r&   rS   )r%   xrM   r   detect_from_filenamer]   K  s;    
 	AQ\\..x8\\..x8: :r   c                s    V P                  4       p\        4       p\        VP                  P	                  V4      VP
                  P	                  V4      4      # )zbDetect mime type, encoding and file type from file-like object

Returns a `FileMagic` namedtuple.
)ZfilenorV   rZ   rQ   r(   rS   )ZfobjZfile_descriptorr\   s   &  r   detect_from_fobjr^   U  sH     kkmOAQ\\44_E\\44_EG Gr   c                r[   )zWDetect mime type, encoding and file type from bytes

Returns a `FileMagic` namedtuple.
)rV   rZ   rQ   r*   rS   )Zbyte_contentr\   rM   r   detect_from_contentr_   a  s=     	AQ\\00>\\00>@ @r   )rX   rY   rW   )|Z__doc__r   Z	threadingZcollectionsr    Zctypes.utilr   r   Z
_librariesrR   ZNONEZMAGIC_DEBUGZDEBUGZMAGIC_SYMLINKZSYMLINKZMAGIC_COMPRESSZCOMPRESSZMAGIC_DEVICESZDEVICESZMAGIC_MIME_TYPEZ	MIME_TYPEZMAGIC_CONTINUEZCONTINUEZMAGIC_CHECKZCHECKZMAGIC_PRESERVE_ATIMEZPRESERVE_ATIMEZ	MAGIC_RAWZRAWZMAGIC_ERRORZERRORZMAGIC_MIME_ENCODINGZMIME_ENCODINGrP   ZMIMEZMAGIC_APPLEZAPPLEZMAGIC_NO_CHECK_COMPRESSZNO_CHECK_COMPRESSZMAGIC_NO_CHECK_TARZNO_CHECK_TARZMAGIC_NO_CHECK_SOFTZNO_CHECK_SOFTZMAGIC_NO_CHECK_APPTYPEZNO_CHECK_APPTYPEZMAGIC_NO_CHECK_ELFZNO_CHECK_ELFZMAGIC_NO_CHECK_TEXTZNO_CHECK_TEXTZMAGIC_NO_CHECK_CDFZNO_CHECK_CDFZMAGIC_NO_CHECK_TOKENSZNO_CHECK_TOKENSZMAGIC_NO_CHECK_ENCODINGZNO_CHECK_ENCODINGZMAGIC_NO_CHECK_BUILTINZNO_CHECK_BUILTINZMAGIC_PARAM_INDIR_MAXZPARAM_INDIR_MAXZMAGIC_PARAM_NAME_MAXZPARAM_NAME_MAXZMAGIC_PARAM_ELF_PHNUM_MAXZPARAM_ELF_PHNUM_MAXZMAGIC_PARAM_ELF_SHNUM_MAXZPARAM_ELF_SHNUM_MAXZMAGIC_PARAM_ELF_NOTES_MAXZPARAM_ELF_NOTES_MAXZMAGIC_PARAM_REGEX_MAXZPARAM_REGEX_MAXZMAGIC_PARAM_BYTES_MAXZPARAM_BYTES_MAXr   Z	Structurer	   Z_fields_ZPOINTERrL   Z
magic_openrK   Zrestyper>   ZargtypesZmagic_closer   Z
magic_filer"   Zc_char_pZmagic_descriptorr'   Zmagic_bufferr)   Zc_void_pZc_size_tZmagic_errorr+   Zmagic_setflagsr-   Z
magic_loadr1   Zmagic_compiler3   Zmagic_checkr7   Z
magic_listr9   Zmagic_errnor;   Zmagic_getparamr?   Zmagic_setparamrF   Zobjectr   rN   Z	Exceptionr,   rO   ZlocalrU   rV   rZ   r]   r^   r_   r   r   r   <module>r`      s     "  $: 
g
7   
T e      )  e(+ + ~ 	C e&* * m 
T e.2 2 +$( ( \&+ + m,1 1 )$) ) \&, , m$* * \*1 1 .5 5 +,3 3 )*+ + () ) ~23 3 /23 3 /23 3 /*+ + *+ + {$EF			 		 
)
7&&	G		(	()7&&8$!22 ' 
W

*
*Xx0 	G		(	()w..		 u%	 7&&8$g,, h' 	G		(	(H%7&&8$	G		(	()w..		 uh/	 w..		 uh/	 L9F L9^	I 	$& $6 ooE:	G@r   