You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/luacrypto_acompress.c
+59-9Lines changed: 59 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@
28
28
#include<lua.h>
29
29
#include<lualib.h>
30
30
#include<lauxlib.h>
31
+
31
32
#include<lunatik.h>
32
33
33
34
#include"luacrypto.h"
@@ -213,7 +214,32 @@ static int luacrypto_acomp_req_##name(lua_State *L) \
213
214
return 0; \
214
215
}
215
216
217
+
/***
218
+
* Request object methods.
219
+
* These methods are available on request objects created by `ACOMPRESS:request()`.
220
+
* @type crypto_acomp_req
221
+
*/
222
+
223
+
/***
224
+
* Compresses data asynchronously using the ACOMPRESS transform.
225
+
* The callback is invoked when the operation completes (either synchronously or asynchronously).
226
+
* @function compress
227
+
* @tparam string data The data to compress.
228
+
* @tparam integer output_size The maximum size of the output buffer.
229
+
* @tparam function callback The callback function to invoke upon completion. It receives two arguments: `err` (integer error code, 0 on success) and `data` (string containing compressed data, or nil on error).
230
+
* @raise Error if the request object is busy, or if parameters are invalid.
231
+
*/
216
232
LUACRYPTO_ACOMP_REQ_OPERATION(compress)
233
+
234
+
/***
235
+
* Decompresses data asynchronously using the ACOMPRESS transform.
236
+
* The callback is invoked when the operation completes (either synchronously or asynchronously).
237
+
* @function decompress
238
+
* @tparam string data The compressed data to decompress.
239
+
* @tparam integer output_size The maximum size of the output buffer.
240
+
* @tparam function callback The callback function to invoke upon completion. It receives two arguments: `err` (integer error code, 0 on success) and `data` (string containing decompressed data, or nil on error).
241
+
* @raise Error if the request object is busy, or if parameters are invalid.
0 commit comments