Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com Date: Mon, 7 May 2001 13:05:01 +0200 From: Corinna Vinschen To: cygapp Subject: Re: Forcing SYSTEMROOT (opinions needed) Message-ID: <20010507130501.Z24200@cygbert.vinschen.de> Mail-Followup-To: cygapp References: <20010502222849 DOT A1238 AT redhat DOT com> <20010503111926 DOT Y24200 AT cygbert DOT vinschen DOT de> <20010503133346 DOT A5353 AT redhat DOT com> <147585893249 DOT 20010507121105 AT logos-m DOT ru> <20010507114813 DOT V24200 AT cygbert DOT vinschen DOT de> <77593264899 DOT 20010507141357 AT logos-m DOT ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <77593264899.20010507141357@logos-m.ru>; from deo@logos-m.ru on Mon, May 07, 2001 at 02:13:57PM +0400 On Mon, May 07, 2001 at 02:13:57PM +0400, egor duda wrote: > Hi! > > Monday, 07 May, 2001 Corinna Vinschen cygwin-apps AT cygwin DOT com wrote: > > CV> Shouldn't we add a generalized interface to be able to set or > CV> unset "settings" in an application? > > CV> int cygwin_get (const char *setting, char *value, size_t *size); > CV> int cygwin_set (const char *setting, const char *value); > > CV> The settings could influence for example our current problem. > CV> Adding a CYGWIN option called "[no]addsyspath" which cares for > CV> SYSTEMROOT and SYSTEMDRIVE in the environment, a savvy programmer > CV> could then use the interface like that: > > CV> cygwin_set ("addsyspath", "no"); > > CV> or similar. The settings should get inherited by child processes. > > the question here is "when this new setting should have effect?". if > the answer is "immediately" then i don't know how we can implement > this. some cygwin options (like 'tty') can't be easily switched in the > middle of the game. Sure. While it's easy to switch eg. ntsec on and off it's impossible to do that for tty. I didn't mean that as a generalized interface to enable technical nonsense but just as far as it makes sense. "tty" for example would need to be blocked in a way. > if the answer is "they should affect process' > children", then savvy programmer already has the means to do what he > (she) wants: > str = getenv ("CYGWIN"); > add_desired_option_at_the_end_of_string (str, new_str); > putenv (new_str); What I think is, we are not at the end of the process of adding options to Cygwin. As Chris I would like to restrict the length of the CYGWIN variable but in contrast to Chris I don't want to restrict the number of settings at all. I don't think that the above example to change CYGWIN could be denoted as an "interface". It works, but it's ugly, as you say. My goal is simply to add a generalized interface to set options to Cygwin. That's it. The basic settings are provided by an environment variable, better a file in future, and a per application registry setting. If a programmer really wants to change settings in Cygwin, (s)he needs an interface. But I don't like the idea to add one interface per setting like cygwin_set_systempaths(TRUE); or so. Why not adding settings in future in an always equal way: The setting has a name and a value, setting is possible by changing CYGWIN, the CYGWIN settings file and the registry setting per application. And now they are overridable by a programmer (as long as it makes sense) by using the generalized setting API as well! > more to say, such generalized api will make a set of $CYGWIN options > (in some sense) part of the api. we won't be able to change them easily, > if some application is known to call cygwin_set ("addsyspath", "no"); But adding an interface to allow the application to set it was exactly what was part of the discussion. I don't understand the point here. Chris asked for an interface so that the programmer of the application can do what (s)he wants with the setting and that is provided by these kind of interface. With one difference: It's always part of an interface system which allows these settings additionally without changing the application as well. See above. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc.