I picked a file at random -- tree.c -- and here are some of my comments about it.
Code:
#define eprintf(fmt, ...) fprintf(stderr, "%s() : line %d : " fmt, __func__, __LINE__, ##__VA_ARGS__)
__func__ and __VA_ARGS__ are C99 only, so if you're hoping for C89 compatibility you might want to use something like this.
Code:
#if defined(__STDC_VERSION) && __STDC_VERSION__ >= 199901L
#define eprintf(fmt, ...) fprintf(stderr, "%s() : line %d : " fmt, __func__, __LINE__, ##__VA_ARGS__)
#else /* not C99 */
#define eprintf(fmt, ...) fprintf(stderr, "unknown : line %d : error\n", __LINE__)
#endif
Note: I'd suggest using __FILE__ as well, it can be very useful. main.c:23 tells you all you need to know, after all.
Code:
TreeNode *tree_add(Tree *this, void *value, TreeNode *before){
"this" is a C++ keyword. You might want to avoid using identifiers of that name.
Code:
Tree *tree(int (*compare)(void *, void *)){
I don't know about you, but I like using typedefs when I pass function pointers to functions.
Now from line.c:
Code:
this->text = malloc(length * sizeof(char));
sizeof(char) is always, always 1, so you can leave it out of that expression if you like.
Variable-length arrays are C99 too . . .
Code:
Line *line_create(const char const *string){
Repeating const does nothing useful. I suspect you wanted
Code:
Line *line_create(const char *const string){
It does do something different if it's on the other side of the asterisk.
Oh, and ©[0] is the same as copy.