commit 0f3e84f4154676dc05a09bd0b1ad9d3d43574d48 from: Alexander Barton date: Mon Jan 13 12:20:16 2003 UTC - new library "libngtool", reorganized code and directory structure therefore. commit - 6a0bd57ec4eeac74ac79ec51b99dcb78033f815e commit + 0f3e84f4154676dc05a09bd0b1ad9d3d43574d48 blob - a82df0871147c1e6c002ce1fc9bf3daf58883fd8 blob + 1b4233c1b94f4d2a623c50caf566fc9d455bbc2e --- configure.in +++ configure.in @@ -2,14 +2,13 @@ # ngIRCd -- The Next Generation IRC Daemon # Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) # -# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen -# der GNU General Public License (GPL), wie von der Free Software Foundation -# herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 -# der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. -# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste -# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. +# 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 2 of the License, or +# (at your option) any later version. +# Please read the file COPYING, README and AUTHORS for more information. # -# $Id: configure.in,v 1.77 2003/01/04 13:07:54 alex Exp $ +# $Id: configure.in,v 1.78 2003/01/13 12:20:16 alex Exp $ # # -- Initialisierung -- @@ -224,6 +223,7 @@ AC_OUTPUT([ \ MacOSX/ngircd.pbproj/Makefile \ src/Makefile \ src/portab/Makefile \ + src/tool/Makefile \ src/ngircd/Makefile \ src/testsuite/Makefile \ man/Makefile \ blob - bc6f268d5300426dd4a01a2db6620da635e712d6 blob + a24e96cefbc4a7502e25c49df8ac25d2f80175fc --- src/Makefile.am +++ src/Makefile.am @@ -2,17 +2,16 @@ # ngIRCd -- The Next Generation IRC Daemon # Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) # -# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen -# der GNU General Public License (GPL), wie von der Free Software Foundation -# herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 -# der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. -# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste -# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. +# 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 2 of the License, or +# (at your option) any later version. +# Please read the file COPYING, README and AUTHORS for more information. # -# $Id: Makefile.am,v 1.4 2002/09/09 10:00:15 alex Exp $ +# $Id: Makefile.am,v 1.5 2003/01/13 12:20:16 alex Exp $ # -SUBDIRS = portab ngircd testsuite +SUBDIRS = portab tool ngircd testsuite maintainer-clean-local: rm -f Makefile Makefile.in config.h config.h.in stamp-h.in blob - 62458e40d356fde84cbd1105d2c6fc9b75268009 blob + 3336d53ad5de9483f6d21798df20660fac3758ef --- src/ngircd/Makefile.am +++ src/ngircd/Makefile.am @@ -2,19 +2,18 @@ # ngIRCd -- The Next Generation IRC Daemon # Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) # -# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen -# der GNU General Public License (GPL), wie von der Free Software Foundation -# herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 -# der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. -# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste -# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. +# 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 2 of the License, or +# (at your option) any later version. +# Please read the file COPYING, README and AUTHORS for more information. # -# $Id: Makefile.am,v 1.35 2003/01/04 10:39:14 alex Exp $ +# $Id: Makefile.am,v 1.36 2003/01/13 12:20:16 alex Exp $ # AUTOMAKE_OPTIONS = ../portab/ansi2knr -INCLUDES = -I$(srcdir)/../portab +INCLUDES = -I$(srcdir)/../portab -I$(srcdir)/../tool LINTARGS = -weak -warnunixlib +unixlib -booltype BOOLEAN @@ -22,17 +21,16 @@ sbin_PROGRAMS = ngircd ngircd_SOURCES = ngircd.c channel.c client.c conf.c conn.c conn-zip.c conn-func.c \ hash.c irc.c irc-channel.c irc-info.c irc-login.c irc-mode.c irc-op.c \ - irc-oper.c irc-server.c irc-write.c lists.c log.c match.c parse.c resolve.c \ - tool.c + irc-oper.c irc-server.c irc-write.c lists.c log.c match.c parse.c resolve.c -ngircd_LDFLAGS = -L../portab +ngircd_LDFLAGS = -L../portab -L../tool -ngircd_LDADD = -lngportab +ngircd_LDADD = -lngportab -lngtool noinst_HEADERS = ngircd.h channel.h client.h conf.h conn.h conn-zip.h conn-func.h \ hash.h irc.h irc-channel.h irc-info.h irc-login.h irc-mode.h irc-op.h \ irc-oper.h irc-server.h irc-write.h lists.h log.h match.h parse.h resolve.h \ - tool.h messages.h defines.h + messages.h defines.h clean-local: rm -f check-version check-help lint.out cvs-version.* blob - 440fcb4b235a0a315bd44dea1ee28e40cf242b74 (mode 644) blob + /dev/null --- src/ngircd/tool.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) - * - * 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 2 of the License, or - * (at your option) any later version. - * Please read the file COPYING, README and AUTHORS for more information. - * - * Tool functions - */ - - -#include "portab.h" - -static char UNUSED id[] = "$Id: tool.c,v 1.10 2002/12/12 12:24:18 alex Exp $"; - -#include "imp.h" -#include -#include -#include -#include - -#include "exp.h" -#include "tool.h" - - -GLOBAL VOID -ngt_TrimStr( CHAR *String ) -{ - /* Mit ngt_TrimStr() werden fuehrende und folgende Leerzeichen, - * Tabulatoren und Zeilenumbrueche (ASCII 10 und ASCII 13) aus - * dem String entfernt. */ - - CHAR *start, *ptr; - - assert( String != NULL ); - - start = String; - - /* Zeichen am Anfang pruefen ... */ - while(( *start == ' ' ) || ( *start == 9 )) start++; - - /* Zeichen am Ende pruefen ... */ - ptr = strchr( start, '\0' ) - 1; - while((( *ptr == ' ' ) || ( *ptr == 9 ) || ( *ptr == 10 ) || ( *ptr == 13 )) && ptr >= start ) ptr--; - *(++ptr) = '\0'; - - memmove( String, start, strlen( start ) + 1 ); -} /* ngt_TrimStr */ - - -GLOBAL CHAR * -ngt_LowerStr( CHAR *String ) -{ - /* String in Kleinbuchstaben konvertieren. Der uebergebene - * Speicherbereich wird durch das Ergebnis ersetzt, zusaetzlich - * wird dieser auch als Pointer geliefert. */ - - CHAR *ptr; - - assert( String != NULL ); - - /* Zeichen konvertieren */ - ptr = String; - while( *ptr ) - { - *ptr = tolower( *ptr ); - ptr++; - } - - return String; -} /* ngt_LowerStr */ - - -/* -eof- */ blob - f094eb35f39d2a4ed2de26f5729b8198c0d1c2f0 (mode 644) blob + /dev/null --- src/ngircd/tool.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) - * - * 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 2 of the License, or - * (at your option) any later version. - * Please read the file COPYING, README and AUTHORS for more information. - * - * $Id: tool.h,v 1.9 2002/12/12 12:23:43 alex Exp $ - * - * Tool functions (Header) - */ - - -#ifndef __tool_h__ -#define __tool_h__ - - -GLOBAL VOID ngt_TrimStr PARAMS((CHAR *String )); - -GLOBAL CHAR *ngt_LowerStr PARAMS((CHAR *String )); - - -#endif - - -/* -eof- */ blob - /dev/null blob + 5f1e97ad056bbebcd0bea8026961e5de500aace7 (mode 644) --- /dev/null +++ src/tool/Makefile.am @@ -0,0 +1,27 @@ +# +# ngIRCd -- The Next Generation IRC Daemon +# Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) +# +# 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 2 of the License, or +# (at your option) any later version. +# Please read the file COPYING, README and AUTHORS for more information. +# +# $Id: Makefile.am,v 1.1 2003/01/13 12:20:16 alex Exp $ +# + +AUTOMAKE_OPTIONS = ansi2knr + +INCLUDES = -I$(srcdir)/../portab + +noinst_LIBRARIES = libngtool.a + +libngtool_a_SOURCES = tool.c + +noinst_HEADERS = tool.h + +maintainer-clean-local: + rm -f Makefile Makefile.in + +# -eof- blob - /dev/null blob + 3b66d7f8315634614a867c3ac16db3949d8784ce (mode 644) --- /dev/null +++ src/tool/tool.c @@ -0,0 +1,77 @@ +/* + * ngIRCd -- The Next Generation IRC Daemon + * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) + * + * 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 2 of the License, or + * (at your option) any later version. + * Please read the file COPYING, README and AUTHORS for more information. + * + * Tool functions + */ + + +#include "portab.h" + +static char UNUSED id[] = "$Id: tool.c,v 1.1 2003/01/13 12:20:16 alex Exp $"; + +#include "imp.h" +#include +#include +#include +#include + +#include "exp.h" +#include "tool.h" + + +GLOBAL VOID +ngt_TrimStr( CHAR *String ) +{ + /* Mit ngt_TrimStr() werden fuehrende und folgende Leerzeichen, + * Tabulatoren und Zeilenumbrueche (ASCII 10 und ASCII 13) aus + * dem String entfernt. */ + + CHAR *start, *ptr; + + assert( String != NULL ); + + start = String; + + /* Zeichen am Anfang pruefen ... */ + while(( *start == ' ' ) || ( *start == 9 )) start++; + + /* Zeichen am Ende pruefen ... */ + ptr = strchr( start, '\0' ) - 1; + while((( *ptr == ' ' ) || ( *ptr == 9 ) || ( *ptr == 10 ) || ( *ptr == 13 )) && ptr >= start ) ptr--; + *(++ptr) = '\0'; + + memmove( String, start, strlen( start ) + 1 ); +} /* ngt_TrimStr */ + + +GLOBAL CHAR * +ngt_LowerStr( CHAR *String ) +{ + /* String in Kleinbuchstaben konvertieren. Der uebergebene + * Speicherbereich wird durch das Ergebnis ersetzt, zusaetzlich + * wird dieser auch als Pointer geliefert. */ + + CHAR *ptr; + + assert( String != NULL ); + + /* Zeichen konvertieren */ + ptr = String; + while( *ptr ) + { + *ptr = tolower( *ptr ); + ptr++; + } + + return String; +} /* ngt_LowerStr */ + + +/* -eof- */ blob - /dev/null blob + 65817779f20da7f8ddc3a2e5b35df65343b9a69f (mode 644) --- /dev/null +++ src/tool/tool.h @@ -0,0 +1,29 @@ +/* + * ngIRCd -- The Next Generation IRC Daemon + * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) + * + * 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 2 of the License, or + * (at your option) any later version. + * Please read the file COPYING, README and AUTHORS for more information. + * + * $Id: tool.h,v 1.1 2003/01/13 12:20:16 alex Exp $ + * + * Tool functions (Header) + */ + + +#ifndef __tool_h__ +#define __tool_h__ + + +GLOBAL VOID ngt_TrimStr PARAMS((CHAR *String )); + +GLOBAL CHAR *ngt_LowerStr PARAMS((CHAR *String )); + + +#endif + + +/* -eof- */