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

Ajout doc

This commit is contained in:
Naej 2016-12-11 04:01:27 +01:00
parent 9535e1e696
commit dba704e4e7
3 changed files with 52 additions and 5 deletions

View File

@ -109,6 +109,7 @@ void removeNextRow(cellElement* tree){
} }
} }
void recursivePrint(cellElement * tree){ void recursivePrint(cellElement * tree){
if (tree != NULL){ if (tree != NULL){
printf("Elem : x: %d y: %d \n",tree->colIndex,tree->rowIndex); printf("Elem : x: %d y: %d \n",tree->colIndex,tree->rowIndex);

View File

@ -51,7 +51,9 @@ cellElement * CreateCellElem();
/*---AddNextCol--- /*---AddNextCol---
*Allocates a cellElement and sets it as the NextCol of the tree *Allocates a cellElement and sets it as the NextCol of the tree
* *
*@tree : an allocated cellElement *@tree : pointer on an allocated cellElement
*
*@return ; error codes
* *
*/ */
int AddNextCol(cellElement* tree); int AddNextCol(cellElement* tree);
@ -60,7 +62,9 @@ int AddNextCol(cellElement* tree);
/*---AddNextRow--- /*---AddNextRow---
*Allocates a cellElement and sets it as the NextRow of the tree *Allocates a cellElement and sets it as the NextRow of the tree
* *
*@tree : an allocated cellElement *@tree : a pointer on an allocated cellElement
*
*@return : error codes
* *
*/ */
int AddNextRow(cellElement* tree); int AddNextRow(cellElement* tree);
@ -68,7 +72,7 @@ int AddNextRow(cellElement* tree);
/*---removeNextCol--- /*---removeNextCol---
*Free the nextCol cellElement of the tree *Free the nextCol cellElement of the tree
* *
*@tree : an allocated cellElement *@tree : a pointer on an allocated cellElement
* *
*/ */
void removeNextCol(cellElement* tree); void removeNextCol(cellElement* tree);
@ -76,7 +80,7 @@ void removeNextCol(cellElement* tree);
/*---removeNextRow--- /*---removeNextRow---
*Free the nextRow cellElement of the tree *Free the nextRow cellElement of the tree
* *
*@tree : an allocated cellElement *@tree : a pointer on an allocated cellElement
* *
*/ */
void removeNextRow(cellElement* tree); void removeNextRow(cellElement* tree);
@ -85,15 +89,55 @@ void removeNextRow(cellElement* tree);
/*---FreeCellElem--- /*---FreeCellElem---
*Allocates a cellElement and returns it *Allocates a cellElement and returns it
* *
*@return : pointer on the allocated cellElement *@element : pointer on the allocated cellElement
* *
*/ */
void FreeCellElement(cellElement* element); void FreeCellElement(cellElement* element);
/*---is_leaf---
*Checks is the tree is a leaf
*
*@tree : a pointer on an allocated cellElement
*
*@return : a bool
*
*/
bool is_leaf(cellElement* tree); bool is_leaf(cellElement* tree);
/*---SetPositionIndex---
*Allows you to set the colIndex and the rowIndex of the cellElement elem
*
*@elem : a pointer on an allocated cellElement
*@Col : the value for colIndex
*@Row : the value for rowIndex
*
*@return : error codes
*
*/
int SetPositionIndex(cellElement* elem,int Col,int Row); int SetPositionIndex(cellElement* elem,int Col,int Row);
/*---SetNextCol---
*Allows you to set the nextCol of the cellElement tree
*
*@tree : a pointer on the element you want to set
*@elem : a pointer on a cellElement
*
*@return : error codes
*
*/
int SetNextCol(cellElement* tree,cellElement* elem); int SetNextCol(cellElement* tree,cellElement* elem);
/*---SetNextRow---
*Allows you to set the nextRow of the cellElement elem
*
*@tree : a pointer on the element you want to set
*@elem : a pointer on a cellElement
*
*@return : error codes
*
*/
int SetNextRow(cellElement* tree,cellElement* elem); int SetNextRow(cellElement* tree,cellElement* elem);

2
main.c
View File

@ -24,6 +24,8 @@ int main(int argc, char **argv){
AddNextCol(tree); AddNextCol(tree);
SetPositionIndex(tree->nextCol,1,3); SetPositionIndex(tree->nextCol,1,3);
SetNextRow(tree->nextCol,tree->nextRow);
recursivePrint(tree); recursivePrint(tree);