OK, so you need to indicate files in the directory from which the user started (e.g. tourneyFile, saveGameFile), distinct from a standard place where XBoard looks for its own support files (textures, pieces, engines).
But there already are two such mechanisms: '.' and '~~'. It seems to me you should use ~~ for the root directory of the installed app. In the Linux version ~~ indicates something like /usr/share/games/xboard, supplied by the configure process through a -DDATADIR compile flag. But on OS X you would not use such a place with a fixed name, but would want to decide on it at run time, dependning on where the user installed the app.
This should be easy to implement, by storing the name in memory as initialized data
Code: Select all
char datadir[MSG_SIZ] = DATADIR;
and then let the code in args.h that interprets ~~ use the variable datadir rather than the constant DATADIR to build the actual path name. The OS X initialization code in main() could then request the app's path name through some gtkosx_... call, and store it in datadir, overwriting the (Linux) value to which it was initialized. You could then configure engines with directories like -fd ~~/Fairy-Max, or ~~/../Fairy-Max, etc. And you should refrain from any cd in the launch script, so that the current directory is preserved.