[Vortex] Impossible to configure location of DTD files
jens at mooseyard.com
Fri Jan 18 23:23:15 CET 2008
I've run into a problem using Vortex on Mac OS X. I've built the
Vortex library as a "framework", which is the preferred way to package
up libraries with their headers and resource files. However,
vortex_init looks for the DTD files only in the current directory
(which will not be the framework's directory), and it's illegal to to
add the framework's resource directory by calling
vortex_support_add_search_path before calling vortex_init.
Looking at the source code, the way Vortex deals with this on other
platforms is to use a hardcoded path set in the preprocessor variable
PACKAGE_DTD_DIR. Unfortunately, frameworks can be installed in
multiple places, or embedded inside apps, so the path isn't fixed — it
needs to be looked up at runtime.
One way to fix this would be to add some #ifdef'ed Mac-specific code
to vortex_init. But that seems like a kludge, and besides, someone
else might want to package Vortex differently on Mac OS, so that
configuration wouldn't be right for them.
A better solution, I think, would be to wait to load the DTD files
until they're needed. That way the call to vortex_init will succeed,
and the client can then vortex_support_add_search_path with the
appropriate path before opening a connection. I'm not sure I
understand the library well enough to make such a change, though...
More information about the Vortex