mirror of
https://gitlab.com/klmp200/LO27.git
synced 2024-11-26 10:54:13 +00:00
Ajouté les fx ds le .h
This commit is contained in:
parent
3dac9bc5f4
commit
9535e1e696
@ -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){
|
||||
|
@ -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
16
main.c
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user