Re: about xmlReadMemory()
nicolas bats via xml <[email protected]> Tue, 2 Mar 2021 19:32:55 +0100
| Newsgroups | gmane.comp.gnome.lib.xml.general |
|---|---|
| Message-ID | <CAPb79oVpS_XPNm5g=wEYvoZUT8_1V1DkvbLAmv+jp4i_NgSBSA@mail.gmail.com> |
--===============3226876630151642669== Content-Type: multipart/alternative; boundary="0000000000002f76b305bc91f779" --0000000000002f76b305bc91f779 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you Nick for your answer, I'll give a try to xmlReadIO. thanks again. ++ Le mar. 2 mars 2021 =C3=A0 18:02, Nick Wellnhofer <[email protected]> a = =C3=A9crit : > On 02/03/2021 16:28, nicolas bats via xml wrote: > > Hi, > > is there's a reason why xmlReadMemory > > <http://xmlsoft.org/html/libxml-parser.html#xmlReadMemory>() accepts > int as > > the size of the array to transform to xmlDocPtr. > > no doubt there's one... > > That's simply a design mistake. The API was created 20 years ago when > 64-bit > systems were rare. > > > and in that case how could I retrieve a xmlDocPtr from > > memory where size is type of size_t? > > If you want to process memory buffers larger than INT_MAX, you can use > xmlReadIO with a custom read callback that uses a size_t to store the > offset. > > Nick > --0000000000002f76b305bc91f779 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Thank=C2=A0you Nick for your answer, I'll give a try t= o=C2=A0<span style=3D"color:rgb(0,0,0)">xmlReadIO.</span><div><span style= =3D"color:rgb(0,0,0)">thanks again.</span></div><div><span style=3D"color:r= gb(0,0,0)"><a class=3D"gmail_plusreply" id=3D"plusReplyChip-1">++</a><br></= span></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"g= mail_attr">Le=C2=A0mar. 2 mars 2021 =C3=A0=C2=A018:02, Nick Wellnhofer <= <a href=3D"mailto:[email protected]">[email protected]</a>> a =C3=A9= crit=C2=A0:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px = 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 0= 2/03/2021 16:28, nicolas bats via xml wrote:<br> > Hi,<br> > is there's a reason why xmlReadMemory <br> > <<a href=3D"http://xmlsoft.org/html/libxml-parser.html#xmlReadMemor= y" rel=3D"noreferrer" target=3D"_blank">http://xmlsoft.org/html/libxml-pars= er.html#xmlReadMemory</a>>() accepts int as <br> > the size of the array to transform to xmlDocPtr.<br> > no doubt there's one...<br> <br> That's simply a design mistake. The API was created 20 years ago when 6= 4-bit <br> systems were rare.<br> <br> > and in that case how could I retrieve a xmlDocPtr from <br> > memory where size is type of size_t?<br> <br> If you want to process memory buffers larger than INT_MAX, you can use <br> xmlReadIO with a custom read callback that uses a size_t to store the offse= t.<br> <br> Nick<br> </blockquote></div> --0000000000002f76b305bc91f779-- --===============3226876630151642669== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] https://mail.gnome.org/mailman/listinfo/xml --===============3226876630151642669==--