ELinks 0.18.0
core.c File Reference
#include "scripting/python/pythoninc.h"
#include <osdefs.h>
#include <stdlib.h>
#include "elinks.h"
#include "config/home.h"
#include "main/main.h"
#include "main/module.h"
#include "scripting/python/core.h"
#include "scripting/python/dialogs.h"
#include "scripting/python/document.h"
#include "scripting/python/keybinding.h"
#include "scripting/python/load.h"
#include "scripting/python/menu.h"
#include "scripting/python/open.h"
#include "scripting/python/python.h"
#include "scripting/scripting.h"
#include "session/session.h"
#include "util/env.h"
#include "util/string.h"
Include dependency graph for core.c:

Functions

void alert_python_error (void)
static int set_python_search_path (void)
static int hooks_module_exists (void)
static PyCFunction * python_showwarning (PyObject *self, PyObject *args, PyObject *kwargs)
static int replace_showwarning (void)
static int add_constant (PyObject *dict, const char *key, int value)
PyMODINIT_FUNC PyInit_elinks (void)
void init_python (struct module *module)
void cleanup_python (struct module *module)
int add_python_methods (PyObject *dict, PyObject *name, PyMethodDef *methods)

Variables

struct sessionpython_ses = NULL
PyObject * python_elinks_err = NULL
PyObject * python_hooks = NULL
static char python_showwarnings_doc []
static PyMethodDef warning_methods []
static char module_doc []
static PyMethodDef python_methods []
static struct PyModuleDef moduledef

Function Documentation

◆ add_constant()

int add_constant ( PyObject * dict,
const char * key,
int value )
static

◆ add_python_methods()

int add_python_methods ( PyObject * dict,
PyObject * name,
PyMethodDef * methods )

◆ alert_python_error()

void alert_python_error ( void )

◆ cleanup_python()

void cleanup_python ( struct module * module)

◆ hooks_module_exists()

int hooks_module_exists ( void )
static

◆ init_python()

void init_python ( struct module * module)

◆ PyInit_elinks()

PyMODINIT_FUNC PyInit_elinks ( void )

◆ python_showwarning()

PyCFunction * python_showwarning ( PyObject * self,
PyObject * args,
PyObject * kwargs )
static

◆ replace_showwarning()

int replace_showwarning ( void )
static

◆ set_python_search_path()

int set_python_search_path ( void )
static

Variable Documentation

◆ module_doc

char module_doc[]
static
Initial value:
=
PYTHON_DOCSTRING("Interface to the ELinks web browser.\n\
\n\
Functions:\n\
\n\
bind_key() -- Bind a keystroke to a callable object.\n\
current_document() -- Return the body of the document being viewed.\n\
current_header() -- Return the header of the document being viewed.\n\
current_link_url() -- Return the URL of the currently selected link.\n\
current_title() -- Return the title of the document being viewed.\n\
current_url() -- Return the URL of the document being viewed.\n\
info_box() -- Display information to the user.\n\
input_box() -- Prompt for user input.\n\
load() -- Load a document into the ELinks cache.\n\
menu() -- Display a menu.\n\
open() -- View a document.\n\
\n\
Exception classes:\n\
\n\
error -- Errors internal to ELinks.\n\
\n\
Other public objects:\n\
\n\
home -- A string containing the pathname of the ~/.config/elinks directory, or\n\
None if ELinks has no configuration directory.\n")
#define PYTHON_DOCSTRING(str)
Definition core.h:46

◆ moduledef

struct PyModuleDef moduledef
static
Initial value:
= {
PyModuleDef_HEAD_INIT,
"elinks",
-1,
NULL,
NULL,
NULL,
NULL,
}
#define NULL
Definition explodename.c:35
static char module_doc[]
Definition core.c:230
static PyMethodDef python_methods[]
Definition core.c:256

◆ python_elinks_err

PyObject* python_elinks_err = NULL

◆ python_hooks

PyObject* python_hooks = NULL

◆ python_methods

PyMethodDef python_methods[]
static

◆ python_ses

struct session* python_ses = NULL

◆ python_showwarnings_doc

char python_showwarnings_doc[]
static
Initial value:
=
PYTHON_DOCSTRING("showwarnings(message, category, filename, lineno, \
file=None, line=None)\n\
\n\
Report a Python warning as an ELinks scripting error.\n\
\n\
Arguments:\n\
\n\
message -- An instance of the class Warning (or a subclass).\n\
\n\
All other arguments are ignored.\n")

◆ warning_methods

PyMethodDef warning_methods[]
static
Initial value:
= {
{"showwarning", (PyCFunction) python_showwarning,
METH_VARARGS | METH_KEYWORDS,
{NULL, NULL, 0, NULL}
}
static PyCFunction * python_showwarning(PyObject *self, PyObject *args, PyObject *kwargs)
Definition core.c:180
static char python_showwarnings_doc[]
Definition core.c:167