ekg2  GIT master
Struktury danych | Definicje | Definicje typów | Wyliczenia | Funkcje | Zmienne
Dokumentacja pliku sources.h
#include <glib.h>
Wykres zależności załączania dla sources.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  watch
 

Definicje

#define TIMER(x)   gint x(gint type, gpointer data)
 
#define TIMER_SESSION(x)   gint x(gint type, session_t *s)
 
#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 WATCHER_SESSION(x)   int x(int type, int fd, watch_type_t watch, session_t *s)
 
#define WATCHER_SESSION_LINE(x)   int x(int type, int fd, const char *watch, session_t *s)
 
#define watch_add_line(p, fd, type, handler, data)   watch_add(p, fd, type, (watcher_handler_func_t *) (handler), data)
 
#define watch_add_session_line(s, fd, type, handler)   watch_add_session(s, fd, type, (watcher_session_handler_func_t *) (handler))
 

Definicje typów

typedef struct ekg_sourceekg_source_t
 
typedef ekg_source_t ekg_child_t
 
typedef ekg_source_t ekg_timer_t
 
typedef int watcher_handler_func_t(int type, int fd, watch_type_t watch, void *data)
 
typedef int watcher_session_handler_func_t(int type, int fd, watch_type_t watch, session_t *s)
 
typedef struct watch watch_t
 
typedef void * watch_handler_func_t
 

Wyliczenia

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

void ekg_source_remove (ekg_source_t s)
 
gboolean ekg_source_remove_by_handler (gpointer handler, const gchar *name)
 
gboolean ekg_source_remove_by_data (gpointer priv_data, const gchar *name)
 
gboolean ekg_source_remove_by_plugin (plugin_t *plugin, const gchar *name)
 
ekg_child_t ekg_child_add (plugin_t *plugin, const gchar *name_format, GPid pid, GChildWatchFunc handler, gpointer data, GDestroyNotify destr,...) G_GNUC_PRINTF(2
 
ekg_timer_t ekg_timer_add (plugin_t *plugin, const gchar *name_format, guint64 interval, GSourceFunc handler, gpointer data, GDestroyNotify destr,...) G_GNUC_PRINTF(2
 
ekg_timer_t timer_add (plugin_t *plugin, const gchar *name, guint period, gboolean persist, gint(*function)(gint, gpointer), gpointer data)
 
ekg_timer_t timer_add_ms (plugin_t *plugin, const gchar *name, guint period, gboolean persist, gint(*function)(gint, gpointer), gpointer data)
 
ekg_timer_t timer_add_session (session_t *session, const gchar *name, guint period, gboolean persist, gint(*function)(gint, session_t *))
 
ekg_timer_t timer_find_session (session_t *session, const gchar *name)
 
gint timer_remove (plugin_t *plugin, const gchar *name)
 
gint timer_remove_session (session_t *session, const gchar *name)
 
int watch_write (watch_t *w, const char *format,...)
 
int watch_write_data (watch_t *w, const char *buf, int len)
 
watch_twatch_find (plugin_t *plugin, int fd, watch_type_t type)
 
void watch_free (watch_t *w)
 
int watch_timeout_set (watch_t *w, time_t timeout)
 
watch_twatch_add (plugin_t *plugin, int fd, watch_type_t type, watcher_handler_func_t *handler, void *data)
 
watch_twatch_add_session (session_t *session, int fd, watch_type_t type, watcher_session_handler_func_t *handler)
 
int watch_remove (plugin_t *plugin, int fd, watch_type_t type)
 

Zmienne

ekg_child_t G_GNUC_MALLOC
 
list_t watches
 

Dokumentacja definicji

◆ TIMER

#define TIMER (   x)    gint x(gint type, gpointer data)

◆ TIMER_SESSION

#define TIMER_SESSION (   x)    gint x(gint type, session_t *s)

◆ watch_add_line

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

◆ watch_add_session_line

#define watch_add_session_line (   s,
  fd,
  type,
  handler 
)    watch_add_session(s, fd, type, (watcher_session_handler_func_t *) (handler))

◆ 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)

