![]() | Fun 0.41.5 The programming language that makes You have fun |
Fun VM opcode snippet: HTTP download to file via libcurl (OP_CURL_DOWNLOAD). More...
Go to the source code of this file.
Functions | |
| free_value (a) | |
| free_value (b) | |
| push_value (vm, make_int(0)) | |
Variables | |
| case | OP_CURL_DOWNLOAD |
| Value | b = pop_value(vm) |
| break | |
Fun VM opcode snippet: HTTP download to file via libcurl (OP_CURL_DOWNLOAD).
This snippet is included by vm.c and implements the OP_CURL_DOWNLOAD instruction. When FUN_WITH_CURL is enabled, it downloads the content at the given URL and writes it to the specified filesystem path.
Stack behavior:
Pops a destination path and URL, streams the HTTP response body into the file, and pushes 1 on success or 0 on any error. Without FUN_WITH_CURL, behaves as a no-op that consumes two values and pushes 0.
Error handling:
Notes:
Definition in file download.c.
| free_value | ( | a | ) |
| free_value | ( | b | ) |
| push_value | ( | vm | , |
| make_int(0) | ) |
| Value b = pop_value(vm) |
Definition at line 84 of file download.c.
| break |
Definition at line 88 of file download.c.
| case OP_CURL_DOWNLOAD |
Definition at line 38 of file download.c.