21 #ifndef SBG_STREAM_BUFFER_COMMON_H 22 #define SBG_STREAM_BUFFER_COMMON_H 33 #if SBG_CONFIG_BIG_ENDIAN == 1 37 #define sbgStreamBufferReadUint16 sbgStreamBufferReadUint16BE 38 #define sbgStreamBufferReadInt16 sbgStreamBufferReadInt16BE 40 #define sbgStreamBufferReadUint24 sbgStreamBufferReadUint24BE 41 #define sbgStreamBufferReadInt24 sbgStreamBufferReadInt24BE 43 #define sbgStreamBufferReadUint32 sbgStreamBufferReadUint32BE 44 #define sbgStreamBufferReadInt32 sbgStreamBufferReadInt32BE 46 #define sbgStreamBufferReadUint40 sbgStreamBufferReadUint40BE 47 #define sbgStreamBufferReadInt40 sbgStreamBufferReadInt40BE 49 #define sbgStreamBufferReadUint48 sbgStreamBufferReadUint48BE 50 #define sbgStreamBufferReadInt48 sbgStreamBufferReadInt48BE 52 #define sbgStreamBufferReadUint56 sbgStreamBufferReadUint56BE 53 #define sbgStreamBufferReadInt56 sbgStreamBufferReadInt56BE 55 #define sbgStreamBufferReadUint64 sbgStreamBufferReadUint64BE 56 #define sbgStreamBufferReadInt64 sbgStreamBufferReadInt64BE 58 #define sbgStreamBufferReadSizeT32 sbgStreamBufferReadSizeT32BE 59 #define sbgStreamBufferReadSizeT64 sbgStreamBufferReadSizeT64BE 61 #define sbgStreamBufferReadFloat sbgStreamBufferReadFloatBE 62 #define sbgStreamBufferReadDouble sbgStreamBufferReadDoubleBE 64 #define sbgStreamBufferWriteUint16 sbgStreamBufferWriteUint16BE 65 #define sbgStreamBufferWriteInt16 sbgStreamBufferWriteInt16BE 67 #define sbgStreamBufferWriteUint24 sbgStreamBufferWriteUint24BE 68 #define sbgStreamBufferWriteInt24 sbgStreamBufferWriteInt24BE 70 #define sbgStreamBufferWriteUint32 sbgStreamBufferWriteUint32BE 71 #define sbgStreamBufferWriteInt32 sbgStreamBufferWriteInt32BE 73 #define sbgStreamBufferWriteUint64 sbgStreamBufferWriteUint64BE 74 #define sbgStreamBufferWriteInt64 sbgStreamBufferWriteInt64BE 76 #define sbgStreamBufferWriteSizeT32 sbgStreamBufferWriteSizeT32BE 77 #define sbgStreamBufferWriteSizeT64 sbgStreamBufferWriteSizeT64BE 79 #define sbgStreamBufferWriteFloat sbgStreamBufferWriteFloatBE 80 #define sbgStreamBufferWriteDouble sbgStreamBufferWriteDoubleBE 82 #define sbgStreamBufferReadString sbgStreamBufferReadStringBE 83 #define sbgStreamBufferWriteString sbgStreamBufferWriteStringBE 88 #define sbgStreamBufferReadUint16 sbgStreamBufferReadUint16LE 89 #define sbgStreamBufferReadInt16 sbgStreamBufferReadInt16LE 91 #define sbgStreamBufferReadUint24 sbgStreamBufferReadUint24LE 92 #define sbgStreamBufferReadInt24 sbgStreamBufferReadInt24LE 94 #define sbgStreamBufferReadUint32 sbgStreamBufferReadUint32LE 95 #define sbgStreamBufferReadInt32 sbgStreamBufferReadInt32LE 97 #define sbgStreamBufferReadUint40 sbgStreamBufferReadUint40LE 98 #define sbgStreamBufferReadInt40 sbgStreamBufferReadInt40LE 100 #define sbgStreamBufferReadUint48 sbgStreamBufferReadUint48LE 101 #define sbgStreamBufferReadInt48 sbgStreamBufferReadInt48LE 103 #define sbgStreamBufferReadUint56 sbgStreamBufferReadUint56LE 104 #define sbgStreamBufferReadInt56 sbgStreamBufferReadInt56LE 106 #define sbgStreamBufferReadUint64 sbgStreamBufferReadUint64LE 107 #define sbgStreamBufferReadInt64 sbgStreamBufferReadInt64LE 109 #define sbgStreamBufferReadSizeT32 sbgStreamBufferReadSizeT32LE 110 #define sbgStreamBufferReadSizeT64 sbgStreamBufferReadSizeT64LE 112 #define sbgStreamBufferReadFloat sbgStreamBufferReadFloatLE 113 #define sbgStreamBufferReadDouble sbgStreamBufferReadDoubleLE 115 #define sbgStreamBufferWriteUint16 sbgStreamBufferWriteUint16LE 116 #define sbgStreamBufferWriteInt16 sbgStreamBufferWriteInt16LE 118 #define sbgStreamBufferWriteUint24 sbgStreamBufferWriteUint24LE 119 #define sbgStreamBufferWriteInt24 sbgStreamBufferWriteInt24LE 121 #define sbgStreamBufferWriteUint32 sbgStreamBufferWriteUint32LE 122 #define sbgStreamBufferWriteInt32 sbgStreamBufferWriteInt32LE 124 #define sbgStreamBufferWriteUint64 sbgStreamBufferWriteUint64LE 125 #define sbgStreamBufferWriteInt64 sbgStreamBufferWriteInt64LE 127 #define sbgStreamBufferWriteSizeT32 sbgStreamBufferWriteSizeT32LE 128 #define sbgStreamBufferWriteSizeT64 sbgStreamBufferWriteSizeT64LE 130 #define sbgStreamBufferWriteFloat sbgStreamBufferWriteFloatLE 131 #define sbgStreamBufferWriteDouble sbgStreamBufferWriteDoubleLE 133 #define sbgStreamBufferReadString sbgStreamBufferReadStringLE 134 #define sbgStreamBufferWriteString sbgStreamBufferWriteStringLE 141 #define sbgStreamBufferReadUint8LE sbgStreamBufferReadUint8 142 #define sbgStreamBufferReadInt8LE sbgStreamBufferReadInt8 143 #define sbgStreamBufferReadBooleanLE sbgStreamBufferReadBoolean 144 #define sbgStreamBufferReadBufferLE sbgStreamBufferReadBuffer 146 #define sbgStreamBufferWriteUint8LE sbgStreamBufferWriteUint8 147 #define sbgStreamBufferWriteInt8LE sbgStreamBufferWriteInt8 148 #define sbgStreamBufferWriteBooleanLE sbgStreamBufferWriteBoolean 149 #define sbgStreamBufferWriteBufferLE sbgStreamBufferWriteBuffer 151 #define sbgStreamBufferReadUint8BE sbgStreamBufferReadUint8 152 #define sbgStreamBufferReadInt8BE sbgStreamBufferReadInt8 153 #define sbgStreamBufferReadBooleanBE sbgStreamBufferReadBoolean 154 #define sbgStreamBufferReadBufferBE sbgStreamBufferReadBuffer 156 #define sbgStreamBufferWriteUint8BE sbgStreamBufferWriteUint8 157 #define sbgStreamBufferWriteInt8BE sbgStreamBufferWriteInt8 158 #define sbgStreamBufferWriteBooleanBE sbgStreamBufferWriteBoolean 159 #define sbgStreamBufferWriteBufferBE sbgStreamBufferWriteBuffer 214 assert(pLinkedBuffer);
226 pHandle->
pBufferPtr = (uint8_t*)pLinkedBuffer;
248 assert(pLinkedBuffer);
260 pHandle->
pBufferPtr = (uint8_t*)pLinkedBuffer;
642 assert((pBuffer) || (numBytesToRead == 0));
657 memcpy(pBuffer, pHandle->
pCurrentPtr, numBytesToRead);
820 assert((pBuffer) || (numBytesToWrite == 0));
835 memcpy(pHandle->
pCurrentPtr, pBuffer, numBytesToWrite);
SBG_INLINE int8_t sbgStreamBufferReadInt8(SbgStreamBuffer *pHandle)
SBG_INLINE bool sbgStreamBufferReadBoolean(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferInitForRead(SbgStreamBuffer *pHandle, const void *pLinkedBuffer, size_t bufferSize)
SBG_INLINE SbgErrorCode sbgStreamBufferSeek(SbgStreamBuffer *pHandle, size_t offset, SbgSBSeekOrigin origin)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint8(SbgStreamBuffer *pHandle, uint8_t value)
struct _SbgStreamBuffer SbgStreamBuffer
SBG_INLINE uint8_t sbgStreamBufferReadUint8(SbgStreamBuffer *pHandle)
enum _SbgSBMode SbgSBMode
SBG_INLINE size_t sbgStreamBufferGetSize(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteInt8(SbgStreamBuffer *pHandle, int8_t value)
SBG_INLINE SbgErrorCode sbgStreamBufferInitForWrite(SbgStreamBuffer *pHandle, void *pLinkedBuffer, size_t bufferSize)
SBG_INLINE SbgErrorCode sbgStreamBufferReadBuffer(SbgStreamBuffer *pHandle, void *pBuffer, size_t numBytesToRead)
enum _SbgSBSeekOrigin SbgSBSeekOrigin
SBG_INLINE size_t sbgStreamBufferGetSpace(SbgStreamBuffer *pHandle)
SBG_INLINE void * sbgStreamBufferGetLinkedBuffer(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteBuffer(SbgStreamBuffer *pHandle, const void *pBuffer, size_t numBytesToWrite)
SBG_INLINE size_t sbgStreamBufferTell(SbgStreamBuffer *pHandle)
Main header file for SBG Systems common C library.
#define SBG_LOG_ERROR(format,...)
SBG_INLINE size_t sbgStreamBufferGetLength(SbgStreamBuffer *pHandle)
SBG_INLINE void sbgStreamBufferClearLastError(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteBoolean(SbgStreamBuffer *pHandle, bool value)
SBG_INLINE void * sbgStreamBufferGetCursor(SbgStreamBuffer *pHandle)
enum _SbgErrorCode SbgErrorCode
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)