ekg2  GIT master
Struktury danych | Definicje | Definicje typów | Wyliczenia | Funkcje | Zmienne
Dokumentacja pliku plugins.h
#include <sys/types.h>
#include <stdarg.h>
#include "dynstuff.h"
#include "sessions.h"
Wykres zależności załączania dla plugins.h:
Ten wykres pokazuje, które pliki bezpośrednio lub pośrednio załączają ten plik:

Idź do kodu źródłowego tego pliku.

Struktury danych

struct  plugins_params_t
 
struct  plugin
 
struct  queryx
 
struct  watch
 

Definicje

#define EKG_ABI_VER   4921
 
#define EXPORT   __attribute__ ((visibility("default")))
 
#define PLUGIN_VAR_ADD(name, type, value, secret, notify)   { name, value, secret, type, notify }
 
#define PLUGIN_VAR_END()   { NULL, NULL, 0, -1, NULL }
 
#define PLUGIN_CHECK_VER(name)   { if (!plugin_abi_version(EKG_ABI_VER, name)) return -1; }
 
#define PLUGIN_DEFINE(x, y, z)
 
#define QUERY(x)   int x(void *data, va_list ap)
 
#define WATCHER(x)   int x(int type, int fd, watch_type_t watch, void *data)
 
#define WATCHER_LINE(x)   int x(int type, int fd, const char *watch, void *data)
 
#define watch_add_line(p, fd, type, handler, data)   watch_add(p, fd, type, (watcher_handler_func_t *) (handler), data)
 

Definicje typów

typedef int(* plugin_destroy_func_t) (void)
 
typedef int(* plugin_theme_init_func_t) (void)
 
typedef void() plugin_notify_func_t(session_t *, const char *)
 
typedef struct plugin plugin_t
 
typedef int query_handler_func_t(void *data, va_list ap)
 
typedef struct queryx query_t
 
typedef int watcher_handler_func_t(int type, int fd, watch_type_t watch, void *data)
 
typedef struct watch watch_t
 
typedef void * watch_handler_func_t
 

Wyliczenia

enum  plugin_class_t {
  PLUGIN_ANY = 0, PLUGIN_GENERIC, PLUGIN_PROTOCOL, PLUGIN_UI,
  PLUGIN_LOG, PLUGIN_SCRIPTING, PLUGIN_AUDIO, PLUGIN_CODEC,
  PLUGIN_CRYPT, PLUGIN_ANY = 0, PLUGIN_GENERIC, PLUGIN_PROTOCOL,
  PLUGIN_UI, PLUGIN_LOG, PLUGIN_SCRIPTING, PLUGIN_AUDIO,
  PLUGIN_CODEC, PLUGIN_CRYPT
}
 
enum  watch_type_t {
  WATCH_NONE = 0, WATCH_WRITE = 1, WATCH_READ = 2, WATCH_READ_LINE = 4,
  WATCH_WRITE_LINE = 8, WATCH_NONE = 0, WATCH_WRITE = 1, WATCH_READ = 2,
  WATCH_READ_LINE = 4, WATCH_WRITE_LINE = 8
}
 

Funkcje

int plugin_abi_version (int plugin_abi_ver, const char *plugin_name)
 
void plugin_load (const char *name)
 
void plugin_unload (plugin_t *p)
 
plugin_tremote_plugin_load (const char *name, int prio)
 
int plugin_register (plugin_t *, int prio)
 
int plugin_unregister (plugin_t *)
 
void remote_plugins_destroy ()
 
plugin_tplugin_find (const char *name)
 
query_tquery_connect_idXXX (plugin_t *plugin, const int id, query_handler_func_t *handler, void *data)
 
int query_emit_idXXX (plugin_t *, const int,...)
 
void queries_destroy ()
 
int watch_write (watch_t *w, const char *buf, int len)
 
void watch_free (watch_t *w)
 
watch_twatch_add (plugin_t *plugin, int fd, watch_type_t type, watcher_handler_func_t *handler, void *data)
 
int watch_remove (plugin_t *plugin, int fd, watch_type_t type)
 
void watch_handle (watch_t *w)
 
void watches_destroy ()
 

Zmienne

plugin_tplugins
 
list_t watches
 
plugin_tui_plugin
 
int ekg_watches_removed
 

Dokumentacja definicji

◆ EKG_ABI_VER

#define EKG_ABI_VER   4921

◆ EXPORT

#define EXPORT   __attribute__ ((visibility("default")))

◆ PLUGIN_CHECK_VER

#define PLUGIN_CHECK_VER (   name)    { if (!plugin_abi_version(EKG_ABI_VER, name)) return -1; }

◆ PLUGIN_DEFINE

#define PLUGIN_DEFINE (   x,
  y,
 
)
Wartość:
static int x##_plugin_destroy(); \
\
plugin_t x##_plugin = { \
.name = #x, \
.pclass = y, \
.destroy = x##_plugin_destroy, \
.theme_init = z \
}

