@@ -149,7 +149,7 @@ set_parameter_error(const _zstd_state* const state, int is_compress,
149149 }
150150 if (ZSTD_isError (bounds .error )) {
151151 PyErr_Format (state -> ZstdError ,
152- "Zstd %s parameter \"%s\" is invalid ." ,
152+ "Invalid zstd %s parameter \"%s\"." ,
153153 type , name );
154154 return ;
155155 }
@@ -184,13 +184,13 @@ _zstd.train_dict
184184 The size of the dictionary.
185185 /
186186
187- Internal function, train a Zstandard dictionary on sample data.
187+ Train a Zstandard dictionary on sample data.
188188[clinic start generated code]*/
189189
190190static PyObject *
191191_zstd_train_dict_impl (PyObject * module , PyBytesObject * samples_bytes ,
192192 PyObject * samples_sizes , Py_ssize_t dict_size )
193- /*[clinic end generated code: output=8e87fe43935e8f77 input=829e31fbbf3454b0 ]*/
193+ /*[clinic end generated code: output=8e87fe43935e8f77 input=d20dedb21c72cb62 ]*/
194194{
195195 // TODO(emmatyping): The preamble and suffix to this function and _finalize_dict
196196 // are pretty similar. We should see if we can refactor them to share that code.
@@ -255,7 +255,7 @@ _zstd_train_dict_impl(PyObject *module, PyBytesObject *samples_bytes,
255255 chunk_sizes , (uint32_t )chunks_number );
256256 Py_END_ALLOW_THREADS
257257
258- /* Check zstd dict error */
258+ /* Check Zstandard dict error */
259259 if (ZDICT_isError (zstd_ret )) {
260260 _zstd_state * const mod_state = get_zstd_state (module );
261261 set_zstd_error (mod_state , ERR_TRAIN_DICT , zstd_ret );
@@ -289,18 +289,18 @@ _zstd.finalize_dict
289289 dict_size: Py_ssize_t
290290 The size of the dictionary.
291291 compression_level: int
292- Optimize for a specific zstd compression level, 0 means default.
292+ Optimize for a specific Zstandard compression level, 0 means default.
293293 /
294294
295- Internal function, finalize a Zstandard dictionary.
295+ Finalize a Zstandard dictionary.
296296[clinic start generated code]*/
297297
298298static PyObject *
299299_zstd_finalize_dict_impl (PyObject * module , PyBytesObject * custom_dict_bytes ,
300300 PyBytesObject * samples_bytes ,
301301 PyObject * samples_sizes , Py_ssize_t dict_size ,
302302 int compression_level )
303- /*[clinic end generated code: output=f91821ba5ae85bda input=11af97dcc7608059 ]*/
303+ /*[clinic end generated code: output=f91821ba5ae85bda input=3c7e2480aa08fb56 ]*/
304304{
305305 Py_ssize_t chunks_number ;
306306 size_t * chunk_sizes = NULL ;
@@ -357,7 +357,7 @@ _zstd_finalize_dict_impl(PyObject *module, PyBytesObject *custom_dict_bytes,
357357
358358 /* Parameters */
359359
360- /* Optimize for a specific zstd compression level, 0 means default. */
360+ /* Optimize for a specific Zstandard compression level, 0 means default. */
361361 params .compressionLevel = compression_level ;
362362 /* Write log to stderr, 0 = none. */
363363 params .notificationLevel = 0 ;
@@ -373,7 +373,7 @@ _zstd_finalize_dict_impl(PyObject *module, PyBytesObject *custom_dict_bytes,
373373 (uint32_t )chunks_number , params );
374374 Py_END_ALLOW_THREADS
375375
376- /* Check zstd dict error */
376+ /* Check Zstandard dict error */
377377 if (ZDICT_isError (zstd_ret )) {
378378 _zstd_state * const mod_state = get_zstd_state (module );
379379 set_zstd_error (mod_state , ERR_FINALIZE_DICT , zstd_ret );
@@ -404,12 +404,12 @@ _zstd.get_param_bounds
404404 is_compress: bool
405405 True for CompressionParameter, False for DecompressionParameter.
406406
407- Internal function, get CompressionParameter/DecompressionParameter bounds.
407+ Get CompressionParameter/DecompressionParameter bounds.
408408[clinic start generated code]*/
409409
410410static PyObject *
411411_zstd_get_param_bounds_impl (PyObject * module , int parameter , int is_compress )
412- /*[clinic end generated code: output=4acf5a876f0620ca input=84e669591e487008 ]*/
412+ /*[clinic end generated code: output=4acf5a876f0620ca input=45742ef0a3531b65 ]*/
413413{
414414 ZSTD_bounds bound ;
415415 if (is_compress ) {
@@ -439,14 +439,12 @@ _zstd.get_frame_size
439439 A bytes-like object, it should start from the beginning of a frame,
440440 and contains at least one complete frame.
441441
442- Get the size of a zstd frame, including frame header and 4-byte checksum if it has one.
443-
444- It will iterate all blocks' headers within a frame, to accumulate the frame size.
442+ Get the size of a Zstandard frame, including the header and optional checksum.
445443[clinic start generated code]*/
446444
447445static PyObject *
448446_zstd_get_frame_size_impl (PyObject * module , Py_buffer * frame_buffer )
449- /*[clinic end generated code: output=a7384c2f8780f442 input=7d3ad24311893bf3 ]*/
447+ /*[clinic end generated code: output=a7384c2f8780f442 input=3b9f73f8c8129d38 ]*/
450448{
451449 size_t frame_size ;
452450
@@ -469,14 +467,14 @@ _zstd_get_frame_size_impl(PyObject *module, Py_buffer *frame_buffer)
469467_zstd.get_frame_info
470468
471469 frame_buffer: Py_buffer
472- A bytes-like object, containing the header of a zstd frame.
470+ A bytes-like object, containing the header of a Zstandard frame.
473471
474- Internal function, get zstd frame infomation from a frame header.
472+ Get Zstandard frame infomation from a frame header.
475473[clinic start generated code]*/
476474
477475static PyObject *
478476_zstd_get_frame_info_impl (PyObject * module , Py_buffer * frame_buffer )
479- /*[clinic end generated code: output=56e033cf48001929 input=1816f14656b6aa22 ]*/
477+ /*[clinic end generated code: output=56e033cf48001929 input=94b240583ae22ca5 ]*/
480478{
481479 uint64_t decompressed_size ;
482480 uint32_t dict_id ;
@@ -515,13 +513,13 @@ _zstd.set_parameter_types
515513 d_parameter_type: object(subclass_of='&PyType_Type')
516514 DecompressionParameter IntEnum type object
517515
518- Internal function, set CompressionParameter/ DecompressionParameter types for validity check.
516+ Set CompressionParameter and DecompressionParameter types for validity check.
519517[clinic start generated code]*/
520518
521519static PyObject *
522520_zstd_set_parameter_types_impl (PyObject * module , PyObject * c_parameter_type ,
523521 PyObject * d_parameter_type )
524- /*[clinic end generated code: output=f3313b1294f19502 input=30402523871b8280 ]*/
522+ /*[clinic end generated code: output=f3313b1294f19502 input=75d7a953580fae5f ]*/
525523{
526524 _zstd_state * const mod_state = get_zstd_state (module );
527525
0 commit comments