I just found this code (doing some LibCurl here). It is a function which is used as callback for LibCurl:
Code: Select all
ProcedureC LibCurl_WriteFunction(*ptr, Size, NMemB, *Stream)
Protected SizeProper.l = Size & 255
Protected NMemBProper.l = NMemB
rdata.s=PeekS(*ptr)
loops=CountString(rdata,#FTPEOL)
For i=1 To loops
file.s=RemoveString(StringField(rdata,i,#FTPEOL),Chr(13))
file.s=RemoveString(file,Chr(10))
PrintN(file)
Next
ProcedureReturn SizeProper * NMemBProper
EndProcedure
Code: Select all
size_t function( char *ptr, size_t size, size_t nmemb, void *userdata);
What happens if size is something bigger 255? Or why doing it at all? Is it about signed/unsigned? But is 255 the right value (I think it works only for bytes then)?
Thanks for clarification,
Kukulkan
[EDIT] added link and better explanation [/EDIT]