1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2024-11-26 17:04:14 +00:00

Ajouté les fx ds le .h

This commit is contained in:
Naej 2016-12-11 03:25:21 +01:00
parent 3dac9bc5f4
commit 9535e1e696
3 changed files with 29 additions and 15 deletions

View File

@ -62,31 +62,32 @@ int SetNextRow(cellElement* tree,cellElement* elem){
int AddNextCol(cellElement* tree){ int AddNextCol(cellElement* tree){
cellElement * elem = NULL; cellElement * elem = NULL;
printf("---insertNextCol---\n");
elem = CreateCellElem(); elem = CreateCellElem();
if (elem == NULL){ if (elem == NULL){
return -1; return -1;
} }
printf("---insertNextCol---\n");
return(SetNextCol(tree,elem)); return(SetNextCol(tree,elem));
} }
int AddNextRow(cellElement* tree){ int AddNextRow(cellElement* tree){
cellElement * elem = NULL; cellElement * elem = NULL;
printf("---insertNextRow---\n");
elem = CreateCellElem(); elem = CreateCellElem();
if (elem == NULL){ if (elem == NULL){
return -1; return -1;
} }
printf("---insertNextRow---\n");
return(SetNextRow(tree,elem)); return(SetNextRow(tree,elem));
} }
void removeNextCol(cellElement* tree){ void removeNextCol(cellElement* tree){

View File

@ -81,8 +81,6 @@ void removeNextCol(cellElement* tree);
*/ */
void removeNextRow(cellElement* tree); void removeNextRow(cellElement* tree);
void recursivePrint(cellElement * tree);
/*---FreeCellElem--- /*---FreeCellElem---
*Allocates a cellElement and returns it *Allocates a cellElement and returns it
@ -92,4 +90,15 @@ void recursivePrint(cellElement * tree);
*/ */
void FreeCellElement(cellElement* element); void FreeCellElement(cellElement* element);
bool is_leaf(cellElement* tree);
int SetPositionIndex(cellElement* elem,int Col,int Row);
int SetNextCol(cellElement* tree,cellElement* elem);
int SetNextRow(cellElement* tree,cellElement* elem);
void recursivePrint(cellElement * tree);
#endif #endif

16
main.c
View File

@ -14,19 +14,23 @@
int main(int argc, char **argv){ int main(int argc, char **argv){
cellElement * tree = NULL; cellElement * tree = NULL;
tree = CreateCellElem(); tree = CreateCellElem();
tree->colIndex = 1; SetPositionIndex(tree,1,1);
tree->rowIndex = 1;
AddNextRow(tree); AddNextRow(tree);
tree->nextRow->colIndex = 2; SetPositionIndex(tree->nextRow,1,2);
tree->nextRow->rowIndex = 2;
AddNextCol(tree); AddNextCol(tree);
tree->nextCol->colIndex = 3; SetPositionIndex(tree->nextCol,1,3);
tree->nextCol->rowIndex = 2;
recursivePrint(tree); recursivePrint(tree);
removeNextRow(tree); removeNextRow(tree);
removeNextCol(tree); removeNextCol(tree);
recursivePrint(tree);
return 0; return 0;