mikew@wyse.wyse.com (Mike Wexler) (09/23/88)
Submitted-by: toml%hpfctel@sde.hp.com (Tom LaStrange) Posting-number: Volume 1, Issue 49 Archive-name: twm/part04 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 4 (of 7)." # Contents: gram.c twm.c # Wrapped by mikew@wyse on Thu Sep 22 16:21:23 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'gram.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'gram.c'\" else echo shar: Extracting \"'gram.c'\" \(21407 characters\) sed "s/^X//" >'gram.c' <<'END_OF_FILE' X X# line 37 "gram.y" Xstatic char RCSinfo[]= X"$Header: gram.y,v 1.32 88/09/08 15:33:52 toml Exp $"; X X#include <stdio.h> X#include "twm.h" X#include "menus.h" X#include "list.h" X#include "util.h" X Xstatic char *Action = ""; Xstatic MenuRoot *root, X *pull = NULL; X X XMenuRoot *GetRoot(); X Xstatic char *ptr; Xstatic int Button; Xstatic int list; Xstatic int mods = 0, cont = 0; Xstatic int color; X Xextern int yylineno; X X# line 62 "gram.y" Xtypedef union X{ X int num; X char *ptr; X} YYSTYPE; X# define LB 257 X# define RB 258 X# define MENUS 259 X# define MENU 260 X# define BUTTON 261 X# define TBUTTON 262 X# define DEFAULT_FUNCTION 263 X# define F_MENU 264 X# define F_UNFOCUS 265 X# define F_REFRESH 266 X# define F_FILE 267 X# define F_TWMRC 268 X# define F_CIRCLEUP 269 X# define F_QUIT 270 X# define F_NOP 271 X# define F_TITLE 272 X# define F_VERSION 273 X# define F_EXEC 274 X# define F_CUT 275 X# define F_CIRCLEDOWN 276 X# define F_SOURCE 277 X# define F_CUTFILE 278 X# define F_MOVE 279 X# define F_ICONIFY 280 X# define F_FOCUS 281 X# define F_RESIZE 282 X# define F_RAISE 283 X# define F_LOWER 284 X# define F_DESTROY 285 X# define F_WINREFRESH 286 X# define F_BEEP 287 X# define DONT_MOVE_OFF 288 X# define ZOOM 289 X# define WARPCURSOR 290 X# define NUMBER 291 X# define BORDERWIDTH 292 X# define TITLE_FONT 293 X# define REVERSE_VIDEO 294 X# define RESIZE_FONT 295 X# define NO_TITLE 296 X# define AUTO_RAISE 297 X# define FORCE_ICON 298 X# define NO_HILITE 299 X# define MENU_FONT 300 X# define ICON_FONT 301 X# define UNKNOWN_ICON 302 X# define ICONS 303 X# define ICON_DIRECTORY 304 X# define META 305 X# define SHIFT 306 X# define CONTROL 307 X# define WINDOW 308 X# define TITLE 309 X# define ICON 310 X# define ROOT 311 X# define FRAME 312 X# define COLON 313 X# define EQUALS 314 X# define BORDER_COLOR 315 X# define TITLE_FOREGROUND 316 X# define TITLE_BACKGROUND 317 X# define MENU_FOREGROUND 318 X# define MENU_BACKGROUND 319 X# define MENU_SHADOW_COLOR 320 X# define MENU_TITLE_FOREGROUND 321 X# define MENU_TITLE_BACKGROUND 322 X# define ICON_FOREGROUND 323 X# define ICON_BACKGROUND 324 X# define ICON_BORDER_COLOR 325 X# define NO_RAISE_ON_MOVE 326 X# define NO_RAISE_ON_DEICONIFY 327 X# define NO_RAISE_ON_RESIZE 328 X# define COLOR 329 X# define MONOCHROME 330 X# define NO_TITLE_FOCUS 331 X# define FUNCTION 332 X# define F_FUNCTION 333 X# define BORDER_TILE_FOREGROUND 334 X# define BORDER_TILE_BACKGROUND 335 X# define STRING 336 X#define yyclearin yychar = -1 X#define yyerrok yyerrflag = 0 Xextern int yychar; Xextern short yyerrflag; X#ifndef YYMAXDEPTH X#define YYMAXDEPTH 150 X#endif XYYSTYPE yylval, yyval; X# define YYERRCODE 256 X X# line 381 "gram.y" X Xyyerror(s) char *s; X{ X fprintf(stderr, "twm: syntax error, line %d\n", yylineno); X ParseError = 1; X} XRemoveDQuote(str) Xchar *str; X{ X strcpy(str, &str[1]); X str[strlen(str)-1] = '\0'; X} X XMenuRoot * XGetRoot(name) Xchar *name; X{ X MenuRoot *tmp; X X tmp = FindMenuRoot(name); X if (tmp == NULL) X tmp = NewMenuRoot(name); X X return tmp; X} X Xshort yyexca[] ={ X-1, 1, X 0, -1, X -2, 0, X-1, 24, X 257, 26, X -2, 28, X }; X# define YYNPROD 116 X# define YYLAST 346 Xshort yyact[]={ X X 4, 128, 34, 72, 27, 33, 35, 32, 115, 116, X 117, 118, 119, 104, 105, 106, 143, 43, 111, 109, X 100, 102, 98, 92, 145, 123, 99, 144, 125, 120, X 46, 148, 17, 18, 13, 91, 19, 10, 6, 8, X 25, 26, 5, 24, 9, 7, 11, 29, 12, 124, X 126, 112, 121, 73, 107, 129, 113, 103, 130, 133, X 134, 135, 136, 139, 137, 138, 140, 141, 142, 114, X 14, 16, 15, 30, 31, 20, 28, 131, 132, 90, X 34, 67, 56, 51, 68, 61, 64, 49, 47, 63, X 62, 69, 70, 65, 53, 66, 54, 55, 50, 57, X 58, 59, 60, 52, 48, 34, 34, 34, 45, 101, X 82, 81, 93, 94, 97, 80, 110, 96, 108, 95, X 77, 76, 75, 3, 2, 1, 23, 42, 21, 0, X 0, 72, 74, 0, 0, 0, 0, 0, 0, 0, X 0, 83, 0, 0, 0, 0, 0, 0, 147, 0, X 71, 0, 0, 34, 67, 56, 51, 68, 61, 64, X 49, 47, 63, 62, 69, 70, 65, 53, 66, 54, X 55, 50, 57, 58, 59, 60, 52, 48, 67, 56, X 51, 68, 61, 64, 49, 47, 63, 62, 69, 70, X 65, 53, 66, 54, 55, 50, 57, 58, 59, 60, X 52, 48, 22, 0, 0, 0, 0, 0, 0, 0, X 36, 37, 38, 39, 40, 41, 0, 0, 0, 0, X 0, 0, 0, 71, 44, 0, 0, 0, 0, 0, X 78, 79, 0, 149, 0, 0, 0, 0, 0, 0, X 0, 0, 0, 0, 0, 0, 0, 71, 0, 0, X 0, 0, 164, 0, 0, 165, 84, 0, 0, 0, X 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, X 85, 86, 87, 88, 89, 0, 0, 0, 0, 0, X 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, X 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, X 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, X 122, 0, 0, 0, 0, 127, 0, 0, 0, 0, X 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, X 150, 0, 0, 151, 152, 153, 154, 155, 156, 157, X 158, 159, 160, 161, 162, 163 }; Xshort yypact[]={ X X-1000,-1000,-256,-1000,-1000,-1000,-1000,-334,-334,-334, X-334,-334,-334,-1000,-1000,-1000,-1000,-1000,-1000,-274, X-1000,-183,-311, -86,-1000,-1000,-1000,-334,-334,-1000, X-1000,-1000, -86,-1000,-1000,-1000,-1000,-1000,-1000,-1000, X-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, X-1000,-1000,-1000,-334,-1000,-1000,-1000,-1000,-1000,-1000, X-1000,-1000,-1000,-1000,-1000,-1000,-1000,-334,-334,-334, X-334,-334,-1000,-1000,-1000,-234,-234,-234,-1000,-1000, X-235,-237,-237,-1000,-1000,-1000,-1000,-1000,-1000,-1000, X-292,-1000,-1000,-1000,-1000,-238,-239,-1000,-1000,-1000, X-1000,-1000,-300,-1000,-1000,-1000,-1000,-229,-1000,-1000, X-1000,-1000,-230,-257,-297,-1000,-1000,-1000,-1000,-1000, X-1000,-1000,-1000,-231,-110,-1000,-1000,-334,-1000,-1000, X-334,-334,-334,-334,-334,-334,-334,-334,-334,-334, X-334,-334,-334, -86,-1000,-1000, -86,-1000,-1000,-1000, X-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000, X-1000,-1000,-1000,-1000,-1000,-1000 }; Xshort yypgo[]={ X X 0, 202, 108, 128, 127, 126, 30, 125, 124, 123, X 122, 35, 121, 120, 119, 118, 117, 116, 115, 114, X 111, 26, 110, 79, 69, 57, 56, 55, 54, 52, X 51, 50, 49, 31, 25, 24 }; Xshort yyr1[]={ X X 0, 7, 8, 8, 9, 9, 9, 9, 9, 9, X 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, X 9, 9, 9, 9, 9, 9, 10, 9, 9, 12, X 9, 13, 9, 14, 9, 16, 9, 18, 9, 20, X 9, 22, 9, 9, 6, 23, 23, 25, 25, 25, X 24, 24, 24, 24, 24, 21, 26, 26, 27, 27, X 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, X 27, 11, 28, 28, 29, 19, 30, 30, 31, 17, X 32, 32, 33, 15, 34, 34, 35, 2, 2, 2, X 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, X 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, X 2, 2, 3, 5, 1, 4 }; Xshort yyr2[]={ X X 0, 1, 0, 2, 1, 1, 1, 2, 2, 2, X 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, X 1, 2, 2, 2, 2, 2, 0, 3, 1, 0, X 3, 0, 3, 0, 4, 0, 4, 0, 3, 0, X 3, 0, 3, 2, 6, 0, 2, 1, 1, 1, X 1, 1, 1, 1, 1, 3, 0, 2, 2, 2, X 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, X 2, 3, 0, 2, 1, 3, 0, 2, 2, 3, X 0, 2, 1, 3, 0, 2, 2, 1, 1, 1, X 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, X 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, X 2, 2, 1, 1, 1, 1 }; Xshort yychk[]={ X X-1000, -7, -8, -9, 256, 298, 294, 301, 295, 300, X 293, 302, 304, 290, 326, 328, 327, 288, 289, 292, X 331, -3, -1, -5, 299, 296, 297, 260, 332, 303, X 329, 330, 263, 261, 336, 262, -1, -1, -1, -1, X -1, -1, -4, 291, -1, -2, -6, 271, 287, 270, X 281, 266, 286, 277, 279, 280, 265, 282, 283, 284, X 285, 268, 273, 272, 269, 276, 278, 264, 267, 274, X 275, 333, 314, -6, -2, -10, -12, -13, -1, -1, X -18, -20, -22, -2, -1, -1, -1, -1, -1, -1, X -23, -11, 257, -11, -11, -14, -16, -19, 257, -21, X 257, -21, 313, -25, 305, 306, 307, -28, -15, 257, X -17, 257, -30, -26, -24, 308, 309, 310, 311, 312, X 258, -29, -1, -34, -32, 258, -31, -1, 258, -27, X 315, 334, 335, 316, 317, 318, 319, 321, 322, 320, X 323, 324, 325, 313, 258, -35, -1, 258, -33, -2, X -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, X -1, -1, -1, -1, -2, -2 }; Xshort yydef[]={ X X 2, -2, 1, 3, 4, 5, 6, 0, 0, 0, X 0, 0, 0, 13, 14, 15, 16, 17, 18, 0, X 20, 0, 0, 0, -2, 29, 31, 0, 0, 37, X 39, 41, 0, 112, 114, 113, 7, 8, 9, 10, X 11, 12, 19, 115, 21, 22, 24, 87, 88, 89, X 90, 91, 92, 0, 94, 95, 96, 97, 98, 99, X 100, 101, 102, 103, 104, 105, 106, 0, 0, 0, X 0, 0, 45, 23, 25, 0, 0, 0, 33, 35, X 0, 0, 0, 43, 93, 107, 108, 109, 110, 111, X 0, 27, 72, 30, 32, 0, 0, 38, 76, 40, X 56, 42, 0, 46, 47, 48, 49, 0, 34, 84, X 36, 80, 0, 0, 0, 50, 51, 52, 53, 54, X 71, 73, 74, 0, 0, 75, 77, 0, 55, 57, X 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, X 0, 0, 0, 0, 83, 85, 0, 79, 81, 82, X 78, 58, 59, 60, 61, 62, 63, 64, 65, 66, X 67, 68, 69, 70, 44, 86 }; X#ifndef lint Xstatic char yaccpar_sccsid[] = "@(#)yaccpar 1.6 88/02/08 SMI"; /* from UCB 4.1 83/02/11 */ X#endif X X# X# define YYFLAG -1000 X# define YYERROR goto yyerrlab X# define YYACCEPT return(0) X# define YYABORT return(1) X X/* parser for yacc output */ X X#ifdef YYDEBUG Xint yydebug = 0; /* 1 for debugging */ X#endif XYYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */ Xint yychar = -1; /* current input token number */ Xint yynerrs = 0; /* number of errors */ Xshort yyerrflag = 0; /* error recovery flag */ X Xyyparse() { X X short yys[YYMAXDEPTH]; X short yyj, yym; X register YYSTYPE *yypvt; X register short yystate, *yyps, yyn; X register YYSTYPE *yypv; X register short *yyxi; X X yystate = 0; X yychar = -1; X yynerrs = 0; X yyerrflag = 0; X yyps= &yys[-1]; X yypv= &yyv[-1]; X X yystack: /* put a state and value onto the stack */ X X#ifdef YYDEBUG X if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar ); X#endif X if( ++yyps>= &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); } X *yyps = yystate; X ++yypv; X *yypv = yyval; X X yynewstate: X X yyn = yypact[yystate]; X X if( yyn<= YYFLAG ) goto yydefault; /* simple state */ X X if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0; X if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault; X X if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */ X yychar = -1; X yyval = yylval; X yystate = yyn; X if( yyerrflag > 0 ) --yyerrflag; X goto yystack; X } X X yydefault: X /* default state action */ X X if( (yyn=yydef[yystate]) == -2 ) { X if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0; X /* look through exception table */ X X for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */ X X while( *(yyxi+=2) >= 0 ){ X if( *yyxi == yychar ) break; X } X if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */ X } X X if( yyn == 0 ){ /* error */ X /* error ... attempt to resume parsing */ X X switch( yyerrflag ){ X X case 0: /* brand new error */ X X yyerror( "syntax error" ); X yyerrlab: X ++yynerrs; X X case 1: X case 2: /* incompletely recovered error ... try again */ X X yyerrflag = 3; X X /* find a state where "error" is a legal shift action */ X X while ( yyps >= yys ) { X yyn = yypact[*yyps] + YYERRCODE; X if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){ X yystate = yyact[yyn]; /* simulate a shift of "error" */ X goto yystack; X } X yyn = yypact[*yyps]; X X /* the current yyps has no shift onn "error", pop stack */ X X#ifdef YYDEBUG X if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] ); X#endif X --yyps; X --yypv; X } X X /* there is no state on the stack with an error shift ... abort */ X X yyabort: X return(1); X X X case 3: /* no shift yet; clobber input char */ X X#ifdef YYDEBUG X if( yydebug ) printf( "error recovery discards char %d\n", yychar ); X#endif X X if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */ X yychar = -1; X goto yynewstate; /* try again in the same state */ X X } X X } X X /* reduction by production yyn */ X X#ifdef YYDEBUG X if( yydebug ) printf("reduce %d\n",yyn); X#endif X yyps -= yyr2[yyn]; X yypvt = yypv; X yypv -= yyr2[yyn]; X yyval = yypv[1]; X yym=yyn; X /* consult goto table to find next state */ X yyn = yyr1[yyn]; X yyj = yypgo[yyn] + *yyps + 1; X if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]]; X switch(yym){ X Xcase 5: X# line 100 "gram.y" X{ if (FirstTime) ForceIcon = TRUE; } break; Xcase 6: X# line 101 "gram.y" X{ if (FirstTime) ReverseVideo = TRUE; } break; Xcase 7: X# line 102 "gram.y" X{ if (FirstTime) IconFontName = yypvt[-0].ptr; } break; Xcase 8: X# line 103 "gram.y" X{ if (FirstTime) SizeFontName = yypvt[-0].ptr; } break; Xcase 9: X# line 104 "gram.y" X{ if (FirstTime) MenuFontName = yypvt[-0].ptr; } break; Xcase 10: X# line 105 "gram.y" X{ if (FirstTime) TitleBarFontName=yypvt[-0].ptr; } break; Xcase 11: X# line 106 "gram.y" X{ if (FirstTime) GetUnknownIcon(yypvt[-0].ptr); } break; Xcase 12: X# line 107 "gram.y" X{ if (FirstTime) X IconDirectory = ExpandFilename(yypvt[-0].ptr); X } break; Xcase 13: X# line 110 "gram.y" X{ if (FirstTime) WarpCursor = TRUE; } break; Xcase 14: X# line 111 "gram.y" X{ if (FirstTime) NoRaiseMove = TRUE; } break; Xcase 15: X# line 112 "gram.y" X{ if (FirstTime) NoRaiseResize = TRUE; } break; Xcase 16: X# line 113 "gram.y" X{ if (FirstTime) NoRaiseDeicon = TRUE; } break; Xcase 17: X# line 114 "gram.y" X{ if (FirstTime) DontMoveOff = TRUE; } break; Xcase 18: X# line 115 "gram.y" X{ if (FirstTime) DoZoom = TRUE; } break; Xcase 19: X# line 116 "gram.y" X{ if (FirstTime) BorderWidth = yypvt[-0].num; } break; Xcase 20: X# line 117 "gram.y" X{ if (FirstTime) TitleFocus = FALSE; } break; Xcase 21: X# line 118 "gram.y" X{ root = GetRoot(yypvt[-0].ptr); X Mouse[yypvt[-1].num][C_ROOT][0].func = F_MENU; X Mouse[yypvt[-1].num][C_ROOT][0].menu = root; X } break; Xcase 22: X# line 122 "gram.y" X{ Mouse[yypvt[-1].num][C_ROOT][0].func = yypvt[-0].num; X if (yypvt[-0].num == F_MENU) X { X pull->prev = NULL; X Mouse[yypvt[-1].num][C_ROOT][0].menu = pull; X } X else X { X root = GetRoot(TWM_ROOT); X Mouse[yypvt[-1].num][C_ROOT][0].item = X AddToMenu(root,"x",Action,0,yypvt[-0].num); X } X Action = ""; X pull = NULL; X } break; Xcase 23: X# line 137 "gram.y" X{ AddFuncKey(yypvt[-1].ptr, cont, mods, X yypvt[-0].num, Action); X Action = ""; X pull = NULL; X cont = 0; X mods = 0; X } break; Xcase 24: X# line 144 "gram.y" X{ Mouse[yypvt[-1].num][cont][mods].func = yypvt[-0].num; X if (yypvt[-0].num == F_MENU) X { X pull->prev = NULL; X Mouse[yypvt[-1].num][cont][mods].menu = pull; X } X else X { X root = GetRoot(TWM_ROOT); X Mouse[yypvt[-1].num][cont][mods].item = X AddToMenu(root,"x",Action,0,yypvt[-0].num); X } X Action = ""; X pull = NULL; X cont = 0; X mods = 0; X } break; Xcase 25: X# line 161 "gram.y" X{ Mouse[yypvt[-1].num][C_TITLE][0].func = yypvt[-0].num; X Mouse[yypvt[-1].num][C_ICON][0].func = yypvt[-0].num; X if (yypvt[-0].num == F_MENU) X { X pull->prev = NULL; X Mouse[yypvt[-1].num][C_TITLE][0].menu = pull; X Mouse[yypvt[-1].num][C_ICON][0].menu = pull; X } X else X { X root = GetRoot(TWM_ROOT); X Mouse[yypvt[-1].num][C_TITLE][0].item = X AddToMenu(root,"x",Action,0,yypvt[-0].num); X Mouse[yypvt[-1].num][C_ICON][0].item = X Mouse[yypvt[-1].num][C_TITLE][0].item; X } X Action = ""; X pull = NULL; X } break; Xcase 26: X# line 180 "gram.y" X{ list = NO_HILITE; } break; Xcase 28: X# line 182 "gram.y" X{ Highlight = FALSE; } break; Xcase 29: X# line 183 "gram.y" X{ list = NO_TITLE; } break; Xcase 31: X# line 185 "gram.y" X{ list = AUTO_RAISE; } break; Xcase 33: X# line 187 "gram.y" X{ root = GetRoot(yypvt[-0].ptr); } break; Xcase 35: X# line 189 "gram.y" X{ root = GetRoot(yypvt[-0].ptr); } break; Xcase 37: X# line 191 "gram.y" X{ list = ICONS; } break; Xcase 39: X# line 193 "gram.y" X{ color = COLOR; } break; Xcase 41: X# line 195 "gram.y" X{ color = MONOCHROME; } break; Xcase 43: X# line 197 "gram.y" X{ DefaultFunction.func = yypvt[-0].num; X if (yypvt[-0].num == F_MENU) X { X pull->prev = NULL; X DefaultFunction.menu = pull; X } X else X { X root = GetRoot(TWM_ROOT); X DefaultFunction.item = X AddToMenu(root,"x",Action,0,yypvt[-0].num); X } X Action = ""; X pull = NULL; X } break; Xcase 44: X# line 215 "gram.y" X{ yyval.num = yypvt[-0].num; } break; Xcase 47: X# line 222 "gram.y" X{ mods |= Mod1Mask; } break; Xcase 48: X# line 223 "gram.y" X{ mods |= ShiftMask; } break; Xcase 49: X# line 224 "gram.y" X{ mods |= ControlMask; } break; Xcase 50: X# line 227 "gram.y" X{ cont = C_WINDOW; } break; Xcase 51: X# line 228 "gram.y" X{ cont = C_TITLE; } break; Xcase 52: X# line 229 "gram.y" X{ cont = C_ICON; } break; Xcase 53: X# line 230 "gram.y" X{ cont = C_ROOT; } break; Xcase 54: X# line 231 "gram.y" X{ cont = C_FRAME; } break; Xcase 58: X# line 241 "gram.y" X{ GetColor(color, &BorderColor, yypvt[-0].ptr); } break; Xcase 59: X# line 242 "gram.y" X{ GetColor(color, X &BorderTileForeground, yypvt[-0].ptr); } break; Xcase 60: X# line 244 "gram.y" X{ GetColor(color, X &BorderTileBackground, yypvt[-0].ptr); } break; Xcase 61: X# line 246 "gram.y" X{ GetColor(color, X &TitleForeground, yypvt[-0].ptr); } break; Xcase 62: X# line 248 "gram.y" X{ GetColor(color, X &TitleBackground, yypvt[-0].ptr); } break; Xcase 63: X# line 250 "gram.y" X{ GetColor(color, X &MenuForeground, yypvt[-0].ptr); } break; Xcase 64: X# line 252 "gram.y" X{ GetColor(color, X &MenuBackground, yypvt[-0].ptr); } break; Xcase 65: X# line 254 "gram.y" X{ GetColor(color, X &MenuTitleForeground, yypvt[-0].ptr); } break; Xcase 66: X# line 256 "gram.y" X{ GetColor(color, X &MenuTitleBackground, yypvt[-0].ptr); } break; Xcase 67: X# line 258 "gram.y" X{ GetColor(color, X &MenuShadowColor, yypvt[-0].ptr); } break; Xcase 68: X# line 260 "gram.y" X{ GetColor(color, X &IconForeground, yypvt[-0].ptr); } break; Xcase 69: X# line 262 "gram.y" X{ GetColor(color, X &IconBackground, yypvt[-0].ptr); } break; Xcase 70: X# line 264 "gram.y" X{ GetColor(color, X &IconBorderColor, yypvt[-0].ptr); } break; Xcase 74: X# line 274 "gram.y" X{ if (FirstTime) AddToList(list, yypvt[-0].ptr, 0); } break; Xcase 78: X# line 284 "gram.y" X{ if (FirstTime) X { X Pixmap pm; X X pm = GetBitmap(yypvt[-0].ptr); X if (pm != NULL) X AddToList(list, yypvt[-1].ptr, pm); X } X } break; Xcase 82: X# line 302 "gram.y" X{ AddToMenu(root, "", Action, NULL, yypvt[-0].num); X Action = ""; X } break; Xcase 86: X# line 314 "gram.y" X{ AddToMenu(root, yypvt[-1].ptr, Action, pull, yypvt[-0].num); X Action = ""; X pull = NULL; X } break; Xcase 87: X# line 320 "gram.y" X{ yyval.num = F_NOP; } break; Xcase 88: X# line 321 "gram.y" X{ yyval.num = F_BEEP; } break; Xcase 89: X# line 322 "gram.y" X{ yyval.num = F_QUIT; } break; Xcase 90: X# line 323 "gram.y" X{ yyval.num = F_FOCUS; } break; Xcase 91: X# line 324 "gram.y" X{ yyval.num = F_REFRESH; } break; Xcase 92: X# line 325 "gram.y" X{ yyval.num = F_WINREFRESH; } break; Xcase 93: X# line 326 "gram.y" X{ Action = yypvt[-0].ptr; yyval.num = F_TWMRC; } break; Xcase 94: X# line 327 "gram.y" X{ yyval.num = F_MOVE; } break; Xcase 95: X# line 328 "gram.y" X{ yyval.num = F_ICONIFY; } break; Xcase 96: X# line 329 "gram.y" X{ yyval.num = F_UNFOCUS; } break; Xcase 97: X# line 330 "gram.y" X{ yyval.num = F_RESIZE; } break; Xcase 98: X# line 331 "gram.y" X{ yyval.num = F_RAISE; } break; Xcase 99: X# line 332 "gram.y" X{ yyval.num = F_LOWER; } break; Xcase 100: X# line 333 "gram.y" X{ yyval.num = F_DESTROY; } break; Xcase 101: X# line 334 "gram.y" X{ yyval.num = F_TWMRC; } break; Xcase 102: X# line 335 "gram.y" X{ yyval.num = F_VERSION; } break; Xcase 103: X# line 336 "gram.y" X{ yyval.num = F_TITLE; } break; Xcase 104: X# line 337 "gram.y" X{ yyval.num = F_CIRCLEUP; } break; Xcase 105: X# line 338 "gram.y" X{ yyval.num = F_CIRCLEDOWN; } break; Xcase 106: X# line 339 "gram.y" X{ yyval.num = F_CUTFILE; } break; Xcase 107: X# line 340 "gram.y" X{ pull = GetRoot(yypvt[-0].ptr); X pull->prev = root; X yyval.num = F_MENU; X } break; Xcase 108: X# line 344 "gram.y" X{ Action = yypvt[-0].ptr; yyval.num = F_FILE; } break; Xcase 109: X# line 345 "gram.y" X{ Action = yypvt[-0].ptr; yyval.num = F_EXEC; } break; Xcase 110: X# line 346 "gram.y" X{ Action = yypvt[-0].ptr; yyval.num = F_CUT; } break; Xcase 111: X# line 347 "gram.y" X{ Action = yypvt[-0].ptr; yyval.num = F_FUNCTION; } break; Xcase 112: X# line 350 "gram.y" X{ yyval.num = yypvt[-0].num; X if (yypvt[-0].num == 0) X yyerror(); X X if (yypvt[-0].num > MAX_BUTTONS) X { X yyval.num = 0; X yyerror(); X } X } break; Xcase 113: X# line 361 "gram.y" X{ yyval.num = yypvt[-0].num; X if (yypvt[-0].num == 0) X yyerror(); X X if (yypvt[-0].num > MAX_BUTTONS) X { X yyval.num = 0; X yyerror(); X } X } break; Xcase 114: X# line 373 "gram.y" X{ ptr = (char *)malloc(strlen(yypvt[-0].ptr)+1); X strcpy(ptr, yypvt[-0].ptr); X RemoveDQuote(ptr); X yyval.ptr = ptr; X } break; Xcase 115: X# line 378 "gram.y" X{ yyval.num = yypvt[-0].num; } break; X } X goto yystack; /* stack new state and value */ X X } END_OF_FILE if test 21407 -ne `wc -c <'gram.c'`; then echo shar: \"'gram.c'\" unpacked with wrong size! fi # end of 'gram.c' fi if test -f 'twm.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'twm.c'\" else echo shar: Extracting \"'twm.c'\" \(16649 characters\) sed "s/^X//" >'twm.c' <<'END_OF_FILE' X/*****************************************************************************/ X/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ X/** Salt Lake City, Utah **/ X/** **/ X/** All Rights Reserved **/ X/** **/ X/** Permission to use, copy, modify, and distribute this software and **/ X/** its documentation for any purpose and without fee is hereby **/ X/** granted, provided that the above copyright notice appear in all **/ X/** copies and that both that copyright notice and this permis- **/ X/** sion notice appear in supporting documentation, and that the **/ X/** name of Evans & Sutherland not be used in advertising or publi- **/ X/** city pertaining to distribution of the software without specif- **/ X/** ic, written prior permission. **/ X/** **/ X/** EVANS & SUTHERLAND DISCLAIMS ALL WARRANTIES WITH REGARD TO **/ X/** THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILI- **/ X/** TY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND BE LIABLE **/ X/** FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAM- **/ X/** AGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, **/ X/** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS **/ X/** ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PER- **/ X/** FORMANCE OF THIS SOFTWARE. **/ X/*****************************************************************************/ X X/*********************************************************************** X * X * $Header: twm.c,v 1.50 88/09/08 15:33:28 toml Exp $ X * X * twm - "Tom's Window Manager" X * X * 27-Oct-87 Thomas E. LaStrange File created X * X ***********************************************************************/ X X#ifndef lint Xstatic char RCSinfo[] = X"$Header: twm.c,v 1.50 88/09/08 15:33:28 toml Exp $"; X#endif X X#include <stdio.h> X#include <signal.h> X#include <fcntl.h> X#include "twm.h" X#include "add_window.h" X#include "gc.h" X#include "parse.h" X#include "version.h" X#include "menus.h" X#include "events.h" X#include "util.h" X#include "gram.h" X X#include "twm.bm" X#include "gray.bm" X XTwmWindow TwmRoot; /* the head of the twm window list */ X XDisplay *dpy; /* which display are we talking to */ Xint screen; /* the default screen */ Xint d_depth; /* copy of DefaultDepth(dpy, screen) */ XVisual *d_visual; /* copy of DefaultVisual(dpy, screen) */ X XWindow Root; /* the root window */ XWindow VersionWindow; /* the twm version window */ XWindow SizeWindow; /* the resize dimensions window */ XWindow ResizeWindow; /* the window we are resizing */ XWindow InitialWindow; /* the window name we are creating */ XColormap CMap; /* default color map */ X XXFontStruct *TitleBarFont; /* title bar font structure */ XXFontStruct *MenuFont; /* menu font structure */ XXFontStruct *IconFont; /* icon font structure */ XXFontStruct *SizeFont; /* resize font structure */ XXFontStruct *VersionFont; /* version font structure */ XXFontStruct *InitialFont; /* window creation font structure */ X Xchar *TitleBarFontName = "8x13";/* default title bar font */ Xchar *MenuFontName = "8x13"; /* default menu font */ Xchar *IconFontName = "8x13"; /* default icon font */ Xchar *SizeFontName = "fg-22"; /* default resize font */ Xchar *VersionFontName = "8x13"; /* default version font */ Xchar *InitialFontName = "9x15"; /* default window creation font */ Xchar *IconDirectory = NULL; /* icon directory to search */ X Xint TitleBarFontHeight; /* height of title bar font */ Xint MenuFontHeight; /* height of menu font */ Xint IconFontHeight; /* height of icon font */ Xint SizeFontHeight; /* height of resize font */ Xint VersionFontHeight; /* height of version font */ Xint InitialFontHeight; /* height of window creation font */ X Xint BorderColor; /* color of window borders */ Xint BorderTileForeground; /* border tile foreground */ Xint BorderTileBackground; /* border tile background */ Xint TitleForeground; /* foreground color of titlebar */ Xint TitleBackground; /* background color of titlebar */ Xint MenuForeground; /* menu foreground color */ Xint MenuBackground; /* menu background color */ Xint MenuTitleForeground; /* menu title foreground color */ Xint MenuTitleBackground; /* menu title background color */ Xint MenuShadowColor; /* menu shadow color */ Xint IconForeground; /* icon foreground color */ Xint IconBackground; /* icon background color */ Xint IconBorderColor; /* icon border color */ X XCursor ArrowCursor; /* title bar cursor */ XCursor ButtonCursor; /* title bar button cursor */ XCursor MoveCursor; /* move and resize cursor */ XCursor ClockCursor; /* wait a while cursor */ XCursor LeftArrowCursor; /* menu cursor */ XCursor UpperLeftCursor; /* upper Left corner cursor */ XCursor DotCursor; /* dot cursor for f.move, etc. from menus */ XCursor SkullCursor; /* skull and cross bones, f.destroy */ X XGC TitleNormalGC; /* GC for title bar */ XGC MenuNormalGC; /* normal GC for menus */ XGC MenuReverseGC; /* reverse video GC for menus */ XGC MenuXorGC; /* XOR GC for menus */ XGC MenuTitleGC; /* normal GC for menu titles */ XGC IconNormalGC; /* GC for icons */ XGC VersionNormalGC; /* GC for the version window */ XGC SizeNormalGC; /* GC for the resize window */ XGC InitialNormalGC; /* GC for the initial creation window */ XGC DrawGC; /* GC to draw lines for move and resize */ XGC BorderGC; /* GC to create the "gray" pixmap */ X XXClassHint NoClass; /* for applications with no class */ X XXContext TwmContext; /* context for twm windows */ XXContext MenuContext; /* context for all menu windows */ X Xint BorderWidth = BW; /* border width of twm windows */ Xunsigned long Foreground; /* foreground color of twm windows */ Xunsigned long Background; /* background color of twm windows */ Xunsigned long Black; Xunsigned long White; XPixmap GrayTile; X Xchar Version[100]; /* place to build the version string */ XPixmap UnknownPm = NULL; /* the unknown icon pixmap */ Xint UnknownWidth = 0; /* width of the unknown icon */ Xint UnknownHeight = 0; /* height of the unknown icon */ Xint FirstTime = TRUE; /* first time we've read .twmrc */ Xint ReverseVideo = FALSE; /* flag to do reverse video */ Xint FocusRoot = TRUE; /* is the input focus on the root ? */ XTwmWindow *Focus = NULL; /* the twm window that has focus */ Xint WarpCursor = FALSE; /* warp cursor on de-iconify ? */ Xint ForceIcon = FALSE; /* force the icon to the user specified */ Xint NoRaiseMove = FALSE; /* don't raise window following move */ Xint NoRaiseResize = FALSE; /* don't raise window following resize */ Xint NoRaiseDeicon = FALSE; /* don't raise window on deiconify */ Xint DontMoveOff = FALSE; /* don't allow windows to be moved off */ Xint DoZoom = FALSE; /* zoom in and out of icons */ Xint Monochrome = COLOR; /* is the display monochrome ? */ Xint TitleFocus = TRUE; /* focus on window in title bar ? */ Xchar *Home; /* the HOME environment variable */ Xint HomeLen; /* length of Home */ Xint ParseError; /* error parsing the .twmrc file */ Xint Highlight = TRUE; /* we should highlight the window borders */ Xint MyDisplayWidth; /* my copy of DisplayWidth(dpy, screen) */ Xint MyDisplayHeight; /* my copy of DisplayHeight(dpy, screen) */ X Xint TitleBarY; /* y coordinate to start text in the title */ Xint TitleBarX = TITLE_BAR_HEIGHT + 4; /* x coordinate ditto */ Xint MenuY; /* y coordiante for text in menus */ Xint HandlingEvents = FALSE; /* are we handling events yet? */ X XWindow JunkRoot; /* junk window */ XWindow JunkChild; /* junk window */ Xint JunkX; /* junk variable */ Xint JunkY; /* junk variable */ Xint JunkWidth; /* junk variable */ Xint JunkHeight; /* junk variable */ Xint JunkDepth; /* junk variable */ Xint JunkBW; /* junk variable */ Xint JunkMask; /* junk variable */ X X/*********************************************************************** X * X * Procedure: X * main - start of twm X * X *********************************************************************** X */ X Xmain(argc, argv) X int argc; X char *argv[]; X{ X Window root, parent, *children; X int nchildren, i; X int m, d, y; X char *display_name; X unsigned long valuemask; /* mask for create windows */ X XSetWindowAttributes attributes; /* attributes for create windows */ X int (*old_handler) (); X X display_name = NULL; X X if (argc != 1 && argc != 3) X { X fprintf(stderr, "Usage: twm [-display display]\n"); X exit(1); X } X X if (argc == 3) X { X if (strncmp(argv[1], "-d", 2) == 0) X display_name = argv[2]; X else X { X fprintf(stderr, "Usage: twm [-display display]\n"); X exit(1); X } X } X X old_handler = signal(SIGINT, SIG_IGN); X if (old_handler != SIG_IGN) X signal(SIGINT, Done); X X old_handler = signal(SIGHUP, SIG_IGN); X if (old_handler != SIG_IGN) X signal(SIGHUP, Done); X X signal(SIGQUIT, Done); X signal(SIGTERM, Done); X X Home = (char *)getenv("HOME"); X if (Home == NULL) X Home = "./"; X X HomeLen = strlen(Home); X X NoClass.res_name = NoName; X NoClass.res_class = NoName; X X TwmRoot.next = NULL; X TwmRoot.prev = NULL; X TwmRoot.w = NULL; X TwmRoot.title_w = NULL; X TwmRoot.iconify_w = NULL; X TwmRoot.resize_w = NULL; X X if ((dpy = XOpenDisplay(display_name)) == NULL) X { X fprintf(stderr, "twm: can't open the display\n"); X exit(1); X } X X X if (fcntl(ConnectionNumber(dpy), F_SETFD, 1) == -1) X { X fprintf(stderr, "twm: child cannot disinherit TCP fd\n"); X exit(1); X } X X screen = DefaultScreen(dpy); X d_depth = DefaultDepth(dpy, screen); X d_visual = DefaultVisual(dpy, screen); X Root = RootWindow(dpy, screen); X CMap = DefaultColormap(dpy, screen); X MyDisplayWidth = DisplayWidth(dpy, screen); X MyDisplayHeight = DisplayHeight(dpy, screen); X X XSetErrorHandler(Other); X XSelectInput(dpy, Root, X SubstructureRedirectMask | KeyPressMask | X ButtonPressMask | ButtonReleaseMask | ExposureMask); X XSync(dpy, screen); X X XSetErrorHandler(Error); X XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); X X TwmContext = XUniqueContext(); X MenuContext = XUniqueContext(); X X /* define cursors */ X X ArrowCursor = XCreateFontCursor(dpy, XC_top_left_arrow); X MoveCursor = XCreateFontCursor(dpy, XC_fleur); X LeftArrowCursor = XCreateFontCursor(dpy, XC_sb_left_arrow); X ButtonCursor = XCreateFontCursor(dpy, XC_center_ptr); X ClockCursor = XCreateFontCursor(dpy, XC_watch); X UpperLeftCursor = XCreateFontCursor(dpy, XC_top_left_corner); X DotCursor = XCreateFontCursor(dpy, XC_dot); X SkullCursor = XCreateFontCursor(dpy, XC_pirate); X X XGrabServer(dpy); X XSync(dpy, screen); X XQueryTree(dpy, Root, &root, &parent, &children, &nchildren); X X /* setup default colors */ X X Black = BlackPixel(dpy, screen); X White = WhitePixel(dpy, screen); X X BorderColor = Black; X BorderTileForeground = Black; X BorderTileBackground = White; X TitleForeground = Black; X TitleBackground = White; X MenuForeground = Black; X MenuBackground = White; X MenuTitleForeground = Black; X MenuTitleBackground = White; X MenuShadowColor = Black; X IconForeground = Black; X IconBackground = White; X IconBorderColor = Black; X X if (DisplayCells(dpy, screen) < 3) X Monochrome = MONOCHROME; X X ParseTwmrc(NULL); X FirstTime = FALSE; X CreateGCs(); X X GrayTile = MakePixmap(Root, BorderGC, gray_bits, X gray_width, gray_height); X X for (i = 0; i < nchildren; i++) X { X if (MappedNotOverride(children[i])) X { X AddWindow(children[i]); X } X } X X InitialWindow = XCreateSimpleWindow(dpy, Root, X 0, 0, 5, InitialFontHeight + 4, BW, Foreground, Background); X X /* contruct the version string */ X sprintf(Version, "%s", &Revision[1]); X Version[strlen(Version) - 1] = '\0'; X sscanf(&Date[7], "%d/%d/%d", &y, &m, &d); X sprintf(Version, "%s Date: %d/%d/%d %s", Version, m, d, y, &Date[16]); X Version[strlen(Version) - 2] = '\0'; X X VersionWindow = XCreateSimpleWindow(dpy, Root, X 0, 0, X twm_width + XTextWidth(VersionFont, Version, strlen(Version)) + 20, X VersionFontHeight + 4, X BW, X Foreground, Background); X X valuemask = CWBackPixmap; X attributes.background_pixmap = MakePixmap(VersionWindow, VersionNormalGC, X twm_bits, twm_width, twm_height); X X XCreateWindow(dpy, VersionWindow, X 4, 1, X twm_width, twm_height, X 0, d_depth, CopyFromParent, X d_visual, valuemask, &attributes); X X XSelectInput(dpy, VersionWindow, ExposureMask); X XMapSubwindows(dpy, VersionWindow); X XMapWindow(dpy, VersionWindow); X X SizeWindow = XCreateSimpleWindow(dpy, Root, X 0, 0, X 100, X SizeFontHeight + 4, X BW, X Foreground, Background); X X X XUngrabServer(dpy); X X HandlingEvents = TRUE; X InitEvents(); X HandleEvents(); X} X X/*********************************************************************** X * X * Procedure: X * Done - cleanup and exit twm X * X * Returned Value: X * none X * X * Inputs: X * none X * X * Outputs: X * none X * X * Special Considerations: X * none X * X *********************************************************************** X */ X Xvoid XDone() X{ X TwmWindow *tmp; /* temp twm window structure */ X unsigned x, y; X XWindowChanges xwc; /* change window structure */ X unsigned int xwcm; /* change window mask */ X X /* put a border back around all windows */ X X for (tmp = TwmRoot.next; tmp != NULL; tmp = tmp->next) X { X XGetGeometry(dpy, tmp->w, &JunkRoot, &x, &y, &JunkWidth, &JunkHeight, X &JunkBW, &JunkDepth); X X xwcm = CWX | CWY | CWBorderWidth; X X xwc.x = x - (2 * BorderWidth); X xwc.y = y - (2 * BorderWidth); X xwc.border_width = BorderWidth; X X XConfigureWindow(dpy, tmp->w, xwcm, &xwc); X } X X XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); X XCloseDisplay(dpy); X exit(0); X} X X/*********************************************************************** X * X * Procedure: X * Error - X error handler. If we got here it is probably, X * because the client window went away and we haven't X * got the DestroyNotify yet. X * X * Inputs: X * dpy - the connection to the X server X * event - the error event structure X * X *********************************************************************** X */ X Xvoid XError(dpy, event) XDisplay *dpy; XXErrorEvent *event; X{ X TwmWindow *tmp; /* temp twm window structure */ X char buffer[BUFSIZ]; X X /* Look for the window in the list, if it's there, remove it X * from the list, and continue on, else ignore the error. X * This is assumes that twm makes no errors. HaHa X for (tmp = TwmRoot.next; tmp != NULL; tmp = tmp->next) X { X if (tmp->w == event->resourceid) X { X if (tmp == Focus) X { X FocusOnRoot(); X } X XDeleteContext(dpy, tmp->w, TwmContext); X XDeleteContext(dpy, tmp->frame, TwmContext); X XDeleteContext(dpy, tmp->title_w, TwmContext); X XDeleteContext(dpy, tmp->iconify_w, TwmContext); X XDeleteContext(dpy, tmp->resize_w, TwmContext); X XDeleteContext(dpy, tmp->icon_w, TwmContext); X#ifndef NOFOCUS X XDeleteContext(dpy, tmp->focus_w, TwmContext); X#endif X XDeleteContext(dpy, tmp->hilite_w, TwmContext); X X XDestroyWindow(dpy, tmp->frame); X XDestroyWindow(dpy, tmp->icon_w); X tmp->prev->next = tmp->next; X if (tmp->next != NULL) X tmp->next->prev = tmp->prev; X X free((char *)tmp); X return; X } X } X */ X X return; X X /* X XGetErrorText(dpy, event->error_code, buffer, BUFSIZ); X (void) fprintf(stderr, "X Error: %s\n", buffer); X (void) fprintf(stderr, " Request Major code: %d\n", event->request_code); X (void) fprintf(stderr, " Request Minor code: %d\n", event->minor_code); X (void) fprintf(stderr, " ResourceId 0x%x\n", event->resourceid); X (void) fprintf(stderr, " Error Serial #%d\n", event->serial); X (void) fprintf(stderr, " Current Serial #%d\n", dpy->request); X X Done(); X */ X} X X/*********************************************************************** X * X * Procedure: X * Other - error handler called if something else has set X * the attributes on the root window. Typically X * another window manager. X * X *********************************************************************** X */ X Xvoid XOther(dpy, event) XDisplay *dpy; XXErrorEvent *event; X{ X fprintf(stderr, "twm: Are you running another window manager?\n"); X exit(1); X} END_OF_FILE if test 16649 -ne `wc -c <'twm.c'`; then echo shar: \"'twm.c'\" unpacked with wrong size! fi # end of 'twm.c' fi echo shar: End of archive 4 \(of 7\). cp /dev/null ark4isdone MISSING="" for I in 1 2 3 4 5 6 7 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 7 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 -- Mike Wexler(wyse!mikew) Phone: (408)433-1000 x1330