Module: ngircd.git
Branch: master
Commit: bd1b72718758c7f49aaab31a1bb34018880c10aa
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=bd1b7271…
Author: Alexander Barton <alex(a)barton.de>
Date: Fri Feb 22 18:11:26 2013 +0100
Update Doxygen configuration
---
doc/src/Doxyfile | 105 ++++++++---------------------------------------
doc/src/footer.inc.html | 2 +-
2 files changed, 18 insertions(+), 89 deletions(-)
diff --git a/doc/src/Doxyfile b/doc/src/Doxyfile
index 8afec5e..6d9ccb5 100644
--- a/doc/src/Doxyfile
+++ b/doc/src/Doxyfile
@@ -16,106 +16,55 @@
# Project related configuration options
#---------------------------------------------------------------------------
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
+DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = ngIRCd
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
+PROJECT_BRIEF = "Lightweight Internet Relay Chat server"
+PROJECT_LOGO = "../../contrib/ngIRCd-Logo.gif"
OUTPUT_DIRECTORY = .
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
STRIP_FROM_PATH = ../..
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like the Qt-style comments (thus requiring an
-# explicit @brief command for a brief description.
-
JAVADOC_AUTOBRIEF = YES
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
OPTIMIZE_OUTPUT_FOR_C = YES
+TYPEDEF_HIDES_STRUCT = YES
+
+TAB_SIZE = 8
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
EXTRACT_ALL = YES
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
EXTRACT_STATIC = YES
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory
-# hierarchy in the documentation. The default is NO.
-
SHOW_DIRECTORIES = YES
#---------------------------------------------------------------------------
-# configuration options related to the input files
+# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories that
-# contain documented source files. You may enter file names like "myfile.cpp"
-# or directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = YES
-INPUT = ../../src
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = ../../src
+INPUT_ENCODING = UTF-8
RECURSIVE = YES
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
SOURCE_BROWSER = YES
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
STRIP_CODE_COMMENTS = NO
-
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# function all documented functions referencing it will be listed.
-
REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES then for each documented
-# function all documented entities called/used by that function will be listed.
-
REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
@@ -123,19 +72,7 @@ REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
GENERATE_HTML = YES
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for each
-# generated HTML page. If it is left blank doxygen will generate a standard
-# footer.
-
HTML_FOOTER = footer.inc.html
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports JavaScript and
-# DHTML is required (for instance Mozilla 1.0+, Firefox Netscape 6.0+,
-# Internet explorer 5.0+, Konqueror, or Safari).
-
HTML_DYNAMIC_SECTIONS = YES
GENERATE_DOCSET = NO
@@ -151,14 +88,6 @@ GENERATE_PERLMOD = NO
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
PREDEFINED = DEBUG ZLIB PAM ZEROCONF CONN_MODULE __client_c__
# -eof-
diff --git a/doc/src/footer.inc.html b/doc/src/footer.inc.html
index a3a9552..ba05dcf 100644
--- a/doc/src/footer.inc.html
+++ b/doc/src/footer.inc.html
@@ -1,6 +1,6 @@
<hr class="footer">
-<p>
+<p style="text-align: center">
ngIRCd
<a href="http://ngircd.barton.de/">Homepage</a>,
<a href="http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git">GIT-Repository</a>,
Module: ngircd.git
Branch: master
Commit: 2c96966431d99ce611736ed841e813c1fac6df8c
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=2c969664…
Author: Alexander Barton <alex(a)barton.de>
Date: Fri Feb 15 21:59:28 2013 +0100
Merge branch 'bug151-iconv' into master
* bug151-iconv:
configure: search for iconv_open as well as libiconv_open
---
Module: ngircd.git
Branch: master
Commit: 65359ff8f722efdf24700ce05011afc0fef28924
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=65359ff8…
Author: Alexander Barton <alex(a)barton.de>
Date: Fri Feb 15 21:59:06 2013 +0100
Merge branch 'bug153-ServerMask' into master
* bug153-ServerMask:
Update irc-info.c to use irc-macros.h
Add new irc-macros.h to project
irc-info.c: add/streamline function documentation comments
irc-info: move static functions at the top of the file
Implement new function Client_SearchServer()
Conflicts:
src/ngircd/irc-info.c
---
Module: ngircd.git
Branch: master
Commit: d0c9f4a692877d0a232499031f82413b02a45739
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=d0c9f4a6…
Author: Alexander Barton <alex(a)barton.de>
Date: Fri Feb 15 21:32:08 2013 +0100
configure: search for iconv_open as well as libiconv_open
On some installations iconv_open() is actually libiconv_open().
iconv_open() is the glibc version while libiconv_open() is the libiconv
version. This patch enables ngIRCd to detect both cases.
Tested on OpenBSD 5.1.
Closes bug #151.
---
configure.ng | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/configure.ng b/configure.ng
index c030996..6c28f39 100644
--- a/configure.ng
+++ b/configure.ng
@@ -528,7 +528,10 @@ if test "$x_ircplus_on" = "yes"; then
fi
AC_CHECK_LIB(iconv, iconv_open)
AC_CHECK_FUNCS(iconv_open, x_iconv_on=yes,
- AC_MSG_ERROR([Can't enable libiconv support!])
+ AC_CHECK_LIB(iconv, libiconv_open)
+ AC_CHECK_FUNCS(libiconv_open, x_iconv_on=yes,
+ AC_MSG_ERROR([Can't enable libiconv support!])
+ )
)
fi
]
Module: ngircd.git
Branch: master
Commit: 5dce3301bd3e9c26e1c1371379366a0aaba32e20
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=5dce3301…
Author: Alexander Barton <alex(a)barton.de>
Date: Sat Feb 9 23:58:11 2013 +0100
Update irc-info.c to use irc-macros.h
This includes:
- move IRC_SetPenalty() at the beginning of the handler functions,
- use macros provided by irc-macros.h,
- code cleanup.
The main benefits of this patch are core size reduction, streamlined
structure of the handler functions, and enhanced functionality:
because of the _IRC_GET_TARGET_SERVER_OR_RETURN_() macro using the
Client_SearchServer() function, the target of the specific IRC command
can now be given server names, server mask, or the nickname of a user
connected to the server.
Closes bug #153.
---
src/ngircd/irc-info.c | 460 ++++++++++++++++++-------------------------------
1 file changed, 170 insertions(+), 290 deletions(-)
Diff: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commitdiff;h=5dce…
Module: ngircd.git
Branch: master
Commit: a9175145462335ef69dbc2509e2db6f2c96e635c
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=a9175145…
Author: Alexander Barton <alex(a)barton.de>
Date: Sat Feb 9 23:55:42 2013 +0100
Add new irc-macros.h to project
This file prvides some macros for common tasks required by functions
implementing handlers for IRC commands:
* _IRC_ARGC_LE_OR_RETURN_
* _IRC_ARGC_GE_OR_RETURN_
* _IRC_GET_SENDER_OR_RETURN_
* _IRC_GET_TARGET_SERVER_OR_RETURN_
---
contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj | 4 +-
src/ngircd/Makefile.ng | 1 +
src/ngircd/irc-macros.h | 83 +++++++++++++++++++++++
3 files changed, 87 insertions(+), 1 deletion(-)
diff --git a/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj b/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
index a2cad27..02502cc 100644
--- a/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
+++ b/contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
@@ -66,10 +66,11 @@
/* Begin PBXFileReference section */
FA1A6BBC0D6857BB00AA8F71 /* misc-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "misc-test.e"; sourceTree = "<group>"; };
FA1A6BBD0D6857D900AA8F71 /* who-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "who-test.e"; sourceTree = "<group>"; };
+ FA1DBB6716C707D200D4F838 /* irc-macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "irc-macros.h"; sourceTree = "<group>"; };
FA2D564811EA158B00D37A35 /* pam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pam.h; sourceTree = "<group>"; };
FA2D564911EA158B00D37A35 /* pam.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pam.c; sourceTree = "<group>"; };
FA2D567A11EA1AB300D37A35 /* libpam.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpam.dylib; path = usr/lib/libpam.dylib; sourceTree = SDKROOT; };
- FA322BBA0CEF72E4001761B3 /* ngIRCd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ngIRCd; sourceTree = BUILT_PRODUCTS_DIR; };
+ FA322BBA0CEF72E4001761B3 /* ngIRCd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = ngIRCd; path = ngircd; sourceTree = BUILT_PRODUCTS_DIR; };
FA322CD60CEF74B1001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
FA322CD90CEF74B1001761B3 /* array.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = array.c; sourceTree = "<group>"; };
FA322CDA0CEF74B1001761B3 /* array.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = array.h; sourceTree = "<group>"; };
@@ -368,6 +369,7 @@
FA322CEF0CEF74B1001761B3 /* irc-info.h */,
FA322CF00CEF74B1001761B3 /* irc-login.c */,
FA322CF10CEF74B1001761B3 /* irc-login.h */,
+ FA1DBB6716C707D200D4F838 /* irc-macros.h */,
FA4F1659164836B100DBD011 /* irc-metadata.c */,
FA4F165C164836BF00DBD011 /* irc-metadata.h */,
FA322CF20CEF74B1001761B3 /* irc-mode.c */,
diff --git a/src/ngircd/Makefile.ng b/src/ngircd/Makefile.ng
index cdbd27c..21e606d 100644
--- a/src/ngircd/Makefile.ng
+++ b/src/ngircd/Makefile.ng
@@ -86,6 +86,7 @@ noinst_HEADERS = \
irc-encoding.h \
irc-info.h \
irc-login.h \
+ irc-macros.h \
irc-metadata.h \
irc-mode.h \
irc-op.h \
diff --git a/src/ngircd/irc-macros.h b/src/ngircd/irc-macros.h
new file mode 100644
index 0000000..bd63ec4
--- /dev/null
+++ b/src/ngircd/irc-macros.h
@@ -0,0 +1,83 @@
+/*
+ * ngIRCd -- The Next Generation IRC Daemon
+ * Copyright (c)2001-2013 Alexander Barton (alex(a)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.
+ */
+
+#ifndef __irc_macros_h__
+#define __irc_macros_h__
+
+/**
+ * @file
+ * Macros for functions that handle IRC commands.
+ */
+
+/**
+ * Make sure that number of passed parameters is less or equal than Max.
+ *
+ * If there are more than Max parameters, send an error to the client and
+ * return from the function.
+ */
+#define _IRC_ARGC_LE_OR_RETURN_(Client, Req, Max) \
+if (Req->argc > Max) \
+ return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
+ Client_ID(Client), Req->command);
+
+/**
+ * Make sure that number of passed parameters is greater or equal than Min.
+ *
+ * If there aren't at least Min parameters, send an error to the client and
+ * return from the function.
+ */
+#define _IRC_ARGC_GE_OR_RETURN_(Client, Req, Min) \
+if (Req->argc < Min) \
+ return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, \
+ Client_ID(Client), Req->command);
+
+/**
+ * Get sender of an IRC command.
+ *
+ * The sender is either stored in the prefix if the command has been
+ * received from a server or set to the client. If the sender is invalid,
+ * send an error to the client and return from the function.
+ */
+#define _IRC_GET_SENDER_OR_RETURN_(Sender, Req, Client) \
+ if (Client_Type(Client) == CLIENT_SERVER) \
+ Sender = Client_Search(Req->prefix); \
+ else \
+ Sender = Client; \
+ if (!Sender) \
+ return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, \
+ Client_ID(Client), Req->prefix);
+
+/**
+ * Get target of an IRC command and make sure that it is a server.
+ *
+ * Set the target to the local server if no target parameter is given in the
+ * received command, and send an error to the client and return from the
+ * function if the given target isn't resolvable to a server: the target
+ * parameter can be a server name, a nick name (then the target is set to
+ * the server to which this nick is connected), or a mask matching at least
+ * one server name in the network.
+ */
+#define _IRC_GET_TARGET_SERVER_OR_RETURN_(Target, Req, Argc, From) \
+ if (Req->argc > Argc) { \
+ Target = Client_Search(Req->argv[Argc]); \
+ if (!Target) \
+ Target = Client_SearchServer(Req->argv[Argc]); \
+ if (!Target) \
+ return IRC_WriteStrClient(From, ERR_NOSUCHSERVER_MSG, \
+ Client_ID(From), Req->argv[Argc]); \
+ if (Client_Type(Target) != CLIENT_SERVER) \
+ Target = Client_Introducer(Target); \
+ } else \
+ Target = Client_ThisServer();
+
+#endif /* __irc_macros_h__ */
+
+/* -eof- */