Skip to content

byfourthwall/em-libcurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

em-libcurl

MIT License

emeralds wrapper for the libcurl C library.

Installation

em install https://github.com/byfourthwall/em-libcurl

Prerequisites: installing libcurl

This wrapper does not ship libcurl itself; it links your system's copy, which is already present on virtually every platform:

Platform Install libcurl (if missing)
macOS Ships with the OS (/usr/lib/libcurl.dylib)
Linux Debian/Ubuntu: apt install libcurl4-openssl-dev
Windows MSYS2: pacman -S mingw-w64-x86_64-curl

Usage

#include "libs/em-libcurl.h"
#include <stdio.h>

static size_t on_data(void *p, size_t s, size_t n, void *u) {
  (void)p; (void)s; (void)n; (void)u;
  return 0;
}

int main(void) {
  CURL *c;
  curl_global_init(CURL_GLOBAL_DEFAULT);
  c = curl_easy_init();
  curl_easy_setopt(c, CURLOPT_URL, "https://example.com");
  curl_easy_setopt(c, CURLOPT_WRITEFUNCTION, on_data);
  curl_easy_perform(c);
  curl_easy_cleanup(c);
  curl_global_cleanup();
  return 0;
}

Contributing

  1. Fork it (https://github.com/byfourthwall/em-libcurl/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • atha - creator and maintainer

About

emeralds wrapper for libcurl.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages