Hi Geoff,
you are approaching ReadOSM the wrong way.
the public API is straightforward simple and has just 3 function calls:
READOSM_DECLARE int
readosm_open (const char *path, const void **osm_handle);
READOSM_DECLARE int
readosm_close (const void *osm_handle);
READOSM_DECLARE int
readosm_parse (const void *osm_handle, const void *user_data,
readosm_node_callback node_fnct, readosm_way_callback way_fnct,
readosm_relation_callback relation_fnct);
for more details please see:
http://www.gaia-gis.it/gaia-sins/readosm-1.0.0b-doxy-doc/readosm_8h.html
any other C function you'll find in the sources is clearly labelled
as "static"; this means that they are private internal methods and
are never expected to be directly invoked from outside the library
itself. More precisely, the caller app is strictly forbidden to
directly call such internal methods because they lack any public
link symbol.
You are obviously free to study and review the code as you wish
better, but this doesn't implies that you are expected to extrapolate
single code snippets out of the intended overall scope and context.
----------------------------
the main goal of ReadOSM exactly is the one to support an "abstract"
access to the underlying input file, completely hiding if it actually
is an XML or a ProtoBuf (PBF) file.
the caller application is simply required to perform three actions:
a) opening the OSM file: reasosm_open()
b) registering three callback functions and starting the parser:
readosm_parse()
c) and finally the caller is expected to nicely finalize the OSM
file when the parser terminates: readosm_close()
the OSM parser once started will then internally handle any
format-specific action in a completely transparent way, and it
will automatically invoke the appropriate callback each time
that a NODE, WAY or RELATION is found.
the main task expected from the caller is simply implementing
the callback functions in the most useful way, anyway the caller
is never expected to directly interact with the OSM file if not
thanks to parser intermediation.
here you can find few practical examples about how to correctly
use the ReadOSM library:
http://www.gaia-gis.it/gaia-sins/readosm-1.0.0b-doxy-doc/examples.html
OTH
Sandro