[BLOCKER] Implement datapackage library
Patryk Kubiak (approved)
Branch: implement-datapackage-library
Branch: to_review
Merged
Merged pull request
Merged in implement-datapackage-library (pull request #41)
Merged in implement-datapackage-library (pull request #41)
General Description:
There is a lot of functions in the system that handles read/write operations on buffers. Very often it is required to pass the buffer size and address to the function and also request about number of bytes that has been read/written. It has to be implemented in each module separately. The idea of the task is to prepare a simple module that helps in such operations. The module should be implemented as part of the Library Space in files
oc_datapackage.h
andoc_datapackage.c
.Example of usage
void WriteData( const void * Buffer, oC_MemorySize_t * Size ) { oC_DataPackage_t dataPackage; // We give here pointer to the dataPackage, // pointer to the buffer with data, // size of the buffer, // number of bytes of data in the buffer // And flag set to true if the buffer is for reading only oC_DataPackage_Initialize( &dataPackage, Buffer, *Size, *Size, true ); // We read data from the buffer as long as it is no empty and we can send the byte while( !oC_DataPackage_IsEmpty( &dataPackage ) && SendByte( oC_DataPackage_GetDataU8( &dataPackage ) ) ); // At the end we can set the number of sent data in the `Size` function parameter *Size -= oC_DataPackage_GetLeftSize( &dataPackage ); }
Pull Request Description
The pull request is implementation of the task #188 Trello requirements you can find here: https://trello.com/c/dTYHKFkE
Release notes:
Add -Werror to libraries space and replace type of <stdbool.h> include to allow eclipse for correctly interpretation in indexer
Implementation of
DataPackage
library