/* Copyright 1997 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/***************************************************/
/* File   : Fetch.h                                */
/*                                                 */
/* Purpose: Mid-level fetch functions, concerned   */
/*          mostly with HStreams but not low level */
/*          HTMLLib interfacing. Compare with      */
/*          FetchPage.h, which provides a much     */
/*          higher level interface.                */
/*                                                 */
/* Author : A.D.Hodgkinson                         */
/*                                                 */
/* History: 25-Nov-96: Created.                    */
/*          17-Aug-97: Split up to form the        */
/*                     URLveneer.c and FetchHTML.c */
/*                     sources.                    */
/***************************************************/

#include "URLstat.h"

/* General definitions */

#define DISPLAY_NAMED ((HStream *) 0x40000000) /* Large enough not to be a token address */
#define ISBULLET(p)   ((((p)->style) & LI) && !((p)->text))
#define ISLINK(p)     ((((p)->style) & A) && ((p)->anchor))
#define ISOBJECT(p)   ((((p)->tagno) == TAG_OBJECT) && !((p)->flags & HFlags_IgnoreObject))

/* Function prototypes */

_kernel_oserror * fetch_start                 (browser_data * b);
int               fetch_fetching              (browser_data * b);
char            * fetch_find_name_tag         (char * url);
HStream         * fetch_find_anchor_token     (browser_data * b, char * anchor);
void              fetch_preprocess_token      (browser_data * b, HStream * tptr);
void              fetch_fetcher               (browser_data * b);
int               fetch_chkerror              (browser_data * b, _kernel_oserror * e);
_kernel_oserror * fetch_cancel                (browser_data * b);
void              fetch_stop                  (browser_data * b, int keep_source);
void              fetch_authorisation_proceed (browser_data * b, urlstat * context, char * realm, char * url);
void              fetch_authorisation_fail    (browser_data * b);
_kernel_oserror * fetch_get_raw_data          (browser_data * b, unsigned int handle, char * buffer, int size, int * done, int * bytes);