uint32.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Copyright (c) The PHP Group |
  4. +----------------------------------------------------------------------+
  5. | This source file is subject to version 3.01 of the PHP license, |
  6. | that is bundled with this package in the file LICENSE, and is |
  7. | available through the world-wide-web at the following url: |
  8. | https://www.php.net/license/3_01.txt |
  9. | If you did not receive a copy of the PHP license and are unable to |
  10. | obtain it through the world-wide-web, please send a note to |
  11. | license@php.net so we can mail you a copy immediately. |
  12. +----------------------------------------------------------------------+
  13. | Author: Marcus Boerger <helly@php.net> |
  14. +----------------------------------------------------------------------+
  15. */
  16. /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/
  17. #ifndef UINT32_H
  18. #define UINT32_H
  19. #if SIZEOF_INT == 4
  20. /* Most 32-bit and 64-bit systems have 32-bit ints */
  21. typedef unsigned int uint32;
  22. #elif SIZEOF_LONG == 4
  23. /* 16-bit systems? */
  24. typedef unsigned long uint32;
  25. #else
  26. #error Need type which holds 32 bits
  27. #endif
  28. void uint32_pack(char *out, uint32 in);
  29. void uint32_unpack(const char *in, uint32 *out);
  30. #endif