Re: [AD] Allegro 4.3 file location API

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


--- Peter Hull wrote:
> I added some thoughts about a file location API to
> the wiki: 
> http://awiki.tomasu.org/bin/view/Main/FileSystems
> 
> Here's what I wrote:
> 
> Different platforms store files in different places,
> so paths can't be 
> hardcoded. I propose a simple API like this:
> enum FILE_LOCATION
> {
>          SYSTEM_SETTINGS,
>          APP_RESOURCES,
>          USER_SETTINGS
> };
> 
> const char* get_file_location(enum FILE_LOCATION);
> void set_app_identifier(const char*);
> 
> 
> The 'app identifier' is a 'unique' name for your
> application (could be 
> a reversed domain name » like Java), so for example
> on Unix-like 
> systems:
> SYSTEM_SETTINGS -> /usr/local/share/allegro/
> APP_RESOURCES -> /usr/local/share/${APP_ID}/
> USER_SETTINGS -> ${HOME}/.allegro/$(APP_ID}/
> 
>   On Windows: (need to check this, anyway there are
> W32 Shell API 
> functions to get these)
> SYSTEM_SETTINGS -> c:\documents and settings\all
> users\application 

I think this changes durasiticaly from version to
version.  Sometimes you want it in
c:\winnt\application data or other obscure places. 
Might need to have some code that checks the version
and then checks the appropriate environment variable
for that version.

> data\allegro\
> APP_RESOURCES -> c:\program files\%APP_ID%\
> USER_SETTINGS -> c:\documents and
> settings\%USER%\application 
> data\%APP_ID%\
> 
>   System settings wouldn't be used much, only by
> things like the 'setup' 
> program.
> 
> 
>   What do you think?

Awesome. :)

> 
> Pete




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/