ELinks 0.18.0
session.h File Reference
#include "bfu/dialog.h"
#include "cache/cache.h"
#include "main/timer.h"
#include "network/state.h"
#include "session/download.h"
#include "session/history.h"
#include "util/lists.h"
#include "viewer/text/vs.h"
Include dependency graph for session.h:

Data Structures

struct  delayed_open
 Used by delayed_open() and delayed_goto_uri_frame(). More...
struct  delayed_rel
struct  frame
 This is generic frame descriptor, meaningful mainly for ses_*_frame*(). More...
struct  iframe
struct  kbdprefix
 Use for keyboard prefixes. More...
struct  session_task
struct  session_status
struct  session
 This is one of the building stones of ELinks architecture — this structure carries information about the specific ELinks session. More...

Macros

#define cur_loc(x)
 This returns a pointer to the current location inside of the given session.

Typedefs

typedef unsigned int remote_session_flags_T

Enumerations

enum  remote_session_flags {
  SES_REMOTE_NEW_TAB = 1 , SES_REMOTE_NEW_WINDOW = 2 , SES_REMOTE_CURRENT_TAB = 4 , SES_REMOTE_PROMPT_URL = 8 ,
  SES_REMOTE_PING = 16 , SES_REMOTE_ADD_BOOKMARK = 32 , SES_REMOTE_INFO_BOX = 64 , SES_REMOTE_RELOAD = 128 ,
  SES_REMOTE_SEARCH = 256
}
enum  kp_mark { KP_MARK_NOTHING , KP_MARK_SET , KP_MARK_GOTO }
enum  task_type {
  TASK_NONE , TASK_FORWARD , TASK_IMGMAP , TASK_RELOAD ,
  TASK_HISTORY
}
 This describes, what are we trying to do right now. More...
enum  insert_mode { INSERT_MODE_LESS , INSERT_MODE_ON , INSERT_MODE_OFF }
enum  navigate_mode { NAVIGATE_LINKWISE , NAVIGATE_CURSOR_ROUTING }

Functions

void print_error_dialog (struct session *ses, struct connection_state state, struct uri *uri, connection_priority_T priority)
void process_file_requests (struct session *)
struct stringencode_session_info (struct string *info, struct string_list_item list *url_list)
int decode_session_info (struct terminal *term, struct terminal_info *info)
 Older elinks versions (up to and including 0.9.1) sends no magic variable and if this is detected we fallback to the old session info format.
int add_session_info (struct session *ses, struct uri *uri, struct uri *referrer, cache_mode_T cache_mode, enum task_type task)
 Registers a base session and returns its id.
void done_saved_session_info (void)
struct sessioninit_session (struct session *ses, struct terminal *term, struct uri *uri, int in_background)
void doc_loading_callback (struct download *, struct session *)
void abort_loading (struct session *, int)
void reload_frame (struct session *, char *, cache_mode_T)
void reload (struct session *, cache_mode_T)
void load_frames (struct session *, struct document_view *)
struct frameses_find_frame (struct session *, const char *)
struct frameses_find_iframe (struct session *, char *)
void free_files (struct session *)
void display_timer (struct session *ses)
 Timer callback for session.display_timer.
void load_common (struct session *ses)
struct downloadget_current_download (struct session *ses)
char * get_current_url (struct session *, char *, size_t)
 Information about the current document.
char * get_current_title (struct session *, char *, size_t)
struct linkget_current_session_link (struct session *ses)
struct linkget_current_link_in_view (struct document_view *doc_view)
char * get_current_link_url (struct session *, char *, size_t)
char * get_current_link_name (struct session *, char *, size_t)
void add_questions_entry (void(*callback)(struct session *, void *), void *data)
void check_questions_queue (struct session *ses)
char * get_homepage_url (void)
int eat_kbd_repeat_count (struct session *ses)
 Returns current keyboard repeat count and reset it.
int set_kbd_repeat_count (struct session *ses, int new_count)
 Set current keyboard repeat count to given value and update link highlighting and status bar.
char * get_ui_clipboard_file (void)
void doc_rerender_after_document_update (struct session *ses)

Variables

struct session list sessions
remote_session_flags_T remote_session_flags
struct questions_entry list questions_queue

Macro Definition Documentation

◆ cur_loc

#define cur_loc ( x)
Value:
((x)->history.current)

This returns a pointer to the current location inside of the given session.

That's nice for encapsulation and already paid out once ;-).

Typedef Documentation

◆ remote_session_flags_T

typedef unsigned int remote_session_flags_T

Enumeration Type Documentation

◆ insert_mode

Enumerator
INSERT_MODE_LESS 
INSERT_MODE_ON 
INSERT_MODE_OFF 

◆ kp_mark

enum kp_mark
Enumerator
KP_MARK_NOTHING 
KP_MARK_SET 
KP_MARK_GOTO 

◆ navigate_mode

