Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Two patches for the readline lib
@ 1999-03-14 14:41 Robert Hoehne
  1999-03-15 11:48 ` Michael Snyder
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Robert Hoehne @ 1999-03-14 14:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: DJ Delorie, shebs

The following patches for readline disable some terminal specific
code which is not available for DJGPP.

Additinally I patched the Makefile.in by removing the current
directory from VPATH, since it is already there by default and
it confuse GNU make to find the sources on DJGPP where
';' is the path spearator and not ':'.

This patch is against "a March 10th snapshot from DJ"
which I got from DJ Delorie.

Sun Mar 14 1999 Robert Hoehne <robert.hoehne@gmx.net>

	* display.c: changing some terminal calls to work on DJGPP
	* terminal.c: likewise
	* Makefile.in: Remove . from the VPATH directive

--- gdb-snap-march-10th-from-DJ/readline/Makefile.in.orig	Thu Dec 31 04:18:56 1998
+++ gdb-snap-march-10th-from-DJ/readline/Makefile.in	Thu Mar 11 23:44:34 1999
@@ -19,7 +19,7 @@
 RL_LIBRARY_NAME = readline
 
 srcdir = @srcdir@
-VPATH = .:@srcdir@
+VPATH = @srcdir@
 top_srcdir = @top_srcdir@
 BUILD_DIR = @BUILD_DIR@
 
--- gdb-snap-march-10th-from-DJ/readline/display.c.orig	Tue Dec 22 21:53:32 1998
+++ gdb-snap-march-10th-from-DJ/readline/display.c	Sat Mar 13 17:12:42 1999
@@ -632,8 +632,12 @@
 	  if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 &&
 	      _rl_last_c_pos <= last_invisible && local_prompt)
 	    {
+#if defined (__MSDOS__)
+	      putc ('\r', rl_outstream);
+#else
 	      if (term_cr)
 		tputs (term_cr, 1, _rl_output_character_function);
+#endif
 	      _rl_output_some_chars (local_prompt, nleft);
 	      _rl_last_c_pos = nleft;
 	    }
@@ -880,7 +884,11 @@
       term_cr && lendiff > visible_length && _rl_last_c_pos > 0 &&
       od > lendiff && _rl_last_c_pos < last_invisible)
     {
+#if defined (__MSDOS__)
+      putc ('\r', rl_outstream);
+#else
       tputs (term_cr, 1, _rl_output_character_function);
+#endif /* !__MSDOS__ */
       _rl_output_some_chars (local_prompt, lendiff);
       _rl_last_c_pos = lendiff;
     }
@@ -1484,7 +1492,11 @@
 {
   if (term_cr)
     {
+#if defined (__MSDOS__)
+      putc ('\r', rl_outstream);
+#else
       tputs (term_cr, 1, _rl_output_character_function);
+#endif /* !__MSDOS__ */
       _rl_last_c_pos = 0;
     }
 }
@@ -1499,8 +1511,16 @@
      the right thing happens if we have wrapped to a new screen line. */
   if (term_cr)
     {
+#if defined (__MSDOS__)
+      putc ('\r', rl_outstream);
+#else
       tputs (term_cr, 1, _rl_output_character_function);
+#endif /* !__MSDOS__ */
       _rl_last_c_pos = 0;
+#if defined (__MSDOS__)
+      space_to_eol (screenwidth);
+      putc ('\r', rl_outstream);
+#else
       if (term_clreol)
 	tputs (term_clreol, 1, _rl_output_character_function);
       else
@@ -1508,6 +1528,7 @@
 	  space_to_eol (screenwidth);
 	  tputs (term_cr, 1, _rl_output_character_function);
 	}
+#endif
       if (_rl_last_v_pos > 0)
 	_rl_move_vert (0);
     }
--- gdb-snap-march-10th-from-DJ/readline/terminal.c.orig	Mon Dec 21 20:06:30 1998
+++ gdb-snap-march-10th-from-DJ/readline/terminal.c	Sat Mar 13 17:20:52 1999
@@ -186,8 +186,10 @@
       if (ignore_env == 0 && (ss = get_env_value ("COLUMNS")))
 	screenwidth = atoi (ss);
 
+#if !defined(__DJGPP__)
       if (screenwidth <= 0 && term_string_buffer)
 	screenwidth = tgetnum ("co");
+#endif
     }
 
   /* Environment variable LINES overrides setting of "li" if IGNORE_ENV
@@ -197,8 +199,10 @@
       if (ignore_env == 0 && (ss = get_env_value ("LINES")))
 	screenheight = atoi (ss);
 
+#if !defined(__DJGPP__)
       if (screenheight <= 0 && term_string_buffer)
 	screenheight = tgetnum ("li");
+#endif
     }
 
   /* If all else fails, default to 80x24 terminal. */
@@ -277,10 +281,12 @@
 get_term_capabilities (bp)
      char **bp;
 {
+#if !defined(__DJGPP__)
   register int i;
 
   for (i = 0; i < NUM_TC_STRINGS; i++)
     *(tc_strings[i].tc_value) = tgetstr (tc_strings[i].tc_var, bp);
+#endif
   tcap_initialized = 1;
 }
 
@@ -530,16 +536,20 @@
 void
 _rl_enable_meta_key ()
 {
+#if !defined(__DJGPP__)
   if (term_has_meta && term_mm)
     tputs (term_mm, 1, _rl_output_character_function);
+#endif
 }
 
 void
 _rl_control_keypad (on)
      int on;
 {
+#if !defined(__DJGPP__)
   if (on && term_ks)
     tputs (term_ks, 1, _rl_output_character_function);
   else if (!on && term_ke)
     tputs (term_ke, 1, _rl_output_character_function);
+#endif
 }

******************************************************
* email:   Robert Hoehne <robert.hoehne@gmx.net>     *
* Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW:     http://www.tu-chemnitz.de/~sho/rho        *
******************************************************


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Two patches for the readline lib
  1999-03-14 14:41 Two patches for the readline lib Robert Hoehne
@ 1999-03-15 11:48 ` Michael Snyder
  1999-04-01  0:00   ` DJ Delorie
                     ` (2 more replies)
  1999-04-01  0:00 ` Elena Zannoni
  1999-04-01  0:00 ` Robert Hoehne
  2 siblings, 3 replies; 10+ messages in thread
