ELinks 0.16.1.1
core.c File Reference
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
#include "elinks.h"
#include "bfu/dialog.h"
#include "cache/cache.h"
#include "config/home.h"
#include "config/kbdbind.h"
#include "config/options.h"
#include "config/opttypes.h"
#include "document/document.h"
#include "document/renderer.h"
#include "document/view.h"
#include "intl/charsets.h"
#include "intl/libintl.h"
#include "main/event.h"
#include "main/module.h"
#include "osdep/osdep.h"
#include "osdep/signals.h"
#include "protocol/uri.h"
#include "scripting/lua/core.h"
#include "session/location.h"
#include "session/session.h"
#include "session/task.h"
#include "terminal/terminal.h"
#include "util/color.h"
#include "util/conv.h"
#include "util/file.h"
#include "util/memory.h"
#include "util/string.h"
#include "viewer/dump/dump.h"
#include "viewer/text/view.h"
#include "viewer/text/vs.h"
Include dependency graph for core.c:

Data Structures

struct  lua_dlg_data
struct  lua_xdialog_data

Macros

#define LUA_HOOKS_FILENAME   "hooks.lua"
#define L   lua_state
#define LS   lua_State *S
#define L_EDIT_BMK_WIDGETS_COUNT   5
#define XDIALOG_MAX_FIELDS   5

Functions

static void handle_standard_lua_returns (const char *from)
static void handle_ref (LS, struct session *ses, int func_ref, const char *from, int num_args, int unref)
static int l_alert (LS)
static int l_current_url (LS)
static int l_current_link (LS)
static int l_current_title (LS)
static int l_current_document (LS)
static int l_current_document_formatted (LS)
static int l_pipe_read (LS)
static int l_execute (LS)
static int l_tmpname (LS)
static enum evhook_status run_lua_func (va_list ap, void *data)
static int l_bind_key (LS)
static void dialog_run_lua (void *data_)
static int l_edit_bookmark_dialog (LS)
static void xdialog_run_lua (void *data_)
static int l_xdialog (LS)
static int l_set_option (LS)
static int l_get_option (LS)
static int l_reload (LS)
static int l_goto_url (LS)
int eval_function (LS, int num_args, int num_results)
static void do_hooks_file (LS, const char *prefix, const char *filename)
void init_lua (struct module *module)
static void free_lua_console_history_entries (void)
void cleanup_lua (struct module *module)
static void handle_sigint (void *data)
int prepare_lua (struct session *ses)
void finish_lua (void)
void alert_lua_error (const char *msg)
void alert_lua_error2 (const char *msg, const char *msg2)
static void handle_ret_eval (struct session *ses)
static void handle_ret_run (struct session *ses)
static void handle_ret_goto_url (struct session *ses)
static void handle_ref_on_stack (LS, struct session *ses, const char *from, int num_args)
static INIT_INPUT_HISTORY (lua_console_history)
static void lua_console (struct session *ses, char *expr)
enum evhook_status dialog_lua_console (va_list ap, void *data)
enum evhook_status free_lua_console_history (va_list ap, void *data)

Variables

lua_State * lua_state
static struct sessionlua_ses
static struct terminalerrterm
static sigjmp_buf errjmp
static char elluaversion [32]

Macro Definition Documentation

◆ L

#define L   lua_state

◆ L_EDIT_BMK_WIDGETS_COUNT

#define L_EDIT_BMK_WIDGETS_COUNT   5

◆ LS

#define LS   lua_State *S

◆ LUA_HOOKS_FILENAME

#define LUA_HOOKS_FILENAME   "hooks.lua"

◆ XDIALOG_MAX_FIELDS

#define XDIALOG_MAX_FIELDS   5

Function Documentation

◆ alert_lua_error()

void alert_lua_error ( const char * msg)

◆ alert_lua_error2()

void alert_lua_error2 ( const char * msg,
const char * msg2 )

◆ cleanup_lua()

void cleanup_lua ( struct module * module)

◆ dialog_lua_console()

enum evhook_status dialog_lua_console ( va_list ap,
void * data )

◆ dialog_run_lua()

void dialog_run_lua ( void * data_)
static

◆ do_hooks_file()

void do_hooks_file ( LS ,
const char * prefix,
const char * filename )
static

◆ eval_function()

int eval_function ( LS ,
int num_args,
int num_results )

◆ finish_lua()

void finish_lua ( void )

◆ free_lua_console_history()

enum evhook_status free_lua_console_history ( va_list ap,
void * data )

◆ free_lua_console_history_entries()

void free_lua_console_history_entries ( void )
static

◆ handle_ref()

void handle_ref ( LS ,
struct session * ses,
int func_ref,
const char * from,
int num_args,
int unref )
static

◆ handle_ref_on_stack()

void handle_ref_on_stack ( LS ,
struct session * ses,
const char * from,
int num_args )
static

◆ handle_ret_eval()

void handle_ret_eval ( struct session * ses)
static

◆ handle_ret_goto_url()

void handle_ret_goto_url ( struct session * ses)
static

◆ handle_ret_run()

void handle_ret_run ( struct session * ses)
static

◆ handle_sigint()

void handle_sigint ( void * data)
static

◆ handle_standard_lua_returns()

void handle_standard_lua_returns ( const char * from)
static

◆ INIT_INPUT_HISTORY()

INIT_INPUT_HISTORY ( lua_console_history )
static

◆ init_lua()

void init_lua ( struct module * module)

◆ l_alert()

int l_alert ( LS )
static

◆ l_bind_key()

int l_bind_key ( LS )
static

◆ l_current_document()

int l_current_document ( LS )
static

◆ l_current_document_formatted()

int l_current_document_formatted ( LS )
static

◆ l_current_link()

int l_current_link ( LS )
static

◆ l_current_title()

int l_current_title ( LS )
static

◆ l_current_url()

int l_current_url ( LS )
static

◆ l_edit_bookmark_dialog()

int l_edit_bookmark_dialog ( LS )
static

◆ l_execute()

int l_execute ( LS )
static

◆ l_get_option()

int l_get_option ( LS )
static

◆ l_goto_url()

int l_goto_url ( LS )
static

◆ l_pipe_read()

int l_pipe_read ( LS )
static

◆ l_reload()

int l_reload ( LS )
static

◆ l_set_option()

int l_set_option ( LS )
static

◆ l_tmpname()

int l_tmpname ( LS )
static

◆ l_xdialog()

int l_xdialog ( LS )
static

◆ lua_console()

void lua_console ( struct session * ses,
char * expr )
static

◆ prepare_lua()

int prepare_lua ( struct session * ses)

◆ run_lua_func()

enum evhook_status run_lua_func ( va_list ap,
void * data )
static

◆ xdialog_run_lua()

void xdialog_run_lua ( void * data_)
static

Variable Documentation

◆ elluaversion

char elluaversion[32]
static

◆ errjmp

sigjmp_buf errjmp
static

◆ errterm

struct terminal* errterm
static

◆ lua_ses

struct session* lua_ses
static

◆ lua_state

lua_State* lua_state