zdict_static.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #include <contrib/libs/zstd06/renames.h>
  2. /*
  3. dictBuilder header file
  4. for static linking only
  5. Copyright (C) Yann Collet 2016
  6. BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
  7. Redistribution and use in source and binary forms, with or without
  8. modification, are permitted provided that the following conditions are
  9. met:
  10. * Redistributions of source code must retain the above copyright
  11. notice, this list of conditions and the following disclaimer.
  12. * Redistributions in binary form must reproduce the above
  13. copyright notice, this list of conditions and the following disclaimer
  14. in the documentation and/or other materials provided with the
  15. distribution.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  18. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  19. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  20. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  21. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  22. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  23. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  24. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  26. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. You can contact the author at :
  28. - Zstd source repository : https://www.zstd.net
  29. */
  30. /* This library is EXPERIMENTAL, below API is not yet stable */
  31. #ifndef DICTBUILDER_STATIC_H_002
  32. #define DICTBUILDER_STATIC_H_002
  33. #if defined (__cplusplus)
  34. extern "C" {
  35. #endif
  36. /*-*************************************
  37. * Dependencies
  38. ***************************************/
  39. #include "zdict.h"
  40. /*-*************************************
  41. * Public type
  42. ***************************************/
  43. typedef struct {
  44. unsigned selectivityLevel; /* 0 means default; larger => bigger selection => larger dictionary */
  45. unsigned compressionLevel; /* 0 means default; target a specific zstd compression level */
  46. unsigned notificationLevel; /* Write to stderr; 0 = none (default); 1 = errors; 2 = progression; 3 = details; 4 = debug; */
  47. unsigned reserved[3]; /* space for future parameters */
  48. } ZDICT_params_t;
  49. /*-*************************************
  50. * Public functions
  51. ***************************************/
  52. /*! ZDICT_trainFromBuffer_advanced() :
  53. Same as ZDICT_trainFromBuffer() with control over more parameters.
  54. `parameters` is optional and can be provided with values set to 0 to mean "default".
  55. @return : size of dictionary stored into `dictBuffer` (<= `dictBufferSize`)
  56. or an error code, which can be tested by DiB_isError().
  57. note : ZDICT_trainFromBuffer_advanced() will send notifications into stderr if instructed to, using ZDICT_setNotificationLevel()
  58. */
  59. size_t ZDICT_trainFromBuffer_advanced(void* dictBuffer, size_t dictBufferCapacity,
  60. const void* samplesBuffer, const size_t* samplesSizes, unsigned nbSamples,
  61. ZDICT_params_t parameters);
  62. #if defined (__cplusplus)
  63. }
  64. #endif
  65. #endif /* DICTBUILDER_STATIC_H_002 */