From afdab77790e8db165b43e9ab34cb26313b067856 Mon Sep 17 00:00:00 2001 From: Erik Prabowo Kamal Date: Tue, 27 Aug 2019 08:28:24 +0800 Subject: Added rtclient module --- .gitmodules | 3 +++ kelakon.pro | 5 +++-- rtclient | 1 + rtclient.c | 33 --------------------------------- rtclient.h | 15 --------------- 5 files changed, 7 insertions(+), 50 deletions(-) create mode 100644 .gitmodules create mode 160000 rtclient delete mode 100644 rtclient.c delete mode 100644 rtclient.h diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ca6a061 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "rtclient"] + path = rtclient + url = ssh://darapsa.co.id/usr/local/git/rtclient.git diff --git a/kelakon.pro b/kelakon.pro index c91ba3e..db85290 100644 --- a/kelakon.pro +++ b/kelakon.pro @@ -1,17 +1,18 @@ QT += quickcontrols2 HEADERS += \ - rtclient.h \ networkworker.hxx SOURCES += \ - rtclient.c \ networkworker.cxx \ main.cxx RESOURCES += kelakon.qrc +INCLUDEPATH += $$PWD/rtclient + LIBS += \ + $$PWD/rtclient/librtclient.a \ -lcurl contains(ANDROID_TARGET_ARCH,arm64-v8a) { diff --git a/rtclient b/rtclient new file mode 160000 index 0000000..647a634 --- /dev/null +++ b/rtclient @@ -0,0 +1 @@ +Subproject commit 647a634d99c37d512cb4589c129985626786e9bd diff --git a/rtclient.c b/rtclient.c deleted file mode 100644 index 1be0579..0000000 --- a/rtclient.c +++ /dev/null @@ -1,33 +0,0 @@ -#ifdef DEBUG -#ifdef ANDROID -#include -#else -#include -#endif // ANDROID -#endif // DEBUG -#include -#include -#include "rtclient.h" - -static CURL *handle = NULL; - -bool rtclient_init() -{ - curl_global_init(CURL_GLOBAL_SSL); - handle = curl_easy_init(); - if (handle) { - curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1L); -#ifdef DEBUG - curl_easy_setopt(handle, CURLOPT_VERBOSE, 1L); -#endif - } - - return (bool)handle; -} - -void rtclient_cleanup() -{ - if (handle) - curl_easy_cleanup(handle); - curl_global_cleanup(); -} diff --git a/rtclient.h b/rtclient.h deleted file mode 100644 index 53b8a51..0000000 --- a/rtclient.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef RTCLIENT_H -#define RTCLIENT_H - -#ifdef __cplusplus -extern "C" { -#endif - - bool rtclient_init(); - void rtclient_cleanup(); - -#ifdef __cplusplus -} -#endif - -#endif // RTCLIENT_H -- cgit v1.2.3