Skip to content

rsachetto/cfetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cfetch

Simple fetch function using libcurl

Example

#include "cfetch.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv) {

    size_t len;
    char *buffer = cfetch(argv[1], &len);
    char *outfile = argv[2];

    /* memory error */
    if(buffer == NULL)
        return 1;

    FILE *f = fopen(outfile, "wb");

    fwrite(buffer, 1, len, f);
    fclose(f);

}

Usage

$make
$./main https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf teste.pdf

About

Simple fetch function using curl

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published