1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2024-12-23 03:01:08 +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){
cellElement * elem = NULL;
printf("---insertNextCol---\n");
elem = CreateCellElem();
if (elem == NULL){
return -1;
}
printf("---insertNextCol---\n");
return(SetNextCol(tree,elem));
}
int AddNextRow(cellElement* tree){
cellElement * elem = NULL;
printf("---insertNextRow---\n");
elem = CreateCellElem();
if (elem == NULL){
return -1;
}
printf("---insertNextRow---\n");
return(SetNextRow(tree,elem));
}
void removeNextCol(cellElement* tree){

View File

@ -81,8 +81,6 @@ void removeNextCol(cellElement* tree);
*/
void removeNextRow(cellElement* tree);
void recursivePrint(cellElement * tree);
/*---FreeCellElem---
*Allocates a cellElement and returns it
@ -92,4 +90,15 @@ void recursivePrint(cellElement * tree);
*/
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

16
main.c
View File

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