Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ukma!rex!uflorida!haven!umd5!cgs From: cgs@umd5.umd.edu (Chris G. Sylvain) Newsgroups: comp.os.minix Subject: More cm= output formats for v1.3d termcap Keywords: termcap, cm=, cdiff Message-ID: <4970@umd5.umd.edu> Date: 6 Jun 89 00:32:34 GMT Organization: University of Maryland, College Park Lines: 87 Here's a cdiff for lib:termcap.c to add "%." and "%>xy" output formats. My (peculiar) terminals requires the use of the "%>xy" format, and not having "%." seemed to be potentially annoying. Also, "OOPS" really will be output if an unrecognized "%" string appears in the termcap file. ---------cut here--------- *** termcap.c.org Tue Apr 4 20:43:38 1989 --- termcap.c Tue May 23 21:17:02 1989 *************** *** 233,249 **** { register char *rp; static char ret[24]; ! int incr = 0; ! int argno = 0, numval; for (rp = ret ; *cm ; cm++) { switch(*cm) { case '%' : switch(*++cm) { case '+' : numval = (argno == 0 ? destline : destcol); argno = 1 - argno; ! *rp++ = numval + incr + *++cm; break; case '%' : --- 233,268 ---- { register char *rp; static char ret[24]; ! int incr = 0, chkval = 0; ! int argno = 0, numval, addval; for (rp = ret ; *cm ; cm++) { switch(*cm) { case '%' : switch(*++cm) { + case '.' : + numval = (argno == 0 ? destline : destcol); + argno = 1 - argno; + *rp++ = numval + incr; + break; + + case '>' : + chkval = *++cm; + addval = *++cm; + break; + case '+' : numval = (argno == 0 ? destline : destcol); argno = 1 - argno; ! if (chkval > 0) { ! *rp = numval + incr + *++cm; ! if (*rp > chkval) ! *rp += addval; ! rp++; ! chkval = 0; ! } else { ! *rp++ = numval + incr + *++cm; ! } break; case '%' : *************** *** 265,270 **** --- 284,293 ---- case 'r' : argno = 1; break; + + default : + *rp++ = 'O'; *rp++ = 'O'; + *rp++ = 'P'; *rp++ = 'S'; } break; -- --==---==---==-- .. Came whiffling through the tulgey wood, .. ARPA: cgs@umd5.UMD.EDU BITNET: cgs%umd5@umd2 UUCP: ..!uunet!umd5.umd.edu!cgs