[bugfix] temporary bugfix by removing the curl library, will reimplement it later
This commit is contained in:
parent
b26fd0a638
commit
28309edcaf
@ -11,4 +11,3 @@ ADD_EXECUTABLE(main
|
|||||||
source/lib.c
|
source/lib.c
|
||||||
)
|
)
|
||||||
|
|
||||||
TARGET_INCLUDE_DIRECTORIES(main PRIVATE source/lib/osx source/lib/linux)
|
|
||||||
|
|||||||
@ -6,7 +6,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
#ifndef LIB_L
|
#ifndef LIB_H
|
||||||
#ifndef LIB_O
|
#define LIB_H
|
||||||
|
|
||||||
#define LIB_L
|
|
||||||
#define LIB_O
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
|
||||||
@ -27,5 +25,3 @@ void device_model();
|
|||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|||||||
@ -1,56 +1,12 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <curl/curl.h>
|
|
||||||
#include <cjson/cJSON.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "lib.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
void get_cpu();
|
||||||
void *gather_cpu_information();
|
void get_ram();
|
||||||
void *gather_ram_information();
|
void get_disk();
|
||||||
void *gather_disk_information();
|
void get_device();
|
||||||
void *gather_device_information();
|
|
||||||
void get_c_version();
|
|
||||||
|
|
||||||
/*
|
|
||||||
cJSON convert_to_json() {
|
|
||||||
|
|
||||||
cJSON *root = cJSON_CreateObject();
|
|
||||||
cJSON_AddStringToObject(root, "cpu", info.cpu->name);
|
|
||||||
cJSON_AddNumberToObject(root, "ram", info.ram->total);
|
|
||||||
cJSON_AddStringToObject(root, "disk", info.disk->name);
|
|
||||||
cJSON_AddStringToObject(root, "device", info.device->name);
|
|
||||||
|
|
||||||
return *root;
|
|
||||||
}
|
|
||||||
|
|
||||||
void handler(char *url) {
|
|
||||||
CURL *curl;
|
|
||||||
CURLcode res;
|
|
||||||
|
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
|
||||||
curl = curl_easy_init();
|
|
||||||
|
|
||||||
if (curl) {
|
|
||||||
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
|
||||||
|
|
||||||
// TO DO
|
|
||||||
// parse the object to a json and pass that as an argument to post it
|
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, NULL);
|
|
||||||
|
|
||||||
res = curl_easy_perform(curl);
|
|
||||||
if (res != CURLE_OK)
|
|
||||||
fprintf(stderr, "curl_easy_perform() failed: %s\n",
|
|
||||||
curl_easy_strerror(res));
|
|
||||||
|
|
||||||
curl_easy_cleanup(curl);
|
|
||||||
}
|
|
||||||
curl_global_cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
void get_c_version()
|
void get_c_version()
|
||||||
{
|
{
|
||||||
@ -68,6 +24,8 @@ void get_c_version()
|
|||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
|
||||||
|
printf("%d", u_cpu->temperature);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user