2003-06-30 16:44:03 +04: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-18 03:27:33 +04:00
|
|
|
/** \file
|
|
|
|
* Fetching of data from a URL (interface).
|
2003-02-09 15:58:15 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NETSURF_DESKTOP_FETCH_H_
|
|
|
|
#define _NETSURF_DESKTOP_FETCH_H_
|
|
|
|
|
2003-08-29 16:57:14 +04:00
|
|
|
#include <stdbool.h>
|
2004-01-05 05:10:59 +03:00
|
|
|
#include "netsurf/utils/config.h"
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
FETCH_TYPE,
|
|
|
|
FETCH_DATA,
|
|
|
|
FETCH_FINISHED,
|
|
|
|
FETCH_ERROR,
|
|
|
|
FETCH_REDIRECT,
|
|
|
|
#ifdef WITH_AUTH
|
|
|
|
FETCH_AUTH
|
|
|
|
#endif
|
|
|
|
} fetch_msg;
|
2003-02-09 15:58:15 +03:00
|
|
|
|
|
|
|
struct content;
|
|
|
|
struct fetch;
|
2004-01-20 22:08:34 +03:00
|
|
|
#ifdef WITH_POST
|
2003-10-25 18:13:49 +04:00
|
|
|
struct form_successful_control;
|
2004-01-20 22:08:34 +03:00
|
|
|
#endif
|
2003-02-09 15:58:15 +03:00
|
|
|
|
2003-11-06 22:41:41 +03:00
|
|
|
extern bool fetch_active;
|
|
|
|
|
2003-02-09 15:58:15 +03:00
|
|
|
void fetch_init(void);
|
|
|
|
struct fetch * fetch_start(char *url, char *referer,
|
2004-06-22 21:37:51 +04:00
|
|
|
void (*callback)(fetch_msg msg, void *p, const char *data,
|
|
|
|
unsigned long size),
|
2004-01-20 22:08:34 +03:00
|
|
|
void *p, bool only_2xx
|
|
|
|
#ifdef WITH_POST
|
|
|
|
, char *post_urlenc,
|
2004-01-05 05:10:59 +03:00
|
|
|
struct form_successful_control *post_multipart
|
2004-01-20 22:08:34 +03:00
|
|
|
#endif
|
2004-01-05 05:10:59 +03:00
|
|
|
#ifdef WITH_COOKIES
|
|
|
|
,bool cookies
|
|
|
|
#endif
|
|
|
|
);
|
2003-02-09 15:58:15 +03:00
|
|
|
void fetch_abort(struct fetch *f);
|
|
|
|
void fetch_poll(void);
|
|
|
|
void fetch_quit(void);
|
2003-03-15 18:53:20 +03:00
|
|
|
const char *fetch_filetype(const char *unix_path);
|
2004-03-22 00:32:15 +03:00
|
|
|
char *fetch_mimetype(const char *ro_path);
|
2004-04-02 17:51:13 +04:00
|
|
|
bool fetch_can_fetch(const char *url);
|
2003-02-09 15:58:15 +03:00
|
|
|
|
|
|
|
#endif
|