ekg2  GIT master
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>
Wykres zależności załączania dla xmsg.c:

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

◆ __func__

#define __func__   ekg_itoa(__LINE__)

◆ NAME_MAX

#define NAME_MAX   255

◆ X

#define X (   x,
 
)    (x ? x : y)

◆ xdebug

#define xdebug (   txt,
  ... 
)    debug("[xmsg:%s] " txt "\n", __func__, ##__VA_ARGS__)

◆ xdebug2

#define xdebug2 (   lvl,
  txt,
  ... 
)    debug_ext(lvl, "[xmsg:%s] " txt "\n", __func__, ##__VA_ARGS__)

◆ xerr

#define xerr (   txt,
  ... 
)    do { debug_error("[xmsg:%s] " txt "\n", __func__, ##__VA_ARGS__); return -1; } while (0)

◆ xerrn

#define xerrn (   txt,
  ... 
)    do { debug_error("[xmsg:%s] " txt ": %s\n", __func__, ##__VA_ARGS__, strerror(errno)); return -1; } while (0)

◆ XMSG_CMDFLAGS

#define XMSG_CMDFLAGS   SESSION_MUSTBELONG

◆ XMSG_CMDFLAGS_TARGET

◆ XMSG_MAXFC_DEF

#define XMSG_MAXFC_DEF   "25"

◆ XMSG_MAXFC_TIMER

#define XMSG_MAXFC_TIMER   "3"

◆ XMSG_MAXFS_DEF

#define XMSG_MAXFS_DEF   "16384"

◆ XMSG_NAMESEP_DEF

#define XMSG_NAMESEP_DEF   "."

◆ XMSG_TIMER_DEF

#define XMSG_TIMER_DEF   "300"

◆ XMSG_TMPFILE_PATH

#define XMSG_TMPFILE_PATH   "/tmp/xmsg.XXXXXX"

◆ XMSG_UID_DIROFFSET

#define XMSG_UID_DIROFFSET   5

Dokumentacja funkcji

◆ xmsg_add_watch()

static int xmsg_add_watch ( session_t s,
const char *  f 
)
inlinestatic

◆ xmsg_checkoutfile()

static int xmsg_checkoutfile ( const char *  file,
char **  data,
int *  len,
time_t *  ts,
const int  maxlen 
)
static

◆ xmsg_connect()

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

◆ xmsg_dirfix()

static const char* xmsg_dirfix ( const char *  path)
static

◆ xmsg_disconnect()

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

◆ xmsg_handle_file()

static int xmsg_handle_file ( session_t s,
const char *  fn 
)
static

◆ xmsg_handle_sigusr()

static int xmsg_handle_sigusr ( void *  data,
va_list  ap 
)
static

◆ xmsg_inline_msg()

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

◆ xmsg_iterate_dir()

static gint xmsg_iterate_dir ( gint  type,
session_t s 
)
static

◆ xmsg_msg()

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

◆ xmsg_plugin_destroy()

static int xmsg_plugin_destroy ( void  )
static

◆ xmsg_plugin_init()

int xmsg_plugin_init ( int  prio)

◆ xmsg_reconnect()

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

◆ xmsg_theme_init()

static int xmsg_theme_init ( void  )
static

◆ xmsg_timer_change()

static void xmsg_timer_change ( session_t s,
const char *  varname 
)
static

◆ xmsg_unlink_dotfiles()

static void xmsg_unlink_dotfiles ( session_t s,
const char *  varname 
)
static

◆ xmsg_validate_uid()

static int xmsg_validate_uid ( void *  data,
va_list  ap 
)
static

Dokumentacja zmiennych

◆ ev

struct inotify_event* ev = NULL
static

◆ in_fd

int in_fd = 0
static

◆ xmsg_plugin

plugin_t xmsg_plugin = { .name = "xmsg", .pclass = PLUGIN_PROTOCOL , .destroy = xmsg_plugin_destroy, .theme_init = xmsg_theme_init }

◆ xmsg_plugin_vars

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

◆ xmsg_priv

const struct protocol_plugin_priv xmsg_priv
static
Wartość początkowa:
= {
.protocols = xmsg_protocols
}
static const char * xmsg_protocols[]
Definition: xmsg.c:683

◆ xmsg_protocols

const char* xmsg_protocols[] = { "xmsg:", NULL }
static