[comp.windows.x] xconsole

hook@cheddar.cc.ubc.ca (Chris Hook) (01/16/90)

I seem to remember that some people had already discussed not being
able to build the contrib client (with X11R4) xconsole. I'm wondering
if anyone out there can send me the fix for building it, and right now,
using gcc 1.36 on a Sun 3/60, SunOS 4.0 (lib's from X11R4), I get to:

gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -O   -I/nfs/leghorn/home/local/src/X/R4/mit
  -DXAW_BC   -sun3 -c  console.c
console.c: In function CreateConsole:
console.c:189: `ca' undeclared (first use this function)
console.c:189: (Each undeclared identifier is reported only once
console.c:189: for each function it appears in.)
console.c:189: parse error before `ddr_t'
*** Error code 1
make: Fatal error: Command failed for target `console.o'

which is the very first step in the make process.

Thanks to whoever responds to this fix,
Chris Hook.

earle@POSEUR.JPL.NASA.GOV (Greg Earle - Sun JPL on-site Software Support) (01/16/90)

In comp.windows.x article <6284@ubc-cs.UUCP> you write:
>I seem to remember that some people had already discussed not being
>able to build the contrib client (with X11R4) xconsole. I'm wondering
>if anyone out there can send me the fix for building it, and right now,
>using gcc 1.36 on a Sun 3/60, SunOS 4.0 (lib's from X11R4), I get to:
>
>gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -O   -I/nfs/leghorn/home/local/src/X/R4/mit
>  -DXAW_BC   -sun3 -c  console.c
>console.c: In function CreateConsole:
>console.c:189: `ca' undeclared (first use this function)
>console.c:189: (Each undeclared identifier is reported only once
>console.c:189: for each function it appears in.)
>console.c:189: parse error before `ddr_t'
>*** Error code 1
>make: Fatal error: Command failed for target `console.o'

[Sorry that this sounds arrogant, but sheesh ... ]
If you had looked at line 189 in console.c for more than 5 seconds, you would
have realized that one of the positional parameters is being cast to a 
caddr_t, but somehow the line got split right after the `ca' and before the
`ddr_t' (a newline snuck in somehow), which makes the compiler wonder where
these 2 strange alien variables came from.  Apply this patch:

	- Greg Earle
	  Sun Microsystems, Inc. - JPL on-site Software Support
	  earle@poseur.JPL.NASA.GOV	(Direct)
	  earle@Sun.COM			(Indirect)

Disclaimer: Don't even THINK that my opinions have anything to do with Sun's.

*** contrib/clients/xconsole/console.c.orig	Wed Dec 13 15:03:13 1989
--- contrib/clients/xconsole/console.c	Tue Jan 16 03:02:11 1990
***************
*** 185,192 ****
     Debug("creating console.");
  
    
! XtAddEventHandler(console->shell,StructureNotifyMask,False,HandleMap,(ca
! ddr_t)console);
  
     frame = XtCreateWidget("consoleFrame", formWidgetClass, console->shell, args, 0);
  
--- 185,191 ----
     Debug("creating console.");
  
    
!    XtAddEventHandler(console->shell,StructureNotifyMask,False,HandleMap,(caddr_t)console);
  
     frame = XtCreateWidget("consoleFrame", formWidgetClass, console->shell, args, 0);
  

beldar@mips.COM (Gardner Cohen) (01/17/90)

earle@POSEUR.JPL.NASA.GOV (Greg Earle - Sun JPL on-site Software Support) writes:

   [Sorry that this sounds arrogant, but sheesh ... ]
   If you had looked at line 189 in console.c for more than 5 seconds, you would
   have realized...

Of course, the same thing has happened to two other files.

Here's a set of patches to fix that, also deal with newlines embedded
in several strings, and switch to the new include file hierarchy.

These changes have been tested on a Decstation 3100 under ultrix 3.1,
uws 2.1.

I also have diffs to make xconsole work with mips computers running
riscos 4.0.

I hope my diffs don't get word wrapped!

*** console.c.orig	Tue Jan 16 08:07:30 1990
--- console.c	Tue Jan 16 08:15:03 1990
***************
*** 30,37 ****
  /** Author:  Roman J. Budzianowski - Project Athena, MIT **/
  
  #if ( !defined(lint) && !defined(SABER))
! static char *rcsid_console_c = "$Header:
! /afs/athena.mit.edu/astaff/project/xdm/xconsole/RCS/console.c,v 2.0
  89/10/31 11:35:25 roman Exp Locker: roman $";
  #endif lint
  
--- 30,37 ----
  /** Author:  Roman J. Budzianowski - Project Athena, MIT **/
  
  #if ( !defined(lint) && !defined(SABER))
! static char *rcsid_console_c = "$Header: \
! /afs/athena.mit.edu/astaff/project/xdm/xconsole/RCS/console.c,v 2.0 \
  89/10/31 11:35:25 roman Exp Locker: roman $";
  #endif lint
  
***************
*** 40,51 ****
  #include <X11/Xlib.h>
  #include <X11/Intrinsic.h>
  #include <X11/StringDefs.h>
  #include <X11/Form.h>
  #include <X11/Command.h>
  #include <X11/Label.h>
- #include <X11/Shell.h>
  #include <X11/AsciiText.h>
  
  #include "console.h"
  
  extern ConsoleRec theConsole;
--- 40,59 ----
  #include <X11/Xlib.h>
  #include <X11/Intrinsic.h>
  #include <X11/StringDefs.h>
+ #ifdef X11R3
  #include <X11/Form.h>
  #include <X11/Command.h>
  #include <X11/Label.h>
  #include <X11/AsciiText.h>
+ #else
+ #include <X11/Xaw/Form.h>
+ #include <X11/Xaw/Command.h>
+ #include <X11/Xaw/Label.h>
+ #include <X11/Xaw/AsciiText.h>
+ #endif
  
+ #include <X11/Shell.h>
+ 
  #include "console.h"
  
  extern ConsoleRec theConsole;
***************
*** 185,192 ****
     Debug("creating console.");
  
    
! XtAddEventHandler(console->shell,StructureNotifyMask,False,HandleMap,(ca
! ddr_t)console);
  
     frame = XtCreateWidget("consoleFrame", formWidgetClass, console->shell, args, 0);
  
--- 193,199 ----
     Debug("creating console.");
  
    
! XtAddEventHandler(console->shell,StructureNotifyMask,False,HandleMap,(caddr_t)console);
  
     frame = XtCreateWidget("consoleFrame", formWidgetClass, console->shell, args, 0);
  
*** console.h.orig	Tue Jan 16 08:15:25 1990
--- console.h	Tue Jan 16 08:14:42 1990
***************
*** 51,56 ****
--- 51,60 ----
  void ConsoleDown();
  void HandleAllEvents();
  
+ #ifdef X11R3
  #include <X11/Text.h>
+ #else
+ #include <X11/Xaw/Text.h>
+ #endif
  XtTextPosition GetPosition();
  #endif _CONSOLE
*** main.c.orig	Tue Jan 16 08:07:29 1990
--- main.c	Tue Jan 16 08:06:14 1990
***************
*** 22,29 ****
   */
  
  #if ( !defined(lint) && !defined(SABER))
!   static char rcs_version[] = "$Header:
! /afs/athena.mit.edu/astaff/project/xdm/xconsole/RCS/main.c,v 2.0
  89/10/31 11:34:37 roman Exp Locker: roman $";
  #endif
  
--- 22,29 ----
   */
  
  #if ( !defined(lint) && !defined(SABER))
!   static char rcs_version[] = "$Header: \
! /afs/athena.mit.edu/astaff/project/xdm/xconsole/RCS/main.c,v 2.0 \
  89/10/31 11:34:37 roman Exp Locker: roman $";
  #endif
  
***************
*** 176,183 ****
  
     if(pipe(signalpipe)==0)
      
! XtAppAddInput(theConsole.appContext,signalpipe[0],XtInputReadMask,Handle
! Signal,NULL);
     else
       SystemError("xconsole: cannot create pipe for signal handling");
       
--- 176,182 ----
  
     if(pipe(signalpipe)==0)
      
! XtAppAddInput(theConsole.appContext,signalpipe[0],XtInputReadMask,HandleSignal,NULL);
     else
       SystemError("xconsole: cannot create pipe for signal handling");
       
*** XConsole.ad.orig	Tue Jan 16 08:07:30 1990
--- XConsole.ad	Tue Jan 16 08:06:27 1990
***************
*** 40,47 ****
  XConsole*closeWindow.horizDistance: 452
  
  XConsole*closeWindow.internalHeight: 2
! XConsole*closeWindow.font: -adobe-new century
! schoolbook-bold-r-normal--14-140-75-75-*
  
  XConsole*Command*resize: false
  
--- 40,46 ----
  XConsole*closeWindow.horizDistance: 452
  
  XConsole*closeWindow.internalHeight: 2
! XConsole*closeWindow.font: -adobe-new century schoolbook-bold-r-normal--14-140-75-75-*
  
  XConsole*Command*resize: false
  
-- 
Gardner Cohen     beldar@mips.com   (408) 991-6567

hook@geog.ubc.ca (01/19/90)

>Errors-To: /dev/null@poseur.jpl.nasa.gov
>Newsgroups: comp.windows.x
>Errors-To: nobody@poseur.jpl.nasa.gov
>Precedence: junk
>Organization: Sun Microsystems - JPL on-site Software Support

Hi, you sent me a request for a fix to xconsole, if I were to get one.
Here I am simply forwarding you a fix I was sent. There are actually
a few places in the xconsole .c files that have the same line splits
in them (i.e., function parameters cut in half sort of thing). They're
east to find, because the compiler will stop, and you'll get a make error
at the place where the improper line split is. Also, you should put
in the Imakefile a line
DEFINES = -DXAW_BC
near the top, if you didn't build X11R4 with that flag enabled
(its set in mit/config/site.def). Its these lines

#ifndef InstallOldHeaderFiles
#define InstallOldHeaderFiles YES       /* set to YES for compat with R3 Xaw */
#endif

Next you may have to go into some of the .c files and add some include files,
and change the include file paths.
 In particular, console.c should have the include files as follows:

#include <stdio.h>
#include <X11/Xos.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Form.h>
#include <X11/Xaw/Command.h>
#include <X11/Xaw/Label.h>
#include <X11/Shell.h>
#include <X11/Xaw/AsciiText.h>

which complies with X11R4. After all that, it should build (I've built all
the contrib stuff, and most are at least this much trouble. Some MUCH more!!)
but I don't know if you'll find it all that useful. I have'nt. Good Luck,

Chris Hook.




In comp.windows.x article <6284@ubc-cs.UUCP> you write:
>I seem to remember that some people had already discussed not being
>able to build the contrib client (with X11R4) xconsole. I'm wondering
>if anyone out there can send me the fix for building it, and right now,
>using gcc 1.36 on a Sun 3/60, SunOS 4.0 (lib's from X11R4), I get to:
>
>gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -O   -I/nfs/leghorn/home/local/src/X/R4/mit
>  -DXAW_BC   -sun3 -c  console.c
>console.c: In function CreateConsole:
>console.c:189: `ca' undeclared (first use this function)
>console.c:189: (Each undeclared identifier is reported only once
>console.c:189: for each function it appears in.)
>console.c:189: parse error before `ddr_t'
>*** Error code 1
>make: Fatal error: Command failed for target `console.o'

[Sorry that this sounds arrogant, but sheesh ... ]
If you had looked at line 189 in console.c for more than 5 seconds, you would
have realized that one of the positional parameters is being cast to a 
caddr_t, but somehow the line got split right after the `ca' and before the
`ddr_t' (a newline snuck in somehow), which makes the compiler wonder where
these 2 strange alien variables came from.  Apply this patch:

	- Greg Earle
	  Sun Microsystems, Inc. - JPL on-site Software Support
	  earle@poseur.JPL.NASA.GOV	(Direct)
	  earle@Sun.COM			(Indirect)

Disclaimer: Don't even THINK that my opinions have anything to do with Sun's.

*** contrib/clients/xconsole/console.c.orig	Wed Dec 13 15:03:13 1989
--- contrib/clients/xconsole/console.c	Tue Jan 16 03:02:11 1990
***************
*** 185,192 ****
     Debug("creating console.");
  
    
! XtAddEventHandler(console->shell,StructureNotifyMask,False,HandleMap,(ca
! ddr_t)console);
  
     frame = XtCreateWidget("consoleFrame", formWidgetClass, console->shell, args, 0);
  
--- 185,191 ----
     Debug("creating console.");
  
    
!    XtAddEventHandler(console->shell,StructureNotifyMask,False,HandleMap,(caddr_t)console);
  
     frame = XtCreateWidget("consoleFrame", formWidgetClass, console->shell, args, 0);
  

DEG41560@UA1VM.BITNET (Rob) (03/05/90)

Hi,
 Thanks to those of you who sent me xconsole. Unfortunately, one copy did
not include the file "console.h", and the other was uuencoded and subsequently
was garbled by this damn EBSCIDIC IBM mainframe that I mail through. I wrote
to the author (who sent one of the copies to me), but my mail must have been
lost. If some one could send me console.h, it would be appreciated.

Thanks,
Rob.

Mail to rob@galab2.mh.ua.edu if you can. Some sites can't find me there.

uk1@spacsun.rice.edu (Paul A. Scowen) (03/22/91)

Hi,

I remember running across a little piece of software called xconsole some months
back that redirects console output to a separate window instead of using the
xterm -C option.  We need this to stop people grabbing the console output when
they login on an Xterminal and not the main Console display.  Anybody know where
it is now?  I need a copy.

Thanks.

|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
-                                                         __________          -
|       Paul A. Scowen                                   / ___  ___ \         |
-       Department of Space Physics and Astronomy       / / @ \/ @ \ \        -
|       Rice University, Houston TX 77251               \ \___/\___/ /\       |
-       (713) 527-8101 x2433, x3534                      \____\/____/||       -
|                                                        /     /\\\\\//       |
-       Internet:       uk1@spacsun.rice.edu             |     |\\\\\\        -
|                       scowen@vega.rice.edu              \      \\\\\\       |
-                                                          \______/\\\\       -
|       Span:           RICE::SCOWEN                        _||_||_           |
-                                                            -- --            -
|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|

klute@tommy.informatik.uni-dortmund.de (Rainer Klute) (03/26/91)

In article <1991Mar22.145850.26216@rice.edu>, uk1@spacsun.rice.edu (Paul A.
Scowen) writes:
|> I remember running across a little piece of software called xconsole
|> some months
|> back that redirects console output to a separate window instead of using
|> the
|> xterm -C option.  We need this to stop people grabbing the console
|> output when
|> they login on an Xterminal and not the main Console display.

You could as well check in your .xsession resp. .xinitrc file whether the X
Window System is running at the console or not and act accordingly. Here is
an excerpt from my .xsession file:

 #
 # If the users works with the X Window System at the console (not at an X
 # terminal) an xterm gets startet which catches the console output.
 #
if ("`tty`" == /dev/console) then
    (xterm -ls -name xterm-console -n "${host} console" -geometry 80x10+0-0 \
           -font 6x10 -C &)
endif

-- 
  Dipl.-Inform. Rainer Klute      klute@irb.informatik.uni-dortmund.de
  Univ. Dortmund, IRB             klute@unido.uucp, klute@unido.bitnet
  Postfach 500500         |)|/    Tel.: +49 231 755-4663
D-4600 Dortmund 50        |\|\    Fax : +49 231 755-2386