*BSD News Article 14596


Return to BSD News archive

Newsgroups: comp.os.386bsd.apps
Path: sserve!newshost.anu.edu.au!munnari.oz.au!cs.mu.OZ.AU!summer
From: summer@ee.mu.OZ.AU (Mark Summerfield)
Subject: OLVWM diffs...
Message-ID: <9310811.25829@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU
Organization: Dept of Electrical & Electronic Engineering, University of Melbourne
Date: Sun, 18 Apr 1993 01:59:14 GMT
Lines: 533

As promised, here they are.  I hope the README file is sufficiently clear.
Let me know if you have problems.  I have tested this by reinstalling the
olvwm sources, applying the 3 olvwm patches, applying my diffs file,
and compiling and installing the resulting binary, so I'm as sure as
I can be that it will work for you at home exactly as it does for us
here in the studio!  So how much would you expect to pay?

Nothing, of course!  Enjoy...

--------X8---cut here-----------------------------------------------------
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	README.olvwm386BSD
#	olvwm.386diffs
#
echo x - README.olvwm386BSD
sed 's/^X//' >README.olvwm386BSD << 'END-of-README.olvwm386BSD'
XNotes on installation of the 386BSD port of OLVWM 3.0
X-----------------------------------------------------
X
XThe patch file should work on the olvwm3 sources with Patches 01, 02 & 03
Xapplied (all available from export.lcs.mit.edu or your nearest equivalent).
XSimply use "patch < olvwm.386diffs" in the directory containing the
Xsources.
X
XTo compile, you MUST HAVE the xview3 distribution (at least the libraries,
Xheader files, and XView config files) installed.
X
XMake sure the environment variable IMAKEINCLUDE is set as necessary so that
Ximake can find all the config and template files (including the XView ones).
X
XType "imake -DUseInstalled".  If you have your X11 hierarchy set up
Xcorrectly, this should generate  a working makefile.  Type "make", and
Xolvwm should compile and link happily.  Well, except for all those
Xwarnings! :-)
X
XI installed the executable and the manual pages by hand, so I don't know
Xif the makefile handles this properly (of course, it should do).  Use e.g.
X
Xinstall -o bin -g bin -m 755 olvwm /usr/X386/bin
Xnroff -man olvwm.man > olvwm.0
Xinstall -o bin -g bin -m 644 olvwm.0 /usr/X386/man/cat1
Xnroff -man olvwmrc.man > olvwmrc.0
Xinstall -o bin -g bin -m 644 olvwmrc.0 /usr/X386/man/cat5
X	[Assuming the directory /usr/X386/man/cat5 exists, of course!]
X
X----
X
XNotes on the port...
X--------------------
X
X- Modified the Imakefile to remove some of the -D options.  This prevents
X  olvwm from trying to use the (incomplete) locale.
X
X- Some minor variations in selection of appropriate header files for
X  386BSD.  These are virtually identical to changes in olwm in Jonas
X  Olsson's xview3 port.
X
X- lex seems a little fussy.  Had to enclose single-statement "if" parts
X  of if ... else in "{" and "}" in parse.l.
X
X- yacc also behaves strangely.  With "#define YYDEBUG 1" in olvwmrc.y, yacc
X  generated code which wouldn't compile.  The easy (and sensible) fix is
X  to turn yacc debugging off!
X
X  Note that modifications to the yacc and lex sources will affect
X  interpretation of the .olvwmrc file.  I'm currently not using one, so this
X  part of the program is untested.  The changes I've made shouldn't stop it
X  working, but there's no guarantee that it worked in the first place!  If
X  you find a bug running under 386BSD, and you're sure the same bug doesn't
X  exist under SUNOS 4.x, let me know!
X
X- The regexp(3) stuff in virtual.c had to be modified to use the 386BSD
X  style calls instead of the (totally dissimilar!) AT&T sysV system found
X  under SunOS.  There also seemed to be a bug in the generation of an
X  appropriate regular expression for file matching, which I fixed.  I
X  don't think the code as it stood should have worked even under SunOS
X  (e.g. "x*" was translated to the reg. exp. "^x*$" instead of "^x.*$").
X  Maybe the SysV regexp(3) is buggy, and this worked?! :-)
X
X- Removed an inexplicable #ifdef wrapper in usermenu.c which prevented
X  the buttons in the titlebar menus from being labelled.
X
X- I fixed the olvwm manual page so it formatted without errors.  Again,
X  this is a general fix, not a 386BSD-specific one.  The olvwmrc manual
X  page doesn't format correctly in a manner I've seen duplicated in an
X  number of man pages under 386BSD.  I don't know why this is, but I'm
X  sure it's a known bug, so maybe someone will enlighten me one day?
X
XMark Summerfield (summer@ee.mu.oz.au)
X17-4-93
X------------
END-of-README.olvwm386BSD
echo x - olvwm.386diffs
sed 's/^X//' >olvwm.386diffs << 'END-of-olvwm.386diffs'
Xdiff -c olvwm3.orig/Imakefile olvwm3/Imakefile
X*** olvwm3.orig/Imakefile	Sat Apr 17 16:38:08 1993
X--- olvwm3/Imakefile	Fri Apr 16 18:14:00 1993
X***************
X*** 34,40 ****
X  /**/# If your compiler does not support the ident directive (or if you don't
X  /**/# want the sccs strings included in the resulting executable), comment
X  /**/# out the following line
X! IDENT=-DIDENT
X  
X  /**/# No more changes needed
X  
X--- 34,40 ----
X  /**/# If your compiler does not support the ident directive (or if you don't
X  /**/# want the sccs strings included in the resulting executable), comment
X  /**/# out the following line
X! /**/#IDENT=-DIDENT
X  
X  /**/# No more changes needed
X  
X***************
X*** 48,54 ****
X  DEFINES = -DSHAPE -DAIXV3 -DSYSV $(XPM) $(IDENT)
X  SYS_LIBRARIES = -ll -lm
X  #else
X! DEFINES =  -DOW_I18N_L3 -DSUNDAE -DSHAPE $(SVR) $(XPM) $(IDENT)
X  SYS_LIBRARIES = -ll
X  #endif
X  INCLUDES = -I$(HEADER_DEST) -I$(TOP) $(XPMINCDIR) 
X--- 48,54 ----
X  DEFINES = -DSHAPE -DAIXV3 -DSYSV $(XPM) $(IDENT)
X  SYS_LIBRARIES = -ll -lm
X  #else
X! DEFINES =  -DSHAPE $(SVR) $(XPM) $(IDENT) #  -DOW_I18N_L3 -DSUNDAE 
X  SYS_LIBRARIES = -ll
X  #endif
X  INCLUDES = -I$(HEADER_DEST) -I$(TOP) $(XPMINCDIR) 
Xdiff -c olvwm3.orig/mem.c olvwm3/mem.c
X*** olvwm3.orig/mem.c	Sat Apr 17 16:38:20 1993
X--- olvwm3/mem.c	Fri Apr 16 18:16:45 1993
X***************
X*** 12,19 ****
X   * Safe memory allocation/free routines - front-ends the C library functions
X   *
X   */
X! 
X  #include <malloc.h>
X  #include <memory.h>
X  #include <stdio.h>
X  #include <sys/types.h>
X--- 12,23 ----
X   * Safe memory allocation/free routines - front-ends the C library functions
X   *
X   */
X! #ifndef __386BSD__
X  #include <malloc.h>
X+ #else /* __386BSD__ */
X+ #include <sys/types.h>
X+ #include <sys/malloc.h>
X+ #endif /* __386BSD__ */
X  #include <memory.h>
X  #include <stdio.h>
X  #include <sys/types.h>
Xdiff -c olvwm3.orig/olvwm.man olvwm3/olvwm.man
X*** olvwm3.orig/olvwm.man	Sat Apr 17 16:38:24 1993
X--- olvwm3/olvwm.man	Fri Apr 16 21:33:15 1993
X***************
X*** 520,526 ****
X  .I
X  Default value:  False
X  .P
X! .TP FreeIconSlots " (Boolean)"
X  By default, when an icon is created, it has that icon
X  position forever (unless it is moved manually), even when the window is
X  not iconified.  This results in potentially large gaps in the icon area
X--- 520,527 ----
X  .I
X  Default value:  False
X  .P
X! .TP
X! .BI FreeIconSlots " (Boolean)"
X  By default, when an icon is created, it has that icon
X  position forever (unless it is moved manually), even when the window is
X  not iconified.  This results in potentially large gaps in the icon area
X***************
X*** 533,539 ****
X  .I
X  Default value:	False
X  .P
X! .TP UniqueIconSlots " (Boolean)"
X  This resource, when set to true, prevents icons from
X  overlapping.  If you move an icon into icon grid slot(s) occupied by
X  other icons, those icons move.  If those other icons were positioned
X--- 534,541 ----
X  .I
X  Default value:	False
X  .P
X! .TP 
X! .BI UniqueIconSlots " (Boolean)"
X  This resource, when set to true, prevents icons from
X  overlapping.  If you move an icon into icon grid slot(s) occupied by
X  other icons, those icons move.  If those other icons were positioned
X***************
X*** 542,549 ****
X  .I
X  Default value:  False
X  .P
X! .TP IconGridHeight " (Integer)"
X! .TP IconGridWidth " (Integer)"
X  Previously the size of the icon grid was fixed.
X  An icon takes up a number of grid slots, depending
X  on it's size, and is aligned with the lower left corner of its lower
X--- 544,552 ----
X  .I
X  Default value:  False
X  .P
X! .TP
X! .BI IconGridHeight " (Integer)"
X! .BI IconGridWidth " (Integer)"
X  Previously the size of the icon grid was fixed.
X  An icon takes up a number of grid slots, depending
X  on it's size, and is aligned with the lower left corner of its lower
Xdiff -c olvwm3.orig/olvwmrc.y olvwm3/olvwmrc.y
X*** olvwm3.orig/olvwmrc.y	Sat Apr 17 16:38:26 1993
X--- olvwm3/olvwmrc.y	Fri Apr 16 19:02:12 1993
X***************
X*** 12,17 ****
X--- 12,21 ----
X  #include <ctype.h>
X  #include <stdlib.h>
X  #include <string.h>
X+ #ifdef __386BSD__
X+ #include <sys/types.h>
X+ #include <sys/stat.h>
X+ #endif
X  #ifdef SVR4
X  #include <sys/types.h>
X  #include <sys/stat.h>
X***************
X*** 501,507 ****
X  	    }
X  %%
X  /* Programs */
X! #define YYDEBUG 1
X  #include "parse.c"
X  
X  extern List	*ActiveClientList;
X--- 505,511 ----
X  	    }
X  %%
X  /* Programs */
X! /* #define YYDEBUG 1 */
X  #include "parse.c"
X  
X  extern List	*ActiveClientList;
Xdiff -c olvwm3.orig/olwm.c olvwm3/olwm.c
X*** olvwm3.orig/olwm.c	Sat Apr 17 16:38:27 1993
X--- olvwm3/olwm.c	Fri Apr 16 18:18:59 1993
X***************
X*** 523,528 ****
X--- 523,531 ----
X      if (!XrmGetResource(OlwmDB, namebuf, namebuf, &type, &value))
X  	return;
X      pid = atoi((char *)value.addr);
X+ #ifndef MAXPID
X+ #define MAXPID 30000
X+ #endif
X      if (pid <= 0 || pid > MAXPID)
X  	return;
X  
Xdiff -c olvwm3.orig/parse.l olvwm3/parse.l
X*** olvwm3.orig/parse.l	Sat Apr 17 16:38:28 1993
X--- olvwm3/parse.l	Fri Apr 16 18:30:03 1993
X***************
X*** 52,60 ****
X  \}	{ return CLOSEBRACE; }
X  
X  \"[^"]*\"	{
X! 	    if (yytext[yyleng - 1] == '\\')
X  		yymore();
X! 	    else {
X  		yylval.sval = strdup(yytext);
X  		return WORD;
X  	    }
X--- 52,60 ----
X  \}	{ return CLOSEBRACE; }
X  
X  \"[^"]*\"	{
X! 	    if (yytext[yyleng - 1] == '\\') {
X  		yymore();
X! 	    } else {
X  		yylval.sval = strdup(yytext);
X  		return WORD;
X  	    }
X***************
X*** 61,69 ****
X  	}
X  
X  \'[^']*\'	{
X! 	    if (yytext[yyleng - 1] == '\\')
X  		yymore();
X! 	    else {
X  		yylval.sval = strdup(yytext);
X  		return WORD;
X  	    }
X--- 61,69 ----
X  	}
X  
X  \'[^']*\'	{
X! 	    if (yytext[yyleng - 1] == '\\') {
X  		yymore();
X! 	    } else {
X  		yylval.sval = strdup(yytext);
X  		return WORD;
X  	    }
Xdiff -c olvwm3.orig/slave.c olvwm3/slave.c
X*** olvwm3.orig/slave.c	Sat Apr 17 16:38:29 1993
X--- olvwm3/slave.c	Fri Apr 16 19:07:32 1993
X***************
X*** 20,25 ****
X--- 20,26 ----
X  #include <sys/types.h>
X  #include <sys/time.h>
X  #include <sys/resource.h>
X+ #include <sys/param.h>
X  #include <X11/Xos.h>
X  #include <X11/Xlib.h>
X  #include <signal.h>
Xdiff -c olvwm3.orig/usermenu.c olvwm3/usermenu.c
X*** olvwm3.orig/usermenu.c	Sat Apr 17 16:38:31 1993
X--- olvwm3/usermenu.c	Sat Apr 17 12:42:34 1993
X***************
X*** 1721,1727 ****
X  void
X  SetWindowMenuLabels()
X  {
X- #ifdef OW_I18N_L3
X          windowTitle = gettext(windowTitle);
X  
X          openButton.label[0].string = gettext("Open");
X--- 1721,1726 ----
X***************
X*** 1770,1776 ****
X          moveDownLeftButton.label[0].string = gettext("Move SouthWest");
X  
X          moveHomeButton.label[0].string = gettext("Move Home");
X- #endif
X  }
X  
X  initMenuButtons(dpy, scrInfo)
X--- 1769,1774 ----
Xdiff -c olvwm3.orig/virtual.c olvwm3/virtual.c
X*** olvwm3.orig/virtual.c	Sat Apr 17 16:38:33 1993
X--- olvwm3/virtual.c	Fri Apr 16 22:50:16 1993
X***************
X*** 5,12 ****
X--- 5,14 ----
X  
X  #include <stdio.h>
X  #include <string.h>
X+ #include <sys/types.h>
X  #include <dirent.h>
X  #include <sys/param.h>
X+ #include <regexp.h>
X  #include <X11/Xos.h>
X  #include <X11/Xlib.h>
X  #include <X11/Xutil.h>
X***************
X*** 29,44 ****
X  #include "vdm.icon"
X  #include "vdm.mask"
X  
X- #define INIT   register char *sp = instring;
X- #define GETC() (*sp++)
X- #define PEEKC()     (*sp)
X- #define UNGETC(c)   (--sp)
X- #define RETURN(c)   return;
X- #define ERROR(val)  regerr(val)
X- #define TRUE 1
X- #define FALSE 0
X- #include <regexp.h>
X- 
X  #ifdef IDENT
X  #ident "@(#)virtual.c	1.5 olvwm version 12/7/92"
X  #endif
X--- 31,36 ----
X***************
X*** 1969,1974 ****
X--- 1961,1968 ----
X  	    ErrorWarning(gettext("An invalid directory was named for DIRMENU"));
X  	    menuInfo->buttons[bindex].subMenu =
X  			MenuInfoCreate(cache, winInfo, menu, depth, slot);
X+ 	    if (newname != NULL)
X+ 		rexFree();
X  	    return;
X  	}
X      }
X***************
X*** 1999,2004 ****
X--- 1993,1999 ----
X  	b->generate_func = NULL;
X      }
X      closedir(dir);
X+     rexFree();
X      if (GRV.VirtualDirSort == SortAlpha || GRV.VirtualDirSort == SortAlphaAll)
X  	qsort(menu->buttons, menu->buttonCount, sizeof(Button *), cmpButton);
X      menuInfo->buttons[bindex].subMenu =
X***************
X*** 2005,2065 ****
X  				MenuInfoCreate(cache, winInfo, menu, depth, slot);
X  }
X  
X! static
X! regerr(val)
X! int val;
X  {
X!     switch(val) {
X! 	case 11:
X! 	    ErrorWarning(gettext("DIRMENU: Range endpoint too large.\n"));
X! 	    break;
X! 	case 16:
X! 	    ErrorWarning(gettext("DIRMENU: Bad number.\n"));
X! 	    break;
X! 	case 25:
X! 	    ErrorWarning(gettext("DIRMENU: ``\\ digit'' out of range.\n"));
X! 	    break;
X! 	case 36:
X! 	    ErrorWarning(gettext("DIRMENU: Illegal or missing delimiter.\n"));
X! 	    break;
X! 	case 41:
X! 	    ErrorWarning(gettext("DIRMENU: No remembered search string.\n"));
X! 	    break;
X! 	case 42:
X! 	    ErrorWarning(gettext("DIRMENU: \\( \\) imbalance.\n"));
X! 	    break;
X! 	case 43:
X! 	    ErrorWarning(gettext("DIRMENU: Too many \\(.\n"));
X! 	    break;
X! 	case 44:
X! 	    ErrorWarning(gettext("DIRMENU: More than 2 numbers given in \\{ \\}.\n"));
X! 	    break;
X! 	case 45:
X! 	    /* { gratutitous brace to match next line for vi */
X! 	    ErrorWarning(gettext("DIRMENU: } expected after \\.\n"));
X! 	    break;
X! 	case 46:
X! 	    ErrorWarning(gettext("DIRMENU: First number exceeds second in \\{ \\}.\n"));
X! 	    break;
X! 	case 49:
X! 	    ErrorWarning(gettext("DIRMENU: [] imbalance.\n"));
X! 	    break;
X! 	case 50:
X! 	    ErrorWarning(gettext("DIRMENU: Regular expression too long.\n"));
X! 	    break;
X! 	default:
X! 	    ErrorWarning(gettext("DIRMENU: Unexpected Error Code\n"));
X! 	    break;
X!     }
X  }
X  
X! static char expbuf[256];
X  
X  static
X  rexMatch(string)
X      char *string;
X  {
X!     return step(string,expbuf);
X  }
X  
X  static
X--- 2000,2021 ----
X  				MenuInfoCreate(cache, winInfo, menu, depth, slot);
X  }
X  
X! void
X! regerror(const char *msg)
X  {
X!     static char errstring[128];
X! 
X!     (void) sprintf(errstring, "DIRMENU: %s\n", msg);
X!     ErrorWarning(gettext(errstring));
X  }
X  
X! static regexp *exp_ptr = NULL;
X  
X  static
X  rexMatch(string)
X      char *string;
X  {
X!     return regexec(exp_ptr, string);
X  }
X  
X  static
X***************
X*** 2078,2085 ****
X  		newPattern[j++] = '.';
X  		break;
X  	    case '*':
X! 		if (i == 0)
X! 		    newPattern[j++] = '.';
X  		newPattern[j++] = '*';
X  		break;
X  	    case '.':
X--- 2034,2040 ----
X  		newPattern[j++] = '.';
X  		break;
X  	    case '*':
X! 		newPattern[j++] = '.';
X  		newPattern[j++] = '*';
X  		break;
X  	    case '.':
X***************
X*** 2092,2096 ****
X      }
X      newPattern[j++] = '$';
X      newPattern[j++] = '\0';
X!     compile(newPattern, expbuf, &expbuf[256], '\0');
X  }
X--- 2047,2057 ----
X      }
X      newPattern[j++] = '$';
X      newPattern[j++] = '\0';
X!     exp_ptr = regcomp(newPattern);
X! }
X! 
X! void
X! rexFree()
X! {
X!     if (exp_ptr != NULL) free(exp_ptr);
X  }
END-of-olvwm.386diffs
exit