I have a project that does some Dijkstra searches on a graph, I implemented a red-black tree and priority queue that I use for the nodes, however I also need the same data structures for other things such as edges. I think there will only be 2, maybe 3 types of struct I would use it with.
In such a scenario where the struct 'types' are known off top, should I use void* and pass function pointers for comparators, or would you say that duplicating the source file to maintain type safety is a stance that I can defend?
I haven't had the opportunity to delve into C enough to have an intuition on these kind of design decisions, so any help will be appreciated.