hdf_sbuf.h

    Core

    Description:

    Defines functions related to a . The HDF provides data serialization and deserialization capabilities for data transmission between user-mode applications and kernel-mode drivers.

    Since:

    1.0

    Function Name

    Description

    HdfSbufWriteBuffer (struct sbuf, const void data, uint32_t writeSize)

    bool 

    Writes a data segment to a SBuf.

    HdfSbufWriteUint64 (struct sbuf, uint64_t value)

    bool 

    Writes a 64-bit unsigned integer to a SBuf.

    HdfSbufWriteUint32 (struct sbuf, uint32_t value)

    bool 

    Writes a 32-bit unsigned integer to a SBuf.

    HdfSbufWriteUint16 (struct sbuf, uint16_t value)

    bool 

    Writes a 16-bit unsigned integer to a SBuf.

    HdfSbufWriteUint8 (struct sbuf, uint8_t value)

    bool 

    Writes an 8-bit unsigned integer to a SBuf.

    HdfSbufWriteInt64 (struct sbuf, int64_t value)

    bool 

    Writes a 64-bit signed integer to a SBuf.

    HdfSbufWriteInt32 (struct sbuf, int32_t value)

    bool 

    Writes a 32-bit signed integer to a SBuf.

    bool 

    Writes a 16-bit signed integer to a SBuf.

    HdfSbufWriteInt8 (struct sbuf, int8_t value)

    bool 

    Writes an 8-bit signed integer to a SBuf.

    HdfSbufWriteString (struct sbuf, const char value)

    bool 

    Writes a string to a SBuf.

    HdfSbufReadBuffer (struct sbuf, const void **data, uint32_t readSize)

    bool 

    Reads a data segment from a SBuf.

    HdfSbufReadUint64 (struct sbuf, uint64_t value)

    bool 

    Reads a 64-bit unsigned integer from a SBuf.

    HdfSbufReadUint32 (struct sbuf, uint32_t value)

    bool 

    Reads a 32-bit unsigned integer from a SBuf.

    HdfSbufReadUint16 (struct sbuf, uint16_t value)

    bool 

    Reads a 16-bit unsigned integer from a SBuf.

    HdfSbufReadUint8 (struct sbuf, uint8_t value)

    bool 

    Reads an 8-bit unsigned integer from a SBuf.

    HdfSbufReadInt64 (struct sbuf, int64_t value)

    bool 

    Reads a 64-bit signed integer from a SBuf.

    HdfSbufReadInt32 (struct sbuf, int32_t value)

    bool 

    Reads a 32-bit signed integer from a SBuf.

    HdfSbufReadInt16 (struct sbuf, int16_t value)

    bool 

    Reads a 16-bit signed integer from a SBuf.

    HdfSbufReadInt8 (struct sbuf, int8_t value)

    bool 

    HdfSbufReadString (struct sbuf)

    const char  

    Reads a string from a SBuf.

    HdfSbufGetData (const struct sbuf)

    uint8_t  

    Obtains the pointer to the data stored in aSBuf.

    HdfSbufFlush (struct sbuf)

    void 

    Clears the data stored in a SBuf.

    HdfSbufGetCapacity (const struct sbuf)

    size_t 

    Obtains the capacity of a SBuf.

    HdfSbufGetDataSize (const struct sbuf)

    size_t 

    Obtains the size of the data stored in a SBuf.

    HdfSBufObtain (size_t capacity)

    struct  

    Obtains a SBuf instance.

    HdfSBufObtainDefaultSize (void)

    struct  

    Obtains a SBuf instance of the default capacity (256 bytes).

    HdfSBufBind (uintptr_t base, size_t size)

    struct  

    Creates a SBuf instance with the specified data and size. The pointer to the data stored in the SBuf is released by the caller, and the written data size should not exceed the specified value of size.

    HdfSBufRecycle (struct sbuf)

    void 

    Releases a SBuf .

    HdfSBufMove (struct sbuf)

    struct HdfSBuf  

    Creates a SBuf instance with an original SBuf. This function moves the data stored in the original SBuf to the new one without memory copy.

    (const struct HdfSBuf sbuf)

    struct  

    Creates a SBuf instance with an original SBuf. This function copies the data stored in the original SBuf to the new one.

    HdfSbufTransDataOwnership (struct sbuf)

    Transfers the data ownership to a SBuf. Once the SBuf is released, the bound data memory is also released. This function is used together with HdfSBufBind.