ekg2  GIT master
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje Grupay Strony
Definicje | Funkcje | Zmienne
Dokumentacja pliku xmsg.c
#include "ekg2.h"
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>

Definicje

#define NAME_MAX   255
 
#define __func__   ekg_itoa(__LINE__)
 
#define XMSG_UID_DIROFFSET   5
 
#define XMSG_NAMESEP_DEF   "."
 
#define XMSG_MAXFS_DEF   "16384"
 
#define XMSG_MAXFC_DEF   "25"
 
#define XMSG_MAXFC_TIMER   "3"
 
#define XMSG_TMPFILE_PATH   "/tmp/xmsg.XXXXXX"
 
#define XMSG_TIMER_DEF   "300"
 
#define xerr(txt,...)   do { debug_error("[xmsg:%s] " txt "\n", __func__, ##__VA_ARGS__); return -1; } while (0)
 
#define xerrn(txt,...)   do { debug_error("[xmsg:%s] " txt ": %s\n", __func__, ##__VA_ARGS__, strerror(errno)); return -1; } while (0)
 
#define xdebug(txt,...)   debug("[xmsg:%s] " txt "\n", __func__, ##__VA_ARGS__)
 
#define xdebug2(lvl, txt,...)   debug_ext(lvl, "[xmsg:%s] " txt "\n", __func__, ##__VA_ARGS__)
 
#define X(x, y)   (x ? x : y)
 
#define XMSG_CMDFLAGS   SESSION_MUSTBELONG
 
#define XMSG_CMDFLAGS_TARGET   SESSION_MUSTBELONG|COMMAND_ENABLEREQPARAMS|COMMAND_PARAMASTARGET|SESSION_MUSTBECONNECTED
 

Funkcje

static int xmsg_theme_init (void)
 
static int xmsg_plugin_destroy ()
 
static int xmsg_checkoutfile (const char *file, char **data, int *len, time_t *ts, const int maxlen)
 
static const char * xmsg_dirfix (const char *path)
 
static int xmsg_handle_file (session_t *s, const char *fn)
 
static gint xmsg_iterate_dir (gint type, session_t *s)
 
static void xmsg_timer_change (session_t *s, const char *varname)
 
static int xmsg_disconnect (const char *name, const char **params, session_t *session, const char *target, int quiet)
 
static int xmsg_handle_sigusr (void *data, va_list ap)
 
static int xmsg_validate_uid (void *data, va_list ap)
 
static int xmsg_add_watch (session_t *s, const char *f)
 
static int xmsg_connect (const char *name, const char **params, session_t *session, const char *target, int quiet)
 
static int xmsg_reconnect (const char *name, const char **params, session_t *session, const char *target, int quiet)
 
static void xmsg_unlink_dotfiles (session_t *s, const char *varname)
 
static int xmsg_msg (const char *name, const char **params, session_t *session, const char *target, int quiet)
 
static int xmsg_inline_msg (const char *name, const char **params, session_t *session, const char *target, int quiet)
 
int xmsg_plugin_init (int prio)
 

Zmienne

static int in_fd = 0
 
static struct inotify_event * ev = NULL
 
plugin_t xmsg_plugin = { .name = "xmsg", .pclass = PLUGIN_PROTOCOL , .destroy = xmsg_plugin_destroy, .theme_init = xmsg_theme_init }
 
static plugins_params_t xmsg_plugin_vars []
 
static const char * xmsg_protocols [] = { "xmsg:", NULL }
 
static const struct
protocol_plugin_priv 
xmsg_priv
 

Dokumentacja definicji

#define __func__   ekg_itoa(__LINE__)
#define NAME_MAX   255
#define X (   x,
 
)    (x ? x : y)
#define xdebug (   txt,
  ... 
)    debug("[xmsg:%s] " txt "\n", __func__, ##__VA_ARGS__)
#define xdebug2 (   lvl,
  txt,
  ... 
)    debug_ext(lvl, "[xmsg:%s] " txt "\n", __func__, ##__VA_ARGS__)
#define xerr (   txt,
  ... 
)    do { debug_error("[xmsg:%s] " txt "\n", __func__, ##__VA_ARGS__); return -1; } while (0)
#define xerrn (   txt,
  ... 
)    do { debug_error("[xmsg:%s] " txt ": %s\n", __func__, ##__VA_ARGS__, strerror(errno)); return -1; } while (0)
#define XMSG_CMDFLAGS   SESSION_MUSTBELONG
#define XMSG_MAXFC_DEF   "25"
#define XMSG_MAXFC_TIMER   "3"
#define XMSG_MAXFS_DEF   "16384"
#define XMSG_NAMESEP_DEF   "."
#define XMSG_TIMER_DEF   "300"
#define XMSG_TMPFILE_PATH   "/tmp/xmsg.XXXXXX"
#define XMSG_UID_DIROFFSET   5

Dokumentacja funkcji

static int xmsg_add_watch ( session_t s,
const char *  f 
)
inlinestatic
static int xmsg_checkoutfile ( const char *  file,
char **  data,
int *  len,
time_t *  ts,
const int  maxlen 
)
static
static int xmsg_connect ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)
static
static const char* xmsg_dirfix ( const char *  path)
static
static int xmsg_disconnect ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)
static
static int xmsg_handle_file ( session_t s,
const char *  fn 
)
static
static int xmsg_handle_sigusr ( void *  data,
va_list  ap 
)
static
static int xmsg_inline_msg ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)
static
static gint xmsg_iterate_dir ( gint  type,
session_t s 
)
static
static int xmsg_msg ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)
static
static int xmsg_plugin_destroy ( void  )
static
int xmsg_plugin_init ( int  prio)
static int xmsg_reconnect ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)
static
static int xmsg_theme_init ( void  )
static
static void xmsg_timer_change ( session_t s,
const char *  varname 
)
static
static void xmsg_unlink_dotfiles ( session_t s,
const char *  varname 
)
static
static int xmsg_validate_uid ( void *  data,
va_list  ap 
)
static

Dokumentacja zmiennych

struct inotify_event* ev = NULL
static
int in_fd = 0
static
plugin_t xmsg_plugin = { .name = "xmsg", .pclass = PLUGIN_PROTOCOL , .destroy = xmsg_plugin_destroy, .theme_init = xmsg_theme_init }
plugins_params_t xmsg_plugin_vars[]
static
Wartość początkowa:
= {
{ "auto_connect" , "1" , 0 , VAR_BOOL , NULL , NULL },
{ "charset" , "" , 0 , VAR_STR , NULL , NULL },
{ "dotfile_suffix" , "" , 0 , VAR_STR , NULL , NULL },
{ "log_formats" , "simple" , 0 , VAR_STR , NULL , NULL },
{ "max_filesize" , "16384" , 0 , VAR_INT , NULL , NULL },
{ "max_oneshot_files" , "25" , 0 , VAR_INT , NULL , NULL },
{ "name_separator" , "." , 0 , VAR_STR , NULL , NULL },
{ "oneshot_resume_timer" , "3" , 0 , VAR_INT , NULL , NULL },
{ "send_cmd" , NULL , 0 , VAR_STR , NULL , NULL },
{ "rescan_timer" , "300" , 0 , VAR_INT , xmsg_timer_change , NULL },
{ "unlink_sent" , "1" , 0 , VAR_BOOL , xmsg_unlink_dotfiles , NULL },
{ "unlink_toobig" , "0" , 0 , VAR_BOOL , xmsg_unlink_dotfiles , NULL },
{ NULL, NULL, 0, -1, NULL }
}
static void xmsg_timer_change(session_t *s, const char *varname)
Definition: xmsg.c:338
Definition: vars.h:35
Definition: vars.h:33
#define NULL
Definition: oralog.c:49
static void xmsg_unlink_dotfiles(session_t *s, const char *varname)
Definition: xmsg.c:529
Definition: vars.h:34
const struct protocol_plugin_priv xmsg_priv
static
Wartość początkowa:
= {
.protocols = xmsg_protocols
}
static const char * xmsg_protocols[]
Definition: xmsg.c:683
const char* xmsg_protocols[] = { "xmsg:", NULL }
static