📄 getttyen.3
字号:
%!PS-Adobe-1.0%%Creator: devps (Pipeline Associates, Inc.)%%CreationDate: Fri Sep 13 13:06:49 1996%%Pages: (atend)%%DocumentFonts: (atend)/devps 180 dict def devps begin/res 10.000000 def/y_offset 843 def/X{exch}bind def/mm {transform round X round X itransform} bind def/r{rmoveto}bind def/m{moveto}bind def/l{lineto}bind def/rl{rlineto}bind def/st{stroke}bind def/gs{gsave}bind def/gr{grestore}bind def/cp{currentpoint}bind def/np{newpath}bind def/ct{curveto}bind defsystemdict /setpacking known { /savepacking currentpacking def true setpacking } if/m0{0 0 moveto}bind def/xc{//res div}bind def/yc{//res neg div //y_offset add}bind def/lc{yc X xc X l st}bind def/mc{yc X xc X m}bind def/el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}bind def/ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}bind def/sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}bind def/V{//res neg div //y_offset addcurrentpoint pop Xm}bind def/H{//res div0 transform X round X itransform popcurrentpoint X popmoveto}bind def/h{//res div 0 r}bind def/v{//res neg div 0 X r}bind def/S{X H show}bind def/A{H //res div 1 index stringwidth pop sub 1 index length div 0 3 2 roll ashow}bind def/psize 10 def/height 0 def/cheight { height 0 ne { height } { psize } ifelse } bind def/slant 0 def/FF{findfont X dup 30 div 0 mm pop setlinewidth /psize X def [psize 0 cheight slant sin slant cos div mul cheight 0 0] makefont setfont}bind def/shade{gs /dy X def /dx X def np m 0 /dy rl /dx 0 rl 0 /dy neg rl /dx neg 0 rl closepath .9 setgray fillgr}bind def1 setlinecap/resolution res 72 mul def/startFig { /SavedState save def userdict maxlength dict begin currentpoint transform DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix itransform moveto /ury exch def /urx exch def /lly exch def /llx exch def /y exch 72 mul resolution div def /x exch 72 mul resolution div def currentpoint /cy exch def /cx exch def /sx x urx llx sub div def /sy y ury lly sub div def sx sy scale cx sx div llx sub cy sy div ury sub translate /DefFigCTM matrix currentmatrix def /initmatrix { DefFigCTM setmatrix } def /defaultmatrix { DefFigCTM exch copy } def /initgraphics { DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix DefFigCTM setmatrix } def /showpage { initgraphics } def}bind def/clipFig { currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll exch lineto exch lineto exch lineto closepath clip newpath moveto}bind def/doclip { llx lly urx ury clipFig } def/endFig { end SavedState restore}bind def/globalstart { fontnum psize slant height resolution currentpoint pagesave restore gsave }bind def/globalend { grestore moveto /resolution exch def /height exch def /slant exch def /psize exch def /fontnum exch def F /pagesave save def}bind def/fontnum 1 def systemdict /setpacking known { savepacking setpacking} ifend/BP{save mark devps begin m0/DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecapcurrentlinejoin currentdash currentgray currentmiterlimit ] cvx def}bind def/EP{end cleartomark restore showpage}def/Encoding-1 256 array def0 1 255 {Encoding-1 exch /.notdef put} forEncoding-1 8#301 StandardEncoding 8#101 26 getinterval putinterval %A-BEncoding-1 8#341 StandardEncoding 8#141 26 getinterval putinterval %a-bEncoding-1 8#241 StandardEncoding 8#301 16 getinterval putinterval %accentsEncoding-1 8#373 StandardEncoding 8#365 1 getinterval putinterval %dotlessiEncoding-1dup 8#41 /copyright putdup 8#42 /registered putdup 8#43 /trademark putdup 8#44 /logicalnot putdup 8#45 /Eth putdup 8#46 /eth putdup 8#47 /Thorn putdup 8#50 /thorn putdup 8#51 /brokenbar putdup 8#52 /degree putdup 8#53 /divide putdup 8#54 /multiply putdup 8#55 /minus putdup 8#56 /onehalf putdup 8#57 /onequarter putdup 8#60 /threequarters putdup 8#101 /Aacute putdup 8#102 /Acircumflex putdup 8#103 /Adieresis putdup 8#104 /Agrave putdup 8#105 /Aring putdup 8#106 /Atilde putdup 8#107 /Ccedilla putdup 8#110 /Eacute putdup 8#111 /Ecircumflex putdup 8#112 /Edieresis putdup 8#113 /Egrave putdup 8#114 /Iacute putdup 8#115 /Icircumflex putdup 8#116 /Idieresis putdup 8#117 /Igrave putdup 8#120 /Ntilde putdup 8#121 /Oacute putdup 8#122 /Ocircumflex putdup 8#123 /Odieresis putdup 8#124 /Ograve putdup 8#125 /Otilde putdup 8#126 /Scaron putdup 8#127 /Uacute putdup 8#130 /Ucircumflex putdup 8#131 /Udieresis putdup 8#132 /Ugrave putdup 8#133 /Ydieresis putdup 8#134 /Zcaron putdup 8#135 /aacute putdup 8#136 /acircumflex putdup 8#137 /adieresis putdup 8#140 /agrave putdup 8#141 /aring putdup 8#142 /atilde putdup 8#143 /ccedilla putdup 8#144 /eacute putdup 8#145 /ecircumflex putdup 8#146 /edieresis putdup 8#147 /egrave putdup 8#150 /iacute putdup 8#151 /icircumflex putdup 8#152 /idieresis putdup 8#153 /igrave putdup 8#154 /ntilde putdup 8#155 /oacute putdup 8#156 /ocircumflex putdup 8#157 /odieresis putdup 8#160 /ograve putdup 8#161 /otilde putdup 8#162 /scaron putdup 8#163 /uacute putdup 8#164 /ucircumflex putdup 8#165 /udieresis putdup 8#166 /ugrave putdup 8#167 /ydieresis putdup 8#170 /zcaron putpop/Enc-dict 30 dict defEnc-dict /tmpstr1 50 string putEnc-dict /tmpstr2 50 string putEnc-dict /tmpstr3 50 string dup (Encoding-) exch cvs pop put/AEnc-def { % arguments: the original font's name, encoding nrEnc-dict begintmpstr2 cvs /Enc-no exch def % Remember the number in a stringdup /OrigName exch def % remember the namefindfont dup maxlength dict /newdict exch def % get dictionary for new font{ exch dup /FID ne { exch newdict 3 1 roll put } { pop pop } % Ignore FID ifelse} forallnewdict begin/Encoding tmpstr3 9 Enc-no putinterval tmpstr3 0 9 Enc-no length add getinterval cvn load def % Replace encodingcurrentdict /UniqueID known{ /UniqueID UniqueID Enc-no cvi 49999 mul add def } if % Derive New UniqueIDend % newdict/FNlength OrigName tmpstr1 cvs length def % convert name, remember lengthFNlength 1 add Enc-no length add stringdup 0 OrigName tmpstr1 cvs putintervaldup FNlength (-) putintervaldup FNlength 1 add Enc-no putintervaldup 0 tmpstr1 0 FNlength getinterval putinterval % Add old namecvn dup newdict /FontName 3 2 roll put newdict definefontend % Enc-dict} def/Times-Roman 1 AEnc-def pop/R-1{/Times-Roman-1 FF}def/R{/Times-Roman FF}def/B{/Times-Bold FF}def/I{/Times-Italic FF}def%%EndProlog%%Page: 1 1BP/slant 0 def/height 0 def480 V10 R(GETTTYENT)591 720 A1319(\()S1361(3)S1419(\))S2696(Eighth)S(Edition)296 2989 A(GETTTYENT)591 4528 A5127(\()S5169(3)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R(getttyent,)377 1080 A(getttynam,)427 1482 A(setttyent,)366 1934 A2325(endttyent)S10 R-12724(-)S10 R(interface)354 2806 A3185(to)S(/etc/ttytab)403 3288 A1248 V9 R720(S)S722(SY)S774(YN)S842(NO)S910(OP)S978(PS)S1030(SI)S1082(IS)S1115(S)S1368 V10 B1080(#include)S1482(<ttyent.h>)S1608 V1080(struct)S1371(ttyent)S(*getttyent\(void\))684 1662 A1728 V1080(struct)S1371(ttyent)S(*getttynam\(const)745 1662 A2445(char)S2679(*)S10 I2729(name)S10 B2947(\))S1848 V1080(int)S(setttyent\(void\))623 1236 A1968 V1080(void)S1302(endttyent\(void\))S2136 V9 R720(D)S722(DE)S790(ES)S848(SC)S900(CR)S962(RI)S1024(IP)S1057(PT)S1109(TI)S1167(IO)S1200(ON)S1268(N)S2256 V10 R1080(The)S10 B(getttyent)382 1262 A10 R1669(functions)S2068(provide)S2400(an)S(interface)354 2520 A2899(to)S3002(the)S(/etc/ttytab.)428 3150 A3628(\(See)S10 B3833(ttytab)S10 R4091(\(5\)\).)S2424 V1080(To)S1218(read)S1419(one)S1591(of)S1702(these)S1936(\256les)S2131(one)S2303(calls)S10 B(getttyent\(\))450 2515 A10 R2992(several)S3305(times)S3550(to)S3655(read)S3856(the)S4006(entries)S4302(in)S4407(the)S4557(table)S(until)184 4780 A4991(NULL)S2544 V1080(is)S1172(returned)S1533(for)S1676(end-of-\256le.)S2712 V10 B(Getttyname\(\))578 1080 A10 R1690(searches)S2064(the)S10 B2219(ttytab)S10 R2509(\256le)S2671(for)S2822(the)S2978(given)S3234(terminal)S3603(device.)S3949(It)S4044(is)S4144(equivalent)S4596(to)S4707(a)S4785(call)S4964(to)S10 B(sett-)186 5075 A2832 V(tyent\(\),)312 1080 A10 R1417(several)S1728(calls)S1938(to)S10 B(getttyent\(\))450 2041 A10 R2516(to)S2619(locate)S2885(the)S3033(entry,)S3290(and)S3460(a)S3530(\256nal)S10 B(endttyent\(\))478 3734 A10 R4237(to)S4340(close)S4572(the)S4720(\256le.)S3000 V10 B(Setttyent\(\))456 1080 A10 R1562(opens)S1822(or)S1932(rewinds)S2277(the)S2426(ttytab)S2681(database,)S3079(and)S10 B(endttyent\(\))478 3251 A3756(closes)S4029(it.)S(Getttyent\(\))478 4143 A10 R4648(opens)S4909(the)S5059(data-)S3120 V1080(base)S1284(if)S1371(not)S1524(already)S1846(open,)S2091(but)S2244(does)S2453(not)S2606(close)S2838(it.)S3288 V1080(The)S1262(struct)S1511(ttyent)S1765(is)S1857(de\256ned)S2178(by)S2303(<ttyent.h>)S2746(as)S2855(follows:)S3528 V1080(struct)S1329(ttyent)S1583({)S3648 V1280(char)S(*ty_name;)424 1580 A2330(/*)S2433(Name)S2699(of)S2808(the)S2956(terminal)S3317(device.)S3630(*/)S3768 V1280(char)S1580(*ty_type;)S2330(/*)S2433(Terminal)S2828(type)S3026(name)S3269(\(termcap\(3\)\).)S3830(*/)S3888 V1280(char)S(**ty_getty;)457 1580 A2330(/*)S2433(Program)S2805(to)S2908(run,)S3092(normally)S3480(getty.)S3731(*/)S4008 V1280(char)S(**ty_init;)390 1580 A2330(/*)S(Initialization)515 2433 A2973(command,)S3419(normally)S3807(stty.)S4002(*/)S4128 V1080(};)S4296 V1080(A)S1179(valid)S1406(entry)S1639(has)S1799(at)S1898(least)S2109(two)S2286(strings,)S2605(so)S2720(both)S10 B2924(ty_name)S10 R3319(and)S10 B3490(ty_type)S10 R3835(are)S3985(\256lled)S4219(in.)S4374(The)S4558(optional)S10 B(ty_getty)347 4914 A4416 V10 R1080(and)S10 B1254(ty_init)S10 R1563(may)S1765(be)S1889(NULL)S2188(\(\256eld)S(omitted\),)366 2430 A2825(point)S3060(to)S3167(a)S3241(pointer)S3555(that)S3735(is)S3830(NULL)S4128(\(null)S(lenght)251 4346 A4625(\256eld,)S4857(i.e.)S5008(""\),)S5177(or)S4536 V1080(an)S1207(array)S1447(of)S1563(strings)S1863(terminated)S2326(by)S2459(a)S2537(NULL)S2840(\(\256eld)S3086(present\).)S3494(For)S3667(now)S3873(no)S4006(useful)S4285(distinction)S4742(can)S4915(be)S5043(made)S4656 V1080(between)S1441(a)S(omitted)307 1511 A1843(\256eld)S2047(and)S2217(an)S2337(empty)S2613(\256eld,)S2842(so)S2956(treat)S3161(both)S3364(cases)S3602(as)S3711(an)S3831(omission.)S4824 V9 R720(F)S722(FI)S774(IL)S807(LE)S865(ES)S923(S)S4944 V10 B1080(/etc/ttytab)S10 R1830(The)S2012(terminal)S2373(device)S2661(database)S5112 V9 R720(S)S722(SE)S774(EE)S832(E)S913(A)S915(AL)S983(LS)S1041(SO)S1093(O)S5232 V10 B1080(ttyname)S10 R1433(\(3\),)S10 B1601(ttyslot)S10 R1870(\(3\),)S10 B2038(ttytab)S10 R2296(\(5\),)S10 B2464(init)S10 R2610(\(8\).)S5400 V9 R720(D)S722(DI)S790(IA)S823(AG)S891(GN)S959(NO)S1027(OS)S1095(ST)S1147(TI)S1205(IC)S1238(CS)S1300(S)S5520 V10 B(Setttyent\(\))456 1080 A10 R1564(has)S1726(the)S1877(same)S2112(return)S2381(value)S2627(and)S2801(error)S3027(codes)S3285(as)S3398(the)S10 B3550(open)S10 R3757(\(2\))S3904(call)S4079(it)S4164(uses)S4366(to)S4473(open)S4697(the)S4849(ttytab)S5107(\256le.)S5640 V1080(The)S10 B1273(get)S10 I(xxx)135 1402 A10 B1545(\(\))S10 R1649(functions)S2059(return)S2336(NULL)S2642(on)S2778(end)S2959(of)S3079(\256le,)S3269(entry)S3512(not)S(found,)259 3676 A3971(or)S4091(error.)S4374(You)S4583(can)S4759(set)S10 B(errno)241 4907 A10 R5183(to)S5760 V1080(zero)S1279(before)S1562(the)S1710(call)S1881(and)S2051(check)S2311(it)S2392(after.)S5928 V9 R720(N)S722(NO)S790(OT)S858(TE)S916(ES)S974(S)S6048 V10 B(Getttyent\(\))478 1080 A10 R1583(and)S10 B(getttynam\(\))505 1753 A10 R2283(return)S2549(a)S2619(pointer)S2929(to)S3032(static)S3270(storage)S3586(that)S3762(is)S(overwritten)465 3854 A4344(in)S(each)185 4447 A4657(call.)S6216 V1080(The)S1263(Minix)S10 B1534(struct)S1813(ttyent)S10 R2092(has)S2252(only)S2456(the)S10 B2605(ty_name)S10 R3000(and)S10 B3172(ty_type)S10 R3518(\256elds)S3763(in)S3868(common)S4246(with)S4452(the)S4602(BSD)S4825(implemen-)S6336 V1080(tation.)S1387(This)S1594(does)S1806(not)S1962(seem)S2197(to)S2303(be)S2426(a)S2499(problem,)S(because)319 2887 A3234(most)S3457(third)S3675(party)S3910(software)S4286(that)S4465(need)S4683(to)S(know)223 4788 A(about)223 5038 A6456 V1080(terminals)S1480(only)S(look)178 1683 A1886(at)S1984(the)S10 B2132(ty_name)S10 R2526(\256eld.)S6624 V9 R720(A)S722(AU)S790(UT)S858(TH)S916(HO)S984(OR)S1052(R)S6744 V10 R1080(Kees)S1307(J.)S1396(Bot)S1566(\(kjb@cs.vu.nl\))S7903 V720(Page)S941(1)S4455(September)S4911(13,)S(1996)200 5061 A8143 VEP%%Trailer%%DocumentFonts: Times-Roman Times-Bold Times-Italic%%Pages: 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -