@@ -54,6 +54,23 @@ function version() end
5454-- if proto.HTTP then ... -- libcurl support http protocol
5555function version_info() end
5656
57+ --- File description table.
58+ --
59+ -- Representation for `struct curl_fileinfo`
60+ --
61+ -- @table curl_fileinfo
62+ --
63+ -- @tfield string filename
64+ -- @tfield integer filetype
65+ -- @tfield integer time
66+ -- @tfield integer perm
67+ -- @tfield integer uid
68+ -- @tfield integer gid
69+ -- @tfield integer size
70+ -- @tfield integer hardlinks
71+ -- @tfield integer flags
72+ -- @tfield table strings can have this string fields: `time`, `perm` , `user` , `group`, `target`
73+
5774end
5875
5976--- HTTP multipart/formdata object
@@ -367,6 +384,135 @@ function setopt_progressfunction() end
367384--
368385function setopt_progressfunction() end
369386
387+ --- Set seek callback function.
388+ --
389+ -- A callback accepting two or three parameters.
390+ -- The first is the seek context if any, the second is the `origin` value
391+ -- same as in file.seek function from io library. Can be (`cur`, `set` and `end`).
392+ -- The third parameter is offset or position in input stream.
393+ -- If stream can not be seeking and need stop current transfer operation
394+ -- function have to raise Lua error or returns `nil` and error message.
395+ -- To indicate success function have to return any truthy value
396+ -- In other case Function must return `true` or `1` or nothing to continue operation.
397+ -- False value indicate that while the seek failed, libcurl is free to work
398+ -- around the problem if possible.
399+ --
400+ -- !!! NOTE !!! This is differents form libcurl API by swapping parameters in callback.
401+ -- It done to be compatiable with Lua io library.
402+ --
403+ -- @tparam function seek
404+ -- @param[opt] context seek context
405+ -- @return[1] self
406+ --
407+ function setopt_seekfunction() end
408+
409+ --- Set seek callback function.
410+ --
411+ -- This call same as easy:setopt_seekfunction(stream.seek, seek)
412+ --
413+ -- @tparam object stream
414+ -- @return[1] self
415+ --
416+ function setopt_seekfunction() end
417+
418+ --- Set debug callback function.
419+ --
420+ -- A callback accepting two or three parameters.
421+ -- The first is the debug context if any, the second is the `data_type` value
422+ -- which represent what kinde of data is passed. This value can be one of
423+ -- constant `INFO_TEXT`, `INFO_HEADER_IN`, `INFO_HEADER_OUT`, `INFO_DATA_IN`,
424+ -- `INFO_DATA_OUT`, `INFO_SSL_DATA_IN`, `INFO_SSL_DATA_OUT`.
425+ -- The third parameter is data itself.
426+ -- Any errors and returning values from this callback are ignored.
427+ --
428+ -- @tparam function debug
429+ -- @param[opt] context debug context
430+ -- @return[1] self
431+ --
432+ function setopt_debugfunction() end
433+
434+ --- Set debug callback function.
435+ --
436+ -- This call same as easy:setopt_debugfunction(debug.debug, debug)
437+ --
438+ -- @tparam object debug
439+ -- @return[1] self
440+ --
441+ function setopt_debugfunction() end
442+
443+ --- Set match callback function.
444+ --
445+ -- A callback accepting two or three parameters.
446+ -- The first is the match context if any, the second is the pattern string,
447+ -- the third is the string to match to pattern.
448+ -- Function must return truthy value to indicate that string match to pattern.
449+ -- If function raise error or return nil and error message then it indicate
450+ -- that curl should interrupt current transfer operation.
451+ -- False value indicate that strind does not match to pattern
452+ --
453+ -- @tparam function match
454+ -- @param[opt] context match context
455+ -- @return[1] self
456+ --
457+ function setopt_fnmatch_function() end
458+
459+ --- Set match callback function.
460+ --
461+ -- This call same as easy:setopt_fnmatch_function(match.match, match)
462+ --
463+ -- @tparam object match
464+ -- @return[1] self
465+ --
466+ function setopt_fnmatch_function() end
467+
468+
469+ --- Set chunk begin function.
470+ --
471+ -- A callback accepting two or three parameters.
472+ -- The first is the chunk context if any, the second is the @{curl_fileinfo} table.
473+ -- The third parameter contains number of chunks remaining per the transfer.
474+ -- Function must return truthy value or nothing to indicate that transfer can begin.
475+ -- If function raise error or return nil and error message then it indicate
476+ -- that curl should interrupt current transfer operation.
477+ -- False value indicate that curl should skip this chunk.
478+ --
479+ -- @tparam function chunk_bgn
480+ -- @param[opt] context chunk context
481+ -- @return[1] self
482+ --
483+ function setopt_chunk_bgn_function() end
484+
485+ --- Set chunk begin function.
486+ --
487+ -- This call same as easy:setopt_chunk_bgn_function(context.chunk_bgn, context)
488+ --
489+ -- @tparam object context
490+ -- @return[1] self
491+ --
492+ function setopt_chunk_bgn_function() end
493+
494+ --- Set chunk end function.
495+ --
496+ -- A callback accepting zero or one parameter.
497+ -- The only parameter is the chunk context if any.
498+ -- Function must return truthy value or nothing to indicate that transfer can continue
499+ -- otherwise it indicate that curl should interrupt current transfer operation.
500+ --
501+ -- @tparam function chunk_end
502+ -- @param[opt] context chunk context
503+ -- @return[1] self
504+ --
505+ function setopt_chunk_end_function() end
506+
507+ --- Set chunk begin function.
508+ --
509+ -- This call same as easy:setopt_chunk_end_function(context.chunk_end, context)
510+ --
511+ -- @tparam object context
512+ -- @return[1] self
513+ --
514+ function setopt_chunk_end_function() end
515+
370516--- Set HTTP multipart/formdata.
371517--
372518-- Caller does not have to save data.
0 commit comments