mingw: fix for G_GNUC_NULL_TERMINATED
[siplcs.git] / src / core / http-conn.h
blobfc183104ead8f941e7d7a2c6711e3630bcea0d0d
1 /**
2 * @file http-conn.h
4 * pidgin-sipe
6 * Copyright (C) 2009 pier11 <pier11@operamail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* Forward declarations */
24 struct _PurpleAccount;
26 #define HTTP_CONN_SSL "SSL"
27 #define HTTP_CONN_TCP "TCP"
29 #define HTTP_CONN_ERROR -100
30 #define HTTP_CONN_ERROR_FATAL -200
32 struct http_conn_auth {
33 char *domain;
34 char *user;
35 char *password;
36 int use_negotiate;
38 typedef struct http_conn_auth HttpConnAuth;
40 struct http_conn_struct;
41 typedef struct http_conn_struct HttpConn;
43 /** callback */
44 typedef void (*HttpConnCallback) (int return_code, const char *body,
45 HttpConn *conn, void *data);
47 /**
48 * Creates SSL connection and POST.
50 HttpConn *
51 http_conn_create(struct _PurpleAccount *account,
52 const char *conn_type,
53 const char *full_url,
54 const char *body,
55 const char *content_type,
56 HttpConnAuth *auth,
57 HttpConnCallback callback,
58 void *data);
60 /**
61 * POST on existing http_conn connection.
63 void
64 http_conn_post( HttpConn *http_conn,
65 const char *full_url,
66 const char *body,
67 const char *content_type,
68 HttpConnCallback callback,
69 void *data);
71 /**
72 * Marks connection for close
74 void
75 http_conn_set_close(HttpConn* http_conn);
77 void
78 http_conn_auth_free(struct http_conn_auth* auth);