ELinks 0.18.0
document.c File Reference

The document base functionality. More...

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "elinks.h"
#include "cache/cache.h"
#include "config/options.h"
#include "document/document.h"
#include "document/forms.h"
#include "document/html/frames.h"
#include "document/html/iframes.h"
#include "document/html/parser.h"
#include "document/html/parser/parse.h"
#include "document/html/renderer.h"
#include "document/options.h"
#include "document/refresh.h"
#include "document/renderer.h"
#include "main/module.h"
#include "main/object.h"
#include "network/dns.h"
#include "protocol/uri.h"
#include "terminal/draw.h"
#include "util/color.h"
#include "util/error.h"
#include "util/lists.h"
#include "util/memory.h"
#include "util/string.h"
#include "viewer/text/link.h"
Include dependency graph for document.c:

Data Structures

struct  document_list
 

Macros

#define check_document_css_magic(document)   1
 

Functions

static void add_to_document_list (struct document_list list *list, struct document *document)
 
static void remove_document_from_format_cache (struct document *document)
 
static void move_document_to_top_of_format_cache (struct document *document)
 
static void get_ip (struct document *document)
 
struct documentinit_document (struct cache_entry *cached, struct document_options *options)
 
static void free_frameset_desc (struct frameset_desc *frameset_desc)
 
static void free_iframeset_desc (struct iframeset_desc *iframeset_desc)
 
void done_link_members (struct link *link)
 Free's the allocated members of the link.
 
void reset_document (struct document *document)
 
void done_document (struct document *document)
 
void release_document (struct document *document)
 
int find_tag (struct document *document, char *name, int namelen)
 
void update_cached_document_options (struct session *ses)
 
struct documentget_cached_document (struct cache_entry *cached, struct document_options *options)
 
void shrink_format_cache (int whole)
 
int get_format_cache_size (void)
 
int get_format_cache_used_count (void)
 
int get_format_cache_refresh_count (void)
 
static void init_documents (struct module *module)
 
static void done_documents (struct module *module)
 
int get_link_number_by_offset (struct document *document, int offset)
 

Variables

static struct document_list list format_cache = { D_LIST_HEAD_EL(format_cache) }
 
const char * script_event_hook_name []
 
struct module document_module
 

Detailed Description

The document base functionality.

Macro Definition Documentation

◆ check_document_css_magic

#define check_document_css_magic ( document)    1

Function Documentation

◆ add_to_document_list()

static void add_to_document_list ( struct document_list list * list,
struct document * document )
static

◆ done_document()

void done_document ( struct document * document)
related

◆ done_documents()

static void done_documents ( struct module * module)
static

◆ done_link_members()

void done_link_members ( struct link * link)

Free's the allocated members of the link.

◆ find_tag()

int find_tag ( struct document * document,
char * name,
int namelen )

◆ free_frameset_desc()

static void free_frameset_desc ( struct frameset_desc * frameset_desc)
static

◆ free_iframeset_desc()

static void free_iframeset_desc ( struct iframeset_desc * iframeset_desc)
static

◆ get_cached_document()

struct document * get_cached_document ( struct cache_entry * cached,
struct document_options * options )

◆ get_format_cache_refresh_count()

int get_format_cache_refresh_count ( void )

◆ get_format_cache_size()

int get_format_cache_size ( void )

◆ get_format_cache_used_count()

int get_format_cache_used_count ( void )

◆ get_ip()

static void get_ip ( struct document * document)
static

◆ get_link_number_by_offset()

int get_link_number_by_offset ( struct document * document,
int offset )

◆ init_document()

struct document * init_document ( struct cache_entry * cached,
struct document_options * options )
related

◆ init_documents()

static void init_documents ( struct module * module)
static

◆ move_document_to_top_of_format_cache()

static void move_document_to_top_of_format_cache ( struct document * document)
static

◆ release_document()

void release_document ( struct document * document)
related

◆ remove_document_from_format_cache()

static void remove_document_from_format_cache ( struct document * document)
static

◆ reset_document()

void reset_document ( struct document * document)

assertm(!is_object_used(document), "Attempt to free locked formatted data."); if_assert_failed return;

if (document->uri) { done_uri(document->uri); document->uri = NULL; } if (document->querydns) { kill_dns_request(&document->querydns); document->querydns = NULL; } mem_free_set(&document->ip, NULL); mem_free_set(&document->title, NULL); if (document->frame_desc) { free_frameset_desc(document->frame_desc); document->frame_desc = NULL; } if (document->refresh) { done_document_refresh(document->refresh); document->refresh = NULL; }

done_document_options(&document->options);

◆ shrink_format_cache()

void shrink_format_cache ( int whole)

◆ update_cached_document_options()

void update_cached_document_options ( struct session * ses)

Variable Documentation

◆ document_module

struct module document_module
Initial value:
"Document",
)
static void done_documents(struct module *module)
Definition document.c:680
static void init_documents(struct module *module)
Definition document.c:674
#define NULL
Definition explodename.c:35
#define struct_module(name, options, hooks, submods, data, init, done, getname)
Definition module.h:47

◆ format_cache

struct document_list list format_cache = { D_LIST_HEAD_EL(format_cache) }
static

◆ script_event_hook_name

const char* script_event_hook_name[]
Initial value:
= {
"click",
"dblclick",
"mouseover",
"hover",
"focus",
"mouseout",
"blur",
"keydown",
"keyup",
"keypress",
"keypress",
}