Tous Fini

please use "gcc Block*" to compile the code
This commit is contained in:
2023-03-20 18:08:09 +01:00
parent 57fb482c0a
commit c1eef852db
4 changed files with 22 additions and 1 deletions

View File

@@ -63,6 +63,10 @@ void DeleteList(SList *list)
SCell *GetCellFromBlock(SList *list)
{
SCell *pcell;
if ((pcell = GetCellFromRecycle(list)))
{
return pcell;
}
while (!(pcell = _GetCellFromBlock(list->block)))
{
AddBlock(list->block);
@@ -97,6 +101,16 @@ SCell *_GetCellFromBlock(SBlock *bList)
return NULL;
}
SCell *GetCellFromRecycle(SList *list)
{
SCell *pcell = list->recycle;
if (pcell != NULL)
{
list->recycle = pcell->next;
}
return pcell;
}
SCell *AddElementBegin(SList *list, int data)
{
SCell *cell = GetCellFromBlock(list);