diff --git a/doc/config.ld b/doc/config.ld index 6df9ff3..17a292b 100644 --- a/doc/config.ld +++ b/doc/config.ld @@ -4,45 +4,38 @@ description='Lua binding to libcurl' format='discount' backtick_references=false file={ - '../src/lua/cURL.lua', - '../src/lua/cURL/safe.lua', - '../src/lua/cURL/utils.lua', - '../src/lua/cURL/impl/cURL.lua', + './curl.ldoc', + './lcurl.ldoc', } dir='html' readme='../README.md' style='!pale' kind_names={topic='Manual',script='Programs'} examples = { -'../examples/lcurl', -'../examples/lcurl/file.lua', -'../examples/lcurl/pause.lua', -'../examples/lcurl/ftpupload.lua', -'../examples/lcurl/easy.obj.lua', -'../examples/lcurl/multi_iterator.lua', -'../examples/lcurl/multi.lua', -'../examples/lcurl/post.lua', -'../examples/lcurl/post_stream.lua', -'../examples/lcurl/share.lua', -'../examples/cURLv3', -'../examples/cURLv3/pop3.lua', -'../examples/cURLv3/file.lua', -'../examples/cURLv3/rss.lua', -'../examples/cURLv3/multi3.lua', -'../examples/cURLv3/multi.lua', -'../examples/cURLv3/post_form.lua', -'../examples/cURLv3/multi2.lua', -'../examples/cURLv2', -'../examples/cURLv2/file.lua', -'../examples/cURLv2/browser.lua', -'../examples/cURLv2/rss.lua', -'../examples/cURLv2/multi.lua', -'../examples/cURLv2/post_stream.lua', -'../test/test_easy.lua', -'../test/run.lua', -'../test/test_form.lua', -'../test/test_safe.lua', -'../test/test_curl.lua', -'../test/.luacov', -'../test/test_pause02.c.lua', + '../examples/lcurl', + '../examples/lcurl/file.lua', + '../examples/lcurl/pause.lua', + '../examples/lcurl/ftpupload.lua', + '../examples/lcurl/easy.obj.lua', + '../examples/lcurl/multi_iterator.lua', + '../examples/lcurl/multi.lua', + '../examples/lcurl/post.lua', + '../examples/lcurl/post_stream.lua', + '../examples/lcurl/share.lua', + + '../examples/cURLv2/file.lua', + '../examples/cURLv2/browser.lua', + '../examples/cURLv2/rss.lua', + '../examples/cURLv2/multi.lua', + '../examples/cURLv2/post_stream.lua', + '../examples/cURLv3/post_json.lua', + '../examples/cURLv3/post_form.lua', + + '../examples/cURLv3/pop3.lua', + '../examples/cURLv3/file.lua', + '../examples/cURLv3/rss.lua', + '../examples/cURLv3/multi3.lua', + '../examples/cURLv3/multi.lua', + '../examples/cURLv3/post_form.lua', + '../examples/cURLv3/multi2.lua', } diff --git a/doc/lcurl.ldoc b/doc/lcurl.ldoc index 7bef225..b997847 100644 --- a/doc/lcurl.ldoc +++ b/doc/lcurl.ldoc @@ -54,6 +54,23 @@ function version() end -- if proto.HTTP then ... -- libcurl support http protocol function version_info() end +--- File description table. +-- +-- Representation for `struct curl_fileinfo` +-- +-- @table curl_fileinfo +-- +-- @tfield string filename +-- @tfield integer filetype +-- @tfield integer time +-- @tfield integer perm +-- @tfield integer uid +-- @tfield integer gid +-- @tfield integer size +-- @tfield integer hardlinks +-- @tfield integer flags +-- @tfield table strings can have this string fields: `time`, `perm` , `user` , `group`, `target` + end --- HTTP multipart/formdata object @@ -448,6 +465,54 @@ function setopt_fnmatch_function() end -- function setopt_fnmatch_function() end + +--- Set chunk begin function. +-- +-- A callback accepting two or three parameters. +-- The first is the chunk context if any, the second is the @{curl_fileinfo} table. +-- The third parameter contains number of chunks remaining per the transfer. +-- Function must return truthy value or nothing to indicate that transfer can begin. +-- If function raise error or return nil and error message then it indicate +-- that curl should interrupt current transfer operation. +-- False value indicate that curl should skip this chunk. +-- +-- @tparam function chunk_bgn +-- @param[opt] context chunk context +-- @return[1] self +-- +function setopt_chunk_bgn_function() end + +--- Set chunk begin function. +-- +-- This call same as easy:setopt_chunk_bgn_function(context.chunk_bgn, context) +-- +-- @tparam object context +-- @return[1] self +-- +function setopt_chunk_bgn_function() end + +--- Set chunk end function. +-- +-- A callback accepting zero or one parameter. +-- The only parameter is the chunk context if any. +-- Function must return truthy value or nothing to indicate that transfer can continue +-- otherwise it indicate that curl should interrupt current transfer operation. +-- +-- @tparam function chunk_end +-- @param[opt] context chunk context +-- @return[1] self +-- +function setopt_chunk_end_function() end + +--- Set chunk begin function. +-- +-- This call same as easy:setopt_chunk_end_function(context.chunk_end, context) +-- +-- @tparam object context +-- @return[1] self +-- +function setopt_chunk_end_function() end + --- Set HTTP multipart/formdata. -- -- Caller does not have to save data. diff --git a/src/lceasy.c b/src/lceasy.c index 1513534..4864e0d 100644 --- a/src/lceasy.c +++ b/src/lceasy.c @@ -1326,7 +1326,7 @@ static int lcurl_easy_set_CHUNK_END_FUNCTION(lua_State *L){ lcurl_easy_t *p = lcurl_geteasy(L); return lcurl_easy_set_callback(L, p, &p->chunk_end, CURLOPT_CHUNK_END_FUNCTION, CURLOPT_CHUNK_DATA, - "chunk_bgn", lcurl_chunk_bgn_callback + "chunk_end", lcurl_chunk_bgn_callback ); }