MD5.h.in 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*============================================================================
  2. KWSys - Kitware System Library
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef @KWSYS_NAMESPACE@_MD5_h
  11. #define @KWSYS_NAMESPACE@_MD5_h
  12. #include <@KWSYS_NAMESPACE@/Configure.h>
  13. /* Redefine all public interface symbol names to be in the proper
  14. namespace. These macros are used internally to kwsys only, and are
  15. not visible to user code. Use kwsysHeaderDump.pl to reproduce
  16. these macros after making changes to the interface. */
  17. #if !defined(KWSYS_NAMESPACE)
  18. # define kwsys_ns(x) @KWSYS_NAMESPACE@##x
  19. # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
  20. #endif
  21. #if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
  22. # define kwsysMD5 kwsys_ns(MD5)
  23. # define kwsysMD5_s kwsys_ns(MD5_s)
  24. # define kwsysMD5_New kwsys_ns(MD5_New)
  25. # define kwsysMD5_Delete kwsys_ns(MD5_Delete)
  26. # define kwsysMD5_Initialize kwsys_ns(MD5_Initialize)
  27. # define kwsysMD5_Append kwsys_ns(MD5_Append)
  28. # define kwsysMD5_Finalize kwsys_ns(MD5_Finalize)
  29. # define kwsysMD5_FinalizeHex kwsys_ns(MD5_FinalizeHex)
  30. # define kwsysMD5_DigestToHex kwsys_ns(MD5_DigestToHex)
  31. #endif
  32. #if defined(__cplusplus)
  33. extern "C"
  34. {
  35. #endif
  36. /**
  37. * MD5 state data structure.
  38. */
  39. typedef struct kwsysMD5_s kwsysMD5;
  40. /**
  41. * Create a new MD5 instance. The returned instance is not initialized.
  42. */
  43. kwsysEXPORT kwsysMD5* kwsysMD5_New(void);
  44. /**
  45. * Delete an old MD5 instance.
  46. */
  47. kwsysEXPORT void kwsysMD5_Delete(kwsysMD5* md5);
  48. /**
  49. * Initialize a new MD5 digest.
  50. */
  51. kwsysEXPORT void kwsysMD5_Initialize(kwsysMD5* md5);
  52. /**
  53. * Append data to an MD5 digest. If the given length is negative,
  54. * data will be read up to but not including a terminating null.
  55. */
  56. kwsysEXPORT void kwsysMD5_Append(kwsysMD5* md5, unsigned char const* data,
  57. int length);
  58. /**
  59. * Finalize a MD5 digest and get the 16-byte hash value.
  60. */
  61. kwsysEXPORT void kwsysMD5_Finalize(kwsysMD5* md5, unsigned char digest[16]);
  62. /**
  63. * Finalize a MD5 digest and get the 32-bit hexadecimal representation.
  64. */
  65. kwsysEXPORT void kwsysMD5_FinalizeHex(kwsysMD5* md5, char buffer[32]);
  66. /**
  67. * Convert a MD5 digest 16-byte value to a 32-byte hexadecimal representation.
  68. */
  69. kwsysEXPORT void kwsysMD5_DigestToHex(unsigned char const digest[16],
  70. char buffer[32]);
  71. #if defined(__cplusplus)
  72. } /* extern "C" */
  73. #endif
  74. /* If we are building a kwsys .c or .cxx file, let it use these macros.
  75. Otherwise, undefine them to keep the namespace clean. */
  76. #if !defined(KWSYS_NAMESPACE)
  77. # undef kwsys_ns
  78. # undef kwsysEXPORT
  79. # if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
  80. # undef kwsysMD5
  81. # undef kwsysMD5_s
  82. # undef kwsysMD5_New
  83. # undef kwsysMD5_Delete
  84. # undef kwsysMD5_Initialize
  85. # undef kwsysMD5_Append
  86. # undef kwsysMD5_Finalize
  87. # undef kwsysMD5_FinalizeHex
  88. # undef kwsysMD5_DigestToHex
  89. # endif
  90. #endif
  91. #endif