mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Merge pull request #42 from ailin-nemui/module-autoload
Protocol module autoloading
This commit is contained in:
commit
d9b181e4a1
94
.github/workflows/termuxpkg.yml
vendored
Normal file
94
.github/workflows/termuxpkg.yml
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
name: Build Irssi Termux package
|
||||
jobs:
|
||||
termux-package:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout termux-packages
|
||||
uses: actions/checkout@main
|
||||
with:
|
||||
repository: termux/termux-packages
|
||||
- name: checkout irssi
|
||||
uses: actions/checkout@main
|
||||
with:
|
||||
path: src.irssi.git
|
||||
- name: download termux docker container
|
||||
uses: docker://termux/package-builder:latest
|
||||
- name: build perl package
|
||||
run: |
|
||||
./scripts/run-docker.sh ./build-package.sh -i perl
|
||||
- name: create irssi build receipe
|
||||
run: |
|
||||
mkdir packages/irssi-an
|
||||
cat << 'BUILD_SH' > packages/irssi-an/build.sh
|
||||
TERMUX_PKG_HOMEPAGE=https://ailin-nemui.github.io/irssi/
|
||||
TERMUX_PKG_DESCRIPTION="Terminal based IRC client"
|
||||
TERMUX_PKG_LICENSE="GPL-2.0"
|
||||
TERMUX_PKG_MAINTAINER="@ailin-nemui"
|
||||
TERMUX_PKG_VERSION=@VERSION@
|
||||
TERMUX_PKG_REVISION=@REVISION@
|
||||
TERMUX_PKG_SRCURL=file:///home/builder/termux-packages/src.irssi.git
|
||||
TERMUX_PKG_AUTO_UPDATE=true
|
||||
TERMUX_PKG_DEPENDS="glib, libandroid-glob, libiconv, libotr, ncurses, openssl, perl, utf8proc"
|
||||
TERMUX_PKG_BREAKS="irssi"
|
||||
TERMUX_PKG_REPLACES="irssi"
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
||||
-Denable-true-color=yes
|
||||
-Dfhs-prefix=$TERMUX_PREFIX
|
||||
"
|
||||
|
||||
termux_step_configure_meson() {
|
||||
termux_setup_meson
|
||||
|
||||
local perl_version=$(. $TERMUX_SCRIPTDIR/packages/perl/build.sh; echo $TERMUX_PKG_VERSION)
|
||||
local perl_srcdir=$TERMUX_TOPDIR/perl/src
|
||||
|
||||
sed -i "/\\[binaries\\]/a\\
|
||||
perl = ['$perl_srcdir/miniperl', '-I$TERMUX_PREFIX/lib/perl5/$perl_version/${TERMUX_ARCH}-android', '-I$TERMUX_PREFIX/lib/perl5/$perl_version']" \
|
||||
$TERMUX_MESON_CROSSFILE
|
||||
|
||||
CC=gcc CXX=g++ CFLAGS= CXXFLAGS= CPPFLAGS= LDFLAGS= $TERMUX_MESON \
|
||||
$TERMUX_PKG_SRCDIR \
|
||||
$TERMUX_PKG_BUILDDIR \
|
||||
--cross-file $TERMUX_MESON_CROSSFILE \
|
||||
--prefix $TERMUX_PREFIX \
|
||||
--libdir lib \
|
||||
--buildtype minsize \
|
||||
--strip \
|
||||
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS
|
||||
}
|
||||
|
||||
termux_step_post_configure() {
|
||||
sed -i "s:-I$TERMUX_PREFIX/:-isystem$TERMUX_PREFIX/:g" $TERMUX_PKG_BUILDDIR/build.ninja
|
||||
}
|
||||
|
||||
|
||||
termux_step_pre_configure() {
|
||||
LDFLAGS+=" -landroid-glob"
|
||||
|
||||
# Make build log less noisy.
|
||||
CFLAGS+=" -Wno-compound-token-split-by-macro"
|
||||
|
||||
# Make sure that perl stuff is reinstalled.
|
||||
rm -rf $TERMUX_PREFIX/lib/irssi/perl
|
||||
}
|
||||
|
||||
BUILD_SH
|
||||
version=$(awk '/^v/ { $0=$1; gsub(/^v/,""); gsub(/-head/,"dev"); gsub(/-/,""); print; exit }' src.irssi.git/NEWS)
|
||||
version=$version+g$(git -C src.irssi.git rev-parse --short HEAD)
|
||||
sed -i \
|
||||
-e "s:@VERSION@:$version:" \
|
||||
-e "s:@REVISION@:$GITHUB_RUN_NUMBER:" \
|
||||
packages/irssi-an/build.sh
|
||||
git -C src.irssi.git tag v$version
|
||||
- name: build irssi package
|
||||
run: |
|
||||
./scripts/run-docker.sh ./build-package.sh -I irssi-an
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: irssi-termux-pkg
|
||||
path: output/irssi-an*.deb
|
@ -6,7 +6,7 @@
|
||||
#define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */
|
||||
#define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */
|
||||
|
||||
#define IRSSI_ABI_VERSION 44
|
||||
#define IRSSI_ABI_VERSION 45
|
||||
|
||||
#define DEFAULT_SERVER_ADD_PORT 6667
|
||||
#define DEFAULT_SERVER_ADD_TLS_PORT 6697
|
||||
|
@ -227,8 +227,7 @@ void channels_setup_init(void)
|
||||
setupchannels = NULL;
|
||||
source_host_ok = FALSE;
|
||||
|
||||
signal_add("setup reread", (SIGNAL_FUNC) channels_read_config);
|
||||
signal_add("irssi init read settings", (SIGNAL_FUNC) channels_read_config);
|
||||
signal_add("setup reread channels", (SIGNAL_FUNC) channels_read_config);
|
||||
}
|
||||
|
||||
void channels_setup_deinit(void)
|
||||
@ -236,6 +235,5 @@ void channels_setup_deinit(void)
|
||||
while (setupchannels != NULL)
|
||||
channel_setup_destroy(setupchannels->data);
|
||||
|
||||
signal_remove("setup reread", (SIGNAL_FUNC) channels_read_config);
|
||||
signal_remove("irssi init read settings", (SIGNAL_FUNC) channels_read_config);
|
||||
signal_remove("setup reread channels", (SIGNAL_FUNC) channels_read_config);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ int chat_protocol_lookup(const char *name)
|
||||
g_return_val_if_fail(name != NULL, -1);
|
||||
|
||||
rec = chat_protocol_find(name);
|
||||
return rec == NULL ? -1 : rec->id;
|
||||
return rec == NULL ? -1 : rec->not_initialized ? CHAT_PROTOCOL_NOT_INITIALIZED : rec->id;
|
||||
}
|
||||
|
||||
CHAT_PROTOCOL_REC *chat_protocol_find(const char *name)
|
||||
@ -99,6 +99,22 @@ CHAT_PROTOCOL_REC *chat_protocol_find_net(GHashTable *optlist)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void chat_protocol_destroy(CHAT_PROTOCOL_REC *rec)
|
||||
{
|
||||
g_return_if_fail(rec != NULL);
|
||||
|
||||
chat_protocols = g_slist_remove(chat_protocols, rec);
|
||||
|
||||
if (default_proto == rec) {
|
||||
chat_protocol_set_default(chat_protocols == NULL ? NULL : chat_protocols->data);
|
||||
}
|
||||
|
||||
signal_emit("chat protocol destroyed", 1, rec);
|
||||
|
||||
g_free(rec->name);
|
||||
g_free(rec);
|
||||
}
|
||||
|
||||
/* Register new chat protocol. */
|
||||
CHAT_PROTOCOL_REC *chat_protocol_register(CHAT_PROTOCOL_REC *rec)
|
||||
{
|
||||
@ -108,6 +124,10 @@ CHAT_PROTOCOL_REC *chat_protocol_register(CHAT_PROTOCOL_REC *rec)
|
||||
g_return_val_if_fail(rec != NULL, NULL);
|
||||
|
||||
newrec = chat_protocol_find(rec->name);
|
||||
if (newrec != NULL && newrec->not_initialized) {
|
||||
chat_protocol_destroy(newrec);
|
||||
newrec = NULL;
|
||||
}
|
||||
created = newrec == NULL;
|
||||
if (newrec == NULL) {
|
||||
newrec = g_new0(CHAT_PROTOCOL_REC, 1);
|
||||
@ -131,23 +151,6 @@ CHAT_PROTOCOL_REC *chat_protocol_register(CHAT_PROTOCOL_REC *rec)
|
||||
return newrec;
|
||||
}
|
||||
|
||||
static void chat_protocol_destroy(CHAT_PROTOCOL_REC *rec)
|
||||
{
|
||||
g_return_if_fail(rec != NULL);
|
||||
|
||||
chat_protocols = g_slist_remove(chat_protocols, rec);
|
||||
|
||||
if (default_proto == rec) {
|
||||
chat_protocol_set_default(chat_protocols == NULL ? NULL :
|
||||
chat_protocols->data);
|
||||
}
|
||||
|
||||
signal_emit("chat protocol destroyed", 1, rec);
|
||||
|
||||
g_free(rec->name);
|
||||
g_free(rec);
|
||||
}
|
||||
|
||||
/* Unregister chat protocol. */
|
||||
void chat_protocol_unregister(const char *name)
|
||||
{
|
||||
@ -191,15 +194,6 @@ static CHANNEL_SETUP_REC *create_channel_setup(void)
|
||||
return g_new0(CHANNEL_SETUP_REC, 1);
|
||||
}
|
||||
|
||||
static SERVER_CONNECT_REC *create_server_connect(void)
|
||||
{
|
||||
return g_new0(SERVER_CONNECT_REC, 1);
|
||||
}
|
||||
|
||||
static void destroy_server_connect(SERVER_CONNECT_REC *conn)
|
||||
{
|
||||
}
|
||||
|
||||
/* Return "unknown chat protocol" record. Used when protocol name is
|
||||
specified but it isn't registered yet. */
|
||||
CHAT_PROTOCOL_REC *chat_protocol_get_unknown(const char *name)
|
||||
@ -218,8 +212,10 @@ CHAT_PROTOCOL_REC *chat_protocol_get_unknown(const char *name)
|
||||
rec->create_chatnet = create_chatnet;
|
||||
rec->create_server_setup = create_server_setup;
|
||||
rec->create_channel_setup = create_channel_setup;
|
||||
/*
|
||||
rec->create_server_connect = create_server_connect;
|
||||
rec->destroy_server_connect = destroy_server_connect;
|
||||
*/
|
||||
|
||||
newrec = chat_protocol_register(rec);
|
||||
g_free(rec);
|
||||
|
@ -35,6 +35,8 @@ void *chat_protocol_check_cast(void *object, int type_pos, const char *id);
|
||||
((object) == NULL ? chat_protocol_get_default() : \
|
||||
chat_protocol_find_id((object)->chat_type))
|
||||
|
||||
#define CHAT_PROTOCOL_NOT_INITIALIZED -2
|
||||
|
||||
/* Register new chat protocol. */
|
||||
CHAT_PROTOCOL_REC *chat_protocol_register(CHAT_PROTOCOL_REC *rec);
|
||||
|
||||
|
@ -24,12 +24,13 @@
|
||||
#include <irssi/src/core/special-vars.h>
|
||||
#include <irssi/src/lib-config/iconfig.h>
|
||||
#include <irssi/src/core/settings.h>
|
||||
#include <irssi/src/core/misc.h>
|
||||
|
||||
#include <irssi/src/core/chat-protocols.h>
|
||||
#include <irssi/src/core/chatnets.h>
|
||||
#include <irssi/src/core/servers.h>
|
||||
|
||||
GSList *chatnets; /* list of available chat networks */
|
||||
GSList *chatnets, *chatnets_unavailable; /* list of available chat networks */
|
||||
|
||||
static void chatnet_config_save(CHATNET_REC *chatnet)
|
||||
{
|
||||
@ -60,6 +61,7 @@ static void chatnet_config_remove(CHATNET_REC *chatnet)
|
||||
void chatnet_create(CHATNET_REC *chatnet)
|
||||
{
|
||||
g_return_if_fail(chatnet != NULL);
|
||||
g_return_if_fail(!CHAT_PROTOCOL(chatnet)->not_initialized);
|
||||
|
||||
chatnet->type = module_get_uniq_id("CHATNET", 0);
|
||||
if (g_slist_find(chatnets, chatnet) == NULL)
|
||||
@ -112,6 +114,21 @@ CHATNET_REC *chatnet_find(const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gboolean chatnet_find_unavailable(const char *name)
|
||||
{
|
||||
CHAT_PROTOCOL_REC *proto;
|
||||
|
||||
if (i_slist_find_icase_string(chatnets_unavailable, name) != NULL)
|
||||
return TRUE;
|
||||
|
||||
proto = CHAT_PROTOCOL(chatnet_find(name));
|
||||
|
||||
if (proto == NULL || proto->not_initialized)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void sig_connected(SERVER_REC *server)
|
||||
{
|
||||
CHATNET_REC *rec;
|
||||
@ -136,14 +153,22 @@ static void chatnet_read(CONFIG_NODE *node)
|
||||
return;
|
||||
|
||||
type = config_node_get_str(node, "type", NULL);
|
||||
proto = type == NULL ? NULL : chat_protocol_find(type);
|
||||
if (proto == NULL) {
|
||||
proto = type == NULL ? chat_protocol_get_default() :
|
||||
chat_protocol_get_unknown(type);
|
||||
if (type == NULL) {
|
||||
proto = chat_protocol_get_default();
|
||||
} else {
|
||||
proto = chat_protocol_find(type);
|
||||
}
|
||||
|
||||
if (type == NULL)
|
||||
if (proto == NULL) {
|
||||
/* protocol not loaded */
|
||||
if (i_slist_find_icase_string(chatnets_unavailable, node->key) == NULL)
|
||||
chatnets_unavailable =
|
||||
g_slist_append(chatnets_unavailable, g_strdup(node->key));
|
||||
|
||||
return;
|
||||
} else if (type == NULL) {
|
||||
iconfig_node_set_str(node, "type", proto->name);
|
||||
}
|
||||
|
||||
rec = proto->create_chatnet();
|
||||
rec->type = module_get_uniq_id("CHATNET", 0);
|
||||
@ -167,6 +192,12 @@ static void read_chatnets(void)
|
||||
while (chatnets != NULL)
|
||||
chatnet_destroy(chatnets->data);
|
||||
|
||||
while (chatnets_unavailable != NULL) {
|
||||
char *name = chatnets_unavailable->data;
|
||||
chatnets_unavailable = g_slist_remove(chatnets_unavailable, name);
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
node = iconfig_node_traverse("chatnets", FALSE);
|
||||
if (node != NULL) {
|
||||
tmp = config_node_first(node->value);
|
||||
@ -180,8 +211,7 @@ void chatnets_init(void)
|
||||
chatnets = NULL;
|
||||
|
||||
signal_add_first("event connected", (SIGNAL_FUNC) sig_connected);
|
||||
signal_add("setup reread", (SIGNAL_FUNC) read_chatnets);
|
||||
signal_add_first("irssi init read settings", (SIGNAL_FUNC) read_chatnets);
|
||||
signal_add("setup reread chatnets", (SIGNAL_FUNC) read_chatnets);
|
||||
}
|
||||
|
||||
void chatnets_deinit(void)
|
||||
@ -189,6 +219,5 @@ void chatnets_deinit(void)
|
||||
module_uniq_destroy("CHATNET");
|
||||
|
||||
signal_remove("event connected", (SIGNAL_FUNC) sig_connected);
|
||||
signal_remove("setup reread", (SIGNAL_FUNC) read_chatnets);
|
||||
signal_remove("irssi init read settings", (SIGNAL_FUNC) read_chatnets);
|
||||
signal_remove("setup reread chatnets", (SIGNAL_FUNC) read_chatnets);
|
||||
}
|
||||
|
@ -25,6 +25,8 @@ void chatnet_destroy(CHATNET_REC *chatnet);
|
||||
|
||||
/* Find the chat network by name */
|
||||
CHATNET_REC *chatnet_find(const char *name);
|
||||
/* Check if this chatnet is unavailable because the protocol is not loaded */
|
||||
gboolean chatnet_find_unavailable(const char *name);
|
||||
|
||||
void chatnets_init(void);
|
||||
void chatnets_deinit(void);
|
||||
|
@ -223,6 +223,13 @@ static void sig_irssi_init_finished(void)
|
||||
irssi_init_finished = TRUE;
|
||||
}
|
||||
|
||||
static void reread_setup(void)
|
||||
{
|
||||
signal_emit("setup reread chatnets", 0);
|
||||
signal_emit("setup reread servers", 0);
|
||||
signal_emit("setup reread channels", 0);
|
||||
}
|
||||
|
||||
void core_init(void)
|
||||
{
|
||||
dialog_type_queue = NULL;
|
||||
@ -269,13 +276,16 @@ void core_init(void)
|
||||
settings_add_str("misc", "ignore_signals", "");
|
||||
settings_add_bool("misc", "override_coredump_limit", FALSE);
|
||||
settings_add_bool("misc", "quit_on_hup", FALSE);
|
||||
settings_add_str("misc", "autoload_modules", "perl otr");
|
||||
settings_add_str("misc", "autoload_modules", "irc dcc flood notifylist perl otr");
|
||||
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
getrlimit(RLIMIT_CORE, &orig_core_rlimit);
|
||||
#endif
|
||||
read_settings();
|
||||
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
|
||||
signal_add("setup reread", (SIGNAL_FUNC) reread_setup);
|
||||
signal_add("irssi init read settings", (SIGNAL_FUNC) reread_setup);
|
||||
signal_add_last("chat protocol created", (SIGNAL_FUNC) reread_setup);
|
||||
signal_add("irssi init finished", (SIGNAL_FUNC) sig_irssi_init_finished);
|
||||
|
||||
settings_check();
|
||||
@ -288,6 +298,9 @@ void core_deinit(void)
|
||||
module_uniq_destroy("WINDOW ITEM TYPE");
|
||||
|
||||
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
|
||||
signal_remove("setup reread", (SIGNAL_FUNC) reread_setup);
|
||||
signal_remove("irssi init read settings", (SIGNAL_FUNC) reread_setup);
|
||||
signal_remove("chat protocol created", (SIGNAL_FUNC) reread_setup);
|
||||
signal_remove("irssi init finished", (SIGNAL_FUNC) sig_irssi_init_finished);
|
||||
|
||||
wcwidth_wrapper_deinit();
|
||||
|
@ -305,6 +305,8 @@ static SERVER_CONNECT_REC *create_addr_conn(int chat_type, const char *address,
|
||||
proto = chat_type >= 0 ? chat_protocol_find_id(chat_type) :
|
||||
chat_protocol_get_default();
|
||||
|
||||
g_return_val_if_fail(proto != NULL, NULL);
|
||||
|
||||
conn = proto->create_server_connect();
|
||||
server_connect_ref(conn);
|
||||
|
||||
@ -469,6 +471,10 @@ static SERVER_SETUP_REC *server_setup_read(CONFIG_NODE *node)
|
||||
chatnetrec = chatnet == NULL ? NULL : chatnet_find(chatnet);
|
||||
if (chatnetrec == NULL && chatnet != NULL) {
|
||||
/* chat network not found, create it. */
|
||||
if (chatnet_find_unavailable(chatnet)) {
|
||||
/* no protocols loaded, skip loading servers */
|
||||
return NULL;
|
||||
}
|
||||
chatnetrec = chat_protocol_get_default()->create_chatnet();
|
||||
chatnetrec->chat_type = chat_protocol_get_default()->id;
|
||||
chatnetrec->name = g_strdup(chatnet);
|
||||
@ -759,8 +765,7 @@ void servers_setup_init(void)
|
||||
read_settings();
|
||||
|
||||
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
|
||||
signal_add("setup reread", (SIGNAL_FUNC) read_servers);
|
||||
signal_add("irssi init read settings", (SIGNAL_FUNC) read_servers);
|
||||
signal_add("setup reread servers", (SIGNAL_FUNC) read_servers);
|
||||
}
|
||||
|
||||
void servers_setup_deinit(void)
|
||||
@ -773,8 +778,7 @@ void servers_setup_deinit(void)
|
||||
server_setup_destroy(setupservers->data);
|
||||
|
||||
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
|
||||
signal_remove("setup reread", (SIGNAL_FUNC) read_servers);
|
||||
signal_remove("irssi init read settings", (SIGNAL_FUNC) read_servers);
|
||||
signal_remove("setup reread servers", (SIGNAL_FUNC) read_servers);
|
||||
|
||||
module_uniq_destroy("SERVER SETUP");
|
||||
}
|
||||
|
@ -17,6 +17,11 @@ libfe_irc_dcc_a = static_library('fe_irc_dcc',
|
||||
def_sysconfdir,
|
||||
],
|
||||
dependencies : dep)
|
||||
shared_module('fe_irc_dcc',
|
||||
install : true,
|
||||
install_dir : moduledir,
|
||||
link_with : dl_cross_irc_dcc,
|
||||
link_whole : libfe_irc_dcc_a)
|
||||
|
||||
install_headers(
|
||||
files(
|
||||
|
@ -30,8 +30,10 @@
|
||||
#include <irssi/src/fe-common/irc/fe-irc-server.h>
|
||||
#include <irssi/src/fe-common/irc/fe-irc-channels.h>
|
||||
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
void fe_irc_modules_init(void);
|
||||
void fe_irc_modules_deinit(void);
|
||||
#endif
|
||||
|
||||
void fe_irc_queries_init(void);
|
||||
void fe_irc_queries_deinit(void);
|
||||
@ -104,12 +106,16 @@ void fe_common_irc_init(void)
|
||||
settings_check();
|
||||
module_register("irc", "fe-common");
|
||||
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
fe_irc_modules_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
void fe_common_irc_deinit(void)
|
||||
{
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
fe_irc_modules_deinit();
|
||||
#endif
|
||||
|
||||
fe_irc_channels_deinit();
|
||||
fe_irc_queries_deinit();
|
||||
|
@ -1,4 +1,6 @@
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
void fe_irc_dcc_init(void);void fe_irc_notifylist_init(void);
|
||||
void fe_irc_notifylist_deinit(void);void fe_irc_dcc_deinit(void);
|
||||
void fe_irc_modules_init(void) { fe_irc_dcc_init(); fe_irc_notifylist_init(); }
|
||||
void fe_irc_modules_deinit(void) { fe_irc_notifylist_deinit(); fe_irc_dcc_deinit(); }
|
||||
#endif
|
||||
|
@ -30,6 +30,11 @@ libfe_common_irc_a = static_library('fe_common_irc',
|
||||
def_themesdir,
|
||||
],
|
||||
dependencies : dep)
|
||||
shared_module('fe_common_irc',
|
||||
install : true,
|
||||
install_dir : moduledir,
|
||||
link_with : dl_cross_irc_core,
|
||||
link_whole : libfe_common_irc_a)
|
||||
|
||||
install_headers(
|
||||
files(
|
||||
|
@ -12,6 +12,11 @@ libfe_irc_notifylist_a = static_library('fe_irc_notifylist',
|
||||
def_sysconfdir,
|
||||
],
|
||||
dependencies : dep)
|
||||
shared_module('fe_irc_notifylist',
|
||||
install : true,
|
||||
install_dir : moduledir,
|
||||
link_with : dl_cross_irc_notifylist,
|
||||
link_whole : libfe_irc_notifylist_a)
|
||||
|
||||
install_headers(
|
||||
files(
|
||||
|
@ -9,7 +9,7 @@ executable('event-get-params-fuzz',
|
||||
link_with : [
|
||||
libconfig_a,
|
||||
libcore_a,
|
||||
libirc_a,
|
||||
libirc_core_a,
|
||||
libfuzzer_fe_common_core_a,
|
||||
],
|
||||
link_args : [fuzzer_lib],
|
||||
|
@ -32,7 +32,7 @@ executable('server-fuzz',
|
||||
libconfig_a,
|
||||
libcore_a,
|
||||
libfuzzer_fe_common_core_a,
|
||||
libirc_a,
|
||||
libirc_core_a,
|
||||
libfe_common_irc_a,
|
||||
libfe_irc_dcc_a,
|
||||
libfe_irc_notifylist_a,
|
||||
|
@ -43,9 +43,9 @@
|
||||
#include <irssi/src/irc/core/irc-channels.h>
|
||||
#include <irssi/src/fe-fuzz/null-logger.h>
|
||||
|
||||
/* irc.c */
|
||||
void irc_init(void);
|
||||
void irc_deinit(void);
|
||||
/* irc-core.c */
|
||||
void irc_core_init(void);
|
||||
void irc_core_deinit(void);
|
||||
|
||||
/* irc-session.c */
|
||||
void irc_session_init(void);
|
||||
@ -153,7 +153,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv) {
|
||||
core_preinit((*argv)[0]);
|
||||
core_init();
|
||||
irssi_ssl_init();
|
||||
irc_init();
|
||||
irc_core_init();
|
||||
fe_common_core_init();
|
||||
fe_common_irc_init();
|
||||
signal_add("event 001", (SIGNAL_FUNC) event_connected);
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <irssi/src/core/modules-load.h>
|
||||
#include <irssi/src/core/args.h>
|
||||
#include <irssi/src/core/signals.h>
|
||||
#include <irssi/src/core/settings.h>
|
||||
#include <irssi/src/core/core.h>
|
||||
|
||||
#ifdef HAVE_STATIC_PERL
|
||||
@ -30,8 +31,10 @@ void perl_core_init(void);
|
||||
void perl_core_deinit(void);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
void irc_init(void);
|
||||
void irc_deinit(void);
|
||||
#endif
|
||||
|
||||
static GMainLoop *main_loop;
|
||||
static char *autoload_module;
|
||||
@ -47,13 +50,32 @@ static void sig_reload(void)
|
||||
reload = TRUE;
|
||||
}
|
||||
|
||||
static void autoload_modules(void)
|
||||
{
|
||||
char **list, **module;
|
||||
list = g_strsplit_set(settings_get_str("autoload_modules"), " ,", -1);
|
||||
for (module = list; *module != NULL; module++) {
|
||||
char *tmp;
|
||||
if ((tmp = strchr(*module, ':')) != NULL) {
|
||||
*tmp = '\0';
|
||||
tmp++;
|
||||
module_load_sub(*module, tmp, NULL);
|
||||
} else {
|
||||
module_load(*module, NULL);
|
||||
}
|
||||
}
|
||||
g_strfreev(list);
|
||||
}
|
||||
|
||||
void noui_init(void)
|
||||
{
|
||||
srand(time(NULL));
|
||||
|
||||
irssi_gui = IRSSI_GUI_NONE;
|
||||
core_init();
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
irc_init();
|
||||
#endif
|
||||
|
||||
module_register("core", "fe-none");
|
||||
|
||||
@ -64,6 +86,8 @@ void noui_init(void)
|
||||
perl_core_init();
|
||||
#endif
|
||||
|
||||
autoload_modules();
|
||||
|
||||
signal_emit("irssi init finished", 0);
|
||||
}
|
||||
|
||||
@ -75,7 +99,9 @@ void noui_deinit(void)
|
||||
|
||||
signal_remove("reload", (SIGNAL_FUNC) sig_reload);
|
||||
signal_remove("gui exit", (SIGNAL_FUNC) sig_exit);
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
irc_deinit();
|
||||
#endif
|
||||
core_deinit();
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ executable('botti',
|
||||
link_with : [
|
||||
libconfig_a,
|
||||
libcore_a,
|
||||
libirc_a,
|
||||
],
|
||||
install : true,
|
||||
dependencies : dep
|
||||
|
@ -59,11 +59,13 @@ void otr_core_init(void);
|
||||
void otr_core_deinit(void);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
void irc_init(void);
|
||||
void irc_deinit(void);
|
||||
|
||||
void fe_common_irc_init(void);
|
||||
void fe_common_irc_deinit(void);
|
||||
#endif
|
||||
|
||||
void gui_expandos_init(void);
|
||||
void gui_expandos_deinit(void);
|
||||
@ -168,9 +170,13 @@ static void textui_init(void)
|
||||
|
||||
irssi_gui = IRSSI_GUI_TEXT;
|
||||
core_init();
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
irc_init();
|
||||
#endif
|
||||
fe_common_core_init();
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
fe_common_irc_init();
|
||||
#endif
|
||||
|
||||
theme_register(gui_text_formats);
|
||||
signal_add("settings userinfo changed", (SIGNAL_FUNC) sig_settings_userinfo_changed);
|
||||
@ -301,9 +307,13 @@ static void textui_deinit(void)
|
||||
|
||||
theme_unregister();
|
||||
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
fe_common_irc_deinit();
|
||||
#endif
|
||||
fe_common_core_deinit();
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
irc_deinit();
|
||||
#endif
|
||||
core_deinit();
|
||||
}
|
||||
|
||||
|
@ -35,10 +35,6 @@ executable('irssi',
|
||||
libconfig_a,
|
||||
libcore_a,
|
||||
libfe_common_core_a,
|
||||
libirc_a,
|
||||
libfe_common_irc_a,
|
||||
libfe_irc_dcc_a,
|
||||
libfe_irc_notifylist_a,
|
||||
],
|
||||
install : true,
|
||||
install_rpath : get_option('prefix') / get_option('libdir'),
|
||||
|
@ -106,9 +106,6 @@ void irc_core_init(void)
|
||||
(QUERY_REC *(*) (const char *, const char *, int))
|
||||
irc_query_create;
|
||||
|
||||
chat_protocol_register(rec);
|
||||
g_free(rec);
|
||||
|
||||
irc_session_init();
|
||||
irc_chatnets_init();
|
||||
irc_servers_init();
|
||||
@ -125,6 +122,10 @@ void irc_core_init(void)
|
||||
sasl_init();
|
||||
|
||||
settings_check();
|
||||
|
||||
chat_protocol_register(rec);
|
||||
g_free(rec);
|
||||
|
||||
module_register("irc", "core");
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,15 @@ libirc_core_a = static_library('irc_core',
|
||||
def_sysconfdir,
|
||||
],
|
||||
dependencies : dep)
|
||||
libirc_core_sm = shared_module('irc_core',
|
||||
install : true,
|
||||
install_dir : moduledir,
|
||||
link_whole : libirc_core_a)
|
||||
|
||||
dl_cross_irc_core = []
|
||||
if need_dl_cross_link
|
||||
dl_cross_irc_core += libirc_core_sm
|
||||
endif
|
||||
|
||||
install_headers(
|
||||
files(
|
||||
|
@ -1,6 +1,6 @@
|
||||
# this file is part of irssi
|
||||
|
||||
libirc_dcc_a = static_library('irc_dcc',
|
||||
libirc_dcc_sm = shared_module('irc_dcc',
|
||||
files(
|
||||
'dcc-autoget.c',
|
||||
'dcc-chat.c',
|
||||
@ -13,8 +13,16 @@ libirc_dcc_a = static_library('irc_dcc',
|
||||
),
|
||||
include_directories : rootinc,
|
||||
implicit_include_directories : false,
|
||||
install : true,
|
||||
install_dir : moduledir,
|
||||
link_with : dl_cross_irc_core,
|
||||
dependencies : dep)
|
||||
|
||||
dl_cross_irc_dcc = []
|
||||
if need_dl_cross_link
|
||||
dl_cross_irc_dcc += libirc_dcc_sm
|
||||
endif
|
||||
|
||||
install_headers(
|
||||
files(
|
||||
'dcc-chat.h',
|
||||
|
@ -8,6 +8,11 @@ libirc_flood_a = static_library('irc_flood',
|
||||
include_directories : rootinc,
|
||||
implicit_include_directories : false,
|
||||
dependencies : dep)
|
||||
shared_module('irc_flood',
|
||||
install : true,
|
||||
install_dir : moduledir,
|
||||
link_with : dl_cross_irc_core,
|
||||
link_whole : libirc_flood_a)
|
||||
|
||||
install_headers(
|
||||
files('module.h'),
|
||||
|
@ -1,5 +1,7 @@
|
||||
#ifdef HAVE_STATIC_IRC
|
||||
void irc_core_init(void); void irc_core_deinit(void);
|
||||
void irc_dcc_init(void);void irc_flood_init(void);void irc_notifylist_init(void);
|
||||
void irc_notifylist_deinit(void);void irc_flood_deinit(void);void irc_dcc_deinit(void);
|
||||
void irc_init(void) { irc_core_init(); irc_dcc_init(); irc_flood_init(); irc_notifylist_init(); }
|
||||
void irc_deinit(void) { irc_notifylist_deinit(); irc_flood_deinit(); irc_dcc_deinit(); irc_core_deinit(); }
|
||||
#endif
|
||||
|
@ -5,20 +5,6 @@ subdir('dcc')
|
||||
subdir('flood')
|
||||
subdir('notifylist')
|
||||
|
||||
libirc_a = static_library('irc',
|
||||
files(
|
||||
'irc.c',
|
||||
),
|
||||
link_with : [
|
||||
libirc_core_a,
|
||||
libirc_dcc_a,
|
||||
libirc_flood_a,
|
||||
libirc_notifylist_a,
|
||||
],
|
||||
include_directories : rootinc,
|
||||
implicit_include_directories : false,
|
||||
)
|
||||
|
||||
if want_proxy
|
||||
subdir('proxy')
|
||||
endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
# this file is part of irssi
|
||||
|
||||
libirc_notifylist_a = static_library('irc_notifylist',
|
||||
libirc_notifylist_sm = shared_module('irc_notifylist',
|
||||
files(
|
||||
'notify-commands.c',
|
||||
'notify-ison.c',
|
||||
@ -10,8 +10,16 @@ libirc_notifylist_a = static_library('irc_notifylist',
|
||||
),
|
||||
include_directories : rootinc,
|
||||
implicit_include_directories : false,
|
||||
install : true,
|
||||
install_dir : moduledir,
|
||||
link_with : dl_cross_irc_core,
|
||||
dependencies : dep)
|
||||
|
||||
dl_cross_irc_notifylist = []
|
||||
if need_dl_cross_link
|
||||
dl_cross_irc_notifylist += libirc_notifylist_sm
|
||||
endif
|
||||
|
||||
install_headers(
|
||||
files(
|
||||
'module.h',
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
libperl_Irssi_a = shared_module('Irssi',
|
||||
shared_module('Irssi',
|
||||
[ xsubpp.process(
|
||||
files(
|
||||
'Channel.xs',
|
||||
|
@ -1,4 +1,4 @@
|
||||
libperl_Irssi_Irc_a = shared_module('Irc',
|
||||
shared_module('Irc',
|
||||
[ xsubpp.process(
|
||||
files(
|
||||
'Channel.xs',
|
||||
@ -26,7 +26,7 @@ libperl_Irssi_Irc_a = shared_module('Irc',
|
||||
include_directories : rootinc,
|
||||
implicit_include_directories : true,
|
||||
dependencies : dep + [ perl_dep ],
|
||||
link_with : dl_cross_perl_core,
|
||||
link_with : dl_cross_perl_core + dl_cross_irc_dcc + dl_cross_irc_notifylist,
|
||||
)
|
||||
|
||||
install_headers(
|
||||
|
@ -17,7 +17,7 @@ irssi_core_pl_h = custom_target('irssi-core.pl.h',
|
||||
# required as of Meson 0.58.0
|
||||
generated_files_inc = include_directories('.')
|
||||
|
||||
libperl_core_a = shared_module('perl_core',
|
||||
libperl_core_sm = shared_module('perl_core',
|
||||
files(
|
||||
'perl-common.c',
|
||||
'perl-core.c',
|
||||
@ -44,10 +44,10 @@ libperl_core_a = shared_module('perl_core',
|
||||
|
||||
dl_cross_perl_core = []
|
||||
if need_dl_cross_link
|
||||
dl_cross_perl_core += libperl_core_a
|
||||
dl_cross_perl_core += libperl_core_sm
|
||||
endif
|
||||
|
||||
libfe_perl_a = shared_module('fe_perl',
|
||||
shared_module('fe_perl',
|
||||
files(
|
||||
'module-formats.c',
|
||||
'perl-fe.c',
|
||||
|
@ -583,6 +583,10 @@ static void perl_register_protocol(CHAT_PROTOCOL_REC *rec)
|
||||
SV *sv;
|
||||
|
||||
chat_type = chat_protocol_lookup(rec->name);
|
||||
if (chat_type == CHAT_PROTOCOL_NOT_INITIALIZED) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_return_if_fail(chat_type >= 0);
|
||||
|
||||
name = g_ascii_strdown(rec->name,-1);
|
||||
|
@ -1,4 +1,4 @@
|
||||
libperl_Irssi_TextUI_a = shared_module('TextUI',
|
||||
shared_module('TextUI',
|
||||
[ xsubpp.process(
|
||||
files(
|
||||
'Statusbar.xs',
|
||||
|
@ -1,4 +1,4 @@
|
||||
libperl_Irssi_UI_a = shared_module('UI',
|
||||
shared_module('UI',
|
||||
[ xsubpp.process(
|
||||
files(
|
||||
'Formats.xs',
|
||||
|
@ -6,7 +6,8 @@ test_test_796 = executable('test-796',
|
||||
libconfig_a,
|
||||
libcore_a,
|
||||
libfe_common_core_a,
|
||||
libirc_a,
|
||||
libirc_core_a,
|
||||
libirc_flood_a,
|
||||
libfe_common_irc_a,
|
||||
libfe_irc_dcc_a,
|
||||
libfe_irc_notifylist_a,
|
||||
|
Loading…
Reference in New Issue
Block a user