Re: [AD] Additions for al_get_path() (was Re: Allegro 5 TODOs (from wiki))

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


On December 14, 2008, Matthew Leverton wrote:
> On Sun, Dec 14, 2008 at 8:17 PM, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> >> AL_USER_HOME_PATH = CSIDL_PERSONAL (e.g. C:\Documents and
> >> Settings\Matthew\Documents)
> >
> > This, at the moment, returns CSIDL_PROFILE. You think that should be
> > changed?
>
> CSIDL_PROFILE is the home path, but you are not supposed to put any
> files or folders in there. So I don't think it does any good to return
> it.
>
> I would assume that AL_USER_HOME_PATH is meant for files that the user
> can open up and access outside of the Allegro application. With that
> interpretation, I think CSIDL_PERSONAL is the only choice.

AL_USER_HOME_PATH is more the base of the user's local disk allocation. In 
unix, its the base of USER_DATA_PATH, and USER_SETTINGS_PATH and whatnot. So 
thats probably why I used PROFILE, but as you said, you can't really do 
anything with that path in windows.

> It might be better to keep the constants named according to what type
> of data goes there. Ie., I don't think HOME_PATH is necessarily a good
> name, because it doesn't describe what belongs there.
>
> > What about AL_(SYSTEM|USER)_SETTINGS_PATH? Right now these are (also)
> > CSIDL_COMMON_APPDATA and CSIDL_APPDATA.
>
> Okay, this is what I assume you were talking about at the beginning of
> the thread. How necessary are these paths?  What is a "setting"?

Its where you place config files. like /etc or ~/.blah on unix. It is only so 
allegro and the user know where they are located. Allegro itself will use the 
function to find the right dirs once config.c is ported to fshooks.

> If it's always a key/value pair, then perhaps a more platform natural
> way of implementing these is via configuration API similar to the INI
> files. This would prevent people from putting things in the wrong
> place (e.g., a high score in the settings folder). Windows can place
> the values in the registry where they belong, and other systems can
> place them in configuration files in the proper place.
>
> If they are kept as duplicate folders, then it will be necessary to
> point out that unique filenames will be necessary to avoid naming
> collisions.

Where other than the registry would apps on windows keep system level 
settings? I believe config.c will want to load every config file it finds in 
the paths it wants to look in, merging them along the way, so one overrides 
the other, so SYSTEM_SETTINGS/allegro.cfg, then USER_SETTINGS/allegro.cfg then 
maybe PROGRAM_PATH/allegro.cfg, and ./allegro.cfg.

> --
> Matthew Leverton
>
> ---------------------------------------------------------------------------
>--- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
> Nevada. The future of the web can't happen without you.  Join us at MIX09
> to help pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com
>/


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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