summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Prabowo Kamal <erik@darapsa.co.id>2019-08-27 08:28:24 +0800
committerErik Prabowo Kamal <erik@darapsa.co.id>2019-08-27 08:28:24 +0800
commitafdab77790e8db165b43e9ab34cb26313b067856 (patch)
tree71a96cde29f2da00683ded90c99db8b72df007e5
parent9716f5aab10be667878942cb5c89a7433a420086 (diff)
Added rtclient module
-rw-r--r--.gitmodules3
-rw-r--r--kelakon.pro5
m---------rtclient0
-rw-r--r--rtclient.c33
-rw-r--r--rtclient.h15
5 files changed, 6 insertions, 50 deletions
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
+Subproject 647a634d99c37d512cb4589c129985626786e9b
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 <android/log.h>
-#else
-#include <stdio.h>
-#endif // ANDROID
-#endif // DEBUG
-#include <stdbool.h>
-#include <curl/curl.h>
-#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