1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 09:03:12 +02:00

+- Added Modules, using dlopen() and LoadLibrary for *nix/win32.

+- Added /module load <path.to.so>, /module status (list modules),
+  /module unload <modulename>
This commit is contained in:
stskeeps
2001-03-10 11:58:04 +00:00
parent 797b6c6f21
commit f41c3bf679
13 changed files with 481 additions and 72 deletions
+6
View File
@@ -97,6 +97,12 @@
*/
#define ADMINCHAT 1
/*
* Kill logging -otherguy
*/
#undef KILL_LOGGING
/*
If you want SHUN_NOTICES, define this
*/
+60
View File
@@ -0,0 +1,60 @@
/************************************************************************
* Unreal Internet Relay Chat Daemon, include/modules.h
* (C) Carsten V. Munk 2000 <stskeeps@tspre.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
*/
#define MOD_VERSION 1
#define MAXMODULES 50
#ifdef _WIN32
#define DLLFUNC _declspec(dllexport)
#define irc_dlopen LoadLibrary
#define irc_dlclose FreeLibrary
#define irc_dlsym (void *)GetProcAddress
#define irc_dlerror strerror(GetLastError())
#else
#define irc_dlopen dlopen
#define irc_dlclose dlclose
#define irc_dlsym dlsym
#define irc_dlerror dlerror
#define DLLFUNC
#endif
typedef struct moduleInfo ModuleInfo;
struct moduleInfo
{
short mversion; /* Written for module header version */
char *name; /* Name of module */
char *version; /* $Id$ */
char *description; /* Small description */
#ifdef _WIN32
HMODULE dll; /* Return value of LoadLibrary */
#else
void *dll; /* Return value of dlopen */
#endif
void (*unload)(); /* pointer to mod_unload */
};
extern ModuleInfo *module_buffer;
void module_init(void);
int load_module(char *module);
int unload_module(char *name);
+4
View File
@@ -294,6 +294,9 @@
#define MSG_CYCLE "CYCLE"
#define TOK_CYCLE "BP"
#define MSG_MODULE "MODULE"
#define TOK_MODULE "BQ"
#define MAXPARA 15
extern int m_private(), m_topic(), m_join(), m_part(), m_mode(), m_svsmode();
@@ -333,6 +336,7 @@ extern int m_chgident(), m_swhois(), m_svso(), m_svsfline();
extern int m_tkl(), m_vhost(), m_botmotd(), m_sjoin(), m_htm();
extern int m_umode2(), m_dccdeny(), m_undccdeny();
extern int m_chgname(), m_shun(), m_post(), m_cycle();
extern int m_module();
#ifdef GUEST
extern int m_guest();
#endif
+1
View File
@@ -27,6 +27,7 @@
#include "common.h"
#include "sys.h"
#include "hash.h"
#include "modules.h"
#include <stdio.h>
#include <sys/types.h>
#ifdef ZIP_LINKS