From: Michael Snyder @ 1999-03-15 11:48 UTC (permalink / raw)
  To: gdb-patches; +Cc: DJ Delorie, shebs, robert.hoehne

Robert Hoehne wrote:
> 
> The following patches for readline disable some terminal specific
> code which is not available for DJGPP.

In that case, would it be appropriate to use a single macro
(eg. if defined (__DJGPP__)) to control these changes?  The old
readline was a hodge-podge of different ifdefs of this sort.
It'd be nice to keep it under control this time.

q


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Two patches for the readline lib
  1999-04-01  0:00   ` Robert Hoehne
@ 1999-03-15 14:04     ` Robert Hoehne
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Hoehne @ 1999-03-15 14:04 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

> In that case, would it be appropriate to use a single macro
> (eg. if defined (__DJGPP__)) to control these changes?  The old
> readline was a hodge-podge of different ifdefs of this sort.
> It'd be nice to keep it under control this time.

At first: I did the patches this way, since there was already
one or two #ifdef __MSDOS__, so I thought this is the way
like it should be. But in general I agree with you, that this is
not the best way. I would do it better if I know where to start.

From other packages I know a way, where you can specify
in a host/target specifc file some conditionals which are then
either included in the source files or including them in the
Makefile so the flags will passed on commandline when compiling.

I would for instance introduce a define like

#define USE_STDIO_IO

to indicate that stdio functions should be used instead of
terminal functions. But I don't know where to specify this
host depended (in my case for DJGPP).

If you can give me some guidelines I will be glad.

Robert

******************************************************
* email:   Robert Hoehne <robert.hoehne@gmx.net>     *
* Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW:     http://www.tu-chemnitz.de/~sho/rho        *
******************************************************


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Two patches for the readline lib
  1999-04-01  0:00   ` DJ Delorie
@ 1999-03-16 11:09     ` DJ Delorie
  0 siblings, 0 replies; 10+ messages in thread
From: DJ Delorie @ 1999-03-16 11:09 UTC (permalink / raw)
  To: msnyder; +Cc: gdb-patches, shebs, robert.hoehne

> In that case, would it be appropriate to use a single macro
> (eg. if defined (__DJGPP__)) to control these changes?  The old
> readline was a hodge-podge of different ifdefs of this sort.
> It'd be nice to keep it under control this time.

A better solution would be to break out the mechanism-specific parts
of readline into separate sources, so that configure could just pick
one.  One for termcap, one for curses, one for djgpp, one for cygwin,
etc.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Two patches for the readline lib
  1999-04-01  0:00 ` Elena Zannoni
@ 1999-03-23  9:54   ` Elena Zannoni
  0 siblings, 0 replies; 10+ messages in thread
From: Elena Zannoni @ 1999-03-23  9:54 UTC (permalink / raw)
  To: gdb-patches; +Cc: shebs

Robert,
I have applied your patches to readline. You should see them
in future snapshots.

Your patches have also been applied to the official version of the
readline library, maintained by Chet Ramey at Case Western 
Reserve University.

Thank you very much for your submissions.

Elena Zannoni
Cygnus Solutions
ezannoni@cygnus.com


Robert Hoehne writes:
 > The following patches for readline disable some terminal specific
 > code which is not available for DJGPP.
 > 
 > Additinally I patched the Makefile.in by removing the current
 > directory from VPATH, since it is already there by default and
 > it confuse GNU make to find the sources on DJGPP where
 > ';' is the path spearator and not ':'.
 > 
 > This patch is against "a March 10th snapshot from DJ"
 > which I got from DJ Delorie.
 > 
 > Sun Mar 14 1999 Robert Hoehne <robert.hoehne@gmx.net>
 > 
 > 	* display.c: changing some terminal calls to work on DJGPP
 > 	* terminal.c: likewise
 > 	* Makefile.in: Remove . from the VPATH directive
 > 
 > --- gdb-snap-march-10th-from-DJ/readline/Makefile.in.orig	Thu Dec 31 04:18:56 1998
 > +++ gdb-snap-march-10th-from-DJ/readline/Makefile.in	Thu Mar 11 23:44:34 1999
 > @@ -19,7 +19,7 @@
 >  RL_LIBRARY_NAME = readline
 >  
 >  srcdir = @srcdir@
 > -VPATH = .:@srcdir@
 > +VPATH = @srcdir@
 >  top_srcdir = @top_srcdir@
 >  BUILD_DIR = @BUILD_DIR@
 >  
 > --- gdb-snap-march-10th-from-DJ/readline/display.c.orig	Tue Dec 22 21:53:32 1998
 > +++ gdb-snap-march-10th-from-DJ/readline/display.c	Sat Mar 13 17:12:42 1999
 > @@ -632,8 +632,12 @@
 >  	  if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 &&
 >  	      _rl_last_c_pos <= last_invisible && local_prompt)
 >  	    {
 > +#if defined (__MSDOS__)
 > +	      putc ('\r', rl_outstream);
 > +#else
 >  	      if (term_cr)
 >  		tputs (term_cr, 1, _rl_output_character_function);
 > +#endif
 >  	      _rl_output_some_chars (local_prompt, nleft);
 >  	      _rl_last_c_pos = nleft;
 >  	    }
 > @@ -880,7 +884,11 @@
 >        term_cr && lendiff > visible_length && _rl_last_c_pos > 0 &&
 >        od > lendiff && _rl_last_c_pos < last_invisible)
 >      {
 > +#if defined (__MSDOS__)
 > +      putc ('\r', rl_outstream);
 > +#else
 >        tputs (term_cr, 1, _rl_output_character_function);
 > +#endif /* !__MSDOS__ */
 >        _rl_output_some_chars (local_prompt, lendiff);
 >        _rl_last_c_pos = lendiff;
 >      }
 > @@ -1484,7 +1492,11 @@
 >  {
 >    if (term_cr)
 >      {
 > +#if defined (__MSDOS__)
 > +      putc ('\r', rl_outstream);
 > +#else
 >        tputs (term_cr, 1, _rl_output_character_function);
 > +#endif /* !__MSDOS__ */
 >        _rl_last_c_pos = 0;
 >      }
 >  }
 > @@ -1499,8 +1511,16 @@
 >       the right thing happens if we have wrapped to a new screen line. */
 >    if (term_cr)
 >      {
 > +#if defined (__MSDOS__)
 > +      putc ('\r', rl_outstream);
 > +#else
 >        tputs (term_cr, 1, _rl_output_character_function);
 > +#endif /* !__MSDOS__ */
 >        _rl_last_c_pos = 0;
 > +#if defined (__MSDOS__)
 > +      space_to_eol (screenwidth);
 > +      putc ('\r', rl_outstream);
 > +#else
 >        if (term_clreol)
 >  	tputs (term_clreol, 1, _rl_output_character_function);
 >        else
 > @@ -1508,6 +1528,7 @@
 >  	  space_to_eol (screenwidth);
 >  	  tputs (term_cr, 1, _rl_output_character_function);
 >  	}
 > +#endif
 >        if (_rl_last_v_pos > 0)
 >  	_rl_move_vert (0);
 >      }
 > --- gdb-snap-march-10th-from-DJ/readline/terminal.c.orig	Mon Dec 21 20:06:30 1998
 > +++ gdb-snap-march-10th-from-DJ/readline/terminal.c	Sat Mar 13 17:20:52 1999
 > @@ -186,8 +186,10 @@
 >        if (ignore_env == 0 && (ss = get_env_value ("COLUMNS")))
 >  	screenwidth = atoi (ss);
 >  
 > +#if !defined(__DJGPP__)
 >        if (screenwidth <= 0 && term_string_buffer)
 >  	screenwidth = tgetnum ("co");
 > +#endif
 >      }
 >  
 >    /* Environment variable LINES overrides setting of "li" if IGNORE_ENV
 > @@ -197,8 +199,10 @@
 >        if (ignore_env == 0 && (ss = get_env_value ("LINES")))
 >  	screenheight = atoi (ss);
 >  
 > +#if !defined(__DJGPP__)
 >        if (screenheight <= 0 && term_string_buffer)
 >  	screenheight = tgetnum ("li");
 > +#endif
 >      }
 >  
 >    /* If all else fails, default to 80x24 terminal. */
 > @@ -277,10 +281,12 @@
 >  get_term_capabilities (bp)
 >       char **bp;
 >  {
 > +#if !defined(__DJGPP__)
 >    register int i;
 >  
 >    for (i = 0; i < NUM_TC_STRINGS; i++)
 >      *(tc_strings[i].tc_value) = tgetstr (tc_strings[i].tc_var, bp);
 > +#endif
 >    tcap_initialized = 1;
 >  }
 >  
 > @@ -530,16 +536,20 @@
 >  void
 >  _rl_enable_meta_key ()
 >  {
 > +#if !defined(__DJGPP__)
 >    if (term_has_meta && term_mm)
 >      tputs (term_mm, 1, _rl_output_character_function);
 > +#endif
 >  }
 >  
 >  void
 >  _rl_control_keypad (on)
 >       int on;
 >  {
 > +#if !defined(__DJGPP__)
 >    if (on && term_ks)
 >      tputs (term_ks, 1, _rl_output_character_function);
 >    else if (!on && term_ke)
 >      tputs (term_ke, 1, _rl_output_character_function);
 > +#endif
 >  }
 > 
 > ******************************************************
 > * email:   Robert Hoehne <robert.hoehne@gmx.net>     *
 > * Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
 > * WWW:     http://www.tu-chemnitz.de/~sho/rho        *
 > ******************************************************


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Two patches for the readline lib
  1999-03-14 14:41 Two patches for the readline lib Robert Hoehne
  1999-03-15 11:48 ` Michael Snyder
@ 1999-04-01  0:00 ` Elena Zannoni
  1999-03-23  9:54   ` Elena Zannoni
  1999-04-01  0:00 ` Robert Hoehne
  2 siblings, 1 reply; 10+ messages in thread
