![Logo](logo_character_tree.png) |
Character Tree
1.0.0
A PDF tree builder from CSV
|
Go to the documentation of this file.
43 #if !defined(TREESTUCT_H)
85 #define LOGS "logs/treeBuilder.log"
86 #define SRC "data.csv"
87 #define TEX "tree.tex"
135 int buildTree(
Tree *t,
int id,
char name[],
int value, FILE* logs);
143 void getFields(
char line[],
char* tokens[]);
151 int toInt(
char* str);
161 int readCSV(FILE* file,
Tree *t, FILE* logs);
220 void writeLogs(FILE* logs,
char message[]);
231 #endif // TREESTUCT_H
void rowMissingChildren(FILE *file, int children)
Add missing children to the tree in the TEX file.
Definition: treeBuilder.c:108
Tree createNode(int id, char name[], int value)
Create a new indivudal (node).
Definition: treeBuilder.c:24
void writeLatexPerson(FILE *file, Tree t, int depth, int rootId)
Write an individual as a node in the TEX file.
Definition: treeBuilder.c:135
void missingChildren(int id, FILE *file, int rootId)
Compute the number of missing children for the given node according to the root id.
Definition: treeBuilder.c:114
int toInt(char *str)
Convert a string to an integer.
Definition: treeBuilder.c:76
void getFields(char line[], char *tokens[])
Read a CSV file row.
Definition: treeBuilder.c:65
void color(int value, char strColor[])
Set the node color according to its value.
Definition: treeBuilder.c:126
void writeLogs(FILE *logs, char message[])
Add a line to the log file.
Definition: treeBuilder.c:175
void displayPerson(Tree t)
Display a tree in the standard output.
Definition: treeBuilder.c:99
struct person * Tree
The type definition of the binary tree.
void formateInteger(int val, char ch[], char addOn[])
Formate an integer to a specific string for the logs.
Definition: treeBuilder.c:184
A structure representing an indivual as a tree node.
Definition: treestruct.h:107
char name[MAXLEN]
Definition: treestruct.h:109
int value
Definition: treestruct.h:110
#define MAXLEN
A macro representing the maximum length of a string.
Definition: treestruct.h:82
void writeLatexFile(FILE *file, Tree t, int rootId)
Write a TEX file from a binary tree.
Definition: treeBuilder.c:164
struct person Person
The type definition of an individual.
int id
Definition: treestruct.h:108
© 2021 Bruno Verchère