2016-11-15 13:13:50 +00:00
|
|
|
#ifndef CELLELMNT_H
|
|
|
|
#define CELLELMNT_H
|
|
|
|
|
|
|
|
|
|
|
|
/*---bool---
|
|
|
|
*@true : 1
|
|
|
|
*@false : 0
|
|
|
|
*/
|
|
|
|
typedef enum Bool{
|
2016-12-10 01:28:10 +00:00
|
|
|
|
2016-12-10 02:55:07 +00:00
|
|
|
true = 1,
|
|
|
|
false = 0
|
2016-11-15 13:13:50 +00:00
|
|
|
|
|
|
|
} bool;
|
|
|
|
|
|
|
|
|
|
|
|
/*---cellElement---
|
|
|
|
*Pointer on a cell of the matrix
|
|
|
|
*
|
|
|
|
*@colIndex : index (int) of the column of this cell
|
|
|
|
*@rowIndex : index (int) of the row of this cell
|
|
|
|
*
|
|
|
|
*@value : a boolean that is the content of the cell
|
|
|
|
*
|
|
|
|
*@nextCol : pointer on the next cellElement in the same column
|
|
|
|
*@nextRow : pointer on the next cellElement in the same row
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
struct cellElement {
|
2016-12-10 01:28:10 +00:00
|
|
|
|
2016-11-15 13:13:50 +00:00
|
|
|
int colIndex;
|
|
|
|
int rowIndex;
|
|
|
|
|
|
|
|
bool value;
|
|
|
|
|
|
|
|
struct cellElement * nextCol;
|
|
|
|
struct cellElement * nextRow;
|
|
|
|
|
|
|
|
};
|
2016-12-10 01:41:43 +00:00
|
|
|
typedef struct cellElement cellElement;
|
2016-11-15 13:13:50 +00:00
|
|
|
|
2016-12-10 02:55:07 +00:00
|
|
|
cellElement * CreateCellElem();
|
|
|
|
void freeCellElem(cellElement * elem);
|
|
|
|
|
2016-12-10 01:41:43 +00:00
|
|
|
int AddNextCol(cellElement* tree);
|
|
|
|
int AddNextRow(cellElement* tree);
|
2016-11-15 13:13:50 +00:00
|
|
|
|
2016-12-10 01:41:43 +00:00
|
|
|
void removeNextCol(cellElement* list);
|
|
|
|
void removeNextRow(cellElement* list);
|
|
|
|
void recursivePrint(cellElement * tree);
|
2016-11-15 13:13:50 +00:00
|
|
|
|
2016-12-10 01:28:10 +00:00
|
|
|
void FreeCellElement(cellElement* element);
|
|
|
|
|
|
|
|
#endif
|