Skip to content

Commit e2d5cfc

Browse files
committed
Update doc.
1 parent fe202ed commit e2d5cfc

File tree

3 files changed

+94
-36
lines changed

3 files changed

+94
-36
lines changed

doc/config.ld

+28-35
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,38 @@ description='Lua binding to libcurl'
44
format='discount'
55
backtick_references=false
66
file={
7-
'../src/lua/cURL.lua',
8-
'../src/lua/cURL/safe.lua',
9-
'../src/lua/cURL/utils.lua',
10-
'../src/lua/cURL/impl/cURL.lua',
7+
'./curl.ldoc',
8+
'./lcurl.ldoc',
119
}
1210
dir='html'
1311
readme='../README.md'
1412
style='!pale'
1513
kind_names={topic='Manual',script='Programs'}
1614
examples = {
17-
'../examples/lcurl',
18-
'../examples/lcurl/file.lua',
19-
'../examples/lcurl/pause.lua',
20-
'../examples/lcurl/ftpupload.lua',
21-
'../examples/lcurl/easy.obj.lua',
22-
'../examples/lcurl/multi_iterator.lua',
23-
'../examples/lcurl/multi.lua',
24-
'../examples/lcurl/post.lua',
25-
'../examples/lcurl/post_stream.lua',
26-
'../examples/lcurl/share.lua',
27-
'../examples/cURLv3',
28-
'../examples/cURLv3/pop3.lua',
29-
'../examples/cURLv3/file.lua',
30-
'../examples/cURLv3/rss.lua',
31-
'../examples/cURLv3/multi3.lua',
32-
'../examples/cURLv3/multi.lua',
33-
'../examples/cURLv3/post_form.lua',
34-
'../examples/cURLv3/multi2.lua',
35-
'../examples/cURLv2',
36-
'../examples/cURLv2/file.lua',
37-
'../examples/cURLv2/browser.lua',
38-
'../examples/cURLv2/rss.lua',
39-
'../examples/cURLv2/multi.lua',
40-
'../examples/cURLv2/post_stream.lua',
41-
'../test/test_easy.lua',
42-
'../test/run.lua',
43-
'../test/test_form.lua',
44-
'../test/test_safe.lua',
45-
'../test/test_curl.lua',
46-
'../test/.luacov',
47-
'../test/test_pause02.c.lua',
15+
'../examples/lcurl',
16+
'../examples/lcurl/file.lua',
17+
'../examples/lcurl/pause.lua',
18+
'../examples/lcurl/ftpupload.lua',
19+
'../examples/lcurl/easy.obj.lua',
20+
'../examples/lcurl/multi_iterator.lua',
21+
'../examples/lcurl/multi.lua',
22+
'../examples/lcurl/post.lua',
23+
'../examples/lcurl/post_stream.lua',
24+
'../examples/lcurl/share.lua',
25+
26+
'../examples/cURLv2/file.lua',
27+
'../examples/cURLv2/browser.lua',
28+
'../examples/cURLv2/rss.lua',
29+
'../examples/cURLv2/multi.lua',
30+
'../examples/cURLv2/post_stream.lua',
31+
'../examples/cURLv3/post_json.lua',
32+
'../examples/cURLv3/post_form.lua',
33+
34+
'../examples/cURLv3/pop3.lua',
35+
'../examples/cURLv3/file.lua',
36+
'../examples/cURLv3/rss.lua',
37+
'../examples/cURLv3/multi3.lua',
38+
'../examples/cURLv3/multi.lua',
39+
'../examples/cURLv3/post_form.lua',
40+
'../examples/cURLv3/multi2.lua',
4841
}

doc/lcurl.ldoc

+65
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ function version() end
5454
-- if proto.HTTP then ... -- libcurl support http protocol
5555
function 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+
5774
end
5875

5976
--- HTTP multipart/formdata object
@@ -448,6 +465,54 @@ function setopt_fnmatch_function() end
448465
--
449466
function setopt_fnmatch_function() end
450467

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+
451516
--- Set HTTP multipart/formdata.
452517
--
453518
-- Caller does not have to save data.

src/lceasy.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ static int lcurl_easy_set_CHUNK_END_FUNCTION(lua_State *L){
13261326
lcurl_easy_t *p = lcurl_geteasy(L);
13271327
return lcurl_easy_set_callback(L, p, &p->chunk_end,
13281328
CURLOPT_CHUNK_END_FUNCTION, CURLOPT_CHUNK_DATA,
1329-
"chunk_bgn", lcurl_chunk_bgn_callback
1329+
"chunk_end", lcurl_chunk_bgn_callback
13301330
);
13311331
}
13321332

0 commit comments

Comments
 (0)