Enumerator
NAVIGATE_LINKWISE 
NAVIGATE_CURSOR_ROUTING 

◆ remote_session_flags

Enumerator
SES_REMOTE_NEW_TAB 
SES_REMOTE_NEW_WINDOW 
SES_REMOTE_CURRENT_TAB 
SES_REMOTE_PROMPT_URL 
SES_REMOTE_PING 
SES_REMOTE_ADD_BOOKMARK 
SES_REMOTE_INFO_BOX 
SES_REMOTE_RELOAD 
SES_REMOTE_SEARCH 

◆ task_type

enum task_type

This describes, what are we trying to do right now.

We pass this around so that we can use generic scheduler routines and when the control will get back to our subsystem, we will know what are we up to.

Enumerator
TASK_NONE 
TASK_FORWARD 
TASK_IMGMAP 
TASK_RELOAD 
TASK_HISTORY 

Function Documentation

◆ abort_loading()

void abort_loading ( struct session * ses,
int interrupt )

◆ add_questions_entry()

void add_questions_entry ( void(* callback )(struct session *, void *),
void * data )

◆ add_session_info()

int add_session_info ( struct session * ses,
struct uri * uri,
struct uri * referrer,
cache_mode_T cache_mode,
enum task_type task )

Registers a base session and returns its id.

Value <= 0 means error.

◆ check_questions_queue()

void check_questions_queue ( struct session * ses)

◆ decode_session_info()

int decode_session_info ( struct terminal * term,
struct terminal_info * info )

Older elinks versions (up to and including 0.9.1) sends no magic variable and if this is detected we fallback to the old session info format.

Returns
zero if the info was remote sessions or if it failed to create any sessions.

For this format the magic member of terminal_info hold the length of the URI string. The old format is handled by the default label in the switch.

The new session info format supports extraction of multiple URIS from the terminal_info data member. The magic variable controls how to interpret the fields:

◆ display_timer()

void display_timer ( struct session * ses)

Timer callback for session.display_timer.

As explained in install_timer(), this function must erase the expired timer ID from all variables.

◆ doc_loading_callback()

void doc_loading_callback ( struct download * download,
struct session * ses )

◆ doc_rerender_after_document_update()

void doc_rerender_after_document_update ( struct session * ses)

This is really not nice. But that's the way how to display the final Javascript render taken from toggle_plain_html(ses, ses->doc_view, 0); This is toggled

◆ done_saved_session_info()

void done_saved_session_info ( void )

◆ eat_kbd_repeat_count()

int eat_kbd_repeat_count ( struct session * ses)
related

Returns current keyboard repeat count and reset it.

◆ encode_session_info()

struct string * encode_session_info ( struct string * info,
struct string_list_item list * url_list )

◆ free_files()

void free_files ( struct session * ses)

◆ get_current_download()

struct download * get_current_download ( struct session * ses)
related

◆ get_current_link_in_view()

struct link * get_current_link_in_view ( struct document_view * doc_view)

◆ get_current_link_name()

char * get_current_link_name ( struct session * ,
char * ,
size_t  )
related

◆ get_current_link_url()

char * get_current_link_url ( struct session * ,
char * ,
size_t  )
related

◆ get_current_session_link()

struct link * get_current_session_link ( struct session * ses)
related

◆ get_current_title()

char * get_current_title ( struct session * ,
char * ,
size_t  )
related

◆ get_current_url()

char * get_current_url ( struct session * ,
char * ,
size_t  )
related

Information about the current document.

◆ get_homepage_url()

char * get_homepage_url ( void )

◆ get_ui_clipboard_file()

char * get_ui_clipboard_file ( void )

◆ init_session()

struct session * init_session ( struct session * ses,
struct terminal * term,
struct uri * uri,
int in_background )
related

◆ load_common()

void load_common ( struct session * ses)

◆ load_frames()

void load_frames ( struct session * ses,
struct document_view * doc_view )

◆ print_error_dialog()

void print_error_dialog ( struct session * ses,
struct connection_state state,
struct uri * uri,
connection_priority_T priority )

◆ process_file_requests()

void process_file_requests ( struct session * ses)

◆ reload()

void reload ( struct session * ses,
cache_mode_T cache_mode )

◆ reload_frame()

void reload_frame ( struct session * ses,
char * name,
cache_mode_T cache_mode )

◆ ses_find_frame()

struct frame * ses_find_frame ( struct session * ses,
const char * name )

◆ ses_find_iframe()

struct frame * ses_find_iframe ( struct session * ses,
char * name )

◆ set_kbd_repeat_count()

int set_kbd_repeat_count ( struct session * ses,
int new_count )
related

Set current keyboard repeat count to given value and update link highlighting and status bar.

Variable Documentation

◆ questions_queue

struct questions_entry list questions_queue
extern

◆ remote_session_flags

◆ sessions

struct session list sessions
extern