Re: gnome-libs proposed change



A while back on gnome-hackers I described something like this, except it
did not involve an API change.

Using the value of argv[0] and the PATH environment variable it is
possible to get the executable name.  There is already a bit of code to do
this in gnome-libs/support/findme.c.

If an application has been installed according to the normal conventions,
the parent of the directory where the application is located will usually
be the prefix for the package.

We could then use this prefix in the resource location routines.  It could
also be used to deduce the locale directory passed to bindtextdomain().

This solution does not handle non trivial directory structuring, but does
make the resulting executable relocatable (since no paths are compiled
into the executable), which is also a useful property.

James.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Tue, 1 Jun 1999, Havoc Pennington wrote:

> 
> Hi,
> 
> This is premature because gnome-libs is frozen, but I want to get it
> out there so I won't forget. 
> 
> When gnome-libs unfreezes, I propose the following:
> 
> void
> gnome_set_app_prefixes (const char* prefix,
>                         const char* datadir,
>                         const char* libdir,
>                         const char* sysconfdir);
> 
> This can be called prior to gnome_init(); some arguments can be NULL.  
> The Gnome functions that locate resources such as help files and pixmaps
> will prepend the relevant prefix to their search path. Then apps can be
> installed in a different prefix from Gnome and still behave properly.
> 
> Not a big change, but very useful IMHO.
> 
> Havoc
> 
> 
>                         
> 
> 
> -- 
> To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> as the Subject.
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]