Funkcje

Dokumentacja pliku plugins/python/python.c

#include "ekg2-config.h"
#include "python.h"
#include "python-ekg.h"
#include "python-config.h"
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <Python.h>
#include <compile.h>
#include <node.h>
#include <ekg/commands.h>
#include <ekg/debug.h>
#include <ekg/plugins.h>
#include <ekg/scripts.h>
#include <ekg/xmalloc.h>
#include <ekg/dynstuff.h>
#include <ekg/protocol.h>
#include <ekg/stuff.h>
#include <ekg/themes.h>
#include <ekg/userlist.h>
#include <ekg/vars.h>
#include <ekg/queries.h>

Funkcje

 PLUGIN_DEFINE (python, PLUGIN_SCRIPTING, NULL)
 SCRIPT_DEFINE (python,".py")
int python_command_eval (const char *name, const char **params, session_t *session, const char *target, int quiet)
int python_command_run (const char *name, const char **params, session_t *session, const char *target, int quiet)
int python_command_load (const char *name, const char **params, session_t *session, const char *target, int quiet)
int python_command_unload (const char *name, const char **params, session_t *session, const char *target, int quiet)
int python_command_list (const char *name, const char **params, session_t *session, const char *target, int quiet)
int python_print_version (void *data, va_list ap)
int python_bind_free (script_t *scr, void *data, int type, void *priv_data,...)
int python_variable_changed (script_t *scr, script_var_t *scr_var, char *newval)
int python_watches (script_t *scr, script_watch_t *scr_wat, int type, int fd, long int watch)
int python_timers (script_t *scr, script_timer_t *time, int type)
int python_commands (script_t *scr, script_command_t *comm, char **params)
int python_query (script_t *scr, script_query_t *scr_que, void **args)
int python_exec (const char *command)
int python_run (const char *filename)
PyObject * python_get_func (PyObject *module, const char *name)
script_tpython_find_script (PyObject *module)
char * python_geterror (script_t *s)
int python_load (script_t *s)
int python_unload (script_t *s)
int python_initialize ()
int python_finalize ()
static int python_plugin_destroy ()
int python_plugin_init (int prio)

Dokumentacja funkcji

PLUGIN_DEFINE ( python  ,
PLUGIN_SCRIPTING  ,
NULL   
)

python_plugin

plugin definition

int python_bind_free ( script_t scr,
void *  data,
int  type,
void *  priv_data,
  ... 
)
int python_command_eval ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)

python_command_eval()

execute python code

int python_command_list ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)

python_command_list()

list loaded python scripts

int python_command_load ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)

python_command_load()

load python script

int python_command_run ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)

python_command_run()

run single python script

int python_command_unload ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)

python_command_unload()

unload python script

int python_commands ( script_t scr,
script_command_t comm,
char **  params 
)
int python_exec ( const char *  command  ) 

python_exec()

run python code

  • command - code to run
int python_finalize (  ) 

python_finalize()

clean interpreter, unload modules, scripts etc.

script_t* python_find_script ( PyObject *  module  ) 
PyObject* python_get_func ( PyObject *  module,
const char *  name 
)
char* python_geterror ( script_t s  ) 
int python_initialize (  ) 

python_initialize()

initialize interpreter

int python_load ( script_t s  ) 
static int python_plugin_destroy (  )  [static]

python_plugin_destroy()

remove plugin

int python_plugin_init ( int  prio  ) 

python_plugin_init()

inicjalizacja pluginu

int python_print_version ( void *  data,
va_list  ap 
)
int python_query ( script_t scr,
script_query_t scr_que,
void **  args 
)

python_protocol_message_query()

handle signals

int python_run ( const char *  filename  ) 

python_run()

run python script from file

  • filename - path to file to run
int python_timers ( script_t scr,
script_timer_t time,
int  type 
)
int python_unload ( script_t s  ) 
int python_variable_changed ( script_t scr,
script_var_t scr_var,
char *  newval 
)
int python_watches ( script_t scr,
script_watch_t scr_wat,
int  type,
int  fd,
long int  watch 
)
SCRIPT_DEFINE ( python  ,
".py"   
)
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje