#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <netdb.h>
#include <sys/time.h>
#include <string.h>
#include <errno.h>
#include <ekg/debug.h>
#include <ekg/net.h>
#include <ekg/plugins.h>
#include <ekg/protocol.h>
#include <ekg/recode.h>
#include <ekg/stuff.h>
#include <ekg/vars.h>
#include <ekg/xmalloc.h>
#include <ekg/userlist.h>
#include <ekg/queries.h>
#include "polchat_handlers.inc"
Struktury danych | |
struct | polchat_private_t |
Definicje | |
#define | DEFPARTMSG "EKG2 bejbi! http://ekg2.org/" |
#define | DEFQUITMSG "EKG2 - It's better than sex!" |
#define | SGPARTMSG(x) session_get(x, "PART_MSG") |
#define | SGQUITMSG(x) session_get(x, "QUIT_MSG") |
#define | PARTMSG(x, r) (r?r: SGPARTMSG(x)?SGPARTMSG(x):DEFPARTMSG) |
#define | QUITMSG(x) (SGQUITMSG(x)?SGQUITMSG(x):DEFQUITMSG) |
#define | DEFPART |
#define | polchat_uid(target) protocol_uid("polchat", target) |
#define | POLCHAT_DEFAULT_HOST "s1.polchat.pl" |
#define | POLCHAT_DEFAULT_PORT "14003" |
#define | POLCHAT_ONLY SESSION_MUSTBELONG | SESSION_MUSTHASPRIVATE |
#define | POLCHAT_FLAGS POLCHAT_ONLY | SESSION_MUSTBECONNECTED |
#define | POLCHAT_FLAGS_TARGET POLCHAT_FLAGS | COMMAND_ENABLEREQPARAMS | COMMAND_PARAMASTARGET |
Funkcje | |
static int | polchat_theme_init () |
PLUGIN_DEFINE (polchat, PLUGIN_PROTOCOL, polchat_theme_init) | |
static char * | dword_str (int dword) |
static char * | word_str (short word) |
static int | polchat_handle_write (int type, int fd, const char *watch, void *data) |
static watch_t * | polchat_sendpkt (session_t *s, short headercode,...) |
static watch_t * | polchat_sendmsg (session_t *s, const char *message,...) |
static int | polchat_validate_uid (void *data, va_list ap) |
static int | polchat_print_version (void *data, va_list ap) |
static int | polchat_session_init (void *data, va_list ap) |
static int | polchat_session_deinit (void *data, va_list ap) |
static void | polchat_handle_disconnect (session_t *s, const char *reason, int type) |
static int | polchat_handle_stream (int type, int fd, watch_type_t watch, session_t *s) |
static int | polchat_handle_connect (int type, int fd, watch_type_t watch, session_t *s) |
static int | polchat_handle_resolver (int type, int fd, watch_type_t watch, void *data) |
static int | polchat_command_connect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | polchat_command_disconnect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | polchat_command_reconnect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | polchat_command_msg (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | polchat_command_inline_msg (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | polchat_command_part (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | polchat_command_join (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | polchat_command_raw (const char *name, const char **params, session_t *session, const char *target, int quiet) |
EXPORT int | polchat_plugin_init (int prio) |
static int | polchat_plugin_destroy () |
Zmienne | |
static plugins_params_t | polchat_plugin_vars [] |
#define DEFPART |
#define DEFPARTMSG "EKG2 bejbi! http://ekg2.org/" |
#define DEFQUITMSG "EKG2 - It's better than sex!" |
#define PARTMSG | ( | x, | ||
r | ||||
) | (r?r: SGPARTMSG(x)?SGPARTMSG(x):DEFPARTMSG) |
#define POLCHAT_DEFAULT_HOST "s1.polchat.pl" |
#define POLCHAT_DEFAULT_PORT "14003" |
#define POLCHAT_FLAGS POLCHAT_ONLY | SESSION_MUSTBECONNECTED |
#define POLCHAT_FLAGS_TARGET POLCHAT_FLAGS | COMMAND_ENABLEREQPARAMS | COMMAND_PARAMASTARGET |
#define POLCHAT_ONLY SESSION_MUSTBELONG | SESSION_MUSTHASPRIVATE |
#define polchat_uid | ( | target | ) | protocol_uid("polchat", target) |
#define QUITMSG | ( | x | ) | (SGQUITMSG(x)?SGQUITMSG(x):DEFQUITMSG) |
#define SGPARTMSG | ( | x | ) | session_get(x, "PART_MSG") |
#define SGQUITMSG | ( | x | ) | session_get(x, "QUIT_MSG") |
static char* dword_str | ( | int | dword | ) | [inline, static] |
PLUGIN_DEFINE | ( | polchat | , | |
PLUGIN_PROTOCOL | , | |||
polchat_theme_init | ||||
) |
static int polchat_command_connect | ( | const char * | name, | |
const char ** | params, | |||
session_t * | session, | |||
const char * | target, | |||
int | quiet | |||
) | [static] |
static int polchat_command_disconnect | ( | const char * | name, | |
const char ** | params, | |||
session_t * | session, | |||
const char * | target, | |||
int | quiet | |||
) | [static] |
static int polchat_command_inline_msg | ( | const char * | name, | |
const char ** | params, | |||
session_t * | session, | |||
const char * | target, | |||
int | quiet | |||
) | [static] |
static int polchat_command_join | ( | const char * | name, | |
const char ** | params, | |||
session_t * | session, | |||
const char * | target, | |||
int | quiet | |||
) | [static] |
static int polchat_command_msg | ( | const char * | name, | |
const char ** | params, | |||
session_t * | session, | |||
const char * | target, | |||
int | quiet | |||
) | [static] |
static int polchat_command_part | ( | const char * | name, | |
const char ** | params, | |||
session_t * | session, | |||
const char * | target, | |||
int | quiet | |||
) | [static] |
static int polchat_command_raw | ( | const char * | name, | |
const char ** | params, | |||
session_t * | session, | |||
const char * | target, | |||
int | quiet | |||
) | [static] |
static int polchat_command_reconnect | ( | const char * | name, | |
const char ** | params, | |||
session_t * | session, | |||
const char * | target, | |||
int | quiet | |||
) | [static] |
static int polchat_handle_connect | ( | int | type, | |
int | fd, | |||
watch_type_t | watch, | |||
session_t * | s | |||
) | [static] |
static void polchat_handle_disconnect | ( | session_t * | s, | |
const char * | reason, | |||
int | type | |||
) | [static] |
static int polchat_handle_resolver | ( | int | type, | |
int | fd, | |||
watch_type_t | watch, | |||
void * | data | |||
) | [static] |
static int polchat_handle_stream | ( | int | type, | |
int | fd, | |||
watch_type_t | watch, | |||
session_t * | s | |||
) | [static] |
static int polchat_handle_write | ( | int | type, | |
int | fd, | |||
const char * | watch, | |||
void * | data | |||
) | [static] |
static int polchat_plugin_destroy | ( | ) | [static] |
EXPORT int polchat_plugin_init | ( | int | prio | ) |
static int polchat_print_version | ( | void * | data, | |
va_list | ap | |||
) | [static] |
static int polchat_session_deinit | ( | void * | data, | |
va_list | ap | |||
) | [static] |
static int polchat_session_init | ( | void * | data, | |
va_list | ap | |||
) | [static] |
static int polchat_theme_init | ( | ) | [static] |
static int polchat_validate_uid | ( | void * | data, | |
va_list | ap | |||
) | [static] |
static char* word_str | ( | short | word | ) | [inline, static] |
plugins_params_t polchat_plugin_vars[] [static] |
{ PLUGIN_VAR_ADD("alias", VAR_STR, NULL, 0, NULL), PLUGIN_VAR_ADD("auto_connect", VAR_BOOL, "0", 0, NULL), PLUGIN_VAR_ADD("log_formats", VAR_STR, "irssi", 0, NULL), PLUGIN_VAR_ADD("nickname", VAR_STR, NULL, 0, NULL), PLUGIN_VAR_ADD("password", VAR_STR, NULL, 1, NULL), PLUGIN_VAR_ADD("port", VAR_INT, POLCHAT_DEFAULT_PORT, 0, NULL), PLUGIN_VAR_ADD("room", VAR_STR, NULL, 0, NULL), PLUGIN_VAR_ADD("server", VAR_STR, POLCHAT_DEFAULT_HOST, 0, NULL), }