[AD] Additions for al_get_path() (was Re: Allegro 5 TODOs (from wiki)) |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: [AD] Additions for al_get_path() (was Re: Allegro 5 TODOs (from wiki))
- From: Evert Glebbeek <eglebbk@xxxxxxxxxx>
- Date: Sat, 13 Dec 2008 21:49:04 -0500
On 9-Dec-08, at 11:25 PM, Thomas Fjellstrom wrote:
It needs AL_PATH_USER_SETTINGS and AL_PATH_SYSTEM_SETTINGS to be
added. IIRC
OSX doesn't want to place the settings for things in the same place,
and if we
ever do get a al_set_application_name(...) function, then the full
dir path
including the app name can be automatically included for the user.
Its a simple addition, just add two new enum values to the enum, and
implement
as the specific platform expects.
Preliminary patch attached (not thoroughly tested).
I've made the following identifications:
* OS X:
AL_USER_PATH_SETTINGS: $HOME/Library/Application Support/
AL_SYSTEM_PATH_SETTINGS: /Library/Application Support/
* Linux/generic UNIX:
AL_USER_PATH_SETTINGS: $HOME/
AL_SYSTEM_PATH_SETTINGS: /etc/
* Windows:
AL_USER_PATH_SETTINGS: same as AL_USER_DATA_PATH
AL_SYSTEM_PATH_SETTINGS: same as AL_SYSTEM_DATA_PATH
The OS X ones I'm fairly certain are correct. I'm not so secure about
the generic UNIX ones; my logic here was that global settings would go
in /etc/namerc and user settings in ~/.namerc (or ~/.name/namerc),
which I think is common but of course not reflected simply by the
directory name. Of course, /etc/ should be something that can be set
(at the very least) at configure time, just like /usr/share/ for
AL_SYSTEM_DATA_PATH.
Windows doesn't seem to have the equivalent of a "settings" directory,
probably because settings are supposed to go into the registry - which
I'm guessing isn't addressable as a filesystem.
Let me know what you think.
Should I post the hard-coded value of /usr/share on the tracker?
Finally, I want to point out an inconsistency for the return value of
al_get_path() between platforms in the case that the path cannot be
retrieved (invalid enum or can't find it). On Windows, the current
code always returns the "dir" parameter, which is "" in that case. On
OS X and *nix, the return value is NULL. Which of these is correct?
Evert