wlantypes.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /****************************************************************************
  2. * Copyright (c) 2002-2003 by Michael Fischer. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the author nor the names of its contributors may
  14. * be used to endorse or promote products derived from this software
  15. * without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  21. * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. ****************************************************************************
  31. * History:
  32. *
  33. * 14.12.02 mifi First Version
  34. * 18.01.03 mifi Change Licence from GPL to BSD.
  35. * 07.02.04 mifi Add some macros.
  36. ****************************************************************************/
  37. #ifndef __TYPEDEFS_H__
  38. #define __TYPEDEFS_H__
  39. /*
  40. * some types to use Windows like source
  41. */
  42. typedef char CHAR; /* 8-bit signed data */
  43. typedef unsigned char BYTE; /* 8-bit unsigned data */
  44. typedef unsigned short WORD; /* 16-bit unsigned data */
  45. typedef long LONG; /* 32-bit signed data */
  46. typedef unsigned long ULONG; /* 32-bit unsigned data */
  47. typedef unsigned long DWORD; /* 32-bit unsigned data */
  48. /*
  49. * some define for the BSD files
  50. */
  51. typedef unsigned char u_int8_t;
  52. typedef unsigned short u_int16_t;
  53. typedef unsigned long u_int32_t;
  54. #define FALSE 0
  55. #define TRUE 1
  56. /**************************************************************************
  57. * Some WORD, BYTE macro's
  58. ***************************************************************************/
  59. #define HIBYTE(_a) ((((WORD)(_a)) >> 8) & 0x00FF)
  60. #define LOBYTE(_a) (((WORD)(_a)) & 0x00FF)
  61. #define HIWORD(_a) ((((DWORD)(_a)) >> 16) & 0xFFFF)
  62. #define LOWORD(_a) (((DWORD)(_a)) & 0xFFFF)
  63. #define SWAP(_a) ((LOBYTE((_a)) << 8) | HIBYTE((_a)))
  64. #endif /* !__TYPEDEFS_H_ */