From: Elena Zannoni @ 1999-04-01  0:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: shebs

Robert,
I have applied your patches to readline. You should see them
in future snapshots.

Your patches have also been applied to the official version of the
readline library, maintained by Chet Ramey at Case Western 
Reserve University.

Thank you very much for your submissions.

Elena Zannoni
Cygnus Solutions
ezannoni@cygnus.com


Robert Hoehne writes:
 > The following patches for readline disable some terminal specific
 > code which is not available for DJGPP.
 > 
 > Additinally I patched the Makefile.in by removing the current
 > directory from VPATH, since it is already there by default and
 > it confuse GNU make to find the sources on DJGPP where
 > ';' is the path spearator and not ':'.
 > 
 > This patch is against "a March 10th snapshot from DJ"
 > which I got from DJ Delorie.
 > 
 > Sun Mar 14 1999 Robert Hoehne <robert.hoehne@gmx.net>
 > 
 > 	* display.c: changing some terminal calls to work on DJGPP
 > 	* terminal.c: likewise
 > 	* Makefile.in: Remove . from the VPATH directive
 > 
 > --- gdb-snap-march-10th-from-DJ/readline/Makefile.in.orig	Thu Dec 31 04:18:56 1998
 > +++ gdb-snap-march-10th-from-DJ/readline/Makefile.in	Thu Mar 11 23:44:34 1999
 > @@ -19,7 +19,7 @@
 >  RL_LIBRARY_NAME = readline
 >  
 >  srcdir = @srcdir@
 > -VPATH = .:@srcdir@
 > +VPATH = @srcdir@
 >  top_srcdir = @top_srcdir@
 >  BUILD_DIR = @BUILD_DIR@
 >  
 > --- gdb-snap-march-10th-from-DJ/readline/display.c.orig	Tue Dec 22 21:53:32 1998
 > +++ gdb-snap-march-10th-from-DJ/readline/display.c	Sat Mar 13 17:12:42 1999
 > @@ -632,8 +632,12 @@
 >  	  if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 &&
 >  	      _rl_last_c_pos <= last_invisible && local_prompt)
 >  	    {
 > +#if defined (__MSDOS__)
 > +	      putc ('\r', rl_outstream);
 > +#else
 >  	      if (term_cr)
 >  		tputs (term_cr, 1, _rl_output_character_function);
 > +#endif
 >  	      _rl_output_some_chars (local_prompt, nleft);
 >  	      _rl_last_c_pos = nleft;
 >  	    }
 > @@ -880,7 +884,11 @@
 >        term_cr && lendiff > visible_length && _rl_last_c_pos > 0 &&
 >        od > lendiff && _rl_last_c_pos < last_invisible)
 >      {
 > +#if defined (__MSDOS__)
 > +      putc ('\r', rl_outstream);
 > +#else
 >        tputs (term_cr, 1, _rl_output_character_function);
 > +#endif /* !__MSDOS__ */
 >        _rl_output_some_chars (local_prompt, lendiff);
 >        _rl_last_c_pos = lendiff;
 >      }
 > @@ -1484,7 +1492,11 @@
 >  {
 >    if (term_cr)
 >      {
 > +#if defined (__MSDOS__)
 > +      putc ('\r', rl_outstream);
 > +#else
 >        tputs (term_cr, 1, _rl_output_character_function);
 > +#endif /* !__MSDOS__ */
 >        _rl_last_c_pos = 0;
 >      }
 >  }
 > @@ -1499,8 +1511,16 @@
 >       the right thing happens if we have wrapped to a new screen line. */
 >    if (term_cr)
 >      {
 > +#if defined (__MSDOS__)
 > +      putc ('\r', rl_outstream);
 > +#else
 >        tputs (term_cr, 1, _rl_output_character_function);
 > +#endif /* !__MSDOS__ */
 >        _rl_last_c_pos = 0;
 > +#if defined (__MSDOS__)
 > +      space_to_eol (screenwidth);
 > +      putc ('\r', rl_outstream);
 > +#else
 >        if (term_clreol)
 >  	tputs (term_clreol, 1, _rl_output_character_function);
 >        else
 > @@ -1508,6 +1528,7 @@
 >  	  space_to_eol (screenwidth);
 >  	  tputs (term_cr, 1, _rl_output_character_function);
 >  	}
 > +#endif
 >        if (_rl_last_v_pos > 0)
 >  	_rl_move_vert (0);
 >      }
 > --- gdb-snap-march-10th-from-DJ/readline/terminal.c.orig	Mon Dec 21 20:06:30 1998
 > +++ gdb-snap-march-10th-from-DJ/readline/terminal.c	Sat Mar 13 17:20:52 1999
 > @@ -186,8 +186,10 @@
 >        if (ignore_env == 0 && (ss = get_env_value ("COLUMNS")))
 >  	screenwidth = atoi (ss);
 >  
 > +#if !defined(__DJGPP__)
 >        if (screenwidth <= 0 && term_string_buffer)
 >  	screenwidth = tgetnum ("co");
 > +#endif
 >      }
 >  
 >    /* Environment variable LINES overrides setting of "li" if IGNORE_ENV
 > @@ -197,8 +199,10 @@
 >        if (ignore_env == 0 && (ss = get_env_value ("LINES")))
 >  	screenheight = atoi (ss);
 >  
 > +#if !defined(__DJGPP__)
 >        if (screenheight <= 0 && term_string_buffer)
 >  	screenheight = tgetnum ("li");
 > +#endif
 >      }
 >  
 >    /* If all else fails, default to 80x24 terminal. */
 > @@ -277,10 +281,12 @@
 >  get_term_capabilities (bp)
 >       char **bp;
 >  {
 > +#if !defined(__DJGPP__)
 >    register int i;
 >  
 >    for (i = 0; i < NUM_TC_STRINGS; i++)
 >      *(tc_strings[i].tc_value) = tgetstr (tc_strings[i].tc_var, bp);
 > +#endif
 >    tcap_initialized = 1;
 >  }
 >  
 > @@ -530,16 +536,20 @@
 >  void
 >  _rl_enable_meta_key ()
 >  {
 > +#if !defined(__DJGPP__)
 >    if (term_has_meta && term_mm)
 >      tputs (term_mm, 1, _rl_output_character_function);
 > +#endif
 >  }
 >  
 >  void
 >  _rl_control_keypad (on)
 >       int on;
 >  {
 > +#if !defined(__DJGPP__)
 >    if (on && term_ks)
 >      tputs (term_ks, 1, _rl_output_character_function);
 >    else if (!on && term_ke)
 >      tputs (term_ke, 1, _rl_output_character_function);
 > +#endif
 >  }
 > 
 > ******************************************************
 > * email:   Robert Hoehne <robert.hoehne@gmx.net>     *
 > * Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
 > * WWW:     http://www.tu-chemnitz.de/~sho/rho        *
 > ******************************************************


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Two patches for the readline lib
  1999-03-15 11:48 ` Michael Snyder
  1999-04-01  0:00   ` DJ Delorie
  1999-04-01  0:00   ` Michael Snyder
@ 1999-04-01  0:00   ` Robert Hoehne
  1999-03-15 14:04     ` Robert Hoehne
  2 siblings, 1 reply; 10+ messages in thread
From: Robert Hoehne @ 1999-04-01  0:00 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

> In that case, would it be appropriate to use a single macro
> (eg. if defined (__DJGPP__)) to control these changes?  The old
> readline was a hodge-podge of different ifdefs of this sort.
> It'd be nice to keep it under control this time.

At first: I did the patches this way, since there was already
one or two #ifdef __MSDOS__, so I thought this is the way
like it should be. But in general I agree with you, that this is
not the best way. I would do it better if I know where to start.

From other packages I know a way, where you can specify
in a host/target specifc file some conditionals which are then
either included in the source files or including them in the
Makefile so the flags will passed on commandline when compiling.

I would for instance introduce a define like

#define USE_STDIO_IO

to indicate that stdio functions should be used instead of
terminal functions. But I don't know where to specify this
host depended (in my case for DJGPP).

If you can give me some guidelines I will be glad.

Robert

******************************************************
* email:   Robert Hoehne <robert.hoehne@gmx.net>     *
* Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW:     http://www.tu-chemnitz.de/~sho/rho        *
******************************************************


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Two patches for the readline lib
  1999-03-15 11:48 ` Michael Snyder
@ 1999-04-01  0:00   ` DJ Delorie
  1999-03-16 11:09     ` DJ Delorie
  1999-04-01  0:00   ` Michael Snyder
  1999-04-01  0:00   ` Robert Hoehne
  2 siblings, 1 reply; 10+ messages in thread
From: DJ Delorie @ 1999-04-01  0:00 UTC (permalink / raw)
  To: msnyder; +Cc: gdb-patches, shebs, robert.hoehne

> In that case, would it be appropriate to use a single macro
> (eg. if defined (__DJGPP__)) to control these changes?  The old
> readline was a hodge-podge of different ifdefs of this sort.
> It'd be nice to keep it under control this time.

A better solution would be to break out the mechanism-specific parts
of readline into separate sources, so that configure could just pick
one.  One for termcap, one for curses, one for djgpp, one for cygwin,
etc.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Two patches for the readline lib
  1999-03-15 11:48 ` Michael Snyder
  1999-04-01  0:00   ` DJ Delorie
@ 1999-04-01  0:00   ` Michael Snyder
  1999-04-01  0:00   ` Robert Hoehne
  2 siblings, 0 replies; 10+ messages in thread
From: Michael Snyder @ 1999-04-01  0:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: DJ Delorie, shebs, robert.hoehne

Robert Hoehne wrote:
> 
> The following patches for readline disable some terminal specific
> code which is not available for DJGPP.

