Skip to content

Commit

Permalink
İsim değişikliği ve notların düzenlenmesi.
Browse files Browse the repository at this point in the history
  • Loading branch information
Enes1313 committed Feb 23, 2020
1 parent 198a7db commit 9bf91b1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion DS/eaDSCircularBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ int eaDSCircularBufferGet(eaDSCircularBuffer circularBuffer, void * data, size_t
return EXIT_SUCCESS;
}

int eaDSCircularBufferGetIndex(eaDSCircularBuffer circularBuffer, const void * data, size_t numberOfData, size_t * len)
int eaDSCircularBufferGetWhereIsIt(eaDSCircularBuffer circularBuffer, const void * data, size_t numberOfData, size_t * len)
{
size_t i;

Expand Down
19 changes: 9 additions & 10 deletions DS/inc/eaDSCircularBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ eaDSCircularBuffer eaDSCircularBufferInit(size_t sizeOfData, void * (*dataCreate
* PARAMETERS : None
* GLOBALS : None
* RETURN : Address from eaDSCircularBuffer type or NULL.
* NOTES : If "info" will be NULL, It will use default settings.
* {sizeof(int), free, malloc, memcpy, memcmp}
* This function uses clear function given in info struct.
* NOTES : All parameters are used in library.
********************************************************************************/
eaDSCircularBuffer eaDSCircularBufferInitWithDetails(size_t sizeOfData, void * (*dataCreate)(size_t), void * (*dataCopy)(void *, const void *, size_t), int (*dataCompare)(const void *, const void *, size_t), void (*dataClear)(void *), size_t capacity);

Expand Down Expand Up @@ -77,7 +75,7 @@ void eaDSCircularBufferReset(eaDSCircularBuffer circularBuffer);
* PARAMETERS : None
* GLOBALS : None
* RETURN : None
* NOTES : This function uses clear function given in info struct.
* NOTES : This function uses clear function passed to init func.
********************************************************************************/
void eaDSCircularBufferClear(eaDSCircularBuffer circularBuffer);

Expand All @@ -87,13 +85,13 @@ void eaDSCircularBufferClear(eaDSCircularBuffer circularBuffer);
* PARAMETERS :
* circularBuffer -> Address of a circular buffer.
* data -> Data address to add to the circular buffer.
* s -> size of data (sizeof(...))
* len -> size of data (sizeof(...))
* GLOBALS : None
* OUTPUTS :
* PARAMETERS : None
* GLOBALS : None
* RETURN : EXIT_SUCCESS or EXIT_FAILURE
* NOTES : This function uses creat and copy functions given in info struct.
* NOTES : This function uses copy functions passed to init func.
********************************************************************************/
int eaDSCircularBufferAdd(eaDSCircularBuffer circularBuffer, const void * data, size_t len);

Expand All @@ -109,7 +107,7 @@ int eaDSCircularBufferAdd(eaDSCircularBuffer circularBuffer, const void * data,
* PARAMETERS : None
* GLOBALS : None
* RETURN : EXIT_SUCCESS or EXIT_FAILURE
* NOTES : This function uses creat and copy functions given in info struct.
* NOTES : This function uses copy functions passed to init func.
********************************************************************************/
int eaDSCircularBufferGet(eaDSCircularBuffer circularBuffer, void * data, size_t len);

Expand All @@ -119,15 +117,16 @@ int eaDSCircularBufferGet(eaDSCircularBuffer circularBuffer, void * data, size_t
* PARAMETERS :
* circularBuffer -> Address of a circular buffer.
* data -> Data address to add to the circular buffer.
* len -> size of data (sizeof(...))
* numberOfData -> Data length
* len -> how many elements later
* GLOBALS : None
* OUTPUTS :
* PARAMETERS : None
* GLOBALS : None
* RETURN : EXIT_SUCCESS or EXIT_FAILURE
* NOTES : This function uses creat and copy functions given in info struct.
* NOTES : This function uses compare functions passed to init func.
********************************************************************************/
int eaDSCircularBufferGetIndex(eaDSCircularBuffer circularBuffer, const void * data, size_t numberOfData, size_t * index);
int eaDSCircularBufferGetWhereIsIt(eaDSCircularBuffer circularBuffer, const void * data, size_t numberOfData, size_t * len);

/********************************************************************************
* DESCRIPTION : Data is added to circular buffer.
Expand Down
12 changes: 6 additions & 6 deletions Test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ void testCircularBuffer()

memset(data, 0, sizeof(data));

if (EXIT_SUCCESS == eaDSCircularBufferGetIndex(circularBuffer, "{", 1, &len))
if (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "{", 1, &len))
{
eaDSCircularBufferMoveHead(circularBuffer, len);

if (EXIT_SUCCESS == eaDSCircularBufferGetIndex(circularBuffer, "}", 1, &len))
if (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "}", 1, &len))
{
if (EXIT_SUCCESS == eaDSCircularBufferGet(circularBuffer, data, len + 1))
{
Expand Down Expand Up @@ -92,11 +92,11 @@ void testCircularBuffer()

memset(data, 0, sizeof(data));

if (EXIT_SUCCESS == eaDSCircularBufferGetIndex(circularBuffer, "{", 1, &len))
if (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "{", 1, &len))
{
eaDSCircularBufferMoveHead(circularBuffer, len);

if (EXIT_SUCCESS == eaDSCircularBufferGetIndex(circularBuffer, "}", 1, &len))
if (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "}", 1, &len))
{
if (EXIT_SUCCESS == eaDSCircularBufferGet(circularBuffer, data, len + 1))
{
Expand All @@ -118,11 +118,11 @@ void testCircularBuffer()
memset(data, 0, 1);
}

while (EXIT_SUCCESS == eaDSCircularBufferGetIndex(circularBuffer, "{", 1, &len))
while (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "{", 1, &len))
{
eaDSCircularBufferMoveHead(circularBuffer, len);

if (EXIT_SUCCESS == eaDSCircularBufferGetIndex(circularBuffer, "}", 1, &len))
if (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "}", 1, &len))
{
if (EXIT_SUCCESS == eaDSCircularBufferGet(circularBuffer, data, len + 1))
{
Expand Down

0 comments on commit 9bf91b1

Please sign in to comment.