+
     h  c                   sr   ^ RI Ht ^ RIHt ^ RIHt ^RI5 ^RIHt Rt]P                  t	]P                  t
]P                  t]P                  t]! R	. RO4      t]! ]P                  !  t]! R
RR.4      tR t ! R R4      t ! R R]4      t ! R R]4      t ! R R]4      t]P,                  ! ]]4       R# )i    )
namedtuple)IntEnum)	lru_cache)Z*)_zstd
CParameter
DParameterStrategyZvaluesZ
frame_infoZdecompressed_sizeZdictionary_idc                s@    \         P                  ! V 4      p\        V!  # )a  Get zstd frame information from a frame header.

Parameter
frame_buffer: A bytes-like object. It should starts from the beginning of
              a frame, and needs to include at least the frame header (6 to
              18 bytes).

Return a two-items namedtuple: (decompressed_size, dictionary_id)

If decompressed_size is None, decompressed size is unknown.

dictionary_id is a 32-bit unsigned integer value. 0 means dictionary ID was
not recorded in the frame header, the frame may or may not need a dictionary
to be decoded, and the ID of such a dictionary is not specified.

It's possible to append more items to the namedtuple in the future.)r   Z_get_frame_info_nt_frame_info)Zframe_bufferZ	ret_tuples   & 8/usr/lib64/python3.14/site-packages/pyzstd/c/__init__.pyget_frame_infor	   $   s    $ %%l3I9%%    c                   s,   a  ] tR t^:t o R tR tRtV tR# )_UnsupportedCParameterc                s    W n         R # )Nname)self_r   s   &&&r   __set_name__Z#_UnsupportedCParameter.__set_name__;   s    	r
   c                sH    V P                   : R \        : R2p\        V4      h)z CParameter only available when the underlying zstd library's version is greater than or equal to v1.5.6. At pyzstd module's run-time, zstd version is Z.)r   zstd_versionZNotImplementedError)r   r   Z__Zmsgs   &*, r   __get__Z_UnsupportedCParameter.__get__>   s!     		<) "#&&r
   r   N)__name__
__module____qualname____firstlineno__r   r   __static_attributes____classdictcell__Z__classdict__   @r   r   r   :   s     ' 'r
   r   c                   s@  a  ] tR t^Ft o Rt]P                  t]P                  t	]P                  t]P                  t]P                  t]P                   t]P$                  t]P(                  t]R8  d   ]P.                  tM]! 4       t]P4                  t]P8                  t]P<                  t]P@                  t!]PD                  t#]PH                  t%]PL                  t']PP                  t)]PT                  t+]PX                  t-]P\                  t/]0! RR7      R 4       t1Rt2V t3R# )r   zCompression parametersNZmaxsizec                sD    \         P                  ! ^V P                  4      # )zIReturn lower and upper bounds of a compression parameter, both inclusive.r   Z_get_param_boundsZvaluer      &r   boundsZCParameter.boundsd        &&q$**55r
    )i   i   i   )4r   r   r   r   __doc__r   Z_ZSTD_c_compressionLevelZcompressionLevelZ_ZSTD_c_windowLogZ	windowLogZ_ZSTD_c_hashLogZhashLogZ_ZSTD_c_chainLogZchainLogZ_ZSTD_c_searchLogZ	searchLogZ_ZSTD_c_minMatchZminMatchZ_ZSTD_c_targetLengthZtargetLengthZ_ZSTD_c_strategyZstrategyzstd_version_infoZ_ZSTD_c_targetCBlockSizeZtargetCBlockSizer   Z"_ZSTD_c_enableLongDistanceMatchingZenableLongDistanceMatchingZ_ZSTD_c_ldmHashLogZ
ldmHashLogZ_ZSTD_c_ldmMinMatchZldmMinMatchZ_ZSTD_c_ldmBucketSizeLogZldmBucketSizeLogZ_ZSTD_c_ldmHashRateLogZldmHashRateLogZ_ZSTD_c_contentSizeFlagZcontentSizeFlagZ_ZSTD_c_checksumFlagZchecksumFlagZ_ZSTD_c_dictIDFlagZ
dictIDFlagZ_ZSTD_c_nbWorkersZ	nbWorkersZ_ZSTD_c_jobSizeZjobSizeZ_ZSTD_c_overlapLogZ
overlapLogr   r   r   r   r   r   r   r   r   F   s     !&!?!?!&!8!8I!&!6!6G!&!7!7H!&!8!8I!&!7!7H!&!;!;L!&!7!7HI%!&!?!?!7!9!&!I!I!&!9!9J!&!:!:K!&!?!?!&!=!=N!&!>!>O!&!;!;L!&!9!9J!&!8!8I!&!6!6G!&!9!9Jt6 6r
   c                   sZ   a  ] tR t^kt o Rt]P                  t]! RR7      R 4       t	Rt
V tR# )r   zDecompression parametersNr   c                sD    \         P                  ! ^ V P                  4      # )zKReturn lower and upper bounds of a decompression parameter, both inclusive.r   r   r   r   r   ZDParameter.boundsp   r    r
   r!   )r   r   r   r   r"   r   Z_ZSTD_d_windowLogMaxZwindowLogMaxr   r   r   r   r   r   r   r   r   k   s*     "--Lt6 6r
   c                   s    ] tR t^wtRt]P                  t]P                  t	]P                  t]P                  t]P                  t]P                   t]P$                  t]P(                  t]P,                  tRtR# )r   zCompression strategies, listed from fastest to strongest.

Note : new strategies _might_ be added in the future, only the order
(from fast to strong) is guaranteed.
r!   N)r   r   r   r   r"   r   Z
_ZSTD_fastZfastZ_ZSTD_dfastZdfastZ_ZSTD_greedyZgreedyZ
_ZSTD_lazyZlazyZ_ZSTD_lazy2Zlazy2Z_ZSTD_btlazy2Zbtlazy2Z_ZSTD_btoptZbtoptZ_ZSTD_btultraZbtultraZ_ZSTD_btultra2Zbtultra2r   r!   r
   r   r   r   w   sl    
 D  E!!FD  E""G  E""G##Hr
   N)compressionLevel_valuesr	   r   r   r   ZZstdCompressorZRichMemZstdCompressorZZstdDecompressorZEndlessZstdDecompressorZZstdDictZ	ZstdErrorZ
decompressZget_frame_sizeZcompress_streamZdecompress_streamr   r#   _train_dict_finalize_dictZZstdFileReaderZZstdFileWriter_ZSTD_CStreamSizes_ZSTD_DStreamSizesZPYZSTD_CONFIG)ZdefaultZminZmax)Zcollectionsr    Zenumr   Z	functoolsr   r   Z Z__all__r'   r(   r%   r&   Z
_nt_valuesZ_compressionLevel_valuesr$   r   r	   r   r   r   r   Z_set_parameter_typesr!   r
   r   <module>r)      s    "     -- -- %% ";<
$e&D&DE  L0/BD&,	' 	'"6 "6J	6 	6$w $$   :z 2r
   