-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLoader.h
73 lines (60 loc) · 2.31 KB
/
Loader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* @(#)highwire/Loader.h
*/
#ifndef __LOADER_H__
#define __LOADER_H__
#include "mime.h"
typedef struct s_post {
char *Buffer;
size_t BufLength;
char *ContentType;
} * POSTDATA;
typedef struct s_loader {
LOCATION Location; /* where the data come from ... */
CONTAINR Target; /* ... and where they should go to */
ENCODING Encoding;
MIMETYPE MimeType;
LOCATION Referer; /* resource from which the Request-URI was obtained */
char * AuthRealm;
char * AuthBasic;
POSTDATA PostBuf;
char FileExt[4];
char * ExtAppl;
short MarginW, MarginH;
short ScrollV, ScrollH;
/* */
LOCATION Cached;
long Tdiff; /* difference between local and remote time */
long Date; /* remote file date/time */
long Expires; /* local expiration date/time */
size_t DataSize; /* expected data size */
size_t DataFill; /* real number of loaded/received bytes */
char * Data;
BOOL notified; /* if a start notification was sent */
short Retry;
short Error; /* (-)errno or 0 if successfull */
/* */
int (*SuccJob)(void*, long);
void * FreeArg;
/* */
BOOL rdChunked; /* whether the data can't be received in one block */
short rdSocket; /* handle for remote connection */
size_t rdLeft; /* number of bytes to complete the current data chunk */
char * rdDest; /* pointer to write received data */
size_t rdTlen; /* remaining bytes in rdTemp */
char rdTemp[32]; /* buffer for chunk header data */
void * rdList, * rdCurr; /* chunk pointers */
} * LOADER;
LOADER new_loader (LOCATION, CONTAINR target, BOOL lookup);
void delete_loader (LOADER *);
LOADER start_page_load (CONTAINR target, const char * url, LOCATION base,
BOOL user_action, POSTDATA post);
LOADER start_cont_load (CONTAINR target, const char * url, LOCATION base,
BOOL user_action, BOOL use_cache);
LOADER start_objc_load (CONTAINR target, const char * url, LOCATION base,
int (*successor)(void*, long), void * objc);
int saveas_job (void * arg, long invalidated);
long file_size (const LOCATION);
char * load_file (const LOCATION, size_t * expected, size_t * loaded);
POSTDATA new_post(char *buffer, size_t length, char *type);
void delete_post(POSTDATA post);
#endif /* __LOADER_H__ */