In that case, would it be appropriate to use a single macro
(eg. if defined (__DJGPP__)) to control these changes?  The old
readline was a hodge-podge of different ifdefs of this sort.
It'd be nice to keep it under control this time.

q


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Two patches for the readline lib
  1999-03-14 14:41 Two patches for the readline lib Robert Hoehne
  1999-03-15 11:48 ` Michael Snyder
  1999-04-01  0:00 ` Elena Zannoni
@ 1999-04-01  0:00 ` Robert Hoehne
  2 siblings, 0 replies; 10+ messages in thread
From: Robert Hoehne @ 1999-04-01  0:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: DJ Delorie, shebs

The following patches for readline disable some terminal specific
code which is not available for DJGPP.

Additinally I patched the Makefile.in by removing the current
directory from VPATH, since it is already there by default and
it confuse GNU make to find the sources on DJGPP where
';' is the path spearator and not ':'.

This patch is against "a March 10th snapshot from DJ"
which I got from DJ Delorie.

Sun Mar 14 1999 Robert Hoehne <robert.hoehne@gmx.net>

	* display.c: changing some terminal calls to work on DJGPP
	* terminal.c: likewise
	* Makefile.in: Remove . from the VPATH directive

--- gdb-snap-march-10th-from-DJ/readline/Makefile.in.orig	Thu Dec 31 04:18:56 1998
+++ gdb-snap-march-10th-from-DJ/readline/Makefile.in	Thu Mar 11 23:44:34 1999
@@ -19,7 +19,7 @@
 RL_LIBRARY_NAME = readline
 
 srcdir = @srcdir@
-VPATH = .:@srcdir@
+VPATH = @srcdir@
 top_srcdir = @top_srcdir@
 BUILD_DIR = @BUILD_DIR@
 
--- gdb-snap-march-10th-from-DJ/readline/display.c.orig	Tue Dec 22 21:53:32 1998
+++ gdb-snap-march-10th-from-DJ/readline/display.c	Sat Mar 13 17:12:42 1999
@@ -632,8 +632,12 @@
 	  if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 &&
 	      _rl_last_c_pos <= last_invisible && local_prompt)
 	    {
+#if defined (__MSDOS__)
+	      putc ('\r', rl_outstream);
+#else
 	      if (term_cr)
 		tputs (term_cr, 1, _rl_output_character_function);
+#endif
 	      _rl_output_some_chars (local_prompt, nleft);
 	      _rl_last_c_pos = nleft;
 	    }
@@ -880,7 +884,11 @@
       term_cr && lendiff > visible_length && _rl_last_c_pos > 0 &&
       od > lendiff && _rl_last_c_pos < last_invisible)
     {
+#if defined (__MSDOS__)
+      putc ('\r', rl_outstream);
+#else
       tputs (term_cr, 1, _rl_output_character_function);
+#endif /* !__MSDOS__ */
       _rl_output_some_chars (local_prompt, lendiff);
       _rl_last_c_pos = lendiff;
     }
@@ -1484,7 +1492,11 @@
 {
   if (term_cr)
     {
+#if defined (__MSDOS__)
+      putc ('\r', rl_outstream);
+#else
       tputs (term_cr, 1, _rl_output_character_function);
+#endif /* !__MSDOS__ */
       _rl_last_c_pos = 0;
     }
 }
@@ -1499,8 +1511,16 @@
      the right thing happens if we have wrapped to a new screen line. */
   if (term_cr)
     {
+#if defined (__MSDOS__)
+      putc ('\r', rl_outstream);
+#else
       tputs (term_cr, 1, _rl_output_character_function);
+#endif /* !__MSDOS__ */
       _rl_last_c_pos = 0;
+#if defined (__MSDOS__)
+      space_to_eol (screenwidth);
+      putc ('\r', rl_outstream);
+#else
       if (term_clreol)
 	tputs (term_clreol, 1, _rl_output_character_function);
       else
@@ -1508,6 +1528,7 @@
 	  space_to_eol (screenwidth);
 	  tputs (term_cr, 1, _rl_output_character_function);
 	}
+#endif
       if (_rl_last_v_pos > 0)
 	_rl_move_vert (0);
     }
--- gdb-snap-march-10th-from-DJ/readline/terminal.c.orig	Mon Dec 21 20:06:30 1998
+++ gdb-snap-march-10th-from-DJ/readline/terminal.c	Sat Mar 13 17:20:52 1999
@@ -186,8 +186,10 @@
       if (ignore_env == 0 && (ss = get_env_value ("COLUMNS")))
 	screenwidth = atoi (ss);
 
+#if !defined(__DJGPP__)
       if (screenwidth <= 0 && term_string_buffer)
 	screenwidth = tgetnum ("co");
+#endif
     }
 
   /* Environment variable LINES overrides setting of "li" if IGNORE_ENV
@@ -197,8 +199,10 @@
       if (ignore_env == 0 && (ss = get_env_value ("LINES")))
 	screenheight = atoi (ss);
 
+#if !defined(__DJGPP__)
       if (screenheight <= 0 && term_string_buffer)
 	screenheight = tgetnum ("li");
+#endif
     }
 
   /* If all else fails, default to 80x24 terminal. */
@@ -277,10 +281,12 @@
 get_term_capabilities (bp)
      char **bp;
 {
+#if !defined(__DJGPP__)
   register int i;
 
   for (i = 0; i < NUM_TC_STRINGS; i++)
     *(tc_strings[i].tc_value) = tgetstr (tc_strings[i].tc_var, bp);
+#endif
   tcap_initialized = 1;
 }
 
@@ -530,16 +536,20 @@
 void
 _rl_enable_meta_key ()
 {
+#if !defined(__DJGPP__)
   if (term_has_meta && term_mm)
     tputs (term_mm, 1, _rl_output_character_function);
+#endif
 }
 
 void
 _rl_control_keypad (on)
      int on;
 {
+#if !defined(__DJGPP__)
   if (on && term_ks)
     tputs (term_ks, 1, _rl_output_character_function);
   else if (!on && term_ke)
     tputs (term_ke, 1, _rl_output_character_function);
+#endif
 }

******************************************************
* email:   Robert Hoehne <robert.hoehne@gmx.net>     *
* Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW:     http://www.tu-chemnitz.de/~sho/rho        *
******************************************************


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1999-04-01  0:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-14 14:41 Two patches for the readline lib Robert Hoehne
1999-03-15 11:48 ` Michael Snyder
1999-04-01  0:00   ` DJ Delorie
1999-03-16 11:09     ` DJ Delorie
1999-04-01  0:00   ` Michael Snyder
1999-04-01  0:00   ` Robert Hoehne
1999-03-15 14:04     ` Robert Hoehne
1999-04-01  0:00 ` Elena Zannoni
1999-03-23  9:54   ` Elena Zannoni
1999-04-01  0:00 ` Robert Hoehne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox