API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

STD_COPYLE()

Brew Release
Brew MP 1.0.2
Description

The std_CopyLE() function copies data while translating numeric values between host byte ordering and "little endian" byte ordering.
pvDest and pvSrc are NOT required to be 16 or 32-bit word aligned.
Behavior is undefined when the destination and source arrays overlap, except in the special case where pvDest and pvSrc are equal. In that case, std_CopyLE() modifies the buffer in-place.
When the target byte ordering (little endian) matches the host byte ordering, in-place translations reduce to a no-op, and copies are delegated directly to std_memmove().
Params
pvDest
[]:
Pointer to destination buffer.
nDestSize
[]:
Size of the destination buffer.
pvSrc
[]:
Pointer to buffer containing source data.
nSrcSize
[]:
Size of source data.
pszFields
[]:
Description of the fields that comprise the source data.
Each field size is given by a positive decimal integer or one of the following
ordering
[]:

S
[]:
a 2 byte (16 bit) value.
L
[]:
a 4 byte (32 bit) value.
Q
[]:
a 8 byte (64 bit) value.

An integer gives a number of bytes and "*" represents the remainder of the pvSrc[] buffer. No reordering is performed on data in these fields.
Comparisons are case-sensitive. Behavior is undefined when other characters are supplied in pszFields.
For
Interface
Prototype
  •    int std_CopyLE(void *pvDest, int nDestSize,
                      const void *pvSrc,  int nSrcSize,
                      const char *pszFields);
    
Return

  • The number of bytes actually copied or translated in-place. This will be the smaller of nDestSize and nSrcSize, or zero if one of them are negative.