2003-06-30 12:44:03 +00:00
|
|
|
/*
|
|
|
|
* This file is part of NetSurf, http://netsurf.sourceforge.net/
|
|
|
|
* Licensed under the GNU General Public License,
|
|
|
|
* http://www.opensource.org/licenses/gpl-license
|
|
|
|
* Copyright 2003 James Bursa <bursa@users.sourceforge.net>
|
|
|
|
*/
|
|
|
|
|
2003-09-17 23:27:33 +00:00
|
|
|
/** \file
|
|
|
|
* Fetching of data from a URL (interface).
|
2003-02-09 12:58:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NETSURF_DESKTOP_FETCH_H_
|
|
|
|
#define _NETSURF_DESKTOP_FETCH_H_
|
|
|
|
|
2003-08-29 12:57:14 +00:00
|
|
|
#include <stdbool.h>
|
2004-01-05 02:10:59 +00:00
|
|
|
#include "netsurf/utils/config.h"
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
FETCH_TYPE,
|
2004-07-10 02:35:31 +00:00
|
|
|
FETCH_PROGRESS,
|
2004-01-05 02:10:59 +00:00
|
|
|
FETCH_DATA,
|
|
|
|
FETCH_FINISHED,
|
|
|
|
FETCH_ERROR,
|
|
|
|
FETCH_REDIRECT,
|
|
|
|
#ifdef WITH_AUTH
|
|
|
|
FETCH_AUTH
|
|
|
|
#endif
|
|
|
|
} fetch_msg;
|
2003-02-09 12:58:15 +00:00
|
|
|
|
|
|
|
struct content;
|
|
|
|
struct fetch;
|
2004-01-20 19:08:34 +00:00
|
|
|
#ifdef WITH_POST
|
2003-10-25 14:13:49 +00:00
|
|
|
struct form_successful_control;
|
2004-01-20 19:08:34 +00:00
|
|
|
#endif
|
2003-02-09 12:58:15 +00:00
|
|
|
|
2003-11-06 19:41:41 +00:00
|
|
|
extern bool fetch_active;
|
|
|
|
|
2003-02-09 12:58:15 +00:00
|
|
|
void fetch_init(void);
|
|
|
|
struct fetch * fetch_start(char *url, char *referer,
|
2004-06-22 17:37:51 +00:00
|
|
|
void (*callback)(fetch_msg msg, void *p, const char *data,
|
|
|
|
unsigned long size),
|
2004-01-20 19:08:34 +00:00
|
|
|
void *p, bool only_2xx
|
|
|
|
#ifdef WITH_POST
|
|
|
|
, char *post_urlenc,
|
2004-01-05 02:10:59 +00:00
|
|
|
struct form_successful_control *post_multipart
|
2004-01-20 19:08:34 +00:00
|
|
|
#endif
|
2004-01-05 02:10:59 +00:00
|
|
|
#ifdef WITH_COOKIES
|
|
|
|
,bool cookies
|
|
|
|
#endif
|
|
|
|
);
|
2003-02-09 12:58:15 +00:00
|
|
|
void fetch_abort(struct fetch *f);
|
|
|
|
void fetch_poll(void);
|
|
|
|
void fetch_quit(void);
|
2003-03-15 15:53:20 +00:00
|
|
|
const char *fetch_filetype(const char *unix_path);
|
2004-03-21 21:32:15 +00:00
|
|
|
char *fetch_mimetype(const char *ro_path);
|
2004-04-02 13:51:13 +00:00
|
|
|
bool fetch_can_fetch(const char *url);
|
2004-06-27 23:24:11 +00:00
|
|
|
void fetch_change_callback(struct fetch *fetch,
|
|
|
|
void (*callback)(fetch_msg msg, void *p, const char *data,
|
|
|
|
unsigned long size),
|
|
|
|
void *p);
|
2003-02-09 12:58:15 +00:00
|
|
|
|
|
|
|
#endif
|