📄 stdarg.3
字号:
%!PS-Adobe-1.0%%Creator: devps (Pipeline Associates, Inc.)%%CreationDate: Fri Sep 13 13:06:59 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(STDARG)S1132(\()S1174(3)S1232(\))S2696(Eighth)S(Edition)296 2989 A4715(STDARG)S5127(\()S5169(3)S5227(\))S960 V9 R720(N)S722(NA)S790(AM)S858(ME)S940(E)S1080 V10 R1080(stdarg)S10 R-11351(-)S10 R1433(variable)S1783(argument)S2188(list)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(<stdarg.h>)S1608 V1080(void)S(va_start\(va_list)665 1302 A10 I2005(ap)S10 B2105(,)S10 I2168(argtypeN)S2580(parmN)S10 B2859(\))S1728 V10 I1080(type)S10 B(va_arg\(va_list)608 1286 A10 I1932(ap)S10 B2032(,)S10 I2095(type)S10 B2263(\))S1848 V1080(void)S(va_end\(va_list)620 1302 A10 I1960(ap)S10 B2060(\))S2016 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)S2136 V10 R1080(This)S1286(set)S1426(of)S1538(macros)S1857(provides)S2231(a)S2304(means)S2589(of)S(writing)291 2701 A3020(portable)S3378(procedures)S3848(that)S(accept)258 4027 A4313(variable)S4666(argument)S5074(lists.)S2256 V1080(Routines)S1469(having)S1774(variable)S2131(argument)S2543(lists)S2737(\(such)S2987(as)S10 B3103(printf)S10 R3356(\(3\)\))S3540(that)S3723(do)S3854(not)S4013(use)S10 B4178(stdarg)S10 R4483(are)S4638(inherently)S(non-)184 5077 A2376 V1080(portable,)S1460(since)S1692(different)S2065(machines)S2470(use)S2629(different)S3002(argument)S3407(passing)S(conventions.)510 3733 A2544 V1080(A)S1181(function)S1544(that)S(accepts)297 1723 A2049(a)S2123(variable)S2477(argument)S2886(list)S3038(is)S3134(declared)S3505(with)S("...")157 3713 A3899(at)S4001(the)S4153(end)S4327(of)S4440(its)S4564(parameter)S4997(list.)S5199(It)S2664 V1080(must)S1300(have)S1515(at)S1613(least)S1823(one)S1993(normal)S2303(argument)S2708(before)S2991(the)S("...".)182 3139 A3371(For)S3536(example:)S2832 V1440(int)S1571(printf\(const)S2066(char)S2265(*format,)S(...\))109 2634 A2768({)S2841(/*)S2944(code)S3159(*/)S3262(})S2952 V1440(int)S1571(fprintf\(FILE)S2102(*stream,)S2471(const)S2708(char)S2907(*format,)S(...\))109 3276 A3410({)S3483(/*)S3586(code)S3801(*/)S3904(})S3120 V10 B(va_list)279 1080 A10 R1398(is)S1504(a)S1588(type)S1800(which)S2085(is)S2191(used)S2414(for)S2571(the)S2733(variable)S10 I3097(ap)S10 R3236(within)S3532(the)S(body)200 3694 A3933(of)S4056(a)S4141(variable)S4506(argument)S4926(function)S3240 V1080(which)S1351(is)S1443(used)S1652(to)S1755(traverse)S2100(the)S2248(list.)S3408 V10 B(va_start)352 1080 A10 R1432(\()S10 I1466(ap)S10 R1574(,)S10 I1624(parmN)S10 R1911(\))S1970(is)S2062(called)S2328(to)S(initialize)353 2431 A10 I2809(ap)S10 R2934(to)S3037(the)S3185(beginning)S3611(of)S3720(the)S3868(list.)S4066(The)S4249(last)S4415(true)S4598(parameter)S5028(of)S5138(the)S3528 V1080(function,)S10 I1466(parmN)S10 R1753(,)S1803(must)S2023(be)S(supplied)340 2143 A2508(to)S2611(allow)S10 B(va_start)352 2860 A10 R3237(to)S3340(compute)S3711(the)S3859(address)S4186(of)S4295(the)S4443(\256rst)S4625(variable)S4975(param-)S3648 V1080(eter.)S3816 V10 B(va_arg)295 1080 A10 R1375(\()S10 I1409(ap)S10 R1517(,)S10 I1573(type)S10 R1749(\))S(will)157 1814 A2002(return)S2274(the)S2428(next)S2632(argument)S3043(in)S3152(the)S3306(list)S3460(pointed)S3792(to)S3901(by)S10 I4032(ap)S10 R4140(.)S10 I4221(Type)S10 R4448(is)S4546(the)S4700(type)S4905(to)S5015(which)S3936 V1080(the)S1228(expected)S1611(argument)S(will)157 2016 A2198(be)S(converted)397 2318 A2740(when)S2983(passed)S3276(as)S3385(an)S3505(argument.)S4104 V1080(Different)S1486(types)S1733(can)S1908(be)S2038(mixed,)S2349(but)S2512(it)S2603(is)S2705(up)S2840(to)S2953(the)S3111(routine)S3431(to)S(know)223 3544 A3802(what)S4033(type)S4241(of)S4360(argument)S4775(is)S4878(expected,)S4224 V1080(since)S1312(it)S(cannot)268 1393 A1686(be)S1806(determined)S2284(at)S2382(runtime.)S4392 V10 B(va_end)307 1080 A10 R1387(\()S10 I1421(ap)S10 R1529(\))S1588(must)S1808(be)S1928(used)S2137(to)S2240(\256nish)S2488(up.)S4560 V(Multiple)346 1080 A1451(traversals,)S(each)185 1888 A2098(bracketed)S2515(by)S10 B(va_start)352 2640 A10 R(...)75 3017 A10 B(va_end,)332 3142 A10 R3499(are)S3648(possible.)S4728 V9 R720(E)S722(EX)S780(XA)S848(AM)S916(MP)S998(PL)S1050(LE)S1108(E)S4848 V10 B1280(#include)S10 R1669(<stdarg.h>)S5016 V1280(execl\()S10 B1527(const)S1776(char)S10 R1997(*path,)S10 B(...)75 2270 A10 R2345(\))S5136 V1280({)S5256 V10 B(va_list)279 1480 A10 R1784(ap;)S5376 V10 B1480(char)S10 R(*args[100];)464 1701 A5496 V10 B1480(int)S10 R(argno)229 1623 A1877(=)S1959(0;)S5736 V10 B(va_start)352 1480 A10 R1832(\(ap,)S2011(path\);)S5856 V10 B1480(while)S10 R(\(\(args[argno++])647 1735 A2407(=)S10 B(va_arg)295 2489 A10 R2784(\(ap,)S10 B2963(char)S10 R3184(*\)\))S3327(!=)S3443(NULL\))S3772({})S5976 V10 B(va_end)307 1480 A10 R1787(\(ap\);)S6096 V10 B1480(return)S10 R1786(execv\(path,)S2278(args\);)S6216 V1280(})S6384 V9 R720(N)S722(NO)S790(OT)S858(TE)S916(ES)S974(S)S6504 V10 R1080(It)S1177(is)S1279(up)S1414(to)S1527(the)S(calling)274 1686 A1996(routine)S2317(to)S2431(determine)S2870(how)S3079(many)S3338(arguments)S3793(there)S4031(are,)S4216(since)S4459(it)S4551(is)S4654(not)S4818(possible)S5183(to)S6624 V1080(determine)S1515(this)S1692(from)S1920(the)S2075(stack)S2314(frame.)S2632(For)S2804(example,)S10 B3202(execl)S10 R3446(passes)S3734(a)S3810(null)S3997(pointer)S4313(to)S4422(signal)S4693(the)S4847(end)S5023(of)S5138(the)S6744 V1080(list.)S10 B1278(Printf)S10 R1562(can)S1727(tell)S1881(how)S2079(many)S2327(arguments)S2771(are)S(supposed)373 2920 A3318(to)S3421(be)S3541(there)S3768(by)S3893(the)S4041(format.)S6912 V1080(The)S1267(macros)S10 B(va_start)352 1588 A10 R1970(and)S10 B(va_end)307 2145 A10 R2482(may)S2685(be)S2810(arbitrarily)S3244(complex;)S3648(for)S3796(example,)S10 B(va_start)352 4192 A10 R4574(might)S4839(contain)S5166(an)S7032 V1080(opening)S(brace,)244 1433 A1707(which)S1983(is)S2080(closed)S2367(by)S2497(a)S2572(matching)S(brace)219 2976 A3224(in)S10 B(va_end)307 3331 A10 R3638(.)S3717(Thus,)S3972(they)S(should)267 4174 A4470(only)S4677(be)S4801(used)S5014(where)S7152 V1080(they)S1278(could)S1526(be)S(placed)263 1646 A1934(within)S2216(a)S2286(single)S2551(complex)S2922(statement.)S7320 V9 R720(B)S722(BU)S784(UG)S852(GS)S920(S)S7440 V10 R1080(It)S1177(is)S1279(impossible)S1749(to)S1863(properly)S2240(show)S2488(the)S2647(macros)S2974(as)S3094(C)S3197(declarations)S3720(as)S3840(is)S(done)195 3943 A4174(in)S4288(the)S(synopsis.)370 4447 A4878(They)S5121(can)S7903 V720(Page)S941(1)S2669(\()S2711(May)S2920(15,)S(1986)200 3070 A3278(\))S4455(September)S4911(13,)S(1996)200 5061 A8143 VEP%%Page: 2 2BP/slant 0 def/height 0 def480 V10 R720(STDARG)S1132(\()S1174(3)S1232(\))S2696(Eighth)S(Edition)296 2989 A4715(STDARG)S5127(\()S5169(3)S5227(\))S960 V1080(never)S1337(be)S1465(coded)S1738(as)S1855(C)S1955(functions,)S(because)319 2387 A2739(all)S2873(three)S3108(macros)S3432(use)S3599(their)S3817(arguments)S4269(by)S4402(address,)S4761(and)S4938(the)S10 I5093(type)S1080 V10 R1080(\256eld)S1284(is)S1376(certainly)S1754(impossible.)S2264(Just)S(look)178 2445 A2648(at)S2746(them)S2972(as)S3081(being)S3329(part)S3511(of)S3620(the)S3768(C)S(language,)388 3860 A4273(like)S10 B4449(sizeof)S10 R4690(.)S7903 V720(September)S1176(13,)S(1996)200 1326 A2669(\()S2711(May)S2920(15,)S(1986)200 3070 A3278(\))S4990(Page)S5211(2)S8143 VEP%%Trailer%%DocumentFonts: Times-Roman Times-Bold Times-Italic%%Pages: 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -