C++ -> C
This commit is contained in:
0
asana/asana.c
Normal file
0
asana/asana.c
Normal file
4
asana/asana.h
Normal file
4
asana/asana.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#ifndef ASANA_ASANA_H_
|
||||
#define ASANA_ASANA_H_
|
||||
|
||||
#endif // ASANA_ASANA_H_
|
||||
19
asana/fetch.c
Normal file
19
asana/fetch.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "fetch.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURL *curl;
|
||||
|
||||
bool asana_init() {
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
curl = curl_easy_init();
|
||||
if (!curl) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void asana_cleanup() {
|
||||
curl_global_cleanup();
|
||||
}
|
||||
|
||||
16
asana/fetch.h
Normal file
16
asana/fetch.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef ASANA_FETCH_H_
|
||||
#define ASANA_FETCH_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/**
|
||||
* initialize libcurl
|
||||
*/
|
||||
bool asana_init();
|
||||
|
||||
/**
|
||||
* cleanup libcurl before program end
|
||||
*/
|
||||
void asana_cleanup();
|
||||
|
||||
#endif // ASANA_FETCH_H_
|
||||
Reference in New Issue
Block a user