Are the map data structure and source data structure structs?
You define these yourself, pass them into any libfov functions that ask for them, and libfov will make sure it passes them back to you when it knows you’ll need them – i.e. in your callbacks. This mechanism, although slightly tricky at first, • avoids nasty global variables and • gives you the liberty of defining your own data structures to suit your own needs.