1999-09-03 14:27:29 +00:00
|
|
|
#ifndef __COMMON_H
|
|
|
|
|
#define __COMMON_H
|
|
|
|
|
|
2000-02-25 17:03:17 +00:00
|
|
|
#define IRSSI_AUTHOR "Timo Sirainen <tss@iki.fi>"
|
1999-09-03 14:27:29 +00:00
|
|
|
#define IRSSI_WEBSITE "http://xlife.dhs.org/irssi/"
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
#include <config.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
# ifdef HAVE_STRING_H
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_STDLIB_H
|
|
|
|
|
# include <stdlib.h>
|
|
|
|
|
#endif
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
#include <sys/wait.h>
|
|
|
|
|
#include <sys/utsname.h>
|
|
|
|
|
|
1999-10-03 14:37:29 +00:00
|
|
|
#ifdef HAVE_POPT_H
|
1999-10-09 18:04:21 +00:00
|
|
|
# include <popt.h>
|
1999-10-03 14:37:29 +00:00
|
|
|
#else
|
1999-10-16 22:53:30 +00:00
|
|
|
# include "lib-popt/popt.h"
|
1999-10-03 14:37:29 +00:00
|
|
|
#endif
|
|
|
|
|
|
1999-09-03 14:27:29 +00:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
|
# include <unistd.h>
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_DIRENT_H
|
|
|
|
|
# include <dirent.h>
|
|
|
|
|
#endif
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SOCKS_H
|
|
|
|
|
#include <socks.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <netdb.h>
|
|
|
|
|
#include <sys/socket.h>
|
|
|
|
|
#include <signal.h>
|
|
|
|
|
#include <sys/signal.h>
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
#include <gmodule.h>
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
gushort family;
|
|
|
|
|
#ifdef HAVE_IPV6
|
|
|
|
|
struct in6_addr addr;
|
|
|
|
|
#else
|
|
|
|
|
struct in_addr addr;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
IPADDR;
|
|
|
|
|
|
1999-10-03 14:37:29 +00:00
|
|
|
#include "irc-base/memdebug.h"
|
1999-09-03 14:27:29 +00:00
|
|
|
#include "lib-config/irssi-config.h"
|
|
|
|
|
#include "common-setup.h"
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2000-03-18 12:52:51 +00:00
|
|
|
G_INPUT_READ = 1 << 0,
|
|
|
|
|
G_INPUT_WRITE = 1 << 1,
|
|
|
|
|
G_INPUT_EXCEPTION = 1 << 2
|
|
|
|
|
} GInputCondition;
|
1999-09-03 14:27:29 +00:00
|
|
|
|
2000-03-18 12:52:51 +00:00
|
|
|
typedef void (*GInputFunction) (gpointer data, int source,
|
|
|
|
|
GInputCondition condition);
|
1999-09-03 14:27:29 +00:00
|
|
|
|
2000-03-18 12:52:51 +00:00
|
|
|
int g_input_add(int source, GInputCondition condition,
|
|
|
|
|
GInputFunction function, gpointer data);
|
1999-09-03 14:27:29 +00:00
|
|
|
|
2000-03-18 12:52:51 +00:00
|
|
|
#define MAX_INT_STRLEN ((sizeof(int) * CHAR_BIT + 2) / 3 + 1)
|
1999-09-03 14:27:29 +00:00
|
|
|
|
|
|
|
|
#endif
|