📄 libmpatrol.ps
字号:
1.337(allocated memory)144 398.4 R 6.337(.T)-.65 G 1.338(he pointer returned will ha)-6.337 F 1.638 -.15(ve n)-.2 H 3.838(oa).15G 1.338(lignment constraints and can be used to)-3.838 F .47(store character data up to the length of)144 410.4 R F2(str)2.97 E F05.47(.I)C(f)-5.47 E F2(str)2.97 E F0(is)2.97 E F1(NULL)2.97 E F0(and)2.97 E F2(size)2.97 E F0 .47(is non-zero then an error will)2.97 F .072(be gi)144 422.4 R -.15(ve)-.25 G 2.572(na).15 G .072(nd the null pointer will be returned.)-2.572 F .073(If the length of)5.072 F F2(str)2.573 E F0 .073(is greater than)2.573 F F2(size)2.573 EF0 .073(then only)2.573 F F2(size)2.573 E F0 .641(characters will be al\located and copied, with one additional byte for the nul character)144434.4 R 5.641(.I)-.55 G 3.141(ft)-5.641 G .641(here is)-3.141 F 1.888(n\ot enough space in the heap then the null pointer will be returned and)144 446.4 R F1(err)4.388 E(no)-.15 E F0 1.888(will be set to)4.388 F F1(ENOMEM)144 458.4 Q F0 6.579(.T)C 1.579(he allocated memory must be deallocated with)-6.579 F F1(fr)4.078 E(ee)-.18 E F0 1.578(or reallocated with)4.078 F F1 -.18(re)4.078 G(alloc).18E F0(.)A 1.343(This function is a)144 470.4 R -.25(va)-.2 G 1.343(ilable for backw).25 F 1.344(ards compatibility with older C libraries and should not be)-.1 F(used in ne)144 482.4 Q 2.5(wc)-.25 G(ode.)-2.5 E F1(strdupa)108 499.2 QF0 .756(Allocates e)144 511.2 R .756(xactly enough temporary memory from the heap to duplicate)-.15 F F2(str)3.255 E F0 .755(\(including the termi-)3.255 F .25(nating nul char\acter\) and returns a pointer to the \214rst byte of the allocation aft\er cop)144 523.2 R(ying)-.1 E F2(str)2.75 E F0 .25(to the)2.75 F(ne)144535.2 Q .115(wly-allocated memory)-.25 F 5.115(.T)-.65 G .115(he pointer returned will ha)-5.115 F .415 -.15(ve n)-.2 H 2.615(oa).15G .114(lignment constraints and can be used)-2.615 F .612(to store character data up to the length of)144 547.2 R F2(str)3.112 EF0 5.612(.I)C(f)-5.612 E F2(str)3.112 E F0(is)3.112 E F1(NULL)3.112 E F0.612(then an error will be gi)3.112 F -.15(ve)-.25 G 3.112(na).15 G .612(nd the)-3.112 F .14(null pointer will be returned.)144 559.2 R .14(If there is not enough space in the heap then the program will be ter)5.14 F(-)-.2 E .142(minated and the)144 571.2 R F2(OUTMEM)2.643 E F0.143(error will be gi)2.643 F -.15(ve)-.25 G 2.643(n. The).15 F F1(strdupa)2.643 E F0 .143(function normally allocates its mem-)2.643 F.209(ory from the stack, with the result that all such allocations will\ be freed when the function returns.)144 583.2 R .473(This v)144 595.2 R.473(ersion of)-.15 F F1(strdupa)2.973 E F0 .473(allocates its memory from the heap in order to pro)2.973 F .474(vide better deb)-.15 F(ugging,)-.2 E -.2(bu)144 607.2 S 2.829(tt).2 G.329(he allocations may not necessarily be freed immediately when the f\unction returns.)-2.829 F .328(The allo-)5.328 F .915(cated memory can be deallocated e)144 619.2 R .915(xplicitly with)-.15F F1(dealloca)3.415 E F0 3.415(,b)C .915(ut may not be reallocated or deallo-)-3.615 F .112(cated in an)144631.2 R 2.612(yo)-.15 G .112(ther w)-2.612 F(ay)-.1 E 5.112(.T)-.65 G.112(his function is a)-5.112 F -.25(va)-.2 G .112(ilable for backw).25F .112(ards compatibility with older C source)-.1 F(code and should not be used in ne)144 643.2 Q 2.5(wc)-.25 G(ode.)-2.5 EF1(str)108 660 Q(ndupa)-.15 E F0 .755(Allocates e)144 672 R .755(xactly enough temporary memory from the heap to duplicate)-.15 F F2(str)3.256 E F0 .756(\(including the termi-)3.256 F .25(nating nul char\acter\) and returns a pointer to the \214rst byte of the allocation aft\er cop)144 684 R(ying)-.1 E F2(str)2.75 E F0 .25(to the)2.75 F(ne)144696 Q .114(wly-allocated memory)-.25 F 5.114(.T)-.65 G .114(he pointer returned will ha)-5.114 F .415 -.15(ve n)-.2 H 2.615(oa).15G .115(lignment constraints and can be used)-2.615 F .859(to store character data up to the length of)144 708 R F2(str)3.359 E F05.859(.I)C(f)-5.859 E F2(str)3.359 E F0(is)3.359 E F1(NULL)3.359 E F0(and)3.359 E F2(size)3.359 E F0 .859(is non-zero then an error)3.359 F.044(will be gi)144 720 R -.15(ve)-.25 G 2.544(na).15 G .044(nd the null pointer will be returned.)-2.544 F .045(If the length of)5.044 F F2(str)2.545 E F0 .045(is greater than)2.545 F F2(size)2.545 EF0 .045(then only)2.545 F(Release 1.4)72 768 Q 2.5(8J)157.35 G(anuary 2002)-2.5 E(5)198.45 E EP%%Page: 6 6%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF(LIBMP)72 48 Q -1.11(AT)-.92 G -.4(RO)1.11 G128.245(L\(3\) mpatrol).4 F 128.245(library LIBMP)2.5 F -1.11(AT)-.92 G-.4(RO)1.11 G(L\(3\)).4 E/F1 10/Times-Italic@0 SF(size)144 84 Q F0 .121(characters will be allocated and copied, with one additional byte for \the nul character)2.621 F 5.12(.I)-.55 G 2.62(ft)-5.12 G(here)-2.62 E.471(is not enough space in the heap then the program will be terminate\d and the)144 96 R F1(OUTMEM)2.972 E F0 .472(error will)2.972 F 1.165(be gi)144 108 R -.15(ve)-.25 G 3.665(n. The).15 F/F2 10/Times-Bold@0 SF(str)3.665 E(ndupa)-.15 E F0 1.164(function normally allocates its memory from the stack, with the result)3.665 F .922(that all such allocations will be freed when the function returns.)144120 R .923(This v)5.923 F .923(ersion of)-.15 F F2(str)3.423 E(ndupa)-.15 E F0(allo-)3.423 E .638(cates its memory from the heap in order to pro)144 132 R .638(vide better deb)-.15 F .638(ugging, b)-.2 F .638(ut the allocations may not)-.2 F .234(necessarily be freed immediately when the function returns.)144 144 R.234(The allocated memory can be deallo-)5.234 F .895(cated e)144 156 R.895(xplicitly with)-.15 F F2(dealloca)3.395 E F0 3.395(,b)C .895(ut may not be reallocated or deallocated in an)-3.595 F 3.394(yo)-.15 G.894(ther w)-3.394 F(ay)-.1 E 5.894(.T)-.65 G(his)-5.894 E .236(function is a)144 168 R -.25(va)-.2 G .236(ilable for backw).25 F .237(ards compatibility with older C source code and should not be used)-.1F(in ne)144 180 Q 2.5(wc)-.25 G(ode.)-2.5 E F2 -.18(re)108 196.8 S(alloc).18 E F0 .446(Resizes the memory allocation be)7.3 F .446(ginning at)-.15 F F1(ptr)2.945 E F0(to)2.945 E F1(size)2.945 E F0 .445(bytes and returns a pointer to the \214rst byte)2.945 F .562(of the ne)144 208.8 R 3.062(wa)-.25 G .562(llocation after cop)-3.062 F(ying)-.1 EF1(ptr)3.062 E F0 .562(to the ne)3.062 F .562(wly-allocated memory)-.25F 3.062(,w)-.65 G .562(hich will be truncated if)-3.062 F F1(size)144220.8 Q F0 .57(is smaller than the original allocation.)3.07 F .57(The pointer returned will be suitably aligned for cast-)5.57 F .184(ing to an)144 232.8 R 2.684(yt)-.15 G .184(ype and can be used to store data of up to)-2.684 F F1(size)2.684 E F0.185(bytes in length.)2.684 F(If)5.185 E F1(ptr)2.685 E F0(is)2.685 E F2(NULL)2.685 E F0 .185(then the)2.685 F .125(call will be equi)144 244.8R -.25(va)-.25 G .125(lent to).25 F F2(malloc)2.625 E F0 5.125(.I)C(f)-5.125 E F1(size)2.625 E F0(is)2.625 E F1(0)2.625 E F0 .125(then the e)2.625 F .125(xisting memory allocation will be freed and)-.15 F .382(the null pointer will be returned.)144 256.8 R(If)5.382 E F1(size)2.882E F0 .383(is greater than the original allocation then the e)2.882 F.383(xtra space)-.15 F .119(will be \214lled with uninitialised bytes.)144 268.8 R .119(If there is not enough space in the heap then the null pointer)5.119 F.432(will be returned and)144 280.8 R F2(err)2.932 E(no)-.15 E F0 .433(will be set to)2.932 F F2(ENOMEM)2.933 E F0 5.433(.T)C .433(he allocated memory must be deallocated)-5.433 F(with)144 292.8 Q F2(fr)2.5 E(ee)-.18 E F0(and can be reallocated ag)2.5 E(ain with)-.05 EF2 -.18(re)2.5 G(alloc).18 E F0(.)A F2 -.18(re)108 309.6 S(allocf).18 EF0 .446(Resizes the memory allocation be)144 321.6 R .446(ginning at)-.15 F F1(ptr)2.945 E F0(to)2.945 E F1(size)2.945 E F0 .445(bytes and returns a pointer to the \214rst byte)2.945 F .562(of the ne)144 333.6 R 3.062(wa)-.25 G .562(llocation after cop)-3.062 F(ying)-.1 EF1(ptr)3.062 E F0 .562(to the ne)3.062 F .562(wly-allocated memory)-.25F 3.062(,w)-.65 G .562(hich will be truncated if)-3.062 F F1(size)144345.6 Q F0 .57(is smaller than the original allocation.)3.07 F .57(The pointer returned will be suitably aligned for cast-)5.57 F .184(ing to an)144 357.6 R 2.684(yt)-.15 G .184(ype and can be used to store data of up to)-2.684 F F1(size)2.684 E F0.185(bytes in length.)2.684 F(If)5.185 E F1(ptr)2.685 E F0(is)2.685 E F2(NULL)2.685 E F0 .185(then the)2.685 F .125(call will be equi)144 369.6R -.25(va)-.25 G .125(lent to).25 F F2(malloc)2.625 E F0 5.125(.I)C(f)-5.125 E F1(size)2.625 E F0(is)2.625 E F1(0)2.625 E F0 .125(then the e)2.625 F .125(xisting memory allocation will be freed and)-.15 F .382(the null pointer will be returned.)144 381.6 R(If)5.382 E F1(size)2.882E F0 .383(is greater than the original allocation then the e)2.882 F.383(xtra space)-.15 F .119(will be \214lled with uninitialised bytes.)144 393.6 R .119(If there is not enough space in the heap then the null pointer)5.119 F1.065(will be returned, the original allocation will be freed and)144405.6 R F2(err)3.565 E(no)-.15 E F0 1.065(will be set to)3.565 F F2(ENOMEM)3.565 E F0 6.065(.T)C(he)-6.065 E .742(allocated memory must be deallocated with)144 417.6 R F2(fr)3.242 E(ee)-.18 E F0 .742(and can be reallocated ag)3.242 F .742(ain with)-.05 F F2-.18(re)3.242 G(alloc).18 E F0 5.742(.T)C(his)-5.742 E .532(function is a)144 429.6 R -.25(va)-.2 G .532(ilable for backw).25 F.532(ards compatibility with older C libraries and should not be used in)-.1F(ne)144 441.6 Q 2.5(wc)-.25 G(ode.)-2.5 E F2 -.18(re)108 458.4 S(calloc).18 E F0 1.728(Resizes the memory allocation be)144 470.4 R1.728(ginning at)-.15 F F1(ptr)4.228 E F0(to)4.228 E F1(nelem)4.228 E F01.728(elements of)4.228 F F1(size)4.228 E F0 1.728(bytes and returns a)4.228 F 1.338(pointer to the \214rst byte of the ne)144 482.4 R 3.839(wa)-.25 G 1.339(llocation after cop)-3.839 F(ying)-.1 E F1(ptr)3.839 EF0 1.339(to the ne)3.839 F 1.339(wly-allocated memory)-.25 F(,)-.65 E.067(which will be truncated if)144 494.4 R F1(nelem)2.566 E F0(*)2.566E F1(size)2.566 E F0 .066(is smaller than the original allocation.)2.566F .066(The pointer returned)5.066 F .388(will be suitably aligned for casting to an)144 506.4 R 2.888(yt)-.15 G.388(ype and can be used to store data of up to)-2.888 F F1(nelem)2.888E F0(*)2.889 E F1(size)2.889 E F0 .245(bytes in length.)144 518.4 R(If)5.245 E F1(ptr)2.745 E F0(is)2.745 E F2(NULL)2.745 E F0 .245(then the call will be equi)2.745 F -.25(va)-.25 G .245(lent to).25 F F2(calloc)2.745 E F0 5.245(.I)C(f)-5.245 E F1(nelem)2.745 E F0(*)2.744 EF1(size)2.744 E F0(is)2.744 E F1(0)2.744 E F0(then)2.744 E .414(the e)144 530.4 R .414(xisting memory allocation will be freed and the null p\ointer will be returned.)-.15 F(If)5.414 E F1(nelem)2.914 E F0(*)2.915 EF1(size)2.915 E F0 .377(is greater than the original allocation then the e)144 542.4 R .376(xtra space will be \214lled with zero-initialised bytes.)-.15 F .172(I\f there is not enough space in the heap then the null pointer will be r\eturned and)144 554.4 R F2(err)2.672 E(no)-.15 E F0 .172(will be set)2.672 F(to)144 566.4 Q F2(ENOMEM)2.793 E F0 5.293(.T)C .293(he allocated memory must be deallocated with)-5.293 F F2(fr)2.793 E(ee)-.18 E F0 .293(and can be reallocated ag)2.793 F(ain)-.05 E(with)144578.4 Q F2 -.18(re)2.547 G(alloc).18 E F0 5.047(.T)C .048(his function is a)-5.047 F -.25(va)-.2 G .048(ilable for backw).25 F.048(ards compatibility with older C libraries and)-.1 F F2(cal-)2.548 E(loc)144 590.4 Q F0(and should not be used in ne)2.5 E 2.5(wc)-.25 G(ode.)-2.5 E F2(expand)108 607.2 Q F0 1.116(Attempts to resize the memory allocation be)144 619.2 R 1.116(ginning at)-.15 F F1(ptr)3.616 E F0(to)3.616 E F1(size)3.616 E F0 1.115(bytes and either returns)3.615 F F1(ptr)3.615 E F0(if)3.615 E .151(there w)144 631.2 R .151(as enough space to resize it, or)-.1 F F2(NULL)2.651 E F0 .151(if the block could not be resized for a particular rea-)2.651 F 2.778(son. If)144 643.2 R F1(ptr)2.778 E F0(is)2.778 E F2(NULL)2.778 E F0.278(then the call will be equi)2.778 F -.25(va)-.25 G .278(lent to).25F F2(malloc)2.778 E F0 5.278(.I)C(f)-5.278 E F1(size)2.778 E F0(is)2.778E F2(0)2.778 E F0 .278(then the e)2.778 F .278(xisting mem-)-.15 F .09(ory allocation will be freed and the)144 655.2 R F2(NULL)2.59 E F0 .091(pointer will be returned.)2.59 F(If)5.091 E F1(size)2.591 E F0 .091(is greater than the orig-)2.591 F .251(inal allocation then the e)144667.2 R .251(xtra space will be \214lled with uninitialised bytes and if)-.15 F F1(size)2.75 E F0 .25(is less than the)2.75 F .968(original allocation then the memory block will be truncated.)144 679.2R .969(If there is not enough space in the)5.969 F .458(heap then the)144 691.2 R F2(NULL)2.958 E F0 .458(pointer will be returned and)2.958 FF2(err)2.957 E(no)-.15 E F0 .457(will be set to)2.957 F F2(ENOMEM)2.957E F0 5.457(.T)C .457(he allocated)-5.457 F .266(memory must be deallocated with)144 703.2 R F2(fr)2.766 E(ee)-.18 E F0.266(and can be reallocated ag)2.766 F .266(ain with)-.05 F F2 -.18(re)2.766 G(alloc).18 E F0 5.266(.T)C .266(his function is)-5.266 F -.2(av)144 715.2 S(ailable for backw)-.05 E(ards compatibility with older C libraries and should not be used in ne)-.1 E 2.5(wc)-.25 G(ode.)-2.5 E(Release 1.4)72 768 Q 2.5(8J)157.35 G(anuary 2002)-2.5 E(6)198.45 E EP%%Page: 7 7%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF(LIBMP)72 48 Q -1.11(AT)-.92 G -.4(RO)1.11 G128.245(L\(3\) mpatrol).4 F 128.245(library LIBMP)2.5 F -1.11(AT)-.92 G-.4(RO)1.11 G(L\(3\)).4 E/F1 10/Times-Bold@0 SF(fr)108 84 Q(ee)-.18 E F0.219(Frees the memory allocation be)19.53 F .218(ginning at)-.15 F/F2 10/Times-Italic@0 SF(ptr)2.718 E F0 .218(so the memory can be reused by another call to allo-)2.718 F .416(cate memory)144 96 R 5.416(.I)-.65 G(f)-5.416 E F2(ptr)2.916 E F0(is)2.916 E F1(NULL)2.916 E F0 .417(then no memory will be freed.)2.916 F.417(All of the pre)5.417 F .417(vious contents will be)-.25 F(destro)144 108 Q(yed.)-.1 E F1(cfr)108 124.8 Q(ee)-.18 E F0 .219(Frees the memory allocation be)15.09 F .218(ginning at)-.15 F F2(ptr)2.718 E F0 .218(so the memory can be reused by another call to allo-)2.718 F .416(cate memory)144 136.8 R 5.416(.I)-.65 G(f)-5.416 E F2(ptr)2.916 E F0(is)2.916 E F1(NULL)2.916 E F0 .417(then no memory will be freed.)2.916 F .417(All of the pre)5.417 F .417(vious contents will be)-.25 F(destro)144 148.8 Q 3.764(yed. The)-.1 FF2(nelem)3.764 E F0(and)3.764 E F2(size)3.764 E F0 1.264
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -