crun_libcurl source file
More...
#include "../inc/crun_libcurl.h"
#include "../inc/crun_audit.h"
#include "../inc/crun_file_manager.h"
#include <curl/curl.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
|
| size_t | write_data (void *ptr, size_t size, size_t nmemb, void *stream) |
| | libcurl write callback used when storing response data to a file.
|
| int | download_file (const char *url, const char *out) |
| | Download a file from URL to a destination path.
|
crun_libcurl source file
- Author
- ZouariOmar zouar.nosp@m.ioma.nosp@m.r20@g.nosp@m.mail.nosp@m..com
- Version
- 0.1
- Date
- 2025-12-26
- Copyright
- Copyright (c) 2025
crun_libcurl.c
◆ download_file()
| int download_file |
( |
const char * | url, |
|
|
const char * | out ) |
Download a file from URL to a destination path.
- Parameters
-
| url | Remote URL. |
| out | Destination file path. |
- Returns
- int EXIT_SUCCESS on success, EXIT_FAILURE otherwise.
◆ write_data()
| size_t write_data |
( |
void * | ptr, |
|
|
size_t | size, |
|
|
size_t | nmemb, |
|
|
void * | stream ) |
libcurl write callback used when storing response data to a file.
- Parameters
-
| ptr | Pointer to downloaded bytes. |
| size | Size of each element. |
| nmemb | Number of elements. |
| stream | Destination stream. |
- Returns
- size_t Number of bytes written.