◆ PLUGIN_VAR_ADD

#define PLUGIN_VAR_ADD (   name,
  type,
  value,
  secret,
  notify 
)    { name, value, secret, type, notify }

◆ PLUGIN_VAR_END

#define PLUGIN_VAR_END ( )    { NULL, NULL, 0, -1, NULL }

◆ QUERY

#define QUERY (   x)    int x(void *data, va_list ap)

◆ watch_add_line

#define watch_add_line (   p,
  fd,
  type,
  handler,
  data 
)    watch_add(p, fd, type, (watcher_handler_func_t *) (handler), data)

◆ WATCHER

#define WATCHER (   x)    int x(int type, int fd, watch_type_t watch, void *data)

◆ WATCHER_LINE

#define WATCHER_LINE (   x)    int x(int type, int fd, const char *watch, void *data)

Dokumentacja definicji typów

◆ plugin_destroy_func_t

typedef int(* plugin_destroy_func_t) (void)

◆ plugin_notify_func_t

typedef void() plugin_notify_func_t(session_t *, const char *)

◆ plugin_t

typedef struct plugin plugin_t

◆ plugin_theme_init_func_t

typedef int(* plugin_theme_init_func_t) (void)

◆ query_handler_func_t

typedef int query_handler_func_t(void *data, va_list ap)

◆ query_t

typedef struct queryx query_t

◆ watch_handler_func_t

typedef void* watch_handler_func_t

◆ watch_t

typedef struct watch watch_t

◆ watcher_handler_func_t

typedef int watcher_handler_func_t(int type, int fd, watch_type_t watch, void *data)

Dokumentacja typów wyliczanych

◆ plugin_class_t

Wartości wyliczeń
PLUGIN_ANY 
PLUGIN_GENERIC 
PLUGIN_PROTOCOL 
PLUGIN_UI 
PLUGIN_LOG 
PLUGIN_SCRIPTING 
PLUGIN_AUDIO 
PLUGIN_CODEC 
PLUGIN_CRYPT 
PLUGIN_ANY 
PLUGIN_GENERIC 
PLUGIN_PROTOCOL 
PLUGIN_UI 
PLUGIN_LOG 
PLUGIN_SCRIPTING 
PLUGIN_AUDIO 
PLUGIN_CODEC 
PLUGIN_CRYPT 

◆ watch_type_t

Wartości wyliczeń
WATCH_NONE 
WATCH_WRITE 
WATCH_READ 
WATCH_READ_LINE 
WATCH_WRITE_LINE 
WATCH_NONE 
WATCH_WRITE 
WATCH_READ 
WATCH_READ_LINE 
WATCH_WRITE_LINE 

Dokumentacja funkcji

◆ plugin_abi_version()

int plugin_abi_version ( int  plugin_abi_ver,
const char *  plugin_name 
)

◆ plugin_find()

plugin_t* plugin_find ( const char *  name)

plugin_find()

Find plugin by name

Parametry
name- name of plugin_t
Zwraca
plugin_t with given name, or NULL if not found.

◆ plugin_load()

void plugin_load ( const char *  name)

◆ plugin_register()

int plugin_register ( plugin_t ,
int  prio 
)

◆ plugin_unload()

void plugin_unload ( plugin_t p)

◆ plugin_unregister()

int plugin_unregister ( plugin_t )

◆ queries_destroy()

void queries_destroy ( )

◆ query_connect_idXXX()

query_t* query_connect_idXXX ( plugin_t plugin,
const int  id,
query_handler_func_t handler,
void *  data 
)

◆ query_emit_idXXX()

int query_emit_idXXX ( plugin_t ,
const int  ,
  ... 
)

◆ remote_plugin_load()

plugin_t* remote_plugin_load ( const char *  name,
int  prio 
)

◆ remote_plugins_destroy()

void remote_plugins_destroy ( )

◆ watch_add()

watch_t* watch_add ( plugin_t plugin,
int  fd,
watch_type_t  type,
watcher_handler_func_t handler,
void *  data 
)

watch_add()

Create new watch_t and add it on the beginning of watches list.

Parametry
plugin- plugin
fd- fd to watch data for.
type- type of watch.
handler- handler of watch.
data- data which be passed to handler.
Zwraca
Created watch_t. if type is either WATCH_READ_LINE or WATCH_WRITE_LINE than also allocate memory for buffer

◆ watch_free()

void watch_free ( watch_t w)

◆ watch_handle()

void watch_handle ( watch_t w)

◆ watch_remove()

int watch_remove ( plugin_t plugin,
int  fd,
watch_type_t  type 
)

◆ watch_write()

int watch_write ( watch_t w,
const char *  buf,
int  len 
)

◆ watches_destroy()

void watches_destroy ( )

Dokumentacja zmiennych

◆ ekg_watches_removed

int ekg_watches_removed

◆ plugins

plugin_t* plugins

◆ ui_plugin

plugin_t* ui_plugin

◆ watches

list_t watches