crun-cli v1.4.0
C-based project scaffolding CLI
Loading...
Searching...
No Matches
crun_libcurl.h File Reference

Network download helpers built on top of libcurl. More...

#include <stdio.h>
Include dependency graph for crun_libcurl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CURL_CA_CERT_NAME   "cacert-2026-03-19.pem"
#define CURL_CA_CERT_REMOTE_PATH   "https://curl.se/ca/" CURL_CA_CERT_NAME

Functions

size_t write_data (void *, size_t, size_t, void *)
 libcurl write callback used when storing response data to a file.
int download_file (const char *, const char *)
 Download a file from URL to a destination path.

Detailed Description

Network download helpers built on top of libcurl.

Author
ZouariOmar (zouar.nosp@m.ioma.nosp@m.r20@g.nosp@m.mail.nosp@m..com)
Version
0.3
Date
2026-03-18

crun_libcurl.h

Macro Definition Documentation

◆ CURL_CA_CERT_NAME

#define CURL_CA_CERT_NAME   "cacert-2026-03-19.pem"

◆ CURL_CA_CERT_REMOTE_PATH

#define CURL_CA_CERT_REMOTE_PATH   "https://curl.se/ca/" CURL_CA_CERT_NAME

Function Documentation

◆ download_file()

int download_file ( const char * url,
const char * out )

Download a file from URL to a destination path.

Parameters
urlRemote URL.
outDestination file path.
Returns
int EXIT_SUCCESS on success, EXIT_FAILURE otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
ptrPointer to downloaded bytes.
sizeSize of each element.
nmembNumber of elements.
streamDestination stream.
Returns
size_t Number of bytes written.
Here is the caller graph for this function: