ELinks 0.16.1.1
parser.c File Reference
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "bfu/listmenu.h"
#include "bfu/menu.h"
#include "document/css/apply.h"
#include "document/css/css.h"
#include "document/css/stylesheet.h"
#include "document/html/frames.h"
#include "document/html/parse-meta-refresh.h"
#include "document/html/parser/link.h"
#include "document/html/parser/stack.h"
#include "document/html/parser/parse.h"
#include "document/html/parser.h"
#include "document/html/renderer.h"
#include "document/options.h"
#include "document/renderer.h"
#include "intl/charsets.h"
#include "protocol/date.h"
#include "protocol/header.h"
#include "protocol/uri.h"
#include "session/task.h"
#include "terminal/draw.h"
#include "util/align.h"
#include "util/box.h"
#include "util/color.h"
#include "util/conv.h"
#include "util/error.h"
#include "util/memdebug.h"
#include "util/memlist.h"
#include "util/memory.h"
#include "util/string.h"
#include "document/html/internal.h"
Include dependency graph for parser.c:

Macros

#define _GNU_SOURCE   /* XXX: we _WANT_ strcasestr() ! */

Functions

static int extract_color (struct html_context *html_context, char *a, const char *attribute, color_T *rgb)
int get_color (struct html_context *html_context, char *a, const char *attribute, color_T *rgb)
int get_color2 (struct html_context *html_context, char *value_value, color_T *rgb)
int get_bgcolor (struct html_context *html_context, char *a, color_T *rgb)
char * get_target (struct document_options *options, char *a)
void ln_break (struct html_context *html_context, int n)
void put_chrs (struct html_context *html_context, const char *start, int len)
void set_fragment_identifier (struct html_context *html_context, char *attr_name, const char *attr)
void add_fragment_identifier (struct html_context *html_context, struct part *part, char *attr)
void html_focusable (struct html_context *html_context, char *a)
void html_skip (struct html_context *html_context, char *a)
static void check_head_for_refresh (struct html_context *html_context, char *head)
static void check_head_for_cache_control (struct html_context *html_context, char *head)
void process_head (struct html_context *html_context, char *head)
static int look_for_map (char **pos, char *eof, struct uri *uri, struct document_options *options)
static int look_for_tag (char **pos, char *eof, char *name, int namelen, char **label)
static int look_for_link (char **pos, char *eof, struct menu_item **menu, struct memory_list **ml, struct uri *href_base, char *target_base, struct conv_table *ct, struct document_options *options)
int get_image_map (char *head, char *pos, char *eof, struct menu_item **menu, struct memory_list **ml, struct uri *uri, struct document_options *options, char *target_base, int to, int def, int hdef)
void * init_html_parser_state (struct html_context *html_context, enum html_element_mortality_type type, int align, int margin, int width)
void done_html_parser_state (struct html_context *html_context, void *state)
struct html_contextinit_html_parser (struct uri *uri, struct document_options *options, char *start, char *end, struct string *head, struct string *title, void(*put_chars)(struct html_context *, const char *, int), void(*line_break)(struct html_context *), void *(*special)(struct html_context *, html_special_type_T,...))
void done_html_parser (struct html_context *html_context)

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE   /* XXX: we _WANT_ strcasestr() ! */

Function Documentation

◆ add_fragment_identifier()

void add_fragment_identifier ( struct html_context * html_context,
struct part * part,
char * attr )

◆ check_head_for_cache_control()

void check_head_for_cache_control ( struct html_context * html_context,
char * head )
static

◆ check_head_for_refresh()

void check_head_for_refresh ( struct html_context * html_context,
char * head )
static

◆ done_html_parser()

void done_html_parser ( struct html_context * html_context)

◆ done_html_parser_state()

void done_html_parser_state ( struct html_context * html_context,
void * state )

◆ extract_color()

int extract_color ( struct html_context * html_context,
char * a,
const char * attribute,
color_T * rgb )
static

◆ get_bgcolor()

int get_bgcolor ( struct html_context * html_context,
char * a,
color_T * rgb )

◆ get_color()

int get_color ( struct html_context * html_context,
char * a,
const char * attribute,
color_T * rgb )

◆ get_color2()

int get_color2 ( struct html_context * html_context,
char * value_value,
color_T * rgb )

◆ get_image_map()

int get_image_map ( char * head,
char * pos,
char * eof,
struct menu_item ** menu,
struct memory_list ** ml,
struct uri * uri,
struct document_options * options,
char * target_base,
int to,
int def,
int hdef )

◆ get_target()

char * get_target ( struct document_options * options,
char * a )

◆ html_focusable()

void html_focusable ( struct html_context * html_context,
char * a )

◆ html_skip()

void html_skip ( struct html_context * html_context,
char * a )

◆ init_html_parser()

struct html_context * init_html_parser ( struct uri * uri,
struct document_options * options,
char * start,
char * end,
struct string * head,
struct string * title,
void(* put_chars )(struct html_context *, const char *, int),
void(* line_break )(struct html_context *),
void *(* special )(struct html_context *, html_special_type_T,...) )

◆ init_html_parser_state()

void * init_html_parser_state ( struct html_context * html_context,
enum html_element_mortality_type type,
int align,
int margin,
int width )

◆ ln_break()

void ln_break ( struct html_context * html_context,
int n )

◆ look_for_link()

int look_for_link ( char ** pos,
char * eof,
struct menu_item ** menu,
struct memory_list ** ml,
struct uri * href_base,
char * target_base,
struct conv_table * ct,
struct document_options * options )
static
Returns
-1 if EOF is hit without the closing tag; 0 if the closing tag is found (in which case this also adds *menu to *ml); or 1 if this should be called again.

◆ look_for_map()

int look_for_map ( char ** pos,
char * eof,
struct uri * uri,
struct document_options * options )
static

◆ look_for_tag()

int look_for_tag ( char ** pos,
char * eof,
char * name,
int namelen,
char ** label )
static

◆ process_head()

void process_head ( struct html_context * html_context,
char * head )

◆ put_chrs()

void put_chrs ( struct html_context * html_context,
const char * start,
int len )

◆ set_fragment_identifier()

void set_fragment_identifier ( struct html_context * html_context,
char * attr_name,
const char * attr )