From cdea9154ff180e95dfbdd8e0647922ca8afa3d46 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 21 May 2016 11:30:28 -0400 Subject: Projects using libtwitter++ no longer have to include its dependencies --- CMakeLists.txt | 2 +- src/client.cpp | 4 +++- src/client.h | 12 +++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c43670..29a0a75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,4 +13,4 @@ include_directories(${CURLCPP_SOURCE_DIR}/include) add_library(twitter++ src/client.cpp src/auth.cpp src/tweet.cpp src/codes.cpp src/notification.cpp src/direct_message.cpp src/list.cpp src/user.cpp) set_property(TARGET twitter++ PROPERTY CXX_STANDARD 11) set_property(TARGET twitter++ PROPERTY CXX_STANDARD_REQUIRED ON) -target_link_libraries(twitter++ oauthcpp curlcpp) +target_link_libraries(twitter++ oauthcpp curlcpp curl pthread) diff --git a/src/client.cpp b/src/client.cpp index ffb651b..bae563f 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include "util.h" #include @@ -727,7 +729,7 @@ namespace twitter { } } - int client::stream::write(char* ptr, size_t size, size_t nmemb) + size_t client::stream::write(char* ptr, size_t size, size_t nmemb) { for (size_t i = 0; i < size*nmemb; i++) { diff --git a/src/client.h b/src/client.h index ae80ed9..750d603 100644 --- a/src/client.h +++ b/src/client.h @@ -5,8 +5,6 @@ #include "tweet.h" #include "auth.h" #include -#include -#include #include #include #include "notification.h" @@ -20,6 +18,8 @@ namespace OAuth { class Client; }; +class curl_httppost; + namespace twitter { class client { @@ -36,6 +36,9 @@ namespace twitter { void start(); void stop(); + int progress(); + size_t write(char* ptr, size_t size, size_t nmemb); + private: enum class backoff { none, @@ -45,11 +48,6 @@ namespace twitter { }; void run(); - int progress(); - int write(char* ptr, size_t size, size_t nmemb); - - friend int client_stream_progress_callback_wrapper(void* stream, curl_off_t, curl_off_t, curl_off_t, curl_off_t); - friend size_t client_stream_write_callback_wrapper(void* ptr, size_t size, size_t nmemb, void* stream); client& _client; notify_callback _notify; -- cgit 1.4.1