ReactOS 0.4.15-dev-7788-g1ad9096
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 94 of file byte_order.h.

◆ be2me_32

#define be2me_32 (   x)    bswap_32(x)

Definition at line 190 of file byte_order.h.

◆ be2me_64

#define be2me_64 (   x)    bswap_64(x)

Definition at line 191 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 195 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 197 of file byte_order.h.

◆ I64

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

Definition at line 111 of file byte_order.h.

◆ IS_ALIGNED_32

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

Definition at line 86 of file byte_order.h.

◆ IS_ALIGNED_64

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

Definition at line 87 of file byte_order.h.

◆ le2me_32

#define le2me_32 (   x)    (x)

Definition at line 192 of file byte_order.h.

◆ le2me_64

#define le2me_64 (   x)    (x)

Definition at line 193 of file byte_order.h.

◆ le32_copy

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

Definition at line 196 of file byte_order.h.

◆ le64_copy

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

Definition at line 198 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 199 of file byte_order.h.

◆ me64_to_le_str

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

Definition at line 200 of file byte_order.h.

◆ ROTL32

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

Definition at line 204 of file byte_order.h.

◆ ROTL64

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

Definition at line 206 of file byte_order.h.

◆ ROTR32

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

Definition at line 205 of file byte_order.h.

◆ ROTR64

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

Definition at line 207 of file byte_order.h.

◆ UI64

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

Definition at line 112 of file byte_order.h.

Function Documentation

◆ __PR() [1/6]

static UInt32_t bswap_32 __PR ( (UInt32_t x )
inlinestatic

◆ __PR() [2/6]

static UInt64_t bswap_64 __PR ( (UInt64_t x )
inlinestatic

◆ __PR() [3/6]

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

◆ __PR() [4/6]

unsigned rhash_ctz __PR ( (unsigned )

◆ __PR() [5/6]

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

◆ __PR() [6/6]

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

◆ bswap_32()

static UInt32_t bswap_32 ( x  )
inlinestatic

◆ bswap_64()

static UInt64_t bswap_64 ( x  )
inlinestatic

Referenced by swap_bytes().

◆ 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 168 of file byte_order.h.

Referenced by __mbtowc(), _BSTR_CY(), _check_file_exists(), _check_file_not_exists(), _cput(), _elem_get_scroll_height(), _elem_get_scroll_left(), _elem_get_scroll_top(), _elem_get_scroll_width(), _lfind_s_comp(), _Loc_codecvt_name(), _Loc_collate_name(), _Loc_ctype_name(), _Loc_messages_name(), _Loc_monetary_name(), _Loc_numeric_name(), _Loc_time_name(), _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_input_set_maxlength(), _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(), XMLStorage::XS_String::assign(), astoll(), astollb(), bezierPatchMeshEval(), bezierPatchMeshListCollect(), BINARY_INSERTION_FIND(), BLOBComp(), bswap_64(), cache_entry_create(), TrimRegion::canTile(), ccf_options(), ccf_search(), ccf_sortlist(), cff_face_init(), CFn_WMCommand(), check_option(), chmc_encint(), cmp_oper(), coff_process_info(), command_line_to_args(), compare_dirs(), compare_paths(), 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(), dispatch(), BtrfsChangeDriveLetter::DlgProc(), messages_byname< char >::do_open(), DoEcho(), DPA_QuickSort(), DPA_Search(), dumpMenu(), 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(), Ext2DropBH(), ext4_ext_binsearch(), ext4_ext_binsearch_idx(), ExtractIP(), ExtractName(), fdi_Ziphuft_build(), fdi_Zipinflate_dynamic(), fdi_Zipinflate_fixed(), fls_long(), FormatCompareFn(), BtrfsVolPropSheet::FormatUsage(), ft_gray_for_premultiplied_srgb_bgra(), FT_Outline_EmboldenXY(), FT_Vector_NormLen(), FtMulDw(), FtMulDwDw(), FTPChdirAndGetCWD(), FTPGetCWD(), FTPPutOneF(), GdiDrawStream(), generic_read_frame_body(), get_default_proxy_reg_value(), Entry::get_path_base(), TrimRegion::getGridExtent(), StrRetA::GetString(), StrRetW::GetString(), CRegistryKey::GetSubkeyNameMaxLength(), gl_compute_spot_exp_table(), gl_display_matches(), gl_GetLightfv(), gl_GetLightiv(), gl_Lightfv(), gl_text(), got_one(), 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(), OpenGLSurfaceEvaluator::inBPMEval(), OpenGLSurfaceEvaluator::inEvalUStrip(), OpenGLSurfaceEvaluator::inEvalVStrip(), CRect::InflateRect(), init_layer12(), init_layer3(), init_light(), Init_Linked(), 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(), joliet_compare_paths(), jpeg_huff_decode(), jpeg_make_c_derived_tbl(), jpeg_make_d_derived_tbl(), KdbpCmdBreakPointList(), KdbpCmdEvalExpression(), KdbpCmdSet(), less_eval(), ListTest::list1(), LsC(), M16(), M24(), M8(), MACRO_Generate(), MACRO_ShortCut(), make_listening_socket(), match_ext(), SstreamTest::maxint(), MiBuildPfnDatabaseFromPageTables(), MirrorRgn(), NotifyInfo::modify(), module_fill_module(), NotifyHook::ModulePathCopyData(), msi_record_stream_name(), naws_string(), nFTPChdirAndGetCWD(), ntlm_AcceptSecurityContext(), ntlm_InitializeSecurityContextW(), number_to_str(), oc_short(), ShellPath::operator+=(), ShellPath::operator=(), pa_ptr(), pa_txt(), QMyMainWindow::paintEvent(), pap_qstring(), XMLStorage::XPathElement::parse(), parse_hex_literal(), ExplorerCmd::ParseCmdLine(), pcf_load_font(), XMLStorage::XS_String::printf(), PrintMenu(), printusage(), process_extensions(), ListTest::push_back(), ListTest::push_front(), Sorter::qs1(), qsort_comp(), r_verify_inifile(), r_verify_pidl(), r_verifyProxyEnable(), read_color_pixels(), read_depth_pixels(), read_index_pixels(), read_stencil_pixels(), readconfiggeneric(), rec_get_message_hook(), RecursiveCreateDirectory(), render_clipped_polygon(), ListTest::resize(), resolveNeutrals(), 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(), FxDmaPacketTransaction::StageTransfer(), str_to_number(), strendswith(), svc_create(), test(), test_atan2(), test_body_style(), test_bsearch(), test_ctrlz(), test_D3DXSHEvalConeLight(), test_D3DXSHEvalDirectionalLight(), test_D3DXSHEvalHemisphereLight(), test_D3DXSHEvalSphericalLight(), test_D3DXSHRotate(), test_D3DXSHRotateZ(), test_default_body(), test_default_client_accessible_object(), test_defaults(), test_effect_parameter_value(), test_effect_parameter_value_GetBoolArray(), test_effect_parameter_value_GetFloatArray(), test_effect_parameter_value_GetIntArray(), test_effect_parameter_value_GetMatrix(), test_effect_parameter_value_GetMatrixArray(), test_effect_parameter_value_GetMatrixPointerArray(), test_effect_parameter_value_GetMatrixTranspose(), test_effect_parameter_value_GetMatrixTransposeArray(), test_effect_parameter_value_GetMatrixTransposePointerArray(), test_effect_parameter_value_GetValue(), test_effect_parameter_value_GetVector(), test_effect_parameter_value_GetVectorArray(), 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_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_XDR_datatypes(), TestASet(), TIFFCIELabToXYZ(), TIFFPrintDirectory(), COMException::toString(), 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(), UDFRenameMoveFile__(), UDFResizeExtent(), UDFReTagDirectory(), UDFShortAllocDescToMapping(), UDFUnPackMapping(), UDFVerifyFreeSpaceBitmap(), UDFWriteData(), UDFWriteInSector(), ulong_bswap(), XMLStorage::unescape(), UpdateProcesses(), utf8_mbtowc(), utf8_wctomb(), XMLStorage::XS_String::vappendf(), var_cmp(), VarCyAdd(), VarCyMul(), VarCySub(), VARIANT_DMYFromJulian(), VectorMagnitude(), vert_interp(), XMLStorage::XS_String::vprintf(), 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(), xmlLinkDeallocator(), xmlListAppend(), xmlListClear(), xmlListCreate(), xmlListDelete(), xmlListEmpty(), xmlListEnd(), xmlListFront(), xmlListHigherSearch(), xmlListInsert(), xmlListLinkReverseSearch(), xmlListLinkSearch(), xmlListLowerSearch(), xmlListPopBack(), xmlListPopFront(), xmlListPushBack(), xmlListPushFront(), xmlListRemoveAll(), xmlListRemoveFirst(), xmlListRemoveLast(), xmlListReverse(), xmlListReverseSearch(), xmlListReverseWalk(), xmlListSearch(), xmlListSize(), xmlListSort(), xmlListWalk(), xmlLoadEntityContent(), xmlNewDocElementContent(), xmlParseAttValueComplex(), xmlParseCDSect(), xmlParseCharDataComplex(), xmlParseCommentComplex(), xmlParseEntityValue(), xmlParseNameComplex(), xmlParseNCNameComplex(), xmlParseNmtoken(), xmlParsePI(), xmlParseQName(), xmlParseStringName(), xmlParseSystemLiteral(), xmlSplitQName(), and xmlStringLenDecodeEntities().

◆ ll