The definition of struct datatype should be in the header file and not the opposite. This is what I understand while this project does the opposite in this special case. What drive the contributor to decide to do so and why ? I am aware it is a design decision but shall I submit a direct question to the code contributor? I was looking at the GNU masscan project and came to my attention the two file event-timeout.c which has the definition of a struct datatype
struct Timeouts {
/**
* This index is a monotonically increasing number, modulus the mask.
* Every time we check timeouts, we simply move it foreward in time.
*/
uint64_t current_index;
/**
* The number of slots is a power-of-2, so the mask is just this
* number minus 1
*/
unsigned mask;
/**
* The ring of entries.
*/
struct TimeoutEntry *slots[1024*1024];
};
while in the header file event-timeout.h contains the below statement to import the "Timeouts" struct datatype
struct Timeouts;
struct Timeouts *timeouts_create(uint64_t timestamp_now);
I am not sure why the struct Timeouts is not defined in the header file ?