LibreOffice
LibreOffice 7.4 SDK C/C++ API Reference
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

◆ OSL_HIBYTE

#define OSL_HIBYTE (   w)    ((sal_uInt8)(((sal_uInt16)(w) >> 8) & 0xFF))

◆ OSL_HINIBBLE

#define OSL_HINIBBLE (   b)    ((sal_uInt8)(((b) >> 4) & 0x0F))

◆ OSL_HIWORD

#define OSL_HIWORD (   d)    ((sal_uInt16)(((sal_uInt32)(d) >> 16) & 0xFFFF))

◆ OSL_LOBYTE

#define OSL_LOBYTE (   w)    ((sal_uInt8)((sal_uInt16)(w) & 0xFF))

◆ OSL_LONIBBLE

#define OSL_LONIBBLE (   b)    ((sal_uInt8)((b) & 0x0F))

◆ OSL_LOWORD

#define OSL_LOWORD (   d)    ((sal_uInt16)((sal_uInt32)(d) & 0xFFFF))

◆ OSL_MAKEBYTE

#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.

◆ OSL_MAKEDWORD

#define OSL_MAKEDWORD (   wl,
  wh 
)    ((sal_uInt32)((wl) & 0xFFFF) | (((sal_uInt32)(wh) & 0xFFFF) << 16))

◆ OSL_MAKEWORD

#define OSL_MAKEWORD (   bl,
  bh 
)    ((sal_uInt16)((sal_uInt16)((bl) & 0xFF) | (((sal_uInt16)(bh) & 0xFF) << 8)))

◆ OSL_NETDWORD

#define OSL_NETDWORD (   d)    OSL_MAKEDWORD(OSL_NETWORD(OSL_HIWORD(d)),OSL_NETWORD(OSL_LOWORD(d)))

◆ OSL_NETWORD

#define OSL_NETWORD (   w)    OSL_MAKEWORD(OSL_HIBYTE(w),OSL_LOBYTE(w))

Define macros for swapping between host and network byte order.

◆ OSL_SWAPDWORD

#define OSL_SWAPDWORD (   d)    OSL_MAKEDWORD(OSL_SWAPWORD(OSL_HIWORD(d)),OSL_SWAPWORD(OSL_LOWORD(d)))

◆ OSL_SWAPWORD

#define OSL_SWAPWORD (   w)    OSL_MAKEWORD(OSL_HIBYTE(w),OSL_LOBYTE(w))

Define macros for swapping between byte orders.