BUGFIX: redefinition of typedef is a C11 feature; moved the struct declarations in the header file