summaryrefslogtreecommitdiff
path: root/rtclient
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-14 10:11:10 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-14 10:11:10 +0800
commit670dc1542e022391737c5fcf01b3cbe8f04c8327 (patch)
tree397f5cab73b81e76fcd3df748cf37340ee424897 /rtclient
parent913d8c5f2fbfd542c955227939fdee6fb440648d (diff)
Distribute code
Diffstat (limited to 'rtclient')
-rw-r--r--rtclient/common.h13
-rw-r--r--rtclient/rtclient.h4
-rw-r--r--rtclient/ticket.h11
-rw-r--r--rtclient/user.h11
4 files changed, 35 insertions, 4 deletions
diff --git a/rtclient/common.h b/rtclient/common.h
new file mode 100644
index 0000000..a63a10c
--- /dev/null
+++ b/rtclient/common.h
@@ -0,0 +1,13 @@
+#ifndef RTCLIENT_COMMON_H
+#define RTCLIENT_COMMON_H
+
+#include <curl/curl.h>
+
+extern CURL *curl;
+extern char *server_url;
+
+void request(const char *path, const char *suffix
+ , size_t (*writefunction)(void *, size_t, size_t, void *)
+ , void *writedata, struct curl_httppost *post);
+
+#endif // RTCLIENT_COMMON_H
diff --git a/rtclient/rtclient.h b/rtclient/rtclient.h
index d9a3639..dcc8c7e 100644
--- a/rtclient/rtclient.h
+++ b/rtclient/rtclient.h
@@ -10,10 +10,6 @@ extern "C" {
bool rtclient_init(const char *server_url);
void rtclient_login(const char *name, const char *password);
- void rtclient_user_show(struct rt_user **userptr, const char *name);
- void rtclient_ticket_search(struct rt_ticketlist **listptr, const char *query);
- void rtclient_ticket_freelist(struct rt_ticketlist *list);
- void rtclient_user_free(struct rt_user *user);
void rtclient_cleanup();
#ifdef __cplusplus
diff --git a/rtclient/ticket.h b/rtclient/ticket.h
index 5c9c4da..e21508b 100644
--- a/rtclient/ticket.h
+++ b/rtclient/ticket.h
@@ -6,4 +6,15 @@ struct rt_ticketlist {
char *tickets[];
};
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ void rtclient_ticket_search(struct rt_ticketlist **listptr, const char *query);
+ void rtclient_ticket_freelist(struct rt_ticketlist *list);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif // RTCLIENT_TICKET_H
diff --git a/rtclient/user.h b/rtclient/user.h
index f48162e..7d7aebc 100644
--- a/rtclient/user.h
+++ b/rtclient/user.h
@@ -30,4 +30,15 @@ struct rt_user {
bool disabled;
};
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ void rtclient_user_show(struct rt_user **userptr, const char *name);
+ void rtclient_user_free(struct rt_user *user);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif // RTCLIENT_USER_H