*** icon/orig/browse.c Thu Aug 24 07:41:54 1989 --- icon/browse.c Tue Sep 11 16:31:12 1990 *************** *** 62,73 **** int n = -1; /* current icon */ int clean(); char *getenv(); FILE *popen(), *fd = popen("/bin/pwd","r"); ! ckmgrterm( *argv ); debug = (int) getenv("DEBUG"); if (fd) { fgets(cwd,sizeof(cwd),fd); *(cwd + strlen(cwd) - 1) = '\0'; /* blah */ --- 62,77 ---- int n = -1; /* current icon */ int clean(); char *getenv(); + #ifndef atarist FILE *popen(), *fd = popen("/bin/pwd","r"); ! #endif ckmgrterm( *argv ); debug = (int) getenv("DEBUG"); + #ifdef atarist + getcwd(cwd, sizeof(cwd)); + #else if (fd) { fgets(cwd,sizeof(cwd),fd); *(cwd + strlen(cwd) - 1) = '\0'; /* blah */ *************** *** 78,83 **** --- 82,88 ---- fprintf(stderr,"%s: can't get current directory\n",*argv); exit(2); } + #endif if (argc <2 || argc > MAXICONS) { fprintf(stderr,"usage: %s icons... (up to %d)\n",*argv,MAXICONS); *** icon/orig/snap.c Tue Jan 24 15:59:30 1989 --- icon/snap.c Sun Sep 23 18:52:06 1990 *************** *** 70,75 **** --- 70,78 ---- FILE *pf; + #ifdef atarist + _binmode(1); + #endif ckmgrterm(); debug = (int) getenv("DEBUG"); *************** *** 140,146 **** --- 143,153 ---- menu_load(1,MENU_COUNT,menu); menu_load(2,MENU_COUNT,rop); m_selectmenu(1); + #ifdef atarist + m_linkmenu(1,2,2,MF_AUTO); + #else m_linkmenu(1,2,2,6); + #endif m_clearmode(M_ACTIVATE); m_flush(); *************** *** 204,211 **** --- 211,222 ---- break; case 'F': /* file it */ if (tmp && !snapping) { + #ifdef atarist + fclose(fp); fp = fopen(name, "w"); + #else fseek(fp,0L,0); ftruncate(fileno(fp),0); + #endif if (!bitmapwrite(fp,tmp,format) ) { m_push(P_ALL); m_font(0); *** icon/orig/zoom.c Tue Jan 24 16:00:56 1989 --- icon/zoom.c Wed Sep 19 09:22:42 1990 *************** *** 17,22 **** --- 17,25 ---- #include #include "term.h" #include "bitmap.h" + #ifdef atarist + #include "dump.h" + #endif /* general defines */ *************** *** 151,157 **** --- 154,164 ---- int debug=0; char *title[MAXMARK]; /* title goes here */ int xmax,ymax,border; /* screen parameters */ + #ifdef atarist + char *str_save(); + #else char *str_save(), *sprintf(); + #endif char *prog; main(argc,argv) *************** *** 185,191 **** --- 192,202 ---- char dims[12]; /* string buffer for icon dims */ char line[512]; /* input buffer */ + #ifdef atarist + char *malloc(), *rindex(), *get_str(), *strcpy(); + #else char *sprintf(), *malloc(), *rindex(), *get_str(), *strcpy(); + #endif int clean(), message(); BITMAP *map; /* what your editting */ *************** *** 269,275 **** --- 280,291 ---- m_clear(); title[T_FUNC] = modes[mode].value; title[T_OP] = options[function].value; + #ifdef atarist + sprintf(dims,"%d x %d",W(map),H(map)); + title[T_SIZE] = dims; + #else title[T_SIZE] = sprintf(dims,"%d x %d",W(map),H(map)); + #endif title[T_NAME] = name; title[4] = NULL; Do_title(title); *************** *** 383,390 **** --- 399,412 ---- if (!yanked) message(SETMSG,"Can't yank bitmap"); else + #ifdef atarist + { sprintf(line, "Yanked bitmap %d x %d", W(new), H(new)); + message(SETMSG, line); + } + #else message(SETMSG,sprintf(line,"Yanked bitmap %d x %d", W(new),H(new))); + #endif break; case PUT: if (!yanked) { *************** *** 432,439 **** --- 454,466 ---- zoom(map,x0,y0,x,y,SET); if (grid) draw_grid(map,x0,y0,x,y); + #ifdef atarist + sprintf(dims,"%d x %d", W(map),H(map)); + title[T_SIZE] = dims; + #else title[T_SIZE] = sprintf(dims,"%d x %d", W(map),H(map)); + #endif Do_title(title); break; case GROW: *************** *** 456,463 **** --- 483,495 ---- zoom(map,x0,y0,x,y,SET); if (grid) draw_grid(map,x0,y0,x,y); + #ifdef atarist + title[T_SIZE] = dims; sprintf(dims,"%d x %d", + W(map),H(map)); + #else title[T_SIZE] = sprintf(dims,"%d x %d", W(map),H(map)); + #endif Do_title(title); break; case SHIFT: *************** *** 522,528 **** --- 554,564 ---- zoom(map,x0,y0,x,y,SET); if (grid) draw_grid(map,x0,y0,x,y); + #ifdef atarist + title[T_SIZE] = dims; sprintf(dims,"%d x %d",W(map),H(map)); + #else title[T_SIZE] = sprintf(dims,"%d x %d",W(map),H(map)); + #endif Do_title(title); if (function) INVERT(T_OP); *************** *** 560,566 **** --- 596,606 ---- m_clear(); code = get_scale(&x,&y,map); zoom(map,x0,y0,x,y,SET); + #ifdef atarist + title[T_SIZE] = dims; sprintf(dims,"%d x %d",W(map),H(map)); + #else title[T_SIZE] = sprintf(dims,"%d x %d",W(map),H(map)); + #endif title[T_NAME] = strcpy(name,pntr); Do_title(title); if (grid) *************** *** 575,582 **** --- 615,628 ---- bit_destroy(yanked); yanked = new; new = BIT_NULL; + #ifdef atarist + sprintf(line,"Yanked %s (%d x %d)", + pntr,W(yanked),H(yanked)); + message(SETMSG, line); + #else message(SETMSG,sprintf(line,"Yanked %s (%d x %d)", pntr,W(yanked),H(yanked))); + #endif if (function == YANK) { INVERT(T_OP); function = 0; *************** *** 655,661 **** zoom(map,x0,y0,x,y,SET); if (grid) draw_grid(map,x0,y0,x,y); ! title[T_SIZE] = sprintf(dims,"%d x %d", W(map),H(map)); Do_title(title); } break; --- 701,707 ---- zoom(map,x0,y0,x,y,SET); if (grid) draw_grid(map,x0,y0,x,y); ! title[T_SIZE] = dims; sprintf(dims,"%d x %d", W(map),H(map)); Do_title(title); } break; *************** *** 907,919 **** --- 953,975 ---- char tmp[100]; if ((fp = fopen(name,"r")) == NULL ) { + #ifdef atarist + sprintf(tmp, "Can't find %s", name); + message(SETMSG, tmp); + #else message(SETMSG,sprintf(tmp,"Can't find %s",name)); + #endif return(BIT_NULL); } if( !( map = bitmapread(fp) ) ) { fclose(fp); + #ifdef atarist + sprintf(tmp, "%s is not an icon or is damaged", name); + message(SETMSG, tmp); + #else message(SETMSG,sprintf(tmp,"%s is not an icon or is damaged",name)); + #endif return(BIT_NULL); } *************** *** 956,964 **** --- 1012,1027 ---- FILE *fp = fopen(name,"w"); char tmp[100]; + #ifdef atarist + if (fp == NULL || !bitmapwrite(fp,map,NEW_BHDR)) { + dprintf(stderr, "Can't write file %s\n",name); + sprintf(tmp, "Can't write file %s",name); + message(SETMSG,tmp); + #else if (fp == NULL || !bitmapwrite(fp,map)) { dprintf(stderr,"Can't write file %s\n",name); message(SETMSG,sprintf(tmp,"Can't write file %s",name)); + #endif return(0); } fclose(fp); *** ify/orig/icondata.c Mon Oct 2 09:17:26 1989 --- ify/icondata.c Mon Sep 17 21:54:50 1990 *************** *** 64,77 **** int s, old_mode, new_mode; m_flush(); ioctl(fileno(m_termout),TIOCLGET,&old_mode); new_mode = old_mode | LLITOUT; ioctl(fileno(m_termout),TIOCLSET,&new_mode); ! m_bitdestroy(n); m_bitldto(*w=68,*h=55,0,0,n,s=B_SIZE32(68,55,1)); fwrite(iconbits,s,1,m_termout); m_flush(); ! ioctl(fileno(m_termout),TIOCLSET,&old_mode); } --- 64,79 ---- int s, old_mode, new_mode; m_flush(); + #ifndef atarist ioctl(fileno(m_termout),TIOCLGET,&old_mode); new_mode = old_mode | LLITOUT; ioctl(fileno(m_termout),TIOCLSET,&new_mode); ! #endif m_bitdestroy(n); m_bitldto(*w=68,*h=55,0,0,n,s=B_SIZE32(68,55,1)); fwrite(iconbits,s,1,m_termout); m_flush(); ! #ifndef atarist ioctl(fileno(m_termout),TIOCLSET,&old_mode); + #endif } *** ify/orig/ify.c Mon Oct 2 09:17:28 1989 --- ify/ify.c Tue Sep 18 23:44:54 1990 *************** *** 62,68 **** /* general tty mashing stuff: */ #define TTYSUFFIXLEN (3) /* length of ptty suffix + 1 */ ! #define TTYPREFIX "/dev/tty" /* prefix for pttys */ #define TTYPREFIXLEN (sizeof(TTYPREFIX)+1) /* length of TTYPREFIX+1 */ char ttytemp[TTYPREFIXLEN+TTYSUFFIXLEN]; /* for FULLTTYNAME() */ #define FULLTTYNAME(suff) /* make full name from suffix - temporary! */\ --- 62,73 ---- /* general tty mashing stuff: */ #define TTYSUFFIXLEN (3) /* length of ptty suffix + 1 */ ! #ifdef atarist ! #define TTYPREFIX "Q:/ttyp." /* prefix for pttys */ ! #else ! #define TTYPREFIX "/dev/tty" ! #endif ! #define TTYPREFIXLEN (sizeof(TTYPREFIX)+1) /* length of TTYPREFIX+1 */ char ttytemp[TTYPREFIXLEN+TTYSUFFIXLEN]; /* for FULLTTYNAME() */ #define FULLTTYNAME(suff) /* make full name from suffix - temporary! */\ *************** *** 172,177 **** --- 177,186 ---- m_ttyset(); m_push(P_EVENT | P_FLAGS | P_MENU | P_POSITION); signal(SIGINT, catchint); + #ifdef atarist + signal(SIGTTOU, SIG_IGN); + signal(SIGTTIN, SIG_IGN); + #endif DUPKEYOFF; m_setmode(M_ABS); m_setmode(M_NOWRAP); *************** *** 179,184 **** --- 188,196 ---- m_func(B_SRC); m_flush(); + #ifdef atarist + strcpy(ourtty, "/dev/fd2"); /* sigh -- the best we can do */ + #else { char *ttyname(); char *t = ttyname(2); /* get tty attached to stderr */ *************** *** 187,203 **** --- 199,223 ---- shutdown("Can't find name of tty"); strcpy(ourtty, t); /* make a copy of ttyname()'s value */ } + #endif /* turn off general write permission to the tty, so we can accept m_sendme() messages */ { + #ifdef atarist + oldmode = 0600; + #else struct stat ttymode; if (stat(ourtty, &ttymode) == -1) closedown(THEERROR("ourtty stat: ")); oldmode = ttymode.st_mode; /* get the old protection bits */ + #endif } + #ifdef atarist + windowpid = 0; + #else /* Can we use m_sendto messages? */ if ((oldmode & 077) == 0 || chmod(ourtty, 00600) != -1) windowpid = getwid(); *************** *** 215,220 **** --- 235,241 ---- m_pop(); m_flush(); } + #endif get_param(NULL, &disp_w, &disp_h, &border); get_font(&font_w, &font_h); *************** *** 437,443 **** --- 458,468 ---- FILE *ttyfp, *oldtermout; int ttyfd; + #ifdef atarist + if ((ttyfp = fopen(FULLTTYNAME(tty), "a")) == NULL) + #else if ((ttyfp = fopen(FULLTTYNAME(tty), "w")) == NULL) + #endif closedown(THEERROR("open tty II: ")); ttyfd = fileno(ttyfp); *************** *** 451,457 **** --- 476,486 ---- DUPKEYON; /* make sure that the window isn't currently ^S-ed */ + #ifdef atarist + if (iocuddle(ttyfd, TIOCSTART, 0) == -1) + #else if (iocuddle(ttyfd, TIOCSTART) == -1) + #endif closedown(THEERROR("iocuddle TIOCSTART II: ")); /* don't notice the windows that haven't been closed yet */ *************** *** 490,502 **** sleep(WAITTIME); /* stop all output to that ptty */ if (iocuddle(ttyfd, TIOCSTOP) == -1) closedown(THEERROR("iocuddle TIOCSTOP: ")); /* queue escape codes to re-open them when output is re-enabled */ foreachwindow(layout, layoutlen, tty, queueopen, CNULL); ! fclose(ttyfp); /* close the tty - we're done */ makemenu(); /* refresh the menu's view of life */ --- 519,536 ---- sleep(WAITTIME); /* stop all output to that ptty */ + #ifdef atarist + if (iocuddle(ttyfd, TIOCSTOP, 0) == -1) + #else if (iocuddle(ttyfd, TIOCSTOP) == -1) + #endif closedown(THEERROR("iocuddle TIOCSTOP: ")); + #ifndef atarist /* queue escape codes to re-open them when output is re-enabled */ foreachwindow(layout, layoutlen, tty, queueopen, CNULL); ! #endif fclose(ttyfp); /* close the tty - we're done */ makemenu(); /* refresh the menu's view of life */ *************** *** 535,546 **** /* quick hack for positioning windows on a full screen */ static int next_x, next_y, widest; if (w->num == 0) sprintf(title, "%-5s", ! (notify[0] == '\0' ? FULLTTYNAME(w->tty) : notify)); else sprintf(title, "%-5s(%d)", ! (notify[0] == '\0' ? FULLTTYNAME(w->tty) : notify), w->num); width = strlen(title)*font_w + 2*border; --- 569,586 ---- /* quick hack for positioning windows on a full screen */ static int next_x, next_y, widest; + #ifdef atarist + #define NM_OFFSET 3 + #else + #define NM_OFFSET 0 + #endif + if (w->num == 0) sprintf(title, "%-5s", ! (notify[0] == '\0' ? FULLTTYNAME(w->tty)+NM_OFFSET : notify)); else sprintf(title, "%-5s(%d)", ! (notify[0] == '\0' ? FULLTTYNAME(w->tty)+NM_OFFSET : notify), w->num); width = strlen(title)*font_w + 2*border; *************** *** 627,635 **** --- 667,689 ---- m_flush(); /* re-enable output to that ptty */ + #ifdef atarist + DUPKEYOFF; + layoutlen = get_all(layout); + DUPKEYON; + + if (iocuddle(ttyfd, TIOCSTART, 0) == -1) + #else if (iocuddle(ttyfd, TIOCSTART) == -1) + #endif closedown(THEERROR("iocuddle TIOCSTART: ")); + #ifdef atarist + /* send escape codes to re-open them when output is + re-enabled */ + foreachwindow(layout, layoutlen, tty, queueopen, CNULL); + #endif + /* queue escape codes to let us know when they're all opened, if we can */ if (windowpid != 0) { *** misc/orig/getpty.c Thu Aug 24 07:29:46 1989 --- misc/getpty.c Wed Sep 19 10:45:08 1990 *************** *** 12,18 **** --- 12,25 ---- #include #include + #ifdef atarist + #include + #include + #define TBDELAY 0 + #define getdtablesize() 20 + #else #include + #endif #include #include *************** *** 19,24 **** --- 26,37 ---- #include #include + #ifdef atarist + # ifndef EWOULDBLOCK + # define EWOULDBLOCK 130 + # endif + #endif + /* ** size of input and output buffers */ *************** *** 252,259 **** --- 265,277 ---- #define index strchr #endif + #ifdef atarist + static char *line = "Q:/ttyp.XX"; + static int pty_index=5; /* better hit rate than 0 */ + #else static char *line = "/dev/ptypX"; static int pty_index=5; /* better hit rate than 0 */ + #endif extern char **environ; /* place to save tty modes */ *************** *** 273,279 **** --- 291,299 ---- char list[20]; strcpy(list,"0123456789abcdef"); + #ifndef atarist line[5] = 'p'; + #endif /* for(line[8]='p';line[8]!='r';line[8]='q') */ *************** *** 284,296 **** --- 304,322 ---- { printf("trying %s\n",line); } + #ifdef atarist + if ((fd = Fcreate(line, FA_SYSTEM|FA_HIDDEN)) >= 0) { + #else if ((fd = open(line,2)) >= 0) { + #endif /* pty_index = (pty_index+i)%16; */ if (verboseflag) { printf(" GOT %s\n",line); } + #ifndef atarist line[5] = 't'; + #endif return(fd); } } *************** *** 300,306 **** --- 326,334 ---- int getatty() { int fd; + #ifndef atarist line[5]='t'; + #endif fd=open(line,2); if (fd<0) { sleep(3); *************** *** 354,366 **** --- 382,398 ---- if ((*file=getapty()) < 0) return(-1); + #ifndef atarist ioctl(*file,TIOCREMOTE,0); /* I dunno */ ioctl(0,TIOCGETD,&t_ldisc); + #endif ioctl(0,TIOCGETP,&t_sgttyb); ioctl(0,TIOCGETC,&t_tchars); ioctl(0,TIOCGLTC,&t_ltchars); + #ifndef atarist ioctl(0,TIOCLGET,&t_lflags); + #endif if ((pid=fork()) != 0) { return(pid); *************** *** 395,400 **** --- 427,433 ---- /* set the uid stuff up */ + #ifndef atarist if (geteuid() < 2) { int uid = getuid(); fchmod(fd,0622); *************** *** 408,425 **** dup(fd), dup(fd), dup(fd); close(fd); ! setpgrp(group,group); ioctl(0,TIOCSPGRP,&group); t_ldisc=NTTYDISC; t_sgttyb.sg_flags = ECHO|CRMOD|EVENP|ODDP; ioctl(0,TIOCSETD,&t_ldisc); ioctl(0,TIOCSETP,&t_sgttyb); ioctl(0,TIOCSETC,&t_tchars); ioctl(0,TIOCSLTC,&t_ltchars); ioctl(0,TIOCLSET,&t_lflags); /* add a utmp entry */ --- 441,467 ---- dup(fd), dup(fd), dup(fd); close(fd); ! #else ! Fforce(-1, fd); Fforce(0, fd); Fforce(1, fd); Fforce(2, fd); ! Fclose(fd); ! #endif setpgrp(group,group); ioctl(0,TIOCSPGRP,&group); + #ifndef atarist t_ldisc=NTTYDISC; + #endif t_sgttyb.sg_flags = ECHO|CRMOD|EVENP|ODDP; + #ifndef atarist ioctl(0,TIOCSETD,&t_ldisc); + #endif ioctl(0,TIOCSETP,&t_sgttyb); ioctl(0,TIOCSETC,&t_tchars); ioctl(0,TIOCSLTC,&t_ltchars); + #ifndef atarist ioctl(0,TIOCLSET,&t_lflags); + #endif /* add a utmp entry */ *************** *** 448,453 **** --- 490,508 ---- /* get a complete path name from command */ + #ifdef atarist + char * + get_path(name) + char *name; + { + char *getenv(), *findfile(); + static char *extensions[] = { "ttp", "prg", "tos", 0 }; + + return findfile(name, getenv("PATH"), extensions); + } + + #else /* !atarist */ + static char path[512]; static char start[512]; *************** *** 490,495 **** --- 545,552 ---- return((char *) 0); } } + + #endif /* atarist */ /* change an environment variable */ *** misc/orig/lock.c Fri Sep 29 16:18:34 1989 --- misc/lock.c Wed Sep 19 11:55:50 1990 *************** *** 5,11 **** * on copies, and credit should be given to Bellcore where it is due. * BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM. */ ! /* ************************************************************ *\ /* star-trek lock screen (sau/sdh) */ #include --- 5,12 ---- * on copies, and credit should be given to Bellcore where it is due. * BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM. */ ! ! /* ************************************************************ */ /* star-trek lock screen (sau/sdh) */ #include *************** *** 19,31 **** #define HIGH BIT_HIGH(display) #define NICE 10 struct passwd *pwd, *getpwuid(); struct timeval poll = {0,50000}; struct sgttyb sg,save; char buff[100]; static int dir = 1; ! main() { int read; int pid; --- 20,39 ---- #define HIGH BIT_HIGH(display) #define NICE 10 + #ifdef atarist + char passwd[80]; + struct timeval poll = {1,0}; + #else struct passwd *pwd, *getpwuid(); struct timeval poll = {0,50000}; + #endif struct sgttyb sg,save; char buff[100]; static int dir = 1; ! main(argc, argv) ! int argc; ! char *argv[]; { int read; int pid; *************** *** 38,44 **** --- 46,56 ---- exit(1); } + #ifdef atarist + strcpy(passwd, argv[1] ? argv[1] : ""); + #else pwd = getpwuid(getuid()); + #endif signal(SIGINT,SIG_IGN); signal(SIGHUP,SIG_IGN); *************** *** 56,72 **** bit_blit(display,0,0,WIDE,HIGH,BIT_SET,NULL,0,0); if (NICE > 0) nice(NICE); if ((pid=fork()) == 0) {/* child */ signal(SIGALRM,flop); fly(display); } ! else { while(1) { read = 1; if (select(32,&read,0,0,&poll) && read) { gets(buff); kill(pid,SIGALRM); /* change directions */ if (strcmp(pwd->pw_passwd,crypt(buff,pwd->pw_passwd)) == 0) { stty(0,&save); kill(pid,SIGKILL); while(wait(0)!=pid); --- 68,94 ---- bit_blit(display,0,0,WIDE,HIGH,BIT_SET,NULL,0,0); if (NICE > 0) nice(NICE); + #ifdef atarist + { void _do_fly(); + pid = tfork(_do_fly, display); + } + #else if ((pid=fork()) == 0) {/* child */ signal(SIGALRM,flop); fly(display); } ! else { ! #endif while(1) { read = 1; if (select(32,&read,0,0,&poll) && read) { gets(buff); kill(pid,SIGALRM); /* change directions */ + #ifdef atarist + if (strcmp(passwd,buff) == 0) { + #else if (strcmp(pwd->pw_passwd,crypt(buff,pwd->pw_passwd)) == 0) { + #endif stty(0,&save); kill(pid,SIGKILL); while(wait(0)!=pid); *************** *** 75,81 **** --- 97,105 ---- } } } + #ifndef atarist } + #endif } /* star trek effect */ *************** *** 94,100 **** --- 118,128 ---- #define BG_COLOR 4 /* usually blue */ #define SSIZE 2 /* star size */ #define MAXZ 500 /* maximum z depth */ + #ifdef atarist + #define NSTARS 128 + #else #define NSTARS 256 /* maximum number of stars */ + #endif #define SPEED 6 /* star speed */ #define SCALE (short)7 /* for rotator */ #define COUNT (short)3 /* for rotator */ *************** *** 243,245 **** --- 271,331 ---- { dir = 1-dir; } + + #ifdef atarist + void + _do_fly(display) + BITMAP *display; + { + signal(SIGALRM, flop); + fly(display); + } + + /* + * routines to fork off a thread to do the star flying + */ + + #undef Random + #include + #include + + #define STKSIZE 8192L + + void + _start_thread(b) + BASEPAGE *b; + { + void (*func)(); + long arg; + + func = (void (*)())b->p_dbase; + arg = b->p_dlen; + func(arg); + Pterm0(); + } + + int + tfork(func, arg) + void (*func)(); + long arg; + { + BASEPAGE *b; + int pid; + + b = (BASEPAGE *)Pexec(PE_CBASEPAGE, 0L, "", 0L); + Mshrink(b, STKSIZE); + b->p_tbase = (char *)_start_thread; + b->p_dbase = (char *)func; + b->p_dlen = arg; + pid = Pexec(104, 0L, b, 0L); + return pid; + } + + nice(x) + { + /* we should maybe call the MiNT Pnice() function; but we could get + locked out if someone else has a high priority + */ + } + + #endif /* atarist */ *** misc/orig/mgrmode.c Tue Jan 24 15:58:36 1989 --- misc/mgrmode.c Wed Sep 19 12:06:04 1990 *************** *** 126,131 **** --- 126,143 ---- } + #if __STDC__ + #define CASE(arg) if( EQ(#arg, mode) ) {\ + switch( setclear ) {\ + case SET:\ + m_setmode( M_##arg );\ + return;\ + case CLEAR:\ + m_clearmode( M_##arg );\ + return;\ + }\ + } + #else #define CASE(arg) if( EQ("arg", mode) ) {\ switch( setclear ) {\ case SET:\ *************** *** 136,141 **** --- 148,154 ---- return;\ }\ } + #endif static action( setclear, mode, originalmode ) *** misc/orig/set_emacs.c Thu Jun 8 14:17:12 1989 --- misc/set_emacs.c Thu Sep 27 23:27:40 1990 *************** *** 17,22 **** --- 17,35 ---- #define ENTRY "\'px|mgr|mgr teminal emulator:am:km:li#%d:co#%d:bs:cl=^L:ce=\\Ec:cd=\\EC:cm=\\E%%r%%d,%%dM:cs=\\E%%d,%%d%t:ve=\\Et:al=\\Ea:AL=\\E%%da:DL=\\E%%dd:dl=\\Ed:ic=\\EA:dc=\\EE:ta=^I:up=\\Eu:do=\\Ef:nd=\\Er:ku=\\E[A:kd=\\E[B:kr=\\E[C:kl=\\E[D:so=\\Ei:se=\\En:\'" + #ifdef atarist + char * + getpass(str) + char *str; + { + static char buf[80]; + + fputs(str, stdout); fflush(stdout); + fgets(buf, 80, stdin); + return buf; + } + #endif + main(argc,argv) int argc; char **argv; *************** *** 38,48 **** --- 51,67 ---- sprintf(get,"%c%d%c",ESC,G_WINSIZE,E_GETINFO); sscanf(getpass(get),"%d %d\n",&cols,&rows); + #ifdef atarist + if (b_flag && shell && strcmp(shell+strlen(shell)-2,"sh")!=0) { + #else if (b_flag && shell && strcmp(shell+strlen(shell)-3,"csh")==0) { /* csh */ printf("set noglob;"); + #endif printf("setenv TERMCAP "); printf(ENTRY,rows,cols); + #ifndef atarist printf(";unset noglob\n"); + #endif } else /* /bin/sh */ { *************** *** 51,54 **** --- 70,76 ---- printf(ENTRY,rows,cols); putchar('\n'); } + #ifdef atarist + return 0; + #endif } *** misc/orig/set_termcap.c Tue Mar 21 08:35:58 1989 --- misc/set_termcap.c Thu Sep 27 23:27:40 1990 *************** *** 17,22 **** --- 17,35 ---- #define ENTRY "\'px|mgr|mgr teminal emulator:am:li#%d:co#%d:bs:cl=^L:ce=\\Ec:cd=\\EC:cm=\\E%%r%%d,%%dM:al=\\Ea:dl=\\Ed:ic=\\EA:dc=\\EE:ta=^I:up=\\Eu:do=\\Ef:nd=\\Er:ku=\\E[A:kd=\\E[B:kr=\\E[C:kl=\\E[D:so=\\Ei:se=\\En:vs=\\EV:ve=\\Ev:\'" + #ifdef atarist + char * + getpass(str) + char *str; + { + static char buf[80]; + + fputs(str, stdout); fflush(stdout); + fgets(buf, 80, stdin); + return buf; + } + #endif + main(argc,argv) int argc; char **argv; *************** *** 37,48 **** sprintf(get,"%c%d%c",ESC,G_WINSIZE,E_GETINFO); sscanf(getpass(get),"%d %d\n",&cols,&rows); ! if (b_flag && shell && strcmp(shell+strlen(shell)-3,"csh")==0) { /* csh */ printf("set noglob;"); printf("setenv TERMCAP "); printf(ENTRY,rows,cols); printf(";unset noglob\n"); } else /* /bin/sh */ { --- 50,67 ---- sprintf(get,"%c%d%c",ESC,G_WINSIZE,E_GETINFO); sscanf(getpass(get),"%d %d\n",&cols,&rows); ! ! #ifdef atarist ! if (b_flag && shell && strcmp(shell+strlen(shell)-2,"sh")!=0) { ! #else if (b_flag && shell && strcmp(shell+strlen(shell)-3,"csh")==0) { /* csh */ printf("set noglob;"); + #endif printf("setenv TERMCAP "); printf(ENTRY,rows,cols); + #ifndef atarist printf(";unset noglob\n"); + #endif } else /* /bin/sh */ { *************** *** 51,54 **** --- 70,76 ---- printf(ENTRY,rows,cols); putchar('\n'); } + #ifdef atarist + return 0; + #endif } *** misc/orig/show.c Tue Jan 16 11:18:30 1990 --- misc/show.c Wed Sep 19 10:33:24 1990 *************** *** 40,45 **** --- 40,49 ---- int op = - 1; int clean(); + #ifdef atarist + _binmode(1); + stdin->_flag |= _IOBIN; /* make everything binary mode */ + #endif ckmgrterm( *argv ); /* check arguments */ *************** *** 91,98 **** --- 95,104 ---- m_setup(0); + #ifndef atarist ioctl(fileno(m_termout),TIOCLGET,&mode); mode |= LLITOUT; + #endif signal(SIGINT,clean); signal(SIGTERM,clean); *************** *** 100,106 **** --- 106,114 ---- get_size(&wx,&wy,0,0); get_param(0,0,0,&border); + #ifndef atarist ioctl(fileno(m_termout),TIOCLSET,&mode); + #endif if (op != -1) m_func(op); *************** *** 133,139 **** --- 141,149 ---- clean(n) int n; { + #ifndef atarist mode &= ~LLITOUT; ioctl(fileno(m_termout),TIOCLSET,&mode); + #endif exit(n); } *** tests/orig/half.c Tue Jan 24 15:57:42 1989 --- tests/half.c Mon Sep 17 22:07:16 1990 *************** *** 15,24 **** --- 15,31 ---- #include #include + #ifdef atarist + #define WIDE 300 + #define HIGH 150 + #define X 50 + #define Y 50 + #else #define WIDE 400 #define HIGH 300 #define X 200 #define Y 200 + #endif main(argc,argv) int argc; *************** *** 78,85 **** else if (pid == 0) { /* new shell (child) */ ! /* remove controlling tty */ ioctl(open("/dev/tty",0),TIOCNOTTY,0); /* close all files */ --- 85,106 ---- else if (pid == 0) { /* new shell (child) */ ! #ifdef atarist ! for (i = 3; i < 20; i++) ! close(i); + i = open(name, 2); + if (i < 0) { + perror(name); + _exit(2); + } + dup2(i, -1); + dup2(i, 0); + dup2(i, 1); + dup2(i, 2); + close(i); + #else + /* remove controlling tty */ ioctl(open("/dev/tty",0),TIOCNOTTY,0); /* close all files */ *************** *** 92,98 **** open(name,0); /* stdin */ open(name,1); /* stdout */ open(name,1); /* stderr */ ! /* get our own process group */ group = getpid(); --- 113,120 ---- open(name,0); /* stdin */ open(name,1); /* stdout */ open(name,1); /* stderr */ ! #endif ! /* get our own process group */ group = getpid();