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

📄 setbuf.3

📁 Unix操作系统minix 2.0源码
💻 3
字号:
%!PS-Adobe-1.0%%Creator: devps (Pipeline Associates, Inc.)%%CreationDate: Fri Sep 13 13:06:57 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 R720(SETBUF)S1104(\()S1146(3)S1204(\))S2696(Eighth)S(Edition)296 2989 A4743(SETBUF)S5127(\()S5169(3)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R1080(setbuf,)S(setvbuf)296 1376 A10 R-11697(-)S10 R1779(assign)S2055(buffering)S2455(to)S2558(a)S2628(stream)S1248 V9 R720(S)S722(SY)S774(YN)S842(NO)S910(OP)S978(PS)S1030(SI)S1082(IS)S1115(S)S1368 V10 B1080(#include)S1482(<stdio.h>)S1608 V1080(int)S1236(setbuf\(FILE)S1807(*)S10 I1857(stream)S10 B2131(,)S2194(char)S2428(*)S10 I2478(buf)S10 B2606(\))S1728 V1080(int)S1236(setvbuf\(FILE)S1857(*)S10 I1907(stream)S10 B2181(,)S2244(char)S2478(*)S10 I2528(buf)S10 B2656(,)S2719(int)S10 I2875(type)S10 B3043(,)S3106(size_t)S10 I3385(size)S10 B3536(\))S1896 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)S2016 V10 R1080(The)S1265(three)S1495(types)S1735(of)S1847(buffering)S2250(available)S2642(are)S(unbuffered,)467 2794 A3289(block)S3540(buffered,)S3935(and)S4108(line)S4287(buffered.)S4707(When)S4975(an)S5099(out-)S2136 V1080(put)S1247(stream)S1555(is)S(unbuffered,)467 1661 A2167(information)S2681(appears)S3028(on)S3167(the)S3329(destination)S3809(\256le)S3977(or)S4100(terminal)S4475(as)S(soon)189 4598 A4825(as)S(written;)314 4947 A2256 V1080(when)S1326(it)S1410(is)S1505(block)S1756(buffered)S2126(many)S2377(characters)S2815(are)S2968(saved)S3226(up)S3355(and)S(written)286 3529 A3844(as)S3957(a)S4031(block;)S4311(when)S4558(it)S4643(is)S4739(line)S4919(buffered)S2376 V1080(characters)S1541(are)S1716(saved)S1996(up)S(until)184 2147 A2382(a)S2478(newline)S2848(is)S(encountered)492 2965 A3507(or)S(input)206 3641 A3897(is)S4014(read)S4238(from)S4484(stdin.)S10 B4779(F\257ush)S10 R5098(\(see)S2496 V10 B1080(fclose)S10 R1321(\(3\)\))S1503(may)S1706(be)S1831(used)S2045(to)S2153(force)S2391(the)S2544(block)S2797(out)S2955(early.)S3237(Normally)S3653(all)S3784(\256les)S3982(are)S4136(block)S4389(buffered.)S4812(A)S4916(buffer)S5194(is)S2616 V1080(obtained)S1455(from)S10 B1680(malloc)S10 R1965(\(3\))S(upon)200 2112 A2341(the)S2493(\256rst)S10 B2679(getc)S10 R2882(or)S10 B2995(putc)S10 R3186(\(3\))S3333(on)S3462(the)S3613(\256le.)S3820(If)S3916(the)S4067(standard)S4436(stream)S10 B4733(stdout)S10 R5030(refers)S2736 V1080(to)S1183(a)S1253(terminal)S1614(it)S1695(is)S1787(line)S1963(buffered.)S2380(The)S2562(standard)S2928(stream)S10 B(stderr)264 3222 A10 R3511(is)S3603(always)S(unbuffered.)467 3908 A2904 V10 B1080(Setbuf)S10 R1386(is)S1478(used)S1687(after)S1898(a)S1968(stream)S2262(has)S2421(been)S2636(opened)S2951(but)S3104(before)S3387(it)S3468(is)S3560(read)S3759(or)S(written.)311 3868 A4229(The)S4411(character)S4807(array)S10 I5040(buf)S10 R5194(is)S3024 V1080(used)S1291(instead)S1603(of)S1714(an)S1836(automatically)S2411(allocated)S2802(buffer.)S3126(If)S10 I3221(buf)S10 R3375(is)S3468(the)S3617(constant)S3978(pointer)S9 B4287(NULL)S9 R4539(,)S10 R(input/output)490 4588 A(will)157 5104 A3144 V1080(be)S1200(completely)S(unbuffered.)467 1672 A2189(A)S2287(manifest)S2659(constant)S9 B3017(BUFSIZ)S10 R3369(tells)S3562(how)S3760(big)S3913(an)S4033(array)S4266(is)S4358(needed:)S3312 V10 B1440(char)S10 R1661(buf[BUFSIZ];)S3480 V10 B1080(Setvbuf)S10 R1411(,)S1471(an)S1601(alternate)S1984(form)S2216(of)S10 B2336(setbuf)S10 R2600(,)S2661(is)S2764(used)S2984(after)S3206(a)S3287(stream)S3592(has)S3762(been)S3988(opened)S4314(but)S4478(before)S4772(it)S4864(is)S4967(read)S5177(or)S3600 V(written.)311 1080 A1441(It)S1528(has)S1687(three)S1914(uses,)S2137(depending)S2580(on)S2705(the)S2853(value)S3096(of)S3205(the)S10 I3353(type)S10 R3546(argument:)S3768 V10 B1080(setvbuf\()S10 I1428(stream)S10 B1702(,)S10 I1752(buf)S10 B1880(,)S1930(_IOFBF,)S10 I2338(size)S10 B2489(\))S3888 V10 R1330(Causes)S(input/output)490 1648 A2171(to)S2282(be)S2410(fully)S2633(buffered)S3008(using)S3259(the)S3416(character)S3821(array)S10 I4063(buf)S10 R4225(whose)S4516(size)S4707(is)S4808(determined)S4008 V1330(by)S1459(the)S10 I1610(size)S10 R1789(argument.)S2247(If)S10 I2343(buf)S10 R2499(is)S2594(the)S2745(constant)S3108(pointer)S9 B3419(NULL)S9 R3671(,)S10 R3722(then)S3923(an)S4046(automatically)S4622(allocated)S5014(buffer)S4128 V(will)157 1330 A1512(be)S1632(used.)S4296 V10 B1080(setvbuf\()S10 I1428(stream)S10 B1702(,)S10 I1752(buf)S10 B1880(,)S1930(_IOLBF,)S10 I2343(size)S10 B2494(\))S4416 V10 R1330(Like)S(above,)265 1546 A1842(except)S2136(that)S2319(output)S(will)157 2607 A2796(be)S2923(line)S3106(buffered,)S3505(i.e.)S3660(the)S3815(buffer)S(will)157 4094 A4283(be)S4410(\257ushed)S4732(when)S4982(a)S5059(new-)S4536 V1330(line)S1506(is)S(written,)311 1598 A1934(the)S2082(buffer)S2354(is)S2446(full,)S2636(or)S(input)206 2745 A2976(is)S3068(requested.)S4704 V10 B1080(setvbuf\()S10 I1428(stream)S10 B1702(,)S10 I1752(buf)S10 B1880(,)S1930(_IONBF,)S10 I2349(size)S10 B2500(\))S4824 V10 R1330(Causes)S(input/output)490 1640 A2155(to)S2258(be)S2378(completely)S(unbuffered.)467 2850 A10 I3367(Buf)S10 R3532(and)S10 I3702(size)S10 R3878(are)S(ignored.)332 4027 A4992 V1080(A)S1194(\256le)S1364(can)S1546(be)S1683(changed)S2060(between)S(unbuffered,)467 2438 A2947(line)S3140(buffered,)S3549(or)S3675(block)S3940(buffered)S4324(by)S4466(using)S10 B4725(freopen)S10 R5098(\(see)S5112 V10 B1080(fopen)S10 R1321(\(3\)\))S1498(followed)S1881(by)S2006(the)S2154(appropriate)S10 B2638(setvbuf)S10 R2977(call.)S5280 V9 R720(S)S722(SE)S774(EE)S832(E)S913(A)S915(AL)S983(LS)S1041(SO)S1093(O)S5400 V10 B1080(fopen)S10 R1321(\(3\),)S10 B1489(getc)S10 R1663(\(3\),)S10 B1831(putc)S10 R2022(\(3\),)S10 B2190(malloc)S10 R2475(\(3\),)S10 B2643(fclose)S10 R2884(\(3\),)S10 B3052(puts)S10 R3237(\(3\),)S10 B3405(printf)S10 R3658(\(3\),)S10 B3826(fread)S10 R4056(\(3\).)S7903 V720(Page)S941(1)S2669(\()S2711(May)S2920(12,)S(1986)200 3070 A3278(\))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 + -