summaryrefslogtreecommitdiffstats
path: root/lib/utils
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-08-26 16:33:27 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-08-26 16:33:27 +0200
commit568f01db9d2e2f540ec855b622b4e93162e0f21d (patch)
treee5bb655ba022c69e558ffda799fccfd7e855179b /lib/utils
parenta46a672a02f6e532947daf49ed5ca1e4b962b055 (diff)
downloadabrt-568f01db9d2e2f540ec855b622b4e93162e0f21d.tar.gz
abrt-568f01db9d2e2f540ec855b622b4e93162e0f21d.tar.xz
abrt-568f01db9d2e2f540ec855b622b4e93162e0f21d.zip
abrt_curl.cpp -> abrt_curl.c, abrt_rh_support.cpp -> abrt_rh_support.c
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/Makefile.am4
-rw-r--r--lib/utils/abrt_curl.c (renamed from lib/utils/abrt_curl.cpp)4
-rw-r--r--lib/utils/abrt_curl.h8
-rw-r--r--lib/utils/abrt_rh_support.c (renamed from lib/utils/abrt_rh_support.cpp)12
-rw-r--r--lib/utils/abrt_rh_support.h8
5 files changed, 22 insertions, 14 deletions
diff --git a/lib/utils/Makefile.am b/lib/utils/Makefile.am
index 5bacd991..66a48b06 100644
--- a/lib/utils/Makefile.am
+++ b/lib/utils/Makefile.am
@@ -56,8 +56,8 @@ libABRTdUtils_la_SOURCES = \
make_descr.cpp \
$(HEADER_DIR)/comm_layer_inner.h CommLayerInner.cpp \
$(HEADER_DIR)/abrt_xmlrpc.h abrt_xmlrpc.cpp \
- abrt_rh_support.h abrt_rh_support.cpp \
- abrt_curl.h abrt_curl.cpp \
+ abrt_rh_support.h abrt_rh_support.c \
+ abrt_curl.h abrt_curl.c \
$(HEADER_DIR)/plugin.h Plugin.cpp \
Polkit.h Polkit.cpp
diff --git a/lib/utils/abrt_curl.cpp b/lib/utils/abrt_curl.c
index a836f704..80faa19c 100644
--- a/lib/utils/abrt_curl.cpp
+++ b/lib/utils/abrt_curl.c
@@ -20,8 +20,6 @@
#include "abrt_curl.h"
#include "comm_layer_inner.h"
-using namespace std;
-
/*
* Utility functions
*/
@@ -170,7 +168,7 @@ static size_t fread_with_reporting(void *ptr, size_t size, size_t nmemb, void *u
fseeko(fp, 0, SEEK_END);
off_t sz = ftello(fp);
fseeko(fp, cur_pos, SEEK_SET);
- update_client(_("Uploaded: %llu of %llu kbytes"),
+ error_msg(_("Uploaded: %llu of %llu kbytes"),
(unsigned long long)cur_pos / 1024,
(unsigned long long)sz / 1024);
}
diff --git a/lib/utils/abrt_curl.h b/lib/utils/abrt_curl.h
index 1f34e7ec..77b4605c 100644
--- a/lib/utils/abrt_curl.h
+++ b/lib/utils/abrt_curl.h
@@ -21,6 +21,10 @@
#include <curl/curl.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
CURL* xcurl_easy_init();
typedef struct abrt_post_state {
@@ -85,4 +89,8 @@ abrt_post_file_as_form(abrt_post_state_t *state,
return abrt_post(state, url, content_type, filename, ABRT_POST_DATA_FROMFILE_AS_FORM_DATA);
}
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/lib/utils/abrt_rh_support.cpp b/lib/utils/abrt_rh_support.c
index fd78a427..04e2c8ef 100644
--- a/lib/utils/abrt_rh_support.cpp
+++ b/lib/utils/abrt_rh_support.c
@@ -16,19 +16,13 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-//#define _GNU_SOURCE
-
#include <libxml/encoding.h>
#include <libxml/xmlwriter.h>
#include <curl/curl.h>
#include "abrtlib.h"
#include "abrt_curl.h"
-#include "abrt_xmlrpc.h"
-#include "abrt_exception.h"
#include "abrt_rh_support.h"
-using namespace std;
-
struct reportfile {
xmlTextWriterPtr writer;
xmlBufferPtr buf;
@@ -225,7 +219,7 @@ post_signature(const char* baseURL, bool ssl_verify, const char* signature)
{
char *URL = concat_path_file(baseURL, "/signatures");
- abrt_post_state *state = new_abrt_post_state(0
+ abrt_post_state_t *state = new_abrt_post_state(0
+ ABRT_POST_WANT_HEADERS
+ ABRT_POST_WANT_BODY
+ ABRT_POST_WANT_ERROR_MSG
@@ -381,7 +375,7 @@ send_report_to_new_case(const char* baseURL,
char *errmsg;
char *allocated = NULL;
char* retval = NULL;
- abrt_post_state *case_state;
+ abrt_post_state_t *case_state;
redirect_case:
case_state = new_abrt_post_state(0
@@ -446,7 +440,7 @@ send_report_to_new_case(const char* baseURL,
}
char *atch_url = concat_path_file(case_location, "/attachments");
- abrt_post_state *atch_state;
+ abrt_post_state_t *atch_state;
redirect_attach:
atch_state = new_abrt_post_state(0
+ ABRT_POST_WANT_HEADERS
diff --git a/lib/utils/abrt_rh_support.h b/lib/utils/abrt_rh_support.h
index 393a1a2c..db6e9cd7 100644
--- a/lib/utils/abrt_rh_support.h
+++ b/lib/utils/abrt_rh_support.h
@@ -19,6 +19,10 @@
#ifndef ABRT_RH_SUPPORT_H_
#define ABRT_RH_SUPPORT_H_ 1
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct reportfile reportfile_t;
reportfile_t *new_reportfile(void);
@@ -44,4 +48,8 @@ send_report_to_new_case(const char* baseURL,
const char* component,
const char* report_file_name);
+#ifdef __cplusplus
+}
+#endif
+
#endif