dslinux/user/bitchx/dll/pkga Makefile.in pkga.c
stsp
stsp at user.in-berlin.de
Sun Jul 2 15:18:37 CEST 2006
Update of /cvsroot/dslinux/dslinux/user/bitchx/dll/pkga
In directory antilope:/tmp/cvs-serv9280/dll/pkga
Added Files:
Makefile.in pkga.c
Log Message:
Adding pristine copy of BitchX so I can branch from it.
--- NEW FILE: pkga.c ---
/*
* pkga.c --
*
* This file contains a simple Tcl package "pkga" that is intended
* for testing the Tcl dynamic loading facilities.
*
* CopyRight Colten Edwards aka panasync at efnet Jan 1997
*/
/* compile with
* gcc -o -I../include -fPIC -o pkga.o pkga.c
* gcc -shared -o pkga.so pkga.o
*/
#include "irc.h"
#include "struct.h"
#include "dcc.h"
#include "server.h"
#include "ircaux.h"
#include "alias.h"
#include "ctcp.h"
#include "list.h"
#include "struct.h"
#include "numbers.h"
#include "output.h"
#include "commands.h"
#include "vars.h"
#include "module.h"
#define INIT_MODULE
#include "modval.h"
/*
* Prototypes for procedures defined later in this file:
*/
static void Pkga_EqCmd (IrcCommandDll *, char *, char *, char *);
static char *Pkga_newctcp (CtcpEntryDll *, char *, char *, char *);
static char *Pkga_ctcppage (CtcpEntryDll *, char *, char *, char *);
static char *Pkga_alias (char *);
static int Pkga_numeric (char *, char *, char **);
/*
*----------------------------------------------------------------------
*
* Pkga_EqCmd --
*
* This procedure is invoked to process the "pkga_eq" Tcl command.
* It expects two arguments and returns 1 if they are the same,
* 0 if they are different.
*
* Results:
* A standard Tcl result.
*
* Side effects:
* See the user documentation.
*
*----------------------------------------------------------------------
*/
void Pkga_EqCmd(intp, command, args, subargs)
IrcCommandDll *intp; /* Current interpreter. */
char *command;
char *args; /* Number of arguments. */
char *subargs; /* Argument strings. */
{
char *arg1, *arg2;
arg1 = next_arg(args, &args);
arg2 = next_arg(args, &args);
if (!arg1 || !arg2)
return;
put_it("arg1 %s arg2", !my_stricmp(arg1, arg2)?"eq":"!eq");
return;
}
static char *Pkga_newctcp (CtcpEntryDll *dll, char *from, char *to, char *args)
{
char putbuf[500];
sprintf(putbuf, "%c%s %s%c", CTCP_DELIM_CHAR, dll->name, my_ctime(time(NULL)), CTCP_DELIM_CHAR);
send_text(from, putbuf, "NOTICE", 0, 0);
return NULL;
}
static char *Pkga_ctcppage (CtcpEntryDll *dll, char *from, char *to, char *args)
{
char putbuf[500];
sprintf(putbuf, "%c%s %s%c", CTCP_DELIM_CHAR, dll->name, my_ctime(time(NULL)), CTCP_DELIM_CHAR);
send_text(from, putbuf, "NOTICE", 0, 0);
put_it(" %s is paging you", from);
return NULL;
}
static char *Pkga_alias (char *word)
{
if (!word || !*word)
return m_strdup("no string passed");
/* caller free's this string */
return m_strdup(word);
}
static int Pkga_numeric (char *from, char *user, char **args)
{
put_it("Server numeric 1 being handled");
return 1;
}
static int Pkga_raw (char *comm, char *from, char *userhost, char **args)
{
if (*args[1] && !strncasecmp(args[1], "test", 4))
{
PasteArgs(args, 1);
put_it("PRIVMSG from %s!%s [%s]", from, userhost, args[1]);
send_to_server("%s %s :You sent me a privmsg [%s]", comm, from, args[1]);
return 1;
}
return 0;
}
char *Pkga_Version(IrcCommandDll **intp)
{
return "99.9";
}
int new_dcc_output(int type, int s, char *buf, int len)
{
if (type == DCC_CHAT)
{
put_it("handler new dcc chat");
write(s, buf, len);
}
return 0;
}
int Pkga_Init(IrcCommandDll **intp, Function_ptr *global_table)
{
int i;
Server *sptr;
initialize_module("pkga");
sptr = get_server_list();
for (i = 0; i < server_list_size(); i++)
put_it("server%d -> %s", i, sptr[i].name);
add_module_proc(COMMAND_PROC, "pkga", "pkga_eq", NULL, 0, 0, Pkga_EqCmd, NULL);
add_module_proc(CTCP_PROC, "pkga", "blah", "New ctcp Type", -1, CTCP_SPECIAL | CTCP_TELLUSER, Pkga_newctcp, NULL);
add_module_proc(CTCP_PROC, "pkga", "page", "Page User", -1, CTCP_SPECIAL | CTCP_TELLUSER, Pkga_ctcppage, NULL);
add_module_proc(ALIAS_PROC, "pkga", "blah", NULL, 0, 0, Pkga_alias, NULL);
add_module_proc(HOOK_PROC, "pkga", NULL, NULL, 1, 0, Pkga_numeric, NULL);
add_module_proc(VAR_PROC, "pkga", "new_variable", "TEST VALUE", STR_TYPE_VAR, 0, NULL, NULL);
add_module_proc(RAW_PROC, "pkga", "PRIVMSG", NULL, 0, 0, Pkga_raw, NULL);
add_dcc_bind("CHAT", "pkga", NULL, NULL, NULL, new_dcc_output, NULL);
return 0;
}
--- NEW FILE: Makefile.in ---
SHELL = @SHELL@
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
topdir = @topdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = @oldincludedir@
local_dir = $(HOME)
# Where the BitchX binary will be installed.
# "make install" will compile and install the program.
INSTALL_IRC = @INSTALL_IRC@
# Where the BitchX library will be. Generally this is the place that
# you put the scripts, help pages and translation tables. It is
# very important that you set this correctly.
IRCLIB = @IRCLIB@
CC = @CC@
DEFS = @INCLUDES@
LIBS = @LIBS@
# Tcl library.
TCL_LIBS = @TCL_LIBS@
# These are for Tcl support.
TCL_OBJS = @TCL_OBJS@
# You don't have the following, so you'll want to leave this blank.
TCL_SRCS = @TCL_SRCS@
# Set this to -g if you want to be able to debug the client, otherwise
# use -O to have the compiler do some optimization instead.
CFLAGS = @CFLAGS@
# Set this to -s if you want the binary to be stripped.
LDFLAGS = @LDFLAGS@
# These are for the cd device player.
CD_SRCS = @CD_SRCS@
CD_OBJS = @CD_OBJS@
# This is the executable suffix for the target operating system.
EXEEXT = @EXEEXT@
# Extra files.
DEFAULT_CTOOLZ_DIR = @DEFAULT_CTOOLZ_DIR@
DEFAULT_MSGLOGFILE = @DEFAULT_MSGLOGFILE@
DEFAULT_BITCHX_HELP_FILE = @DEFAULT_BITCHX_HELP_FILE@
DEFAULT_SCRIPT_HELP_FILE = @DEFAULT_SCRIPT_HELP_FILE@
DEFAULT_BITCHX_KICK_FILE = @DEFAULT_BITCHX_KICK_FILE@
DEFAULT_BITCHX_QUIT_FILE = @DEFAULT_BITCHX_QUIT_FILE@
DEFAULT_BITCHX_IRCNAME_FILE = @DEFAULT_BITCHX_IRCNAME_FILE@
# Full path of the directory for BitchX help files.
HELPDIR = @HELPDIR@
# Full path of the directory for the BitchX scripts.
INSTALL_SCRIPT = @INSTALL_SCRIPT@
# Default setting for IRCPATH where BitchX will look for
# its script files if the environment variable is undefined.
# Usually, this should contain the same path as used for INSTALL_SCRIPT in
# the Makefile, but it can contain multiple path elements
# separated by colons. The path MUST lead to an existing directory,
# because the 'global' script is expected to be found there.
IRCPATH = @IRCPATH@
# Path for TRANSLATION variable.
TRANSLATION_PATH = @TRANSLATION_PATH@
# This command will be used to install the BitchX help files. If you don't
# want to install them, replace with the following:
# INSTALL_HELP_CMD = @echo The help files have not been installed.
INSTALL_HELP_CMD = @INSTALL_HELP_CMD@
# This is where the optional plugins will be copied to.
PLUGINDIR = @PLUGINDIR@
# Plugin flags.
SHLIB_LD = @SHLIB_LD@
SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_SUFFIX = @SHLIB_SUFFIX@
# This command will be used to install the BitchX files on Win32/OS2EMX
# systems.
WINNT_INSTALL = @WINNT_INSTALL@
# This program allows you to use screen/xterm's to put new BitchX windows
# on new screen/xterm windows.
INSTALL_WSERV = @INSTALL_WSERV@
# This program allows you to screen BitchX and reattach to it later.
INSTALL_SCRBX = @INSTALL_SCRBX@
# Set gzip and bzip2 options.
GZIP_ENV = @GZIP_ENV@
BZIP2 = @BZIP2@
# Standard programs.
RM = @RM@
LN = @LN_S@
CP = @CP@
MV = @MV@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
VERSION = @VERSION@
_VERSION_ = @_VERSION_@
MAKE_BIN = @MAKE@
MAKE = $(MAKE_BIN) $(MFLAGS)
MFLAGS = \
'local_dir=$(HOME)' \
'INSTALL_IRC=$(INSTALL_IRC)' \
'IRCLIB=$(IRCLIB)' \
'CC=$(CC)' \
'CFLAGS=$(CFLAGS)' \
'HELPDIR=$(HELPDIR)' \
'INSTALL_WSERV=$(INSTALL_WSERV)' \
'IRCPATH=$(IRCPATH)' \
'TRANSLATION_PATH=$(TRANSLATION_PATH)' \
'LDFLAGS=$(LDFLAGS)' \
'LIBS=$(LIBS)' \
'LN=$(LN)' \
'RM=$(RM)' \
'TCL_SRCS=$(TCL_SRCS)' \
'TCL_OBJS=$(TCL_OBJS)' \
'CD_PLAY=$(CD_PLAY)' \
'CD_SRCS=$(CD_SRCS)' \
'CD_OBJS=$(CD_OBJS)' \
'TCL_LIBS=$(TCL_LIBS)' \
'PLUGINDIR=$(PLUGINDIR)' \
'_VERSION_=$(_VERSION_)' \
'VERSION=$(VERSION)' \
'INSTALL_DATA=$(INSTALL_DATA)' \
'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \
'EXEEXT=$(EXEEXT)' \
'SHLIB_CFLAGS=$(SHLIB_CFLAGS)' \
'SHLIB_SUFFIX=$(SHLIB_SUFFIX)'
## Makefile starts here.
PLUGIN_NAME = pkga
all: Makefile pkga$(SHLIB_SUFFIX)
Makefile: Makefile.in
cd $(topdir) \
&& ./config.status
pkga.o: $(srcdir)/pkga.c
$(CC) $(DEFS) $(CFLAGS) -c $(srcdir)/pkga.c
pkga$(SHLIB_SUFFIX): pkga.o ../dllinit.o
$(SHLIB_LD) pkga.o ../dllinit.o $(SHLIB_CFLAGS) -o pkga$(SHLIB_SUFFIX)
clean:
$(RM) *~ *.o *.a *.dll pkga$(SHLIB_SUFFIX) *.def .#*
distclean: clean
$(RM) Makefile
install:
$(INSTALL) $(PLUGIN_NAME)$(SHLIB_SUFFIX) $(PLUGINDIR)
More information about the dslinux-commit
mailing list