/* @(#)html_extern.h 1.4 95/09/16 */

/*
 * Copyright (c) 1994, 1995 by Wayne C. Gramlich.  All rights reserved.
 *
 * Permission to use, copy, modify, distribute, and sell this software
 * for any purpose is hereby granted without fee provided that the above
 * copyright notice and this permission are retained.  The author makes
 * no representations about the suitability of this software for any purpose.
 * It is provided "as is" without express or implied warranty.
 */

#if !defined(HTML_EXTERN_H)
#define HTML_EXTERN_H

#include <stdio.h>

#include "config_typedef.h"
#include "error_typedef.h"
#include "html_typedef.h"
#include "remote_typedef.h"
#include "str_typedef.h"
#include "text_typedef.h"
#include "url_typedef.h"

#define TAG_END_SEARCH(variable, tags, tag_name) \
    VECTOR_LOOP(Tag, variable, tags) \
	if (tag_is_end(variable) && tag_is_name(variable, tag_name))

#define TAG_START_SEARCH(variable, tags, tag_name) \
    VECTOR_LOOP(Tag, variable, tags) \
	if (tag_is_start(variable) && tag_is_name(variable, tag_name))

extern void attributes_scan(Attributes, Remote, Config);
extern Str attributes_search(Attributes, Str);

extern Tags html_tags(Html);

extern Html html_parse(Text);
extern Html html_read(Url, Errors);
extern Match html_search(Html, Str, Remote);
extern void html_write_public_annotation(Html, FILE *, Str, Str);
extern void html_write_remaining(Html, FILE *, int);
extern void html_write_to_body_end(Html, FILE *, Matches, int);
extern void html_write_to_body_start(Html, FILE *, int);

extern Matches matches_create(void);
extern void matches_append(Matches, Match);
extern void matches_sort(Matches);

extern Attributes tag_attributes(Tag);
extern int tag_is_end(Tag);
extern int tag_is_name(Tag, Str);
extern int tag_is_start(Tag);
extern Text tag_preceeding_text(Tag);

#endif /* HTML_EXTERN_H */