◆ WATCHER_SESSION

#define WATCHER_SESSION (   x)    int x(int type, int fd, watch_type_t watch, session_t *s)

◆ WATCHER_SESSION_LINE

#define WATCHER_SESSION_LINE (   x)    int x(int type, int fd, const char *watch, session_t *s)

Dokumentacja definicji typów

◆ ekg_child_t

◆ ekg_source_t

typedef struct ekg_source* ekg_source_t

◆ ekg_timer_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)

◆ watcher_session_handler_func_t

typedef int watcher_session_handler_func_t(int type, int fd, watch_type_t watch, session_t *s)

Dokumentacja typów wyliczanych

◆ 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

◆ ekg_child_add()

ekg_child_t ekg_child_add ( plugin_t plugin,
const gchar *  name_format,
GPid  pid,
GChildWatchFunc  handler,
gpointer  data,
GDestroyNotify  destr,
  ... 
)

◆ ekg_source_remove()

void ekg_source_remove ( ekg_source_t  s)

ekg_source_remove()

Remove a particular source (which can be ekg_child_t, ekg_timer_t...).

Parametry
s- the source identifier.

◆ ekg_source_remove_by_data()

gboolean ekg_source_remove_by_data ( gpointer  priv_data,
const gchar *  name 
)

◆ ekg_source_remove_by_handler()

gboolean ekg_source_remove_by_handler ( gpointer  handler,
const gchar *  name 
)

◆ ekg_source_remove_by_plugin()

gboolean ekg_source_remove_by_plugin ( plugin_t plugin,
const gchar *  name 
)

◆ ekg_timer_add()

ekg_timer_t ekg_timer_add ( plugin_t plugin,
const gchar *  name_format,
guint64  interval,
GSourceFunc  handler,
gpointer  data,
GDestroyNotify  destr,
  ... 
)

◆ timer_add()

ekg_timer_t timer_add ( plugin_t plugin,
const gchar *  name,
guint  period,
gboolean  persist,
gint(*)(gint, gpointer)  function,
gpointer  data 
)

◆ timer_add_ms()

ekg_timer_t timer_add_ms ( plugin_t plugin,
const gchar *  name,
guint  period,
gboolean  persist,
gint(*)(gint, gpointer)  function,
gpointer  data 
)

◆ timer_add_session()

ekg_timer_t timer_add_session ( session_t session,
const gchar *  name,
guint  period,
gboolean  persist,
gint(*)(gint, session_t *)  function 
)

◆ timer_find_session()

ekg_timer_t timer_find_session ( session_t session,
const gchar *  name 
)

◆ timer_remove()

gint timer_remove ( plugin_t plugin,
const gchar *  name 
)

◆ timer_remove_session()

gint timer_remove_session ( session_t session,
const gchar *  name 
)

◆ 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_add_session()

watch_t* watch_add_session ( session_t session,
int  fd,
watch_type_t  type,
watcher_session_handler_func_t handler 
)

watch_add_session()

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

Parametry
session- session
fd- fd to watch data for
type- type of watch.
handler- handler of watch.
Zwraca
If session is NULL, or session->plugin is NULL, it return NULL.
else created watch_t

◆ watch_find()

watch_t* watch_find ( plugin_t plugin,
int  fd,
watch_type_t  type 
)

◆ watch_free()

void watch_free ( watch_t w)

◆ watch_remove()

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

◆ watch_timeout_set()

int watch_timeout_set ( watch_t w,
time_t  timeout 
)

◆ watch_write()

int watch_write ( watch_t w,
const char *  format,
  ... 
)

◆ watch_write_data()

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

Dokumentacja zmiennych

◆ G_GNUC_MALLOC

ekg_timer_t G_GNUC_MALLOC

◆ watches

list_t watches