'smart qotes' now will replace '<', '>' and '&' inside 'pre' and 'code' tags
[k8lowj.git] / src / network-internal.h
blob1e803efa8951cb320b8e6e058f5aba3f49d18a9d
1 /* logjam - a GTK client for LiveJournal.
2 * Copyright (C) 2000-2003 Evan Martin <evan@livejournal.com>
4 * vim: tabstop=4 shiftwidth=4 noexpandtab :
5 */
7 #ifndef network_internal_h
8 #define network_internal_h
10 #include "network.h"
12 /* network-internal -- interface to http, used by network.
13 * provides a blocking and nonblocking interface.
14 * implemented by
15 * network-curl -- curl (unix, fork);
16 * network-win32 -- windows api (windows, threads).
19 #define READ_BLOCK_SIZE 2048
21 typedef enum {
22 NET_STATUS_NULL,
23 NET_STATUS_BEGIN,
24 NET_STATUS_SUCCESS,
25 NET_STATUS_ERROR,
26 NET_STATUS_PROGRESS,
27 NET_STATUS_DONE
28 } NetStatusType;
30 typedef struct {
31 guint32 current;
32 guint32 total;
33 } NetStatusProgress;
35 typedef void (*NetStatusCallback)(NetStatusType status,
36 gpointer statusdata,
37 gpointer data);
39 GString* net_post_blocking(const char *url, GSList *headers, GString *post,
40 NetStatusCallback cb, gpointer data,
41 GError **err);
43 typedef void* NetMainloopHandle;
45 GString* net_post_mainloop(const char *url, GSList *headers, GString *post,
46 NetStatusCallback cb, gpointer data,
47 GError **err);
48 void net_mainloop_cancel(NetMainloopHandle handle);
50 gboolean net_verb_run_internal(LJVerb *verb,
51 NetStatusCallback cb, gpointer data,
52 GError **err);
54 #endif /* network_internal_h */