On Mon, 16 Jul 2001 [EMAIL PROTECTED] wrote:
> The question was two-fold, as I understood it.
> Testing for X/ncurses and Testing for Console.
Well, Peter's question wasn't. But why you thought this intrigues me...
my own background in this area is sketchy enough that I am curious to find
out more about your thoughts. Even if your solution doesn't answer
Peter's question specifically, what related problems might your solution
apply to?
> The approach suggested below -- the use of the ncurses
> pre-init routines is a library as opposed to environment
> approach to testing for X/ncurses as well as console,
> non-console.
I am not seeing how ncurses library routines would allow one to
distinguish a graphical display from a character-cell display.
> I suppose the DISPLAY can be used by its value to
> determine the console target, but that implies a console
> target, not a console environment, unless I'm wrong.
As I understand it, DISPLAY contains a display name... but what this has
to console targets eludes me. An empty DISPLAY could be construed as
indicating that X libraries should not be used, though it might be
appropriate to use a command line option to allow ncurses to be forced to
be used from an xterm.
While I find myself thinking I understand your terminology, I am not sure.
What is your definition of "console target" vs. "console environment"?
> In any case, the library approach seemed to be a more
> sure fire method.
A library approach that was known to be portable and was designed to
address this problem might well be the best solution. I am just
scratching my head trying to see how your suggestion applies.
> Brian S.
>
> Peter Jay Salzman wrote:
>
> > begin: Henry House <[EMAIL PROTECTED]> quote
> > > On Mon, Jul 16, 2001 at 11:31:30AM -0700, Peter Jay Salzman wrote:
> > > [...]
> > > > from. how is this done from C?
> > >
> > > Usually one checks for the existance of a non-empty DISPLAY.
> >
> > cool beans. works like a charm. it's neat to be able to run this program
> > from both console and X. very cool...
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<[EMAIL PROTECTED]> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...2k
---------------------------------------------------------------------------