LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros
endian.h File Reference
#include <sal/types.h>

Go to the source code of this file.

Macros

#define OSL_MAKEBYTE(nl, nh)   ((sal_uInt8)(((nl) & 0x0F) | (((nh) & 0x0F) << 4)))
 Define the platform byte order as OSL_BIGENDIAN or OSL_LITENDIAN. More...
 
#define OSL_LONIBBLE(b)   ((sal_uInt8)((b) & 0x0F))
 
#define OSL_HINIBBLE(b)   ((sal_uInt8)(((b) >> 4) & 0x0F))
 
#define OSL_MAKEWORD(bl, bh)   ((sal_uInt16)((sal_uInt16)((bl) & 0xFF) | (((sal_uInt16)(bh) & 0xFF) << 8)))
 
#define OSL_LOBYTE(w)   ((sal_uInt8)((sal_uInt16)(w) & 0xFF))
 
#define OSL_HIBYTE(w)   ((sal_uInt8)(((sal_uInt16)(w) >> 8) & 0xFF))
 
#define OSL_MAKEDWORD(wl, wh)   ((sal_uInt32)((wl) & 0xFFFF) | (((sal_uInt32)(wh) & 0xFFFF) << 16))
 
#define OSL_LOWORD(d)   ((sal_uInt16)((sal_uInt32)(d) & 0xFFFF))
 
#define OSL_HIWORD(d)   ((sal_uInt16)(((sal_uInt32)(d) >> 16) & 0xFFFF))
 
#define OSL_NETWORD(w)   OSL_MAKEWORD(OSL_HIBYTE(w),OSL_LOBYTE(w))
 Define macros for swapping between host and network byte order. More...
 
#define OSL_NETDWORD(d)   OSL_MAKEDWORD(OSL_NETWORD(OSL_HIWORD(d)),OSL_NETWORD(OSL_LOWORD(d)))
 
#define OSL_SWAPWORD(w)   OSL_MAKEWORD(OSL_HIBYTE(w),OSL_LOBYTE(w))
 Define macros for swapping between byte orders. More...
 
#define OSL_SWAPDWORD(d)   OSL_MAKEDWORD(OSL_SWAPWORD(OSL_HIWORD(d)),OSL_SWAPWORD(OSL_LOWORD(d)))
 

Macro Definition Documentation

#define OSL_HIBYTE (   w)    ((sal_uInt8)(((sal_uInt16)(w) >> 8) & 0xFF))
#define OSL_HINIBBLE (   b)    ((sal_uInt8)(((b) >> 4) & 0x0F))
#define OSL_HIWORD (   d)    ((sal_uInt16)(((sal_uInt32)(d) >> 16) & 0xFFFF))
#define OSL_LOBYTE (   w)    ((sal_uInt8)((sal_uInt16)(w) & 0xFF))
#define OSL_LONIBBLE (   b)    ((sal_uInt8)((b) & 0x0F))
#define OSL_LOWORD (   d)    ((sal_uInt16)((sal_uInt32)(d) & 0xFFFF))
#define OSL_MAKEBYTE (   nl,
  nh 
)    ((sal_uInt8)(((nl) & 0x0F) | (((nh) & 0x0F) << 4)))

Define the platform byte order as OSL_BIGENDIAN or OSL_LITENDIAN.

Define macros for byte order manipulation.

#define OSL_MAKEDWORD (   wl,
  wh 
)    ((sal_uInt32)((wl) & 0xFFFF) | (((sal_uInt32)(wh) & 0xFFFF) << 16))
#define OSL_MAKEWORD (   bl,
  bh 
)    ((sal_uInt16)((sal_uInt16)((bl) & 0xFF) | (((sal_uInt16)(bh) & 0xFF) << 8)))
#define OSL_NETDWORD (   d)    OSL_MAKEDWORD(OSL_NETWORD(OSL_HIWORD(d)),OSL_NETWORD(OSL_LOWORD(d)))
#define OSL_NETWORD (   w)    OSL_MAKEWORD(OSL_HIBYTE(w),OSL_LOBYTE(w))

Define macros for swapping between host and network byte order.

#define OSL_SWAPDWORD (   d)    OSL_MAKEDWORD(OSL_SWAPWORD(OSL_HIWORD(d)),OSL_SWAPWORD(OSL_LOWORD(d)))
#define OSL_SWAPWORD (   w)    OSL_MAKEWORD(OSL_HIBYTE(w),OSL_LOBYTE(w))

Define macros for swapping between byte orders.