diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-11-01 14:40:46 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-11-01 14:40:46 +0100 |
commit | 893403b7cd6793e97fe617218a70bf0d0bfa7142 (patch) | |
tree | 9bd8dff74a88362b7c50a3b32dec888014438a8d /gweb | |
parent | 406ca6dc6ee38abca6dd9f20c458ee37d6b7c963 (diff) | |
download | connman-893403b7cd6793e97fe617218a70bf0d0bfa7142.tar.gz connman-893403b7cd6793e97fe617218a70bf0d0bfa7142.tar.bz2 connman-893403b7cd6793e97fe617218a70bf0d0bfa7142.zip |
Split the GET and POST method APIs
Diffstat (limited to 'gweb')
-rw-r--r-- | gweb/gweb.c | 20 | ||||
-rw-r--r-- | gweb/gweb.h | 11 |
2 files changed, 24 insertions, 7 deletions
diff --git a/gweb/gweb.c b/gweb/gweb.c index eb31ae94..8f5fc0fe 100644 --- a/gweb/gweb.c +++ b/gweb/gweb.c @@ -569,7 +569,7 @@ static void resolv_result(GResolvResultStatus status, start_request(session); } -guint g_web_request(GWeb *web, GWebMethod method, const char *url, +guint g_web_request_get(GWeb *web, const char *url, GWebResultFunc func, gpointer user_data) { struct web_session *session; @@ -629,6 +629,24 @@ guint g_web_request(GWeb *web, GWebMethod method, const char *url, return web->next_query_id++; } +guint g_web_request_post(GWeb *web, const char *url, + const char *type, guint8 *data, gsize length, + GWebResultFunc func, gpointer user_data) +{ + if (web == NULL || url == NULL) + return 0; + + return 0; +} + +gboolean g_web_cancel_request(GWeb *web, guint id) +{ + if (web == NULL) + return FALSE; + + return TRUE; +} + guint16 g_web_result_get_status(GWebResult *result) { if (result == NULL) diff --git a/gweb/gweb.h b/gweb/gweb.h index df947e0a..8e918784 100644 --- a/gweb/gweb.h +++ b/gweb/gweb.h @@ -38,10 +38,6 @@ typedef struct _GWeb GWeb; typedef struct _GWebResult GWebResult; typedef struct _GWebParser GWebParser; -typedef enum { - G_WEB_METHOD_GET, -} GWebMethod; - typedef gboolean (*GWebResultFunc)(GWebResult *result, gpointer user_data); typedef void (*GWebDebugFunc)(const char *str, gpointer user_data); @@ -63,10 +59,13 @@ gboolean g_web_set_user_agent(GWeb *web, const char *format, ...) void g_web_set_close_connection(GWeb *web, gboolean enabled); gboolean g_web_get_close_connection(GWeb *web); -guint g_web_request(GWeb *web, GWebMethod method, const char *url, +guint g_web_request_get(GWeb *web, const char *url, + GWebResultFunc func, gpointer user_data); +guint g_web_request_post(GWeb *web, const char *url, + const char *type, guint8 *data, gsize length, GWebResultFunc func, gpointer user_data); -gboolean g_web_cancel(GWeb *web, guint id); +gboolean g_web_cancel_request(GWeb *web, guint id); guint16 g_web_result_get_status(GWebResult *result); |