[haiku-development] Re: Separation of application configuration, data and cache

  • From: "François Revol" <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 11 Nov 2009 13:23:05 +0100 CET

> I think it's a little bit more complicated because with XDG you can
> override the default directories with environment variables.

Well this doesn't mean we want to implement it fully.

> Looking at ~/.config (the standard place on Linux where the
> configuration is
> stored according to this XDG standard) I can find only Gtk/Xfce
> applications
> right now. I guess that SDL and console apps are more interresting to
> Haiku
> than Gtk apps. Unfortunately, I doubt there is something as nice as
> find_directory() in glibc and/or SDL. So my idea would be to provide
>  functions

SDL doesn't have that indeed...
Maybe Glib (not glibc) has some though... many apps now use Glib
without GTK.

> For console apps, since Linux/BSD seemingly doesn't have anything
> like
> find_directory(), maybe I could just create a function also called
> find_directory() with the Be semantics in a standalone C file/header

FindDirectory.h can be included in C code, there is a C version of the
call.

> but that would use XDG as it's backend. That way when a console app
> is compiled on Haiku it would just use directly the find_directory()
> in libroot. And when compiled on Linux/BSD it would use the
> find_directory() provided in the extra C file/header. However I don't
> how people would react to this.

Well, just have the app have its own abstraction code.

See find_resource() in netsurf for ex:
http://source.netsurf-browser.org/trunk/netsurf/beos/beos_gui.cpp?revision=8752&view=markup
it tries find_directory() then fallbacks to the *nix stuff.

François.

Other related posts: