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

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>
Include dependency graph for crun_libcurl.c:

Classes

struct  DownloadProgress

Functions

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.

Detailed Description

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

crun_libcurl.c

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: