⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 paper.ps

📁 早期freebsd实现
💻 PS
📖 第 1 页 / 共 5 页
字号:
(hich is the image of what the programmer)336.04 124.2 R -.1(wa)72 136.2 S .496(nts the terminal to look lik).1 F 2.996(en)-.1 G -.15(ex)204.214 136.2 S 2.996(t. The).15 F .496(user should not access)2.996 F F2(cur)2.996 E(scr)-.1 E F1(directly)2.996 E 5.496(.C)-.65 G .496(hanges should be made)409.472 136.2 R(to the appropriate screen, and then the routine)72 148.2 Q/F3 10/Courier-Bold@0 SF(refresh)2.5 E F1(\(\) \(or)A F3(wrefresh)2.5 E F1(\(\)\) should be called.)A(Man)97 164.4 Q 2.903(yf)-.15 G .402(unctions are set up to deal with)126.413 164.4 R F2(stdscr)2.902 E F1 .402(as a def)2.902 F .402(ault screen.)-.1 F -.15(Fo)5.402 G 2.902(re).15 G .402(xample, to add a character to)386.47 164.4 R F2(stdscr)72 176.4 Q F1 2.76(,o)C.26(ne calls)106.15 176.4 R F3(addch)2.76 E F1 .26(\(\) with the desired character)B 5.26(.I)-.55 G 2.761(fad)293.2 176.4 S(if)311.492 176.4 Q .261(ferent windo)-.25 F 2.761(wi)-.25 G 2.761(st)380.944 176.4S 2.761(ob)390.375 176.4 S 2.761(eu)403.136 176.4 S .261(sed, the routine)415.337 176.4 R F3(wad-)2.761 E(dch)72 190.4 Q F1 .539(\(\) \(for)B F0 -7.218(ww)3.039 G F1(indo)7.218 E(w-specif)-.25 E(ic)-.2 E F3(addch)3.039 E F1 .539(\(\)\) is pro)B(vided)-.15 E/F4 7/Times-Roman@0 SF(1)275.106 186.4 Q F1 5.538(.T)278.606 190.4 S .538(his con)292.754 190.4 R -.15(ve)-.4 G .538(ntion of prepending function names with a).15 F<99>72 202.4 Q F0 -7.218(ww)CF1 2.887<9a77>7.218 G .387(hen the)98.209 202.4 R 2.887(ya)-.15 G .388(re to be applied to specif)139.933 202.4 R .388(ic windo)-.2 F .388(ws is consistent.)-.25 F .388(The only routines which do)5.388 F F2(not)2.888E F1 .388(do this)2.888 F(are those to which a windo)72 214.4 Q 2.5(wm)-.25 G(ust al)196.73 214.4 Q -.1(wa)-.1 G(ys be specif).1 E(ied.)-.2 E .815(In order to mo)97 230.6 R 1.115 -.15(ve t)-.15 H .815(he current \(y).15 F 2.5(,x)-.65 G 3.315(\)c)234.24 230.6 S .815(o-ordinates from one point to another)245.325 230.6 R 3.315(,t)-.4 G .815(he routines)407.295 230.6 R F3(move)3.315 EF1 .815(\(\) and)B F3(wmove)72 242.6 Q F1 .722(\(\) are pro)B 3.222(vided. Ho)-.15 F(we)-.25 E -.15(ve)-.25 G 1.522 -.4(r, i).15 H 3.222(ti).4 G 3.222(so)223.82 242.6 S .722(ften desirable to f)235.932 242.6 R .723(irst mo)-.2 F1.023 -.15(ve a)-.15 H .723(nd then perform some I/O operation.).15 F .695(In order to a)72 254.6 R -.2(vo)-.2 G .695(id clumsiness, most I/O routines can be preceded by the pref).2 F .695(ix \231)-.2 F F0 -8.328(mm)C -4.998(vv)8.328 G F1 3.194<9a61>4.998 G .694(nd the desired \(y)422.308 254.6 R 2.5(,x)-.65 G(\))500.67 254.6 Q(co-ordinates can then be added to the ar)72 266.6 Q(guments to the function.)-.18 E -.15(Fo)5 G 2.5(re).15 G(xample, the calls)353.69 266.6 Q(mo)112 282.8 Q-.15(ve)-.15 G(\(y).15 E 2.5(,x)-.65 G(\);)151.6 282.8 Q(addch\(ch\);)112 294.8Q(can be replaced by)72 311 Q(mv)112 327.2 Q(addch\(y)-.25 E 2.5(,x)-.65 G 2.5(,c)166.09 327.2 S(h\);)175.53 327.2 Q(and)72 343.4 Q(wmo)112 359.6 Q -.15(ve)-.15 G(\(win, y).15 E 2.5(,x)-.65 G(\);)178.82 359.6 Q -.1(wa)112 371.6 S(ddch\(win, ch\);).1 E(can be replaced by)72 387.8 Q(mvw)112 404 Q(addch\(win, y)-.1 E 2.5(,x)-.65 G 2.5(,c)193.46 404 S(h\);)202.9 404 Q 1.086(Note that the windo)72 420.2 R 3.586(wd)-.25 G 1.086(escription pointer \()169.974 420.2 R F2(win)A F1 3.586(\)c)C 1.086(omes before the added \(y)274.052420.2 R 2.5(,x)-.65 G 3.586(\)c)388.826 420.2 S 3.586(o-ordinates. If)400.182420.2 R 3.586(aw)3.586 G(indo)479.25 420.2 Q(w)-.25 E(pointer is needed, it is al)72 432.2 Q -.1(wa)-.1 G(ys the f).1 E(irst parameter passed.)-.2 E F0 -4.998(22)72 456.2 S 7.496 -2.498(.. V)4.998 H-.92(Va)84.506 456.2 S(ar)90.808 456.2 Q(ri)95.81 456.2 Q(ia)100.252 456.2 Q(ab)103.034 456.2 Q(bl)108.036 456.2 Q(le)113.598 456.2 Q(es)116.38 456.2 Q(s)120.822 456.2 Q F1(Man)97 472.4 Q 2.64(yv)-.15 G .139(ariables which are used to describe the terminal en)127.57 472.4 R .139(vironment are a)-.4 F -.25(va)-.2 G .139(ilable to the programmer).25 F(.)-.55E(The)72 484.4 Q 2.5(ya)-.15 G(re:)99.34 484.4 Q 61.28(type name)112 504.8 R(description)254 504.8 Q .4 LW 504 509.3 112 509.3 DL(WINDO)112 518.8 Q(W)-.35E/F5 10/Symbol SF(*)2.5 E F1(curscr)193 518.8 Q(current v)254 518.8 Q(ersion of the screen \(terminal screen\).)-.15 E(WINDO)112 530.8 Q(W)-.35 E F5(*)2.5 E F1(stdscr)193 530.8 Q(standard screen.)254 530.8 Q(Most updates are usually done here.)5 E(char)112 542.8 Q F5(*)2.5 E F1(Def)193542.8 Q F5(-)207.99 547.8 Q F1(term)213.48 542.8 Q(def)254 542.8 Q(ault terminal type if type cannot be determined)-.1 E 60.72(bool My)112 554.8R F5(-)206.89 559.8 Q F1(term)212.38 554.8 Q .698(use the terminal specif)254554.8 R .699(ication in)-.2 F F2(Def)3.199 E F5(-)401.993 559.8 Q F2(term)407.483 554.8 Q F1 .699(as terminal, irrele-)3.199 F -.25(va)254 566.8 S(nt of real terminal type).25 E(char)112 578.8 Q F5(*)2.5 E F1(ttytype)193578.8 Q(full name of the current terminal.)254 578.8 Q 67.94(int LINES)112590.8 R(number of lines on the terminal)254 590.8 Q 67.94(int COLS)112 602.8 R(number of columns on the terminal)254 602.8 Q 67.94(int ERR)112 614.8 R(error flag returned by routines on a f)254 614.8 Q(ail.)-.1 E 67.94(int OK)112626.8 R(flag returned by routines upon success.)254 626.8 Q F0 -4.998(33)72651.4 S 7.496 -2.498(.. U)4.998 H(Us)84.506 651.4 Q(sa)91.728 651.4 Q(ag)95.62651.4 Q(ge)100.622 651.4 Q(e)105.624 651.4 Q F1 .314(This is a description of ho)97 667.6 R 2.814(wt)-.25 G 2.814(oa)215.294 667.6S .314(ctually use the screen package.)227.548 667.6 R -.15(Fo)5.313 G 2.813(rs).15 G(implicity)378.128 667.6 Q 2.813(,w)-.65 G 2.813(ea)426.131 667.6 S.313(ssume all updat-)437.824 667.6 R(ing, reading, etc.)72 679.6 Q(is applied to)5 E F2(stdscr)2.5 E F1 2.5(,a)C(lthough a dif)228.65 679.6 Q(ferent windo)-.25 E 2.5(wc)-.25 G(an of course be specif)344.24 679.6 Q(ied.)-.2 E .32 LW 76 689.2 72 689.2 DL 80 689.2 76 689.2 DL 84 689.2 80 689.2 DL 88689.2 84 689.2 DL 92 689.2 88 689.2 DL 96 689.2 92 689.2 DL 100 689.2 96 689.2DL 104 689.2 100 689.2 DL 108 689.2 104 689.2 DL 112 689.2 108 689.2 DL 116689.2 112 689.2 DL 120 689.2 116 689.2 DL 124 689.2 120 689.2 DL 128 689.2 124689.2 DL 132 689.2 128 689.2 DL 136 689.2 132 689.2 DL 140 689.2 136 689.2 DL144 689.2 140 689.2 DL 148 689.2 144 689.2 DL 152 689.2 148 689.2 DL 156 689.2152 689.2 DL 160 689.2 156 689.2 DL 164 689.2 160 689.2 DL 168 689.2 164 689.2DL 172 689.2 168 689.2 DL 176 689.2 172 689.2 DL 180 689.2 176 689.2 DL 184689.2 180 689.2 DL 188 689.2 184 689.2 DL 192 689.2 188 689.2 DL 196 689.2 192689.2 DL 200 689.2 196 689.2 DL 204 689.2 200 689.2 DL 208 689.2 204 689.2 DL212 689.2 208 689.2 DL 216 689.2 212 689.2 DL/F6 5/Times-Roman@0 SF(1)93.6699.6 Q/F7 8/Times-Roman@0 SF(Actually)2 3.2 M(,)-.52 E/F8 8/Courier-Bold@0 SF(addch)2 E F7(\(\) is really a \231#def)A(ine\232 macro with ar)-.16 E(guments, as are most of the "functions" which act upon)-.144 E/F9 8/Times-Italic@0 SF(stdscr)2 E F7(.)A EP%%Page: 5 4%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Bold@0 SF -5.558(SS)72 60 S -4.438(cc)5.558 G 6.196 -4.438(rr ee)4.438 H -4.438(ee)4.438 G 11.116 -5.558(nn P)4.438 H -.1(Pa)-.55 G(ac)109.22660 Q(ck)114.228 60 Q(ka)118.67 60 Q(ag)124.232 60 Q(ge)129.234 60 Q 326.978(eP)134.236 60 S(PS)465.656 60 Q(S1)471.768 60 Q(1:)477.33 60 Q(:1)482.332 60 Q(19)485.664 60 Q(9-)490.666 60 Q(-5)495.668 60 Q(5)499 60 Q -4.998(33)72 96 S-2.498(..)4.998 G -4.998(11)2.498 G 7.496 -2.498(.. I)4.998 H(In)-1.39 E(ni)95.902 96 Q(it)101.464 96 Q(ti)104.246 96 Q(ia)107.578 96 Q(al)110.36 96 Q(li)115.362 96 Q(iz)118.144 96 Q(za)120.926 96 Q(at)125.368 96 Q(ti)130.37 96 Q(io)133.702 96 Q(on)136.484 96 Q(n)141.486 96 Q/F1 10/Times-Roman@0 SF 1.211(In order to use the screen package, the routines must kno)97 112.2 R 3.712(wa)-.25 G 1.212(bout terminal characteristics, and the)351.682 112.2 R 1.364(space for)72 124.2 R/F2 10/Times-Italic@0 SF(cur)3.864 E(scr)-.1 E F1(and)3.864 E F2(stdscr)3.864 E F1 1.364(must be allocated.)3.864 F 1.364(These functions are performed by)6.364 F/F3 10/Courier-Bold@0 SF(initscr)3.864E F1 3.864(\(\). Since)B(it)3.864 E 1.009(must allocate space for the windo)72136.2 R 1.009(ws, it can o)-.25 F -.15(ve)-.15 G(rflo).15 E 3.509(wc)-.25 G1.009(ore when attempting to do so.)298.009 136.2 R 1.009(On this rather rare)6.009 F(occasion,)72 148.2 Q F3(initscr)3.392 E F1 .892(\(\) returns ERR.)B F3(Initscr)5.892 E F1 .892(\(\) must)B/F4 10/Times-BoldItalic@0 SF(alw)3.392 E(ays)-.1 E F1 .891(be called before an)3.391 F 3.391(yo)-.15 G 3.391(ft)421.617148.2 S .891(he routines which)431.118 148.2 R(af)72 160.2 Q .34(fect windo)-.25 F .34(ws are used.)-.25 F .34(If it is not, the program will core dump as soon as either)5.34 F F2(cur)2.84E(scr)-.1 E F1(or)2.84 E F2(stdscr)2.84 E F1 .34(are ref-)2.84 F 3.65(erenced. Ho)72 172.2 R(we)-.25 E -.15(ve)-.25 G 1.95 -.4(r, i).15 H 3.65(ti).4G 3.65(su)165.48 172.2 S 1.15(sually best to w)178.02 172.2 R 1.15(ait to call it until after you are sure you will need it, lik)-.1 F 3.65(ea)-.1 G(fter)490.12 172.2 Q 1.102(checking for startup errors.)72 184.2 R -.7(Te)6.102 G 1.102(rminal status changing routines lik).7 F(e)-.1 E F3(nl)3.602 E F11.102(\(\) and)B F3(cbreak)3.602 E F1 1.103(\(\) should be called)B(after)72196.2 Q F3(initscr)2.5 E F1(\(\).)A .68(After the initial windo)97 212.4 R3.179(wa)-.25 G .679(llocation done by)202.789 212.4 R F3(initscr)3.179 E F1.679(\(\), specif)B .679(ic windo)-.2 F 3.179(wc)-.25 G .679(haracteristics can be set.)404.773 212.4 R .834(Scrolling can be enabled by calling)72 224.4 R F3(scrollok)3.334 E F1 3.334(\(\). If)B .834(you w)3.334 F .835(ant the cursor to be left after the last change,)-.1 F(use)72 236.4 Q F3(leaveok)3.767 E F1 3.767(\(\). If)B 1.267(this isn')3.767 F 3.767(td)-.18 G(one,)201.535 236.4 Q F3(refresh)3.767 E F1 1.267(\(\) will mo)B 1.567 -.15(ve t)-.15 H 1.267(he cursor to the windo).15 F(w')-.25 E 3.767(sc)-.55 G 1.266(urrent \(y)438.808 236.4 R 2.5(,x)-.65 G 3.766(\)c)484.134 236.4 S(o-)495.67236.4 Q .061(ordinates after updating it.)72 248.4 R .061(Additional windo)5.061 F .061(ws can be created by using the functions)-.25 F F3(newwin)2.562 EF1 .062(\(\) and)B F3(sub-)2.562 E(win)72 260.4 Q F1(\(\).)A F3(Delwin)5.806 EF1 .806(\(\) allo)B .806(ws you to delete an e)-.25 F .806(xisiting windo)-.15F 4.606 -.65(w. T)-.25 H .806(he v).65 F(ariables)-.25 E F2(LINES)3.306 E F1(and)3.306 E F2(COLS)3.306 E F1 .806(control the)3.306 F 1.012(size of the terminal.)72 272.4 R(The)6.012 E 3.512(ya)-.15 G 1.012(re initially implicitly set by)188.83 272.4 R F3(initscr)3.512 E F1 1.012(\(\), b)B 1.013(ut can be altered e)-.2 F 1.013(xplicitly by the)-.15 F .723(user follo)72 284.4 R .723(wed by a call to)-.25 F F3(initscr)3.223 E F1 3.223(\(\). Note)B .723(that an)3.223 F 3.223(yc)-.15 G .723(all to)299.68 284.4 RF3(initscr)3.223 E F1 .723(\(\), will al)B -.1(wa)-.1 G .723(ys delete an).1 F3.222(ye)-.15 G(xisting)476.77 284.4 Q F2(stdscr)72 296.4 Q F1(and/or)5.142 EF2(cur)5.142 E(scr)-.1 E F1 2.642(before creating ne)5.142 F 5.142(wo)-.25 G2.643(nes so this change is best done before the initial call to)256.902 296.4R F3(initscr)72 308.4 Q F1(\(\).)A F0 -4.998(33)72 324.6 S -2.498(..)4.998 G-4.998(22)2.498 G 7.496 -2.498(.. O)4.998 H(Ou)92.01 324.6 Q(ut)99.792 324.6 Q(tp)105.354 324.6 Q(pu)108.686 324.6 Q(ut)114.248 324.6 Q(t)119.81 324.6 Q F1.763(The basic functions used to change what will go on a windo)97 340.8 R3.263(wa)-.25 G(re)359.758 340.8 Q F3(addch)3.263 E F1 .763(\(\) and)B F3(move)3.263 E F1(\(\).)A F3(Addch)5.763 E F1(\(\))A .585(adds a character at the current \(y)72 352.8 R 2.5(,x)-.65 G 3.085(\)c)215.36352.8 S .585(o-ordinates, returning ERR if it w)226.215 352.8 R .586(ould cause the windo)-.1 F 3.086(wt)-.25 G 3.086(oi)463.334 352.8 S(lle)474.2352.8 Q -.05(ga)-.15 G(lly).05 E(scroll,)72 364.8 Q F2(i.e)3.315 E(.)-.15 E F13.315(,p)C .815(rinting a character in the lo)122.92 364.8 R .815(wer right-hand corner of a terminal which automatically scrolls if)-.25 F .575(scrolling is not allo)72 376.8 R(wed.)-.25 E F3(Move)5.575 E F1 .575(\(\) changes the current \(y)B 2.5(,x)-.65 G 3.075(\)c)308.55 376.8 S .575(o-ordinates to whate)319.395 376.8 R -.15(ve)-.25 G 3.075(ry).15 G .575(ou w)422.64 376.8 R .575(ant them to be.)-.1 F 1.258(It returns ERR if you try to mo)72 388.8 R 1.557 -.15(ve o)-.15 H 1.757 -.25(ff t).15 H 1.257(he windo).25 F 5.057 -.65(w. A)-.25 H 3.757(sm).65 G 1.257(entioned abo)311.181 388.8 R -.15(ve)-.15 G 3.757(,y).15 G 1.257(ou can combine the tw)384.215 388.8 R 3.757(oi)-.1 G(nto)491.22 388.8 Q F3(mvaddch)72 400.8 Q F1(\(\) to do both things in one call.)A .394(The other output functions \(such as)97 417 R F3(addstr)2.894 E F1 .394(\(\) and)B F3(printw)2.894 E F1 .394(\(\)\) all call)B F3(addch)2.894 E F1.394(\(\) to add characters to)B(the windo)72 429 Q -.65(w.)-.25 G .194(After a change has been made to the windo)97 445.2 R 1.494 -.65(w, y)-.25 H.193(ou must call).65 F F3(refresh)2.693 E F1 2.693(\(\). when)B .193(you w)2.693 F .193(ant the portion)-.1 F 2.381(of the terminal co)72 457.2 R -.15(ve)-.15 G 2.382(red by the windo).15 F 4.882(wt)-.25 G 4.882(or)248.372 457.2 S2.382(eflect the change.)261.584 457.2 R 2.382(In order to optimize f)7.382 F2.382(inding changes,)-.2 F F3(refresh)72 469.2 Q F1 .006(\(\) assumes that an)B 2.506(yp)-.15 G .006(art of the windo)198.304 469.2 R 2.506(wn)-.25 G .006(ot changed since the last)276.398 469.2 R F3(refresh)2.506 E F1 .006(\(\) of that windo)B 2.505(wh)-.25 G(as)495.67 469.2 Q .049(not been changed on the terminal,)72 481.2 R F2(i.e)2.549 E(.)-.15 E F1 2.549(,t)C .049(hat you ha)230.223 481.2 R .349 -.15(ve n)-.2 H .05(ot refreshed a portion of the terminal with an o).15 F -.15(ve)-.15 G(rlap-).15 E .025(ping windo)72 493.2 R 3.825 -.65(w. I)-.25 H 2.525(ft).65 G .024(his is not the case, the routines)143.115 493.2 R F3(touchwin)2.524 E F1(\(\),)A F3(touchline)2.524 E F1 .024(\(\), and)B F3(touchoverlap)2.524 E F1.024(\(\) are)B(pro)72 505.2 Q .083(vided to mak)-.15 F 2.584(ei)-.1 G 2.584(tl)147.27 505.2 S .084(ook lik)155.414 505.2 R 2.584(ead)-.1 G .084(esired part of windo)202.506 505.2 R 2.584(wh)-.25 G .084(as been changed, thus forcing)297.572 505.2 R F3(refresh)2.584 E F1 .084(\(\) to check)B(that whole subsection of the terminal for changes.)72 517.2 Q.695(If you call)97 533.4 R F3(wrefresh)3.195 E F1 .695(\(\) with)B F2(cur)3.195 E(scr)-.1 E F1 3.195(,i)C 3.195(tw)255.44 533.4 S .695(ill mak)268.635533.4 R 3.194(et)-.1 G .694(he screen look lik)307.704 533.4 R 3.194(et)-.1 G.694(he image of)390.92 533.4 R F2(cur)3.194 E(scr)-.1 E F1 5.694(.T)C .694(his is)482.466 533.4 R(useful for implementing a command which w)72 545.4 Q(ould redra)-.1 E 2.5(wt)-.15 G(he screen in case it got messed up.)307.27545.4 Q F0 -4.998(33)72 569.4 S -2.498(..)4.998 G -4.998(33)2.498 G 7.496-2.498(.. I)4.998 H(In)-1.39 E(np)95.902 569.4 Q(pu)101.464 569.4 Q(ut)107.026569.4 Q(t)112.588 569.4 Q F1 .701(Input is essentially a mirror image of output.)97 585.6 R .702(The complementary function to)5.701 F F3(addch)3.202 E F1 .702(\(\) is)B F3(getch)3.202 E F1(\(\))A .051(which, if echo is set, will call)72 597.6 R F3(addch)2.551 E F1 .051(\(\) to echo the character)B 5.05(.S)-.55 G .05

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -