0707070000020011071006660001460001440000010271040363201057500000500000000003Size50 0707070000020006301007770001460001440000010271140363201032600000700000000633Remove# This is a generic remove program ... the key name is given by NAME # The directories in SFOLDER and DFOLDER are removed along with the executable NAME=WINDY SFOLDER=/u/$LOGNAME/Filecabinet/SRC DFOLDER=/u/$LOGNAME/Filecabinet/DOCS ELIST="/usr/bin/windy" if [ -d $SFOLDER/$NAME ] then rm -rf $SFOLDER/$NAME fi if [ -d $DFOLDER/$NAME ] then rm -rf $DFOLDER/$NAME fi for i in $ELIST do rm -rf $i done 0707070000020020761006660001460001440000010271110363201065100000500000000030NameWINDY - from THE STORE! 0707070000020010441007770001460001440000010033130363201070000001100000000042MAKEcpiocat Files | cpio -ocBv > WINDY+IN 0707070000020021741006660001460001440000010341140363201210700000600000000140Files./Size ./Remove ./Name ./MAKEcpio ./Files ./windy.c ./Install ./windy.README ./Makefile ./windy 0707070000020033371006660001460001440000010155150363155032500001000000010761windy.c#include #include #include #define NA 0xffff struct uwdata xuw = { NA, NA, NA, NA, NA}; struct utdata xut[WTXTNUM]; int bflag = 0; int Kflag = 0; char blot[81]; char *ttyname(); main(ac,av) int ac; char **av; { int nflag = 0; char avname[81]; extern char *optarg; extern int optind; int i, c; while((c = getopt(ac, av, "brp:c:l:u:1:2:n:f:h:w:x:y:K:")) != EOF) { switch(c) { case 'r': report(ttyname(0)); exit(0); break; case 'b': bflag++; break; case 'h': xuw.uw_height = atoi(optarg); break; case 'w': xuw.uw_width = atoi(optarg); break; case 'x': xuw.uw_x = atoi(optarg); break; case 'y': xuw.uw_y = atoi(optarg); break; case 'f': xuw.uw_uflags = htoi(optarg); xuw.uw_uflags &= ~NOSETUFLAGS; break; case 'p': utset(WTXTPROMPT, optarg); break; case 'c': utset(WTXTCMD, optarg); break; case 'l': utset(WTXTLABEL, optarg); break; case 'n': case 'u': nflag = 1; utset(WTXTUSER, optarg); break; case '1': utset(WTXTSLK1, optarg); break; case '2': utset(WTXTSLK2, optarg); break; case '?': fprintf(stderr, "usage: windy [window-args] [command-args]\n"); fprintf(stderr, "or windy -r\n"); exit(2); case 'K': strncpy(blot, optarg, 80); Kflag ++; } } /* * if gave command args, put it in a new window * if gave window args, or no args at all, change window params */ if(optind == 1) { xuw.uw_x = 0; xuw.uw_y = 12; xuw.uw_width = 720; xuw.uw_height = 288; xuw.uw_uflags = 0x1; } if(optind < ac) { newwind(); avname[0] = 0; for(i=optind; i 0) exit(1); else if(pid == 0) { setpgrp(); ioctl(0, WIOCPGRP); } } av += optind; execvp(av[0], av); perror(av[0]); exit(1); } exit(0); } utset(n, s) char *s; { xut[n].ut_num = 1; strncpy(xut[n].ut_text, s, WTXTLEN); } newwind() { char name[10]; extern char **environ; struct termio t; int bad = 0, i, fd; if (!isatty(0)) return; if(strncmp("/dev/w", ttyname(0), 6)!=0 ) return; if (ioctl(0, TCGETA, &t) < 0) { perror("getting tty chars"); bad = 1; } fd = open("/dev/window",2); if (fd < 0) { perror("opening window"); return; } if(bflag) { ioctl(fd, WIOCSELECT); sprintf(name, "[w%d]\n", ioctl(fd, WIOCGCURR)); write(0, name, strlen(name)); } close(0); dup(fd); close(1); dup(fd); close(2); dup(fd); close(fd); /* Set in the previous edit characters to the new window */ if (!bad && ioctl(0, TCSETAF, &t) < 0) perror("setting tty chars"); for (i=0; environ[i]; ++i) { if (!strncmp(environ[i],"TERMCAP=",8)) { environ[i] = "TERMCAP=/etc/termcap"; } if (!strncmp(environ[i],"TERM=",5)) { environ[i] = "TERM=s4"; } } } fixwind() { struct uwdata uw; int i; if(Kflag) { xut[WTXTSLK1].ut_num = WTXTSLK1; xut[WTXTSLK2].ut_num = WTXTSLK2; keyfix(xut[WTXTSLK1].ut_text); keyfix(xut[WTXTSLK2].ut_text); } for(i=0; i\n", utname[i], ut.ut_text); } } } uwshow(p, s) struct uwdata *p; char *s; { printf("(x,y)=(%d,%d) ", p->uw_x, p->uw_y); printf("(width,height)=(%d,%d) ", p->uw_width, p->uw_height); printf("flags=%x\n ", p->uw_uflags); printf("(hs,vs)=(%d, %d)[RO] ", p->uw_hs, p->uw_vs); printf("baseline=%d[RO] ", p->uw_baseline); printf("(cx,cy)=(%d, %d)[RO]\n", p->uw_cx, p->uw_cy); } htoi(s) char *s; { int x = NA; sscanf(s, "%x", &x); return x; } 0707070000020021361007770001460001440000010212670363201212300001000000004524Install# This is a generic install program ... the key name is given by NAME # The source files in SLIST are placed in directory SFOLDER. # The documentation files in DLIST are placed in DFOLDER # The executables in ELIST are placed in /usr/bin NAME=WINDY SFOLDER=/u/$LOGNAME/Filecabinet/SRC SLIST="windy.c Makefile" ELIST="windy" DFOLDER=/u/$LOGNAME/Filecabinet/DOCS DLIST="windy.README" # First we make sure there is a place for the source code ... echo "\n\nDo you want the source code ???? (y or n) \c" read ANS if [ "$ANS" = 'y' ] then if [ -d $SFOLDER ] then message -i "A new folder called $NAME will be created in your Filecabinet/SRC folder. The source code and final executable will be placed in this folder for your use.\n\nThe executable will be linked to /usr/bin.\n\nTouch to continue." else message -i "A folder called SRC is being created in your Filecabinet. A second folder called SRC/$NAME will then be created to hold the source code and executable for your use.\n\nThe executable will be linked to /usr/bin.\n\nTouch to continue." mkdir $SFOLDER chown $LOGNAME $SFOLDER fi mkdir ${SFOLDER}/$NAME 2>/dev/null chown $LOGNAME ${SFOLDER}/$NAME fi # Then we make sure there is a place for the documentation if [ -d $DFOLDER ] then message -i "A new folder called $NAME will be created in your Filecabinet/DOCS folder. The relevent documentation will be placed in this folder for your use.\n\nTouch to continue." else message -i "A folder called DOCS is being created in your Filecabinet. A second folder called DOCS/$NAME will then be created to hold the relevent documents for your use.\n\nTouch to continue." mkdir $DFOLDER chown $LOGNAME $DFOLDER fi mkdir ${DFOLDER}/$NAME 2>/dev/null chown $LOGNAME ${DFOLDER}/$NAME # Now we move the stuff in ..... # First the source and executable ..... (if any) if [ "$ANS" = 'y' ] then DEST=${SFOLDER}/$NAME if [ "$SLIST" ] then for i in $SLIST $ELIST do ln $i ${DEST}/$i chown $LOGNAME ${DEST}/$i done echo .... source code now in $DEST fi fi # Link the executables to /usr/bin if [ "$ELIST" ] then for i in $ELIST do ln $i /usr/bin/$i done echo .... executables now in /usr/bin fi # Then the documentation DEST=${DFOLDER}/$NAME if [ "$DLIST" ] then for i in $DLIST do ln $i ${DEST}/$i chown $LOGNAME ${DEST}/$i done echo .... documentation now in $DEST fi 0707070000020007701006660001460001440000010226770363154771100001500000006437windy.READMEwindy, a tool for inspecting and manipulating window parameters. See the article 'window' in Section 7 of the 7300 System V Administrator's manual, and see the file /usr/include/sys/window.h Brief theory. Each window has these parameters: (the ones marked RO are not alterable by a user) NAME ARG TYPE MEANING uw_x -x 16 bits x coord of upper left corner, in pixels uw_y -y 16 bits y coord of upper left corner, in pixels uw_width -w 16 bits width of window, in pixels uw_height -h 16 bits height of window, in pixels uw_uflags -f 16 bits word of bits. see /usr/include/sys/window.h You can alter bits 4ff. uw_hs 8 bits[RO] ? uw_vs 8 bits[RO] ? uw_baseline 8 bits[RO] ? uw_cx 16 bits[RO] ? uw_cy 16 bits[RO] ? PROMPT -p char string 'prompt' line CMD -c char string 'command' line LABEL -l char string label on top of window border USER -n char string name of window as reported W icon. SLK1 -1 char string first line of F-key labels SLK2 -2 char string second line of F-key labels The 29-line screen is divied up like this: Line 1: status line Lines 2-25: window lines Line 26: the prompt line Line 27: the line a user types in Line 28: the top line of special function key labels Line 29: the bottom line of ditto. OK. the program windy can be used to 1) report these things or 2) alter them. Examples of use: (see the column labeles ARGS above) 1. To get a report about current window, do this: windy -r 2. To alter current window name: windy -n "My New Name" 3. To alter size of current window: windy -w 400 -h 100 4. To make current window borderless & of maximal size: windy 5. To make a new borderless maximal window with 'vi file' running in it: windy vi file 6. To do the above and call the new window "Vi Hotshot": windy -n "Vi Hotshot" vi file In general, there are 2 forms: windy -r windy [window-args] [command-args] As we saw, windy -r just reports on current window. In the second case, if no command-args are given, the window-args apply to the current window. If command-args are given, a new window is created and the window-args apply to it, and the indicated command is run in the new window. An empty window-args list means borderless & maximal size. Valid window args are listed in ARGS column of table above. The only zinger is this: the -f arg must be specified in hex, the other numerical args in decimal. NEW STUFF 5 Dec 85 === ===== = === == Two new flags: -b -K -b applies only to windy invocations that create a new window, viz, those that specify command-args. It puts the command in the new window in the background, so that if you return to the window manager and select your shell, the shell will not wait for the windy command to finish. Try "windy -b directu" and click on the corner W and select the shell, contrast with "windy directu" followed by ditto: much better the -b way. NOTE: there is a command 'resume' which is a shelly way of selecting windows for the mouse shy. -K is used to put RVideo mode on the SLK labels. You invoke windy with an argument list like: windy -1 "special key label, row 1" -2 "special key label, row 2" \ -K " rrrrrrrr rrrrrrr rrrrrrrr rrrrrrrr rrrrrrrr " and whereever an 'r' occurs in the K-arg, the corresponding slk label noodle will be in reverse video. The other entries will be blank. 0707070000020021101006660001460001440000010244450363154720400001100000000226Makefile include $(MAKEINC)/Makepre.h OBJ=windy.o all: $(OBJ) $(LD) $(LDFLAGS) $(SHAREDLIB) $(OBJ) $(LIBM) -o windy include $(MAKEINC)/Makepost.h 0707070000020020731007770001460001440000010227250363155015400000600000010672windyRfι L .text  .data @.bss  L.lib  /< N1X OQ./HJf/H#0N (x,y)=(%d,%d) (width,height)=(%d,%d) flags=%x (hs,vs)=(%d, %d)[RO] baseline=%d[RO] (cx,cy)=(%d, %d)[RO] %x0707070000020020731007770001460001440000010227250363155015400001300000000000TRAILER!!!    ! & +brp:c:l:u:1:2:n:f:h:w:x:y:K:usage: windy [window-args] [command-args] or windy -r /dev/wgetting tty chars/dev/windowopening window[w%d] setting tty charsTERMCAP=TERMCAP=/etc/termcapTERM=TERM=s4Prompt lineCommand lineLabelUserSLK1SLK2%s: %s=<%.81s> (x,y)=(%d,%d) (width,height)=(%d,%d) flags=%x (hs,vs)=(%d, %d)[RO] baseline=%d[RO] (cx,cy)=(%d, %d)[RO] %x0707070000020020731007770001460001440000010227250363155015400001300000000000TRAILER!!!    ! & +brp:c:l:u:1:2:n:f:h:w:x:y:K:usage: windy [window-args] [command-args] or windy -r /dev/wgetting tty chars/dev/windowopening window[w%d] setting tty charsTERMCAP=TERMCAP=/etc/termcapTERM=TERM=s4Prompt lineCommand lineLabelUserSLK1SLK2%s: %s=<%.81s> (x,y)=(%d,%d) (width,height)=(%d,%d) flags=%x (hs,vs)=(%d, %d)[RO] baseline=%d[RO] (cx,cy)=(%d, %d)[RO] %x0707070000020020731007770001460001440000010227250363155015400001300000000000TRAILER!!!    ! & +brp:c:l:u:1:2:n:f:h:w:x:y:K:usage: windy [window-args] [command-args] or windy -r /dev/wgetting tty chars/dev/windowopening window[w%d] setting tty charsTERMCAP=TERMCAP=/etc/termcapTERM=TERM=s4Prompt lineCommand lineLabelUserSLK1SLK2%s: %s=<%.81s> (x,y)=(%d,%d) (width,height)=(%d,%d) flags=%x (hs,vs)=(%d, %d)[RO] baseline=%d[RO] (cx,cy)=(%d, %d)[RO] %x0707070000020020731007770001460001440000010227250363155015400001300000000000TRAILER!!!