ReactOS  0.4.12-dev-90-g2e2e63e
byte_order.h File Reference
#include <schily/stdlib.h>
#include <schily/types.h>
#include <schily/stdint.h>
Include dependency graph for byte_order.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define IS_ALIGNED_32(p)   (0 == (3 & ((const char *)(p) - (const char *)0)))
 
#define IS_ALIGNED_64(p)   (0 == (7 & ((const char *)(p) - (const char *)0)))
 
#define ALIGN_ATTR(n)   /* nothing */
 
#define I64(x)   ((long long)(x))
 
#define UI64(x)   ((unsigned long long)(x))
 
#define be2me_32(x)   bswap_32(x)
 
#define be2me_64(x)   bswap_64(x)
 
#define le2me_32(x)   (x)
 
#define le2me_64(x)   (x)
 
#define be32_copy(to, index, from, length)   rhash_swap_copy_str_to_u32((to), (index), (from), (length))
 
#define le32_copy(to, index, from, length)   memcpy((to) + (index), (from), (length))
 
#define be64_copy(to, index, from, length)   rhash_swap_copy_str_to_u64((to), (index), (from), (length))
 
#define le64_copy(to, index, from, length)   memcpy((to) + (index), (from), (length))
 
#define me64_to_be_str(to, from, length)   rhash_swap_copy_u64_to_str((to), (from), (length))
 
#define me64_to_le_str(to, from, length)   memcpy((to), (from), (length))
 
#define ROTL32(dword, n)   ((dword) << (n) ^ ((dword) >> (32 - (n))))
 
#define ROTR32(dword, n)   ((dword) >> (n) ^ ((dword) << (32 - (n))))
 
#define ROTL64(qword, n)   ((qword) << (n) ^ ((qword) >> (64 - (n))))
 
#define ROTR64(qword, n)   ((qword) >> (n) ^ ((qword) << (64 - (n))))
 

Functions

unsigned rhash_ctz __PR ((unsigned))
 
void rhash_swap_copy_str_to_u32 __PR ((void *to, int idx, const void *from, size_t length))
 
void rhash_swap_copy_u64_to_str __PR ((void *to, const void *from, size_t length))
 
void rhash_u32_mem_swap __PR ((unsigned *p, int length_in_u32))
 
static UInt32_t bswap_32 __PR ((UInt32_t x))
 
static UInt32_t bswap_32 (x) UInt32_t x
 
 return ((x >> 16)|(x<< 16))
 
static UInt64_t bswap_64 __PR ((UInt64_t x))
 
static UInt64_t bswap_64 (x) UInt64_t x
 
 return (r.ll)
 

Variables

w ll = x
 
r l [0] = bswap_32(w.l[1])
 

Macro Definition Documentation

◆ ALIGN_ATTR

#define ALIGN_ATTR (   n)    /* nothing */

Definition at line 93 of file byte_order.h.

◆ be2me_32

#define be2me_32 (   x)    bswap_32(x)

Definition at line 189 of file byte_order.h.

◆ be2me_64

#define be2me_64 (   x)    bswap_64(x)

Definition at line 190 of file byte_order.h.

◆ be32_copy

#define be32_copy (   to,
  index,
  from,
  length 
)    rhash_swap_copy_str_to_u32((to), (index), (from), (length))

Definition at line 194 of file byte_order.h.

◆ be64_copy

#define be64_copy (   to,
  index,
  from,
  length 
)    rhash_swap_copy_str_to_u64((to), (index), (from), (length))

Definition at line 196 of file byte_order.h.

◆ I64

#define I64 (   x)    ((long long)(x))

Definition at line 110 of file byte_order.h.

Referenced by DLDInit().

◆ IS_ALIGNED_32

#define IS_ALIGNED_32 (   p)    (0 == (3 & ((const char *)(p) - (const char *)0)))

Definition at line 85 of file byte_order.h.

◆ IS_ALIGNED_64

#define IS_ALIGNED_64 (   p)    (0 == (7 & ((const char *)(p) - (const char *)0)))

Definition at line 86 of file byte_order.h.

◆ le2me_32

#define le2me_32 (   x)    (x)

Definition at line 191 of file byte_order.h.

◆ le2me_64

#define le2me_64 (   x)    (x)

Definition at line 192 of file byte_order.h.

◆ le32_copy

#define le32_copy (   to,
  index,
  from,
  length 
)    memcpy((to) + (index), (from), (length))

Definition at line 195 of file byte_order.h.

◆ le64_copy

#define le64_copy (   to,
  index,
  from,
  length 
)    memcpy((to) + (index), (from), (length))

Definition at line 197 of file byte_order.h.

◆ me64_to_be_str

#define me64_to_be_str (   to,
  from,
  length 
)    rhash_swap_copy_u64_to_str((to), (from), (length))

Definition at line 198 of file byte_order.h.

◆ me64_to_le_str

#define me64_to_le_str (   to,
  from,
  length 
)    memcpy((to), (from), (length))

Definition at line 199 of file byte_order.h.

◆ ROTL32

#define ROTL32 (   dword,
  n 
)    ((dword) << (n) ^ ((dword) >> (32 - (n))))

Definition at line 203 of file byte_order.h.

Referenced by sfnt_is_postscript().

◆ ROTL64

#define ROTL64 (   qword,
  n 
)    ((qword) << (n) ^ ((qword) >> (64 - (n))))

Definition at line 205 of file byte_order.h.

◆ ROTR32

#define ROTR32 (   dword,
  n 
)    ((dword) >> (n) ^ ((dword) << (32 - (n))))

Definition at line 204 of file byte_order.h.

◆ ROTR64

#define ROTR64 (   qword,
  n 
)    ((qword) >> (n) ^ ((qword) << (64 - (n))))

Definition at line 206 of file byte_order.h.

◆ UI64

#define UI64 (   x)    ((unsigned long long)(x))

Definition at line 111 of file byte_order.h.

Function Documentation

◆ __PR() [1/6]

unsigned rhash_ctz __PR ( (unsigned)  )

◆ __PR() [2/6]

void rhash_swap_copy_str_to_u32 __PR ( (void *to, int idx, const void *from, size_t length )

◆ __PR() [3/6]

void rhash_swap_copy_u64_to_str __PR ( (void *to, const void *from, size_t length )

◆ __PR() [4/6]

void rhash_u32_mem_swap __PR ( (unsigned *p, int length_in_u32)  )

◆ __PR() [5/6]

static UInt32_t bswap_32 __PR ( (UInt32_t x )
inlinestatic

◆ __PR() [6/6]

static UInt64_t bswap_64 __PR ( (UInt64_t x )
inlinestatic

◆ bswap_32()

static UInt32_t bswap_32 ( x  )
inlinestatic

◆ bswap_64()

static UInt64_t bswap_64 ( x  )
inlinestatic

◆ return() [1/2]

return ( (x >> 16)|(x<< 16)  )

◆ return() [2/2]

return ( r.  ll)

Variable Documentation

◆ l

r l = bswap_32(w.l[1])

Definition at line 167 of file byte_order.h.

Referenced by __swab32s(), _BSTR_CY(), _elem_get_scroll_height(), _elem_get_scroll_left(), _elem_get_scroll_top(), _elem_get_scroll_width(), _mesa_GetLightfv(), _mesa_GetLightiv(), _mesa_strdup(), _mesa_texstore_unorm1616(), _Refcount_Base::_Refcount_Base(), _test_elem_client_rect(), _test_elem_client_size(), _test_elem_offset(), _test_elem_source_index(), _test_event_button(), _test_event_clientx(), _test_event_clienty(), _test_event_keycode(), _test_event_offsetx(), _test_event_offsety(), _test_event_reason(), _test_event_screenx(), _test_event_screeny(), _test_event_x(), _test_event_y(), _test_object_vspace(), _test_text_length(), _tWinMain(), add_eval(), adns__makefinal_str(), adns__procdgram(), adns__vbuf_appendstr(), XMLStorage::XS_String::appendf(), Array_reverse(), ShellPath::assign(), astoll(), astollb(), bezierPatchMeshEval(), bezierPatchMeshListCollect(), BINARY_INSERTION_FIND(), BLOBComp(), RopeTest::bug_report(), cache_entry_create(), TrimRegion::canTile(), ccf_options(), ccf_search(), ccf_sortlist(), cff_face_init(), CFn_WMCommand(), check_managed_app(), chmc_encint(), cmp_oper(), coff_process_info(), command_line_to_args(), compare_dirs(), compare_substring(), CompareFunc(), computeIsolatingRunsSet(), convert_latin1(), convert_utf16bom(), CRect::CRect(), CUiRect::CUiRect(), d3d8_device_GetTextureStageState(), d3d8_device_SetTextureStageState(), d3d_device7_GetTextureStageState(), d3d_device7_SetTextureStageState(), d3d_viewport_DeleteLight(), d3d_viewport_NextLight(), D3DXMatrixOrthoOffCenterLH(), D3DXMatrixOrthoOffCenterRH(), D3DXMatrixPerspectiveOffCenterLH(), D3DXMatrixPerspectiveOffCenterRH(), XMLStorage::DecodeXMLString(), CRect::DeflateRect(), deleteRepeatDiagonals(), deskey(), DIALOG_FileExit(), dispatch(), DisplayBlur(), DisplaySharpness(), DPA_QuickSort(), DPA_Search(), dumpMenu(), duplicate_ppstrings(), dwarfpctoline(), EDIT_EM_LineLength(), EDIT_EM_PosFromChar(), EDIT_EM_ScrollCaret(), EDIT_ML_InvalidateText(), EDIT_MoveWordBackward(), EDIT_MoveWordForward(), EDIT_WM_LButtonDblClk(), XMLStorage::EncodeXMLString(), ListTest::erase(), error(), EtfspCompareNames(), OpenGLSurfaceEvaluator::evalUStrip(), OpenGLSurfaceEvaluator::evalVStrip(), CShellCommandValue::Execute(), EXPR_complex(), expr_complex(), EXPR_unary(), expr_unary(), Ext2DropBH(), ext4_ext_binsearch(), ext4_ext_binsearch_idx(), ExtractIP(), ExtractName(), fallbackSort(), fdi_Ziphuft_build(), fdi_Zipinflate_dynamic(), fdi_Zipinflate_fixed(), NumPutGetTest::fix_float_long(), BtrfsVolPropSheet::FormatUsage(), ft_gray_for_premultiplied_srgb_bgra(), FT_Outline_EmboldenXY(), FT_Vector_NormLen(), FtMulDw(), FtMulDwDw(), FTPChdirAndGetCWD(), FTPGetCWD(), FTPPutOneF(), generic_read_frame_body(), get_default_proxy_reg_value(), get_path(), Entry::get_path_base(), CRegistryKey::GetSubkeyNameMaxLength(), gl_display_matches(), gl_text(), GPOS_apply_ContextPos(), GSUB_apply_ContextSubst(), GSUB_apply_LigatureSubst(), gxv_kern_subtable_fmt1_subtable_setup(), gxv_mort_subtable_type1_subtable_setup(), gxv_mort_subtable_type2_subtable_setup(), gxv_morx_subtable_type1_subtable_setup(), gxv_morx_subtable_type2_subtable_setup(), gxv_morx_subtable_type5_subtable_setup(), gxv_StateTable_subtable_setup(), gxv_XStateTable_subtable_setup(), handle_escape_cmd(), HTMLImageElementFactory_create(), huft_build(), III_dequantize_sample(), ILGetSize_local(), CMathTest::import_checks(), OpenGLSurfaceEvaluator::inBPMEval(), OpenGLSurfaceEvaluator::inEvalUStrip(), OpenGLSurfaceEvaluator::inEvalVStrip(), CRect::InflateRect(), init_layer12(), init_layer3(), int_log10(), int_log2(), interp_add(), interp_and(), interp_concat(), interp_div(), interp_eq(), interp_eq2(), interp_eqv(), interp_exp(), interp_gt(), interp_gteq(), interp_idiv(), interp_imp(), interp_is(), interp_lshift(), interp_lt(), interp_lteq(), interp_mod(), interp_mul(), interp_neq(), interp_neq2(), interp_or(), interp_rshift(), interp_rshift2(), interp_sub(), interp_xor(), IntSetupDiSetDeviceRegistryPropertyAW(), IsValidIP(), joliet_compare_dirs(), jpeg_huff_decode(), jpeg_make_c_derived_tbl(), jpeg_make_d_derived_tbl(), js_fprintf(), KdbpCmdBreakPointList(), KdbpCmdEvalExpression(), KdbpCmdSet(), less_eval(), ListTest::list1(), LsC(), M8(), make_ifref(), make_listening_socket(), make_number(), match_ext(), SstreamTest::maxint(), MiBuildPfnDatabaseFromPageTables(), NotifyInfo::modify(), module_fill_module(), NotifyHook::ModulePathCopyData(), naws_string(), nearest_mipmap_level(), nFTPChdirAndGetCWD(), ntlm_AcceptSecurityContext(), ntlm_InitializeSecurityContextW(), NumPutGetTest::num_get_float(), NumPutGetTest::num_put_float(), number_to_str(), oc_short(), ShellPath::operator+=(), ShellPath::operator=(), pa_ptr(), pa_txt(), pack_float_AL1616(), pack_float_AL1616_REV(), pack_ubyte_AL1616(), pack_ubyte_AL1616_REV(), QMyMainWindow::paintEvent(), pap_qstring(), XMLStorage::XPathElement::parse(), parse_hex_literal(), parse_numeric_literal(), ExplorerCmd::ParseCmdLine(), pbuf_alloc(), pcf_load_font(), png_access_version_number(), print_error(), XMLStorage::XS_String::printf(), PrintMenu(), printusage(), process_extensions(), ListTest::push_back(), ListTest::push_front(), readconfiggeneric(), RecursiveCreateDirectory(), ListTest::resize(), resolveNeutrals(), root_gen(), sampleCompTopSimpleOpt(), scale_internal_byte(), scale_internal_float(), scale_internal_int(), scale_internal_short(), scale_internal_ubyte(), scale_internal_uint(), scale_internal_ushort(), scaleInternalPackedPixel(), scrub_extent_raid10(), seamless_process_line(), SelectSetInit(), set(), TConfig::set_string(), SETUPDI_CreateDevKey(), SETUPDI_OpenDevKey(), SetupDiOpenClassRegKeyExW(), SHELL_execute(), ShellPath::ShellPath(), show_cert_dialog(), show_export_ui(), sources_entry_create(), str_to_number(), strendswith(), svc_create(), test(), test_atan2(), test_body_style(), test_bsearch(), test_ctrlz(), test_default_body(), test_default_client_accessible_object(), test_defaults(), test_elem_bounding_client_rect(), test_fgetwc(), test_get_profiles_dir(), test_GetSecurityInfo(), test_length(), test_ndr_simple_type(), test_reader_pos(), test_readmode(), test_rotate(), test_safearray(), test_screen(), test_SHLWAPI_213(), test_SHLWAPI_214(), test_simple_struct(), test_simple_types(), test_strtol(), test_TypeInfo(), test_VarDecAbs(), test_VarDecAdd(), test_VarDecCmp(), test_VarDecCmpR8(), test_VarDecDiv(), test_VarDecMul(), test_VarDecNeg(), test_VarDecRound(), test_VarDecSub(), test_VarMod(), test_WSAEnumNetworkEvents(), test_XDR_datatypes(), TestASet(), TIFFPrintDirectory(), COMException::toString(), ValarrayTest::transcendentals(), triangulateXYMono(), triangulateXYMonoTB(), TT_Process_Composite_Component(), UDFAddXSpaceBitmap(), UDFBuildFileEntry(), UDFBuildFileIdent(), UDFBuildFreeSpaceBitmap(), UDFCanNameBeA8dot3(), UDFConvertFEToExtended(), UDFCreateFile__(), UDFExtAllocDescToMapping(), UDFExtentOffsetToLba(), UDFFindDloc(), UDFFindDlocInMem(), UDFFindFreeDloc(), UDFGetFileStreamInformation(), UDFIsNameValid(), UDFLocateLbaInExtent(), UDFLongAllocDescToMapping(), UDFMarkAllocatedAsNotXXX(), UDFMarkNotAllocatedAsAllocated(), UDFNextExtentToLba(), UDFPackDirectory__(), UDFPackMapping(), UDFReleaseFCB(), UDFRenameMoveFile__(), UDFResizeExtent(), UDFReTagDirectory(), UDFShortAllocDescToMapping(), UDFUnPackMapping(), UDFUpdateNWA(), UDFVerifyFreeSpaceBitmap(), UDFWriteData(), UDFWriteInSector(), XMLStorage::unescape(), unreg_context_menu_handler(), unreg_icon_overlay(), unreg_prop_sheet_handler(), unregister_clsid(), UpdateProcesses(), utf8_mbtowc(), utf8_wctomb(), VarCyAdd(), VarCyMul(), VarCySub(), VARIANT_DMYFromJulian(), VectorMagnitude(), VTUTF8ChannelAnsiDispatch(), WCacheInitFrame(), win_time_to_unix(), wined3d_log2i(), WinHttpGetDefaultProxyConfiguration(), WinHttpSetDefaultProxyConfiguration(), WndProc(), write_label(), write_reg_key(), xdr_getint32(), xdr_int(), xdr_int16_t(), xdr_int32_t(), xdr_putint32(), xdr_short(), xdr_u_int(), xdr_u_int16_t(), xdr_u_int32_t(), xdr_u_short(), xdrmem_getlong_unaligned(), xdrmem_putlong_unaligned(), xmlCanonicPath(), xmlDictExists(), xmlDictLookup(), xmlDictQLookup(), xmlEntitiesErrMemory(), xmlIsXHTML(), xmlListCreate(), xmlLoadEntityContent(), xmlNewDocElementContent(), xmlParseAttValueComplex(), xmlParseCDSect(), xmlParseCharDataComplex(), xmlParseCommentComplex(), xmlParseEntityValue(), xmlParseNameComplex(), xmlParseNCNameComplex(), xmlParseNmtoken(), xmlParsePI(), xmlParseQName(), xmlParseStringName(), xmlParseSystemLiteral(), xmlSplitQName(), xmlStringLenDecodeEntities(), xmlTreeErrMemory(), XMLStorage::XS_String::XS_String(), xsltLocaleStrcmp(), xsltSaveProfiling(), and xsltTimestamp().

